update it

This commit is contained in:
Sukchan Lee 2017-04-07 23:36:08 +09:00
parent 759158a972
commit 465a8e9e8a
10 changed files with 497 additions and 7 deletions

View File

@ -26,7 +26,7 @@
/*******************************************************************************
* This file had been created by gtpv2c_tlv.py script v0.1.0
* Please do not modify this file but regenerate it via script.
* Created on: 2017-04-07 22:21:56.132857 by acetcom
* Created on: 2017-04-07 23:34:23.764413 by acetcom
* from 24301-d80.docx
******************************************************************************/
@ -581,6 +581,79 @@ c_int32_t nas_decode_security_mode_reject(nas_message_t *message, pkbuf_t *pkbuf
return decoded;
}
c_int32_t nas_decode_pdn_connectivity_request(nas_message_t *message, pkbuf_t *pkbuf)
{
nas_pdn_connectivity_request_t *pdn_connectivity_request = &message->esm.pdn_connectivity_request;
c_int32_t decoded = 0;
c_int32_t size = 0;
size = nas_decode_request_type(&pdn_connectivity_request->request_type, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
decoded += size;
while(pkbuf->len > 0)
{
c_uint8_t *buffer = pkbuf->payload;
c_uint8_t type = (*buffer) >= 0x80 ? ((*buffer) & 0xf0) : (*buffer);
size = sizeof(c_uint8_t);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1,
"pkbuf_header error");
decoded += size;
switch(type)
{
case NAS_PDN_CONNECTIVITY_REQUEST_ESM_INFORMATION_TRANSFER_FLAG_TYPE:
size = nas_decode_esm_information_transfer_flag(&pdn_connectivity_request->esm_information_transfer_flag, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
pdn_connectivity_request->presencemask |= NAS_PDN_CONNECTIVITY_REQUEST_ESM_INFORMATION_TRANSFER_FLAG_PRESENT;
decoded += size;
break;
case NAS_PDN_CONNECTIVITY_REQUEST_ACCESS_POINT_NAME_TYPE:
size = nas_decode_access_point_name(&pdn_connectivity_request->access_point_name, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
pdn_connectivity_request->presencemask |= NAS_PDN_CONNECTIVITY_REQUEST_ACCESS_POINT_NAME_PRESENT;
decoded += size;
break;
case NAS_PDN_CONNECTIVITY_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_TYPE:
size = nas_decode_protocol_configuration_options(&pdn_connectivity_request->protocol_configuration_options, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
pdn_connectivity_request->presencemask |= NAS_PDN_CONNECTIVITY_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT;
decoded += size;
break;
case NAS_PDN_CONNECTIVITY_REQUEST_DEVICE_PROPERTIES_TYPE:
size = nas_decode_device_properties(&pdn_connectivity_request->device_properties, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
pdn_connectivity_request->presencemask |= NAS_PDN_CONNECTIVITY_REQUEST_DEVICE_PROPERTIES_PRESENT;
decoded += size;
break;
case NAS_PDN_CONNECTIVITY_REQUEST_NBIFOM_CONTAINER_TYPE:
size = nas_decode_nbifom_container(&pdn_connectivity_request->nbifom_container, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
pdn_connectivity_request->presencemask |= NAS_PDN_CONNECTIVITY_REQUEST_NBIFOM_CONTAINER_PRESENT;
decoded += size;
break;
case NAS_PDN_CONNECTIVITY_REQUEST_HEADER_COMPRESSION_CONFIGURATION_TYPE:
size = nas_decode_header_compression_configuration(&pdn_connectivity_request->header_compression_configuration, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
pdn_connectivity_request->presencemask |= NAS_PDN_CONNECTIVITY_REQUEST_HEADER_COMPRESSION_CONFIGURATION_PRESENT;
decoded += size;
break;
case NAS_PDN_CONNECTIVITY_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE:
size = nas_decode_extended_protocol_configuration_options(&pdn_connectivity_request->extended_protocol_configuration_options, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
pdn_connectivity_request->presencemask |= NAS_PDN_CONNECTIVITY_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT;
decoded += size;
break;
default:
d_error("Unknown type(0x%x) or not implemented\n", type);
return -1;
}
}
return decoded;
}
status_t nas_emm_decode(nas_message_t *message, pkbuf_t *pkbuf)
{
status_t rv = CORE_ERROR;
@ -692,6 +765,11 @@ status_t nas_esm_decode(nas_message_t *message, pkbuf_t *pkbuf)
switch(message->esm.h.message_type)
{
case NAS_PDN_CONNECTIVITY_REQUEST:
size = nas_decode_pdn_connectivity_request(message, pkbuf);
d_assert(size >= CORE_OK, return CORE_ERROR, "decode error");
decoded += size;
break;
case NAS_ESM_INFORMATION_REQUEST:
break;
default:

View File

@ -26,7 +26,7 @@
/*******************************************************************************
* This file had been created by gtpv2c_tlv.py script v0.1.0
* Please do not modify this file but regenerate it via script.
* Created on: 2017-04-07 22:21:56.137354 by acetcom
* Created on: 2017-04-07 23:34:23.771272 by acetcom
* from 24301-d80.docx
******************************************************************************/
@ -662,6 +662,92 @@ c_int32_t nas_encode_security_mode_reject(pkbuf_t *pkbuf, nas_message_t *message
return encoded;
}
c_int32_t nas_encode_pdn_connectivity_request(pkbuf_t *pkbuf, nas_message_t *message)
{
nas_pdn_connectivity_request_t *pdn_connectivity_request = &message->esm.pdn_connectivity_request;
c_int32_t encoded = 0;
c_int32_t size = 0;
size = nas_encode_request_type(pkbuf, &pdn_connectivity_request->request_type);
d_assert(size >= 0, return -1, "encode failed");
encoded += size;
if (pdn_connectivity_request->presencemask & NAS_PDN_CONNECTIVITY_REQUEST_ESM_INFORMATION_TRANSFER_FLAG_PRESENT)
{
pdn_connectivity_request->esm_information_transfer_flag.type = (NAS_PDN_CONNECTIVITY_REQUEST_ESM_INFORMATION_TRANSFER_FLAG_TYPE >> 4);
size = nas_encode_esm_information_transfer_flag(pkbuf, &pdn_connectivity_request->esm_information_transfer_flag);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
}
if (pdn_connectivity_request->presencemask & NAS_PDN_CONNECTIVITY_REQUEST_ACCESS_POINT_NAME_PRESENT)
{
size = nas_encode_optional_type(pkbuf, NAS_PDN_CONNECTIVITY_REQUEST_ACCESS_POINT_NAME_TYPE);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
size = nas_encode_access_point_name(pkbuf, &pdn_connectivity_request->access_point_name);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
}
if (pdn_connectivity_request->presencemask & NAS_PDN_CONNECTIVITY_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT)
{
size = nas_encode_optional_type(pkbuf, NAS_PDN_CONNECTIVITY_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_TYPE);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
size = nas_encode_protocol_configuration_options(pkbuf, &pdn_connectivity_request->protocol_configuration_options);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
}
if (pdn_connectivity_request->presencemask & NAS_PDN_CONNECTIVITY_REQUEST_DEVICE_PROPERTIES_PRESENT)
{
pdn_connectivity_request->device_properties.type = (NAS_PDN_CONNECTIVITY_REQUEST_DEVICE_PROPERTIES_TYPE >> 4);
size = nas_encode_device_properties(pkbuf, &pdn_connectivity_request->device_properties);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
}
if (pdn_connectivity_request->presencemask & NAS_PDN_CONNECTIVITY_REQUEST_NBIFOM_CONTAINER_PRESENT)
{
size = nas_encode_optional_type(pkbuf, NAS_PDN_CONNECTIVITY_REQUEST_NBIFOM_CONTAINER_TYPE);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
size = nas_encode_nbifom_container(pkbuf, &pdn_connectivity_request->nbifom_container);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
}
if (pdn_connectivity_request->presencemask & NAS_PDN_CONNECTIVITY_REQUEST_HEADER_COMPRESSION_CONFIGURATION_PRESENT)
{
size = nas_encode_optional_type(pkbuf, NAS_PDN_CONNECTIVITY_REQUEST_HEADER_COMPRESSION_CONFIGURATION_TYPE);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
size = nas_encode_header_compression_configuration(pkbuf, &pdn_connectivity_request->header_compression_configuration);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
}
if (pdn_connectivity_request->presencemask & NAS_PDN_CONNECTIVITY_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT)
{
size = nas_encode_optional_type(pkbuf, NAS_PDN_CONNECTIVITY_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
size = nas_encode_extended_protocol_configuration_options(pkbuf, &pdn_connectivity_request->extended_protocol_configuration_options);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
}
return encoded;
}
status_t nas_emm_encode(pkbuf_t **pkbuf, nas_message_t *message)
{
status_t rv = CORE_ERROR;
@ -783,6 +869,11 @@ status_t nas_esm_encode(pkbuf_t **pkbuf, nas_message_t *message)
switch(message->esm.h.message_type)
{
case NAS_PDN_CONNECTIVITY_REQUEST:
size = nas_encode_pdn_connectivity_request(*pkbuf, message);
d_assert(size >= 0, return CORE_ERROR, "decode error");
encoded += size;
break;
case NAS_ESM_INFORMATION_REQUEST:
break;
default:

View File

@ -26,7 +26,7 @@
/*******************************************************************************
* This file had been created by gtpv2c_tlv.py script v0.1.0
* Please do not modify this file but regenerate it via script.
* Created on: 2017-04-07 22:21:56.122732 by acetcom
* Created on: 2017-04-07 23:34:23.747038 by acetcom
* from 24301-d80.docx
******************************************************************************/
@ -1177,3 +1177,194 @@ c_int16_t nas_encode_emm_cause(pkbuf_t *pkbuf, nas_emm_cause_t *emm_cause)
return size;
}
/* 9.9.4.1 Access point name
* O TLV 3-102 */
c_int16_t nas_decode_access_point_name(nas_access_point_name_t *access_point_name, pkbuf_t *pkbuf)
{
c_uint16_t size = 0;
nas_access_point_name_t *source = pkbuf->payload;
access_point_name->length = source->length;
size = access_point_name->length + sizeof(access_point_name->length);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(access_point_name, pkbuf->payload - size, size);
return size;
}
c_int16_t nas_encode_access_point_name(pkbuf_t *pkbuf, nas_access_point_name_t *access_point_name)
{
c_uint16_t size = access_point_name->length + sizeof(access_point_name->length);
nas_access_point_name_t target;
memcpy(&target, access_point_name, sizeof(nas_access_point_name_t));
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(pkbuf->payload - size, &target, size);
return size;
}
/* 9.9.4.11 Protocol configuration options
* O TLV 3-253 */
c_int16_t nas_decode_protocol_configuration_options(nas_protocol_configuration_options_t *protocol_configuration_options, pkbuf_t *pkbuf)
{
c_uint16_t size = 0;
nas_protocol_configuration_options_t *source = pkbuf->payload;
protocol_configuration_options->length = source->length;
size = protocol_configuration_options->length + sizeof(protocol_configuration_options->length);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(protocol_configuration_options, pkbuf->payload - size, size);
return size;
}
c_int16_t nas_encode_protocol_configuration_options(pkbuf_t *pkbuf, nas_protocol_configuration_options_t *protocol_configuration_options)
{
c_uint16_t size = protocol_configuration_options->length + sizeof(protocol_configuration_options->length);
nas_protocol_configuration_options_t target;
memcpy(&target, protocol_configuration_options, sizeof(nas_protocol_configuration_options_t));
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(pkbuf->payload - size, &target, size);
return size;
}
/* 9.9.4.14 Request type
* M V 1/2 */
c_int16_t nas_decode_request_type(nas_request_type_t *request_type, pkbuf_t *pkbuf)
{
c_uint16_t size = sizeof(nas_request_type_t);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(request_type, pkbuf->payload - size, size);
return size;
}
c_int16_t nas_encode_request_type(pkbuf_t *pkbuf, nas_request_type_t *request_type)
{
c_uint16_t size = sizeof(nas_request_type_t);
nas_request_type_t target;
memcpy(&target, request_type, size);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(pkbuf->payload - size, &target, size);
return size;
}
/* 9.9.4.19 NBIFOM container
* O TLV 3-257 */
c_int16_t nas_decode_nbifom_container(nas_nbifom_container_t *nbifom_container, pkbuf_t *pkbuf)
{
c_uint16_t size = 0;
nas_nbifom_container_t *source = pkbuf->payload;
nbifom_container->length = source->length;
size = nbifom_container->length + sizeof(nbifom_container->length);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(nbifom_container, pkbuf->payload - size, size);
return size;
}
c_int16_t nas_encode_nbifom_container(pkbuf_t *pkbuf, nas_nbifom_container_t *nbifom_container)
{
c_uint16_t size = nbifom_container->length + sizeof(nbifom_container->length);
nas_nbifom_container_t target;
memcpy(&target, nbifom_container, sizeof(nas_nbifom_container_t));
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(pkbuf->payload - size, &target, size);
return size;
}
/* 9.9.4.22 Header compression configuration
* O TLV 5-257 */
c_int16_t nas_decode_header_compression_configuration(nas_header_compression_configuration_t *header_compression_configuration, pkbuf_t *pkbuf)
{
c_uint16_t size = 0;
nas_header_compression_configuration_t *source = pkbuf->payload;
header_compression_configuration->length = source->length;
size = header_compression_configuration->length + sizeof(header_compression_configuration->length);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(header_compression_configuration, pkbuf->payload - size, size);
return size;
}
c_int16_t nas_encode_header_compression_configuration(pkbuf_t *pkbuf, nas_header_compression_configuration_t *header_compression_configuration)
{
c_uint16_t size = header_compression_configuration->length + sizeof(header_compression_configuration->length);
nas_header_compression_configuration_t target;
memcpy(&target, header_compression_configuration, sizeof(nas_header_compression_configuration_t));
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(pkbuf->payload - size, &target, size);
return size;
}
/* 9.9.4.26 Extended protocol configuration options
* O TLV-E 4-65538 */
c_int16_t nas_decode_extended_protocol_configuration_options(nas_extended_protocol_configuration_options_t *extended_protocol_configuration_options, pkbuf_t *pkbuf)
{
c_uint16_t size = 0;
nas_extended_protocol_configuration_options_t *source = pkbuf->payload;
extended_protocol_configuration_options->length = ntohs(source->length);
size = extended_protocol_configuration_options->length + sizeof(extended_protocol_configuration_options->length);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
extended_protocol_configuration_options->buffer = pkbuf->payload - size + sizeof(extended_protocol_configuration_options->length);
return size;
}
c_int16_t nas_encode_extended_protocol_configuration_options(pkbuf_t *pkbuf, nas_extended_protocol_configuration_options_t *extended_protocol_configuration_options)
{
c_uint16_t size = 0;
c_uint16_t target;
d_assert(extended_protocol_configuration_options, return -1, "Null param");
d_assert(extended_protocol_configuration_options->buffer, return -1, "Null param");
size = sizeof(extended_protocol_configuration_options->length);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
target = htons(extended_protocol_configuration_options->length);
memcpy(pkbuf->payload - size, &target, size);
size = extended_protocol_configuration_options->length;
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(pkbuf->payload - size, extended_protocol_configuration_options->buffer, size);
return extended_protocol_configuration_options->length + sizeof(extended_protocol_configuration_options->length);
}
/* 9.9.4.5 ESM information transfer flag
* O TV 1 */
c_int16_t nas_decode_esm_information_transfer_flag(nas_esm_information_transfer_flag_t *esm_information_transfer_flag, pkbuf_t *pkbuf)
{
memcpy(esm_information_transfer_flag, pkbuf->payload - 1, 1);
return 0;
}
c_int16_t nas_encode_esm_information_transfer_flag(pkbuf_t *pkbuf, nas_esm_information_transfer_flag_t *esm_information_transfer_flag)
{
c_uint16_t size = sizeof(nas_esm_information_transfer_flag_t);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(pkbuf->payload - size, esm_information_transfer_flag, size);
return size;
}

View File

@ -26,7 +26,7 @@
/*******************************************************************************
* This file had been created by gtpv2c_tlv.py script v0.1.0
* Please do not modify this file but regenerate it via script.
* Created on: 2017-04-07 22:21:56.120273 by acetcom
* Created on: 2017-04-07 23:34:23.743668 by acetcom
* from 24301-d80.docx
******************************************************************************/
@ -84,6 +84,13 @@ CORE_DECLARE(c_int16_t) nas_decode_guti_type(nas_guti_type_t *guti_type, pkbuf_t
CORE_DECLARE(c_int16_t) nas_decode_extended_drx_parameters(nas_extended_drx_parameters_t *extended_drx_parameters, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_drx_parameter(nas_drx_parameter_t *drx_parameter, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_emm_cause(nas_emm_cause_t *emm_cause, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_access_point_name(nas_access_point_name_t *access_point_name, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_protocol_configuration_options(nas_protocol_configuration_options_t *protocol_configuration_options, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_request_type(nas_request_type_t *request_type, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_nbifom_container(nas_nbifom_container_t *nbifom_container, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_header_compression_configuration(nas_header_compression_configuration_t *header_compression_configuration, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_extended_protocol_configuration_options(nas_extended_protocol_configuration_options_t *extended_protocol_configuration_options, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_esm_information_transfer_flag(nas_esm_information_transfer_flag_t *esm_information_transfer_flag, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_encode_device_properties(pkbuf_t *pkbuf, nas_device_properties_t *device_properties);
CORE_DECLARE(c_int16_t) nas_encode_supported_codec_list(pkbuf_t *pkbuf, nas_supported_codec_list_t *supported_codec_list);
@ -127,6 +134,13 @@ CORE_DECLARE(c_int16_t) nas_encode_guti_type(pkbuf_t *pkbuf, nas_guti_type_t *gu
CORE_DECLARE(c_int16_t) nas_encode_extended_drx_parameters(pkbuf_t *pkbuf, nas_extended_drx_parameters_t *extended_drx_parameters);
CORE_DECLARE(c_int16_t) nas_encode_drx_parameter(pkbuf_t *pkbuf, nas_drx_parameter_t *drx_parameter);
CORE_DECLARE(c_int16_t) nas_encode_emm_cause(pkbuf_t *pkbuf, nas_emm_cause_t *emm_cause);
CORE_DECLARE(c_int16_t) nas_encode_access_point_name(pkbuf_t *pkbuf, nas_access_point_name_t *access_point_name);
CORE_DECLARE(c_int16_t) nas_encode_protocol_configuration_options(pkbuf_t *pkbuf, nas_protocol_configuration_options_t *protocol_configuration_options);
CORE_DECLARE(c_int16_t) nas_encode_request_type(pkbuf_t *pkbuf, nas_request_type_t *request_type);
CORE_DECLARE(c_int16_t) nas_encode_nbifom_container(pkbuf_t *pkbuf, nas_nbifom_container_t *nbifom_container);
CORE_DECLARE(c_int16_t) nas_encode_header_compression_configuration(pkbuf_t *pkbuf, nas_header_compression_configuration_t *header_compression_configuration);
CORE_DECLARE(c_int16_t) nas_encode_extended_protocol_configuration_options(pkbuf_t *pkbuf, nas_extended_protocol_configuration_options_t *extended_protocol_configuration_options);
CORE_DECLARE(c_int16_t) nas_encode_esm_information_transfer_flag(pkbuf_t *pkbuf, nas_esm_information_transfer_flag_t *esm_information_transfer_flag);
#ifdef __cplusplus
}

View File

@ -26,7 +26,7 @@
/*******************************************************************************
* This file had been created by gtpv2c_tlv.py script v0.1.0
* Please do not modify this file but regenerate it via script.
* Created on: 2017-04-07 22:21:56.128710 by acetcom
* Created on: 2017-04-07 23:34:23.758891 by acetcom
* from 24301-d80.docx
******************************************************************************/
@ -397,6 +397,40 @@ typedef struct _nas_security_mode_reject_t {
} nas_security_mode_reject_t;
/*******************************************************
* PDN CONNECTIVITY REQUEST
******************************************************/
#define NAS_PDN_CONNECTIVITY_REQUEST_ESM_INFORMATION_TRANSFER_FLAG_PRESENT (1<<0)
#define NAS_PDN_CONNECTIVITY_REQUEST_ACCESS_POINT_NAME_PRESENT (1<<1)
#define NAS_PDN_CONNECTIVITY_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT (1<<2)
#define NAS_PDN_CONNECTIVITY_REQUEST_DEVICE_PROPERTIES_PRESENT (1<<3)
#define NAS_PDN_CONNECTIVITY_REQUEST_NBIFOM_CONTAINER_PRESENT (1<<4)
#define NAS_PDN_CONNECTIVITY_REQUEST_HEADER_COMPRESSION_CONFIGURATION_PRESENT (1<<5)
#define NAS_PDN_CONNECTIVITY_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT (1<<6)
#define NAS_PDN_CONNECTIVITY_REQUEST_ESM_INFORMATION_TRANSFER_FLAG_TYPE 0xD0
#define NAS_PDN_CONNECTIVITY_REQUEST_ACCESS_POINT_NAME_TYPE 0x28
#define NAS_PDN_CONNECTIVITY_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x27
#define NAS_PDN_CONNECTIVITY_REQUEST_DEVICE_PROPERTIES_TYPE 0xC0
#define NAS_PDN_CONNECTIVITY_REQUEST_NBIFOM_CONTAINER_TYPE 0x33
#define NAS_PDN_CONNECTIVITY_REQUEST_HEADER_COMPRESSION_CONFIGURATION_TYPE 0x66
#define NAS_PDN_CONNECTIVITY_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
typedef struct _nas_pdn_connectivity_request_t {
/* Mandatory fields */
nas_request_type_t request_type;
/* Optional fields */
c_uint32_t presencemask;
nas_esm_information_transfer_flag_t esm_information_transfer_flag;
nas_access_point_name_t access_point_name;
nas_protocol_configuration_options_t protocol_configuration_options;
nas_device_properties_t device_properties;
nas_nbifom_container_t nbifom_container;
nas_header_compression_configuration_t header_compression_configuration;
nas_extended_protocol_configuration_options_t extended_protocol_configuration_options;
} nas_pdn_connectivity_request_t;
typedef struct _nas_emm_message_t {
nas_emm_header_t h;
union {
@ -418,6 +452,7 @@ typedef struct _nas_emm_message_t {
typedef struct _nas_esm_message_t {
nas_esm_header_t h;
union {
nas_pdn_connectivity_request_t pdn_connectivity_request;
};
} nas_esm_message_t;

View File

@ -735,6 +735,76 @@ ED2(c_uint8_t paging_time_window:4;,
c_uint8_t e_drx_value:4;)
} __attribute__ ((packed)) nas_extended_drx_parameters_t;
/* 9.9.4.1 Access point name
* See subclause 10.5.6.1 in 3GPP TS 24.008 [13].
* O TLV 3-102 */
#define NAS_MAX_ACCESS_POINT_NAME_LEN 100
typedef struct _nas_access_point_name_t {
c_uint8_t length;
c_uint8_t access_point_name_value[NAS_MAX_ACCESS_POINT_NAME_LEN];
} __attribute__ ((packed)) nas_access_point_name_t;
/* 9.9.4.5 ESM information transfer flag
* O TV 1 */
typedef struct _nas_esm_information_transfer_flag_t {
ED3(c_uint8_t type:4;,
c_uint8_t spare:3;,
c_uint8_t security_protected_required:1;)
} __attribute__ ((packed)) nas_esm_information_transfer_flag_t;
/* 9.9.4.11 Protocol configuration options
* See subclause 10.5.6.3 in 3GPP TS 24.008 [13].
* O TLV 3-253 */
#define NAS_MAX_PCO_LEN 250
typedef struct _nas_protocol_configuration_options_t {
c_uint8_t length;
c_uint8_t todo[NAS_MAX_PCO_LEN];
} __attribute__ ((packed)) nas_protocol_configuration_options_t;
/* 9.9.4.14 Request type
* M V 1/2
* See subclause 10.5.6.17 in 3GPP TS 24.008 [13].
* 9.9.4.10 PDN type "PDN type
* M V 1/2
*/
#define NAS_PDN_CONNECTIVITY_REQUEST_TYPE_INITIAL 1
#define NAS_PDN_CONNECTIVITY_REQUEST_TYPE_HANDOVER 2
#define NAS_PDN_CONNECTIVITY_REQUEST_TYPE_EMERGENCY 4
#define NAS_PDN_CONNECTIVITY_PDN_TYPE_IPV4 1
#define NAS_PDN_CONNECTIVITY_PDN_TYPE_IPV6 2
#define NAS_PDN_CONNECTIVITY_PDN_TYPE_IPV4V6 3
#define NAS_PDN_CONNECTIVITY_PDN_TYPE_NON_IP 5
typedef struct _nas_request_type_t {
ED4(c_uint8_t spare1:1;,
c_uint8_t request_type:3;,
c_uint8_t spare2:1;,
c_uint8_t pdn_type:3;)
} __attribute__ ((packed)) nas_request_type_t;
/* 9.9.4.19 NBIFOM container
* O TLV 3-257 */
typedef struct _nas_nbifom_container_t {
c_uint8_t length;
c_uint8_t todo[257];
} __attribute__ ((packed)) nas_nbifom_container_t;
/* 9.9.4.22 Header compression configuration
* O TLV 5-257 */
typedef struct _nas_header_compression_configuration_t {
c_uint8_t length;
c_uint8_t todo[257];
} __attribute__ ((packed)) nas_header_compression_configuration_t;
/* 9.9.4.26 * Extended protocol configuration options
* O TLV-E 4-65538 */
typedef struct _nas_extended_protocol_configuration_options_t {
c_uint16_t length;
c_uint8_t *buffer;
} __attribute__ ((packed)) nas_extended_protocol_configuration_options_t;
#ifdef __cplusplus
}
#endif /* __cplusplus */

Binary file not shown.

10
lib/nas/support/cache/nas_msg_208.py vendored Normal file
View File

@ -0,0 +1,10 @@
ies = []
ies.append({ "iei" : "", "value" : "Request type", "type" : "Request type", "reference" : "9.9.4.14", "presence" : "M", "format" : "V", "length" : "1/2"})
ies.append({ "iei" : "D-", "value" : "ESM information transfer flag", "type" : "ESM information transfer flag", "reference" : "9.9.4.5", "presence" : "O", "format" : "TV", "length" : "1"})
ies.append({ "iei" : "28", "value" : "Access point name", "type" : "Access point name", "reference" : "9.9.4.1", "presence" : "O", "format" : "TLV", "length" : "3-102"})
ies.append({ "iei" : "27", "value" : "Protocol configuration options", "type" : "Protocol configuration options", "reference" : "9.9.4.11", "presence" : "O", "format" : "TLV", "length" : "3-253"})
ies.append({ "iei" : "C-", "value" : "Device properties", "type" : "Device properties", "reference" : "9.9.2.0A", "presence" : "O", "format" : "TV", "length" : "1"})
ies.append({ "iei" : "33", "value" : "NBIFOM container", "type" : "NBIFOM container", "reference" : "9.9.4.19", "presence" : "O", "format" : "TLV", "length" : "3-257"})
ies.append({ "iei" : "66", "value" : "Header compression configuration", "type" : "Header compression configuration", "reference" : "9.9.4.22", "presence" : "O", "format" : "TLV", "length" : "5-257"})
ies.append({ "iei" : "7B", "value" : "Extended protocol configuration options", "type" : "Extended protocol configuration options", "reference" : "9.9.4.26", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
msg_list[key]["ies"] = ies

View File

@ -221,7 +221,9 @@ msg_list["IDENTITY RESPONSE"]["table"] = 28
msg_list["SECURITY MODE COMMAND"]["table"] = 29
msg_list["SECURITY MODE COMPLETE"]["table"] = 30
msg_list["SECURITY MODE REJECT"]["table"] = 31
msg_list["ESM INFORMATION REQUEST"]["table"] = 57
msg_list["PDN CONNECTIVITY REQUEST"]["table"] = 65
for key in msg_list.keys():
if "table" not in msg_list[key].keys():
@ -392,7 +394,7 @@ for (k, v) in sorted_type_list:
f.write(" memcpy(pkbuf->payload - size, &target, size);\n\n")
f.write(" return size;\n")
f.write("}\n\n")
elif type_list[k]["format"] == "LV-E":
elif type_list[k]["format"] == "LV-E" or type_list[k]["format"] == "TLV-E":
f.write("c_int16_t nas_decode_%s(nas_%s_t *%s, pkbuf_t *pkbuf)\n" % (v_lower(k), v_lower(k), v_lower(k)))
f.write("{\n")
f.write(" c_uint16_t size = 0;\n")

View File

@ -147,7 +147,6 @@ void emm_handle_security_mode_complete(mme_ue_t *ue)
d_assert(nas_security_encode(&sendbuf, ue, &message) == CORE_OK &&
sendbuf,,);
d_print_hex(sendbuf->payload, sendbuf->len);
pkbuf_free(sendbuf);
d_assert(ue, return, "Null param");