diff options
author | Yang Gu <yang.gu@intel.com> | 2010-04-21 12:55:54 +0800 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-04-21 10:18:16 -0500 |
commit | ee85ca8d7ab9f6c6a3d02fdd24c68d0f63612cab (patch) | |
tree | f5ffdb6de2fbf1e668afedfc425b674dc50e0aab /src | |
parent | d2830249c6c58264a9b2be680f3cf4cf771c6f19 (diff) | |
download | ofono-ee85ca8d7ab9f6c6a3d02fdd24c68d0f63612cab.tar.bz2 |
Add parser for network access name objects
Diffstat (limited to 'src')
-rw-r--r-- | src/stkutil.c | 20 | ||||
-rw-r--r-- | src/stkutil.h | 9 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/stkutil.c b/src/stkutil.c index 639642a6..1e05ceae 100644 --- a/src/stkutil.c +++ b/src/stkutil.c @@ -1445,6 +1445,24 @@ static gboolean parse_dataobj_esn(struct comprehension_tlv_iter *iter, return TRUE; } +/* Defined in TS 102.223 Section 8.70 */ +static gboolean parse_dataobj_network_access_name( + struct comprehension_tlv_iter *iter, void *user) +{ + struct stk_network_access_name *nan = user; + const unsigned char *data; + unsigned int len = comprehension_tlv_iter_get_length(iter); + + if (len == 0) + return TRUE; + + data = comprehension_tlv_iter_get_data(iter); + nan->len = len; + memcpy(nan->name, data, len); + + return TRUE; +} + /* Defined in TS 102.223 Section 8.72 */ static gboolean parse_dataobj_text_attr(struct comprehension_tlv_iter *iter, void *user) @@ -1613,6 +1631,8 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type) return parse_dataobj_remote_entity_address; case STK_DATA_OBJECT_TYPE_ESN: return parse_dataobj_esn; + case STK_DATA_OBJECT_TYPE_NETWORK_ACCESS_NAME: + return parse_dataobj_network_access_name; case STK_DATA_OBJECT_TYPE_TEXT_ATTRIBUTE: return parse_dataobj_text_attr; case STK_DATA_OBJECT_TYPE_FRAME_ID: diff --git a/src/stkutil.h b/src/stkutil.h index 39d159bc..9e3cbf51 100644 --- a/src/stkutil.h +++ b/src/stkutil.h @@ -656,6 +656,15 @@ struct stk_remote_entity_address { }; /* + * According to 102.223 Section 8.70 the length of CTLV is 1 byte. This means + * that the maximum size is 127 according to the rules of CTLVs. + */ +struct stk_network_access_name { + unsigned char name[127]; + unsigned char len; +}; + +/* * According to 102.223 Section 8.72 the length of text attribute CTLV is 1 * byte. This means that the maximum size is 127 according to the rules * of CTLVs. Empty attribute options will have len of 0. |