| 36 } msn_tlv_t; |
36 } msn_tlv_t; |
| 37 |
37 |
| 38 /* TLV handling functions */ |
38 /* TLV handling functions */ |
| 39 char *msn_tlv_getvalue_as_string(msn_tlv_t *tlv); |
39 char *msn_tlv_getvalue_as_string(msn_tlv_t *tlv); |
| 40 |
40 |
| 41 msn_tlv_t *msn_tlv_gettlv(GSList *list, const guint16 type, const int nth); |
41 msn_tlv_t *msn_tlv_gettlv(GSList *list, const guint8 type, const int nth); |
| 42 int msn_tlv_getlength(GSList *list, const guint16 type, const int nth); |
42 int msn_tlv_getlength(GSList *list, const guint8 type, const int nth); |
| 43 char *msn_tlv_getstr(GSList *list, const guint16 type, const int nth); |
43 char *msn_tlv_getstr(GSList *list, const guint8 type, const int nth); |
| 44 guint8 msn_tlv_get8(GSList *list, const guint16 type, const int nth); |
44 guint8 msn_tlv_get8(GSList *list, const guint8 type, const int nth); |
| 45 guint16 msn_tlv_get16(GSList *list, const guint16 type, const int nth); |
45 guint16 msn_tlv_get16(GSList *list, const guint8 type, const int nth); |
| 46 guint32 msn_tlv_get32(GSList *list, const guint16 type, const int nth); |
46 guint32 msn_tlv_get32(GSList *list, const guint8 type, const int nth); |
| 47 |
47 |
| 48 /* TLV list handling functions */ |
48 /* TLV list handling functions */ |
| 49 GSList *msn_tlvlist_read(const char *bs, size_t bs_len); |
49 GSList *msn_tlvlist_read(const char *bs, size_t bs_len); |
| 50 GSList *msn_tlvlist_copy(GSList *orig); |
50 GSList *msn_tlvlist_copy(GSList *orig); |
| 51 |
51 |
| 53 size_t msn_tlvlist_size(GSList *list); |
53 size_t msn_tlvlist_size(GSList *list); |
| 54 gboolean msn_tlvlist_equal(GSList *one, GSList *two); |
54 gboolean msn_tlvlist_equal(GSList *one, GSList *two); |
| 55 char *msn_tlvlist_write(GSList *list, size_t *out_len); |
55 char *msn_tlvlist_write(GSList *list, size_t *out_len); |
| 56 void msn_tlvlist_free(GSList *list); |
56 void msn_tlvlist_free(GSList *list); |
| 57 |
57 |
| 58 int msn_tlvlist_add_raw(GSList **list, const guint16 type, const guint16 length, const char *value); |
58 int msn_tlvlist_add_raw(GSList **list, const guint8 type, const guint8 length, const char *value); |
| 59 int msn_tlvlist_add_empty(GSList **list, const guint16 type); |
59 int msn_tlvlist_add_empty(GSList **list, const guint8 type); |
| 60 int msn_tlvlist_add_8(GSList **list, const guint16 type, const guint8 value); |
60 int msn_tlvlist_add_8(GSList **list, const guint8 type, const guint8 value); |
| 61 int msn_tlvlist_add_16(GSList **list, const guint16 type, const guint16 value); |
61 int msn_tlvlist_add_16(GSList **list, const guint8 type, const guint16 value); |
| 62 int msn_tlvlist_add_32(GSList **list, const guint16 type, const guint32 value); |
62 int msn_tlvlist_add_32(GSList **list, const guint8 type, const guint32 value); |
| 63 int msn_tlvlist_add_str(GSList **list, const guint16 type, const char *value); |
63 int msn_tlvlist_add_str(GSList **list, const guint8 type, const char *value); |
| 64 |
64 |
| 65 int msn_tlvlist_replace_raw(GSList **list, const guint16 type, const guint16 lenth, const char *value); |
65 int msn_tlvlist_replace_raw(GSList **list, const guint8 type, const guint8 lenth, const char *value); |
| 66 int msn_tlvlist_replace_str(GSList **list, const guint16 type, const char *str); |
66 int msn_tlvlist_replace_str(GSList **list, const guint8 type, const char *str); |
| 67 int msn_tlvlist_replace_empty(GSList **list, const guint16 type); |
67 int msn_tlvlist_replace_empty(GSList **list, const guint8 type); |
| 68 int msn_tlvlist_replace_8(GSList **list, const guint16 type, const guint8 value); |
68 int msn_tlvlist_replace_8(GSList **list, const guint8 type, const guint8 value); |
| 69 int msn_tlvlist_replace_16(GSList **list, const guint16 type, const guint16 value); |
69 int msn_tlvlist_replace_16(GSList **list, const guint8 type, const guint16 value); |
| 70 int msn_tlvlist_replace_32(GSList **list, const guint16 type, const guint32 value); |
70 int msn_tlvlist_replace_32(GSList **list, const guint8 type, const guint32 value); |
| 71 |
71 |
| 72 void msn_tlvlist_remove(GSList **list, const guint16 type); |
72 void msn_tlvlist_remove(GSList **list, const guint8 type); |
| 73 |
73 |
| 74 #endif /* MSN_TLV_H */ |
74 #endif /* MSN_TLV_H */ |
| 75 |
75 |