all NAS EMM message is implemented

This commit is contained in:
Sukchan Lee 2017-04-26 15:14:56 +09:00
parent 880eee1a16
commit 520bd03f68
15 changed files with 902 additions and 8 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-26 12:23:52.117713 by acetcom
* Created on: 2017-04-26 14:51:04.156252 by acetcom
* from 24301-d80.docx
******************************************************************************/
@ -903,6 +903,43 @@ c_int32_t nas_decode_service_reject(nas_message_t *message, pkbuf_t *pkbuf)
return decoded;
}
c_int32_t nas_decode_guti_reallocation_command(nas_message_t *message, pkbuf_t *pkbuf)
{
nas_guti_reallocation_command_t *guti_reallocation_command = &message->emm.guti_reallocation_command;
c_int32_t decoded = 0;
c_int32_t size = 0;
size = nas_decode_eps_mobile_identity(&guti_reallocation_command->guti, 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_GUTI_REALLOCATION_COMMAND_TAI_LIST_TYPE:
size = nas_decode_tracking_area_identity_list(&guti_reallocation_command->tai_list, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
guti_reallocation_command->presencemask |= NAS_GUTI_REALLOCATION_COMMAND_TAI_LIST_PRESENT;
decoded += size;
break;
default:
d_error("Unknown type(0x%x) or not implemented\n", type);
return -1;
}
}
return decoded;
}
c_int32_t nas_decode_authentication_request(nas_message_t *message, pkbuf_t *pkbuf)
{
nas_authentication_request_t *authentication_request = &message->emm.authentication_request;
@ -1173,6 +1210,169 @@ c_int32_t nas_decode_emm_information(nas_message_t *message, pkbuf_t *pkbuf)
return decoded;
}
c_int32_t nas_decode_downlink_nas_transport(nas_message_t *message, pkbuf_t *pkbuf)
{
nas_downlink_nas_transport_t *downlink_nas_transport = &message->emm.downlink_nas_transport;
c_int32_t decoded = 0;
c_int32_t size = 0;
size = nas_decode_message_container(&downlink_nas_transport->nas_message_container, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
decoded += size;
return decoded;
}
c_int32_t nas_decode_uplink_nas_transport(nas_message_t *message, pkbuf_t *pkbuf)
{
nas_uplink_nas_transport_t *uplink_nas_transport = &message->emm.uplink_nas_transport;
c_int32_t decoded = 0;
c_int32_t size = 0;
size = nas_decode_message_container(&uplink_nas_transport->nas_message_container, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
decoded += size;
return decoded;
}
c_int32_t nas_decode_cs_service_notification(nas_message_t *message, pkbuf_t *pkbuf)
{
nas_cs_service_notification_t *cs_service_notification = &message->emm.cs_service_notification;
c_int32_t decoded = 0;
c_int32_t size = 0;
size = nas_decode_paging_identity(&cs_service_notification->paging_identity, 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_CS_SERVICE_NOTIFICATION_CLI_TYPE:
size = nas_decode_cli(&cs_service_notification->cli, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
cs_service_notification->presencemask |= NAS_CS_SERVICE_NOTIFICATION_CLI_PRESENT;
decoded += size;
break;
case NAS_CS_SERVICE_NOTIFICATION_SS_CODE_TYPE:
size = nas_decode_ss_code(&cs_service_notification->ss_code, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
cs_service_notification->presencemask |= NAS_CS_SERVICE_NOTIFICATION_SS_CODE_PRESENT;
decoded += size;
break;
case NAS_CS_SERVICE_NOTIFICATION_LCS_INDICATOR_TYPE:
size = nas_decode_lcs_indicator(&cs_service_notification->lcs_indicator, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
cs_service_notification->presencemask |= NAS_CS_SERVICE_NOTIFICATION_LCS_INDICATOR_PRESENT;
decoded += size;
break;
case NAS_CS_SERVICE_NOTIFICATION_LCS_CLIENT_IDENTITY_TYPE:
size = nas_decode_lcs_client_identity(&cs_service_notification->lcs_client_identity, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
cs_service_notification->presencemask |= NAS_CS_SERVICE_NOTIFICATION_LCS_CLIENT_IDENTITY_PRESENT;
decoded += size;
break;
default:
d_error("Unknown type(0x%x) or not implemented\n", type);
return -1;
}
}
return decoded;
}
c_int32_t nas_decode_uplink_generic_nas_transport(nas_message_t *message, pkbuf_t *pkbuf)
{
nas_uplink_generic_nas_transport_t *uplink_generic_nas_transport = &message->emm.uplink_generic_nas_transport;
c_int32_t decoded = 0;
c_int32_t size = 0;
size = nas_decode_generic_message_container_type(&uplink_generic_nas_transport->generic_message_container_type, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
decoded += size;
size = nas_decode_generic_message_container(&uplink_generic_nas_transport->generic_message_container, 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_UPLINK_GENERIC_NAS_TRANSPORT_ADDITIONAL_INFORMATION_TYPE:
size = nas_decode_additional_information(&uplink_generic_nas_transport->additional_information, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
uplink_generic_nas_transport->presencemask |= NAS_UPLINK_GENERIC_NAS_TRANSPORT_ADDITIONAL_INFORMATION_PRESENT;
decoded += size;
break;
default:
d_error("Unknown type(0x%x) or not implemented\n", type);
return -1;
}
}
return decoded;
}
c_int32_t nas_decode_downlink_generic_nas_transport(nas_message_t *message, pkbuf_t *pkbuf)
{
nas_downlink_generic_nas_transport_t *downlink_generic_nas_transport = &message->emm.downlink_generic_nas_transport;
c_int32_t decoded = 0;
c_int32_t size = 0;
size = nas_decode_generic_message_container_type(&downlink_generic_nas_transport->generic_message_container_type, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
decoded += size;
size = nas_decode_generic_message_container(&downlink_generic_nas_transport->generic_message_container, 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_DOWNLINK_GENERIC_NAS_TRANSPORT_ADDITIONAL_INFORMATION_TYPE:
size = nas_decode_additional_information(&downlink_generic_nas_transport->additional_information, pkbuf);
d_assert(size >= 0, return -1, "decode failed");
downlink_generic_nas_transport->presencemask |= NAS_DOWNLINK_GENERIC_NAS_TRANSPORT_ADDITIONAL_INFORMATION_PRESENT;
decoded += size;
break;
default:
d_error("Unknown type(0x%x) or not implemented\n", type);
return -1;
}
}
return decoded;
}
c_int32_t nas_decode_activate_default_eps_bearer_context_request(nas_message_t *message, pkbuf_t *pkbuf)
{
nas_activate_default_eps_bearer_context_request_t *activate_default_eps_bearer_context_request = &message->esm.activate_default_eps_bearer_context_request;
@ -1735,6 +1935,13 @@ status_t nas_emm_decode(nas_message_t *message, pkbuf_t *pkbuf)
d_assert(size >= CORE_OK, return CORE_ERROR, "decode error");
decoded += size;
break;
case NAS_GUTI_REALLOCATION_COMMAND:
size = nas_decode_guti_reallocation_command(message, pkbuf);
d_assert(size >= CORE_OK, return CORE_ERROR, "decode error");
decoded += size;
break;
case NAS_GUTI_REALLOCATION_COMPLETE:
break;
case NAS_AUTHENTICATION_REQUEST:
size = nas_decode_authentication_request(message, pkbuf);
d_assert(size >= CORE_OK, return CORE_ERROR, "decode error");
@ -1787,6 +1994,31 @@ status_t nas_emm_decode(nas_message_t *message, pkbuf_t *pkbuf)
d_assert(size >= CORE_OK, return CORE_ERROR, "decode error");
decoded += size;
break;
case NAS_DOWNLINK_NAS_TRANSPORT:
size = nas_decode_downlink_nas_transport(message, pkbuf);
d_assert(size >= CORE_OK, return CORE_ERROR, "decode error");
decoded += size;
break;
case NAS_UPLINK_NAS_TRANSPORT:
size = nas_decode_uplink_nas_transport(message, pkbuf);
d_assert(size >= CORE_OK, return CORE_ERROR, "decode error");
decoded += size;
break;
case NAS_CS_SERVICE_NOTIFICATION:
size = nas_decode_cs_service_notification(message, pkbuf);
d_assert(size >= CORE_OK, return CORE_ERROR, "decode error");
decoded += size;
break;
case NAS_UPLINK_GENERIC_NAS_TRANSPORT:
size = nas_decode_uplink_generic_nas_transport(message, pkbuf);
d_assert(size >= CORE_OK, return CORE_ERROR, "decode error");
decoded += size;
break;
case NAS_DOWNLINK_GENERIC_NAS_TRANSPORT:
size = nas_decode_downlink_generic_nas_transport(message, pkbuf);
d_assert(size >= CORE_OK, return CORE_ERROR, "decode error");
decoded += size;
break;
default:
d_error("Unknown message type (0x%x) or not implemented",
message->emm.h.message_type);

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-26 12:23:52.139199 by acetcom
* Created on: 2017-04-26 14:51:04.184245 by acetcom
* from 24301-d80.docx
******************************************************************************/
@ -1128,6 +1128,30 @@ c_int32_t nas_encode_service_reject(pkbuf_t *pkbuf, nas_message_t *message)
return encoded;
}
c_int32_t nas_encode_guti_reallocation_command(pkbuf_t *pkbuf, nas_message_t *message)
{
nas_guti_reallocation_command_t *guti_reallocation_command = &message->emm.guti_reallocation_command;
c_int32_t encoded = 0;
c_int32_t size = 0;
size = nas_encode_eps_mobile_identity(pkbuf, &guti_reallocation_command->guti);
d_assert(size >= 0, return -1, "encode failed");
encoded += size;
if (guti_reallocation_command->presencemask & NAS_GUTI_REALLOCATION_COMMAND_TAI_LIST_PRESENT)
{
size = nas_encode_optional_type(pkbuf, NAS_GUTI_REALLOCATION_COMMAND_TAI_LIST_TYPE);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
size = nas_encode_tracking_area_identity_list(pkbuf, &guti_reallocation_command->tai_list);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
}
return encoded;
}
c_int32_t nas_encode_authentication_request(pkbuf_t *pkbuf, nas_message_t *message)
{
nas_authentication_request_t *authentication_request = &message->emm.authentication_request;
@ -1374,6 +1398,145 @@ c_int32_t nas_encode_emm_information(pkbuf_t *pkbuf, nas_message_t *message)
return encoded;
}
c_int32_t nas_encode_downlink_nas_transport(pkbuf_t *pkbuf, nas_message_t *message)
{
nas_downlink_nas_transport_t *downlink_nas_transport = &message->emm.downlink_nas_transport;
c_int32_t encoded = 0;
c_int32_t size = 0;
size = nas_encode_message_container(pkbuf, &downlink_nas_transport->nas_message_container);
d_assert(size >= 0, return -1, "encode failed");
encoded += size;
return encoded;
}
c_int32_t nas_encode_uplink_nas_transport(pkbuf_t *pkbuf, nas_message_t *message)
{
nas_uplink_nas_transport_t *uplink_nas_transport = &message->emm.uplink_nas_transport;
c_int32_t encoded = 0;
c_int32_t size = 0;
size = nas_encode_message_container(pkbuf, &uplink_nas_transport->nas_message_container);
d_assert(size >= 0, return -1, "encode failed");
encoded += size;
return encoded;
}
c_int32_t nas_encode_cs_service_notification(pkbuf_t *pkbuf, nas_message_t *message)
{
nas_cs_service_notification_t *cs_service_notification = &message->emm.cs_service_notification;
c_int32_t encoded = 0;
c_int32_t size = 0;
size = nas_encode_paging_identity(pkbuf, &cs_service_notification->paging_identity);
d_assert(size >= 0, return -1, "encode failed");
encoded += size;
if (cs_service_notification->presencemask & NAS_CS_SERVICE_NOTIFICATION_CLI_PRESENT)
{
size = nas_encode_optional_type(pkbuf, NAS_CS_SERVICE_NOTIFICATION_CLI_TYPE);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
size = nas_encode_cli(pkbuf, &cs_service_notification->cli);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
}
if (cs_service_notification->presencemask & NAS_CS_SERVICE_NOTIFICATION_SS_CODE_PRESENT)
{
size = nas_encode_optional_type(pkbuf, NAS_CS_SERVICE_NOTIFICATION_SS_CODE_TYPE);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
size = nas_encode_ss_code(pkbuf, &cs_service_notification->ss_code);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
}
if (cs_service_notification->presencemask & NAS_CS_SERVICE_NOTIFICATION_LCS_INDICATOR_PRESENT)
{
size = nas_encode_optional_type(pkbuf, NAS_CS_SERVICE_NOTIFICATION_LCS_INDICATOR_TYPE);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
size = nas_encode_lcs_indicator(pkbuf, &cs_service_notification->lcs_indicator);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
}
if (cs_service_notification->presencemask & NAS_CS_SERVICE_NOTIFICATION_LCS_CLIENT_IDENTITY_PRESENT)
{
size = nas_encode_optional_type(pkbuf, NAS_CS_SERVICE_NOTIFICATION_LCS_CLIENT_IDENTITY_TYPE);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
size = nas_encode_lcs_client_identity(pkbuf, &cs_service_notification->lcs_client_identity);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
}
return encoded;
}
c_int32_t nas_encode_uplink_generic_nas_transport(pkbuf_t *pkbuf, nas_message_t *message)
{
nas_uplink_generic_nas_transport_t *uplink_generic_nas_transport = &message->emm.uplink_generic_nas_transport;
c_int32_t encoded = 0;
c_int32_t size = 0;
size = nas_encode_generic_message_container_type(pkbuf, &uplink_generic_nas_transport->generic_message_container_type);
d_assert(size >= 0, return -1, "encode failed");
encoded += size;
size = nas_encode_generic_message_container(pkbuf, &uplink_generic_nas_transport->generic_message_container);
d_assert(size >= 0, return -1, "encode failed");
encoded += size;
if (uplink_generic_nas_transport->presencemask & NAS_UPLINK_GENERIC_NAS_TRANSPORT_ADDITIONAL_INFORMATION_PRESENT)
{
size = nas_encode_optional_type(pkbuf, NAS_UPLINK_GENERIC_NAS_TRANSPORT_ADDITIONAL_INFORMATION_TYPE);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
size = nas_encode_additional_information(pkbuf, &uplink_generic_nas_transport->additional_information);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
}
return encoded;
}
c_int32_t nas_encode_downlink_generic_nas_transport(pkbuf_t *pkbuf, nas_message_t *message)
{
nas_downlink_generic_nas_transport_t *downlink_generic_nas_transport = &message->emm.downlink_generic_nas_transport;
c_int32_t encoded = 0;
c_int32_t size = 0;
size = nas_encode_generic_message_container_type(pkbuf, &downlink_generic_nas_transport->generic_message_container_type);
d_assert(size >= 0, return -1, "encode failed");
encoded += size;
size = nas_encode_generic_message_container(pkbuf, &downlink_generic_nas_transport->generic_message_container);
d_assert(size >= 0, return -1, "encode failed");
encoded += size;
if (downlink_generic_nas_transport->presencemask & NAS_DOWNLINK_GENERIC_NAS_TRANSPORT_ADDITIONAL_INFORMATION_PRESENT)
{
size = nas_encode_optional_type(pkbuf, NAS_DOWNLINK_GENERIC_NAS_TRANSPORT_ADDITIONAL_INFORMATION_TYPE);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
size = nas_encode_additional_information(pkbuf, &downlink_generic_nas_transport->additional_information);
d_assert(size >= 0, return encoded, "decode failed");
encoded += size;
}
return encoded;
}
c_int32_t nas_encode_activate_default_eps_bearer_context_request(pkbuf_t *pkbuf, nas_message_t *message)
{
nas_activate_default_eps_bearer_context_request_t *activate_default_eps_bearer_context_request = &message->esm.activate_default_eps_bearer_context_request;
@ -1973,6 +2136,13 @@ status_t nas_emm_encode(pkbuf_t **pkbuf, nas_message_t *message)
d_assert(size >= 0, return CORE_ERROR, "decode error");
encoded += size;
break;
case NAS_GUTI_REALLOCATION_COMMAND:
size = nas_encode_guti_reallocation_command(*pkbuf, message);
d_assert(size >= 0, return CORE_ERROR, "decode error");
encoded += size;
break;
case NAS_GUTI_REALLOCATION_COMPLETE:
break;
case NAS_AUTHENTICATION_REQUEST:
size = nas_encode_authentication_request(*pkbuf, message);
d_assert(size >= 0, return CORE_ERROR, "decode error");
@ -2025,6 +2195,31 @@ status_t nas_emm_encode(pkbuf_t **pkbuf, nas_message_t *message)
d_assert(size >= 0, return CORE_ERROR, "decode error");
encoded += size;
break;
case NAS_DOWNLINK_NAS_TRANSPORT:
size = nas_encode_downlink_nas_transport(*pkbuf, message);
d_assert(size >= 0, return CORE_ERROR, "decode error");
encoded += size;
break;
case NAS_UPLINK_NAS_TRANSPORT:
size = nas_encode_uplink_nas_transport(*pkbuf, message);
d_assert(size >= 0, return CORE_ERROR, "decode error");
encoded += size;
break;
case NAS_CS_SERVICE_NOTIFICATION:
size = nas_encode_cs_service_notification(*pkbuf, message);
d_assert(size >= 0, return CORE_ERROR, "decode error");
encoded += size;
break;
case NAS_UPLINK_GENERIC_NAS_TRANSPORT:
size = nas_encode_uplink_generic_nas_transport(*pkbuf, message);
d_assert(size >= 0, return CORE_ERROR, "decode error");
encoded += size;
break;
case NAS_DOWNLINK_GENERIC_NAS_TRANSPORT:
size = nas_encode_downlink_generic_nas_transport(*pkbuf, message);
d_assert(size >= 0, return CORE_ERROR, "decode error");
encoded += size;
break;
default:
d_error("Unknown message type (0x%x) or not implemented",
message->emm.h.message_type);

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-26 12:23:52.084610 by acetcom
* Created on: 2017-04-26 14:51:04.120969 by acetcom
* from 24301-d80.docx
******************************************************************************/
@ -45,6 +45,34 @@ c_int16_t nas_encode_optional_type(pkbuf_t *pkbuf, c_uint8_t type)
return size;
}
/* 9.9.2.0 Additional information
* O TLV 3-n */
c_int16_t nas_decode_additional_information(nas_additional_information_t *additional_information, pkbuf_t *pkbuf)
{
c_uint16_t size = 0;
nas_additional_information_t *source = pkbuf->payload;
additional_information->length = source->length;
size = additional_information->length + sizeof(additional_information->length);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(additional_information, pkbuf->payload - size, size);
return size;
}
c_int16_t nas_encode_additional_information(pkbuf_t *pkbuf, nas_additional_information_t *additional_information)
{
c_uint16_t size = additional_information->length + sizeof(additional_information->length);
nas_additional_information_t target;
memcpy(&target, additional_information, sizeof(nas_additional_information_t));
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(pkbuf->payload - size, &target, size);
return size;
}
/* 9.9.2.0A Device properties
* O TV 1 */
c_int16_t nas_decode_device_properties(nas_device_properties_t *device_properties, pkbuf_t *pkbuf)
@ -783,6 +811,34 @@ c_int16_t nas_encode_key_set_identifier(pkbuf_t *pkbuf, nas_key_set_identifier_t
return size;
}
/* 9.9.3.22 message container
* M LV 3-252 */
c_int16_t nas_decode_message_container(nas_message_container_t *message_container, pkbuf_t *pkbuf)
{
c_uint16_t size = 0;
nas_message_container_t *source = pkbuf->payload;
message_container->length = source->length;
size = message_container->length + sizeof(message_container->length);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(message_container, pkbuf->payload - size, size);
return size;
}
c_int16_t nas_encode_message_container(pkbuf_t *pkbuf, nas_message_container_t *message_container)
{
c_uint16_t size = message_container->length + sizeof(message_container->length);
nas_message_container_t target;
memcpy(&target, message_container, sizeof(nas_message_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.3.23 security algorithms
* M V 1 */
c_int16_t nas_decode_security_algorithms(nas_security_algorithms_t *security_algorithms, pkbuf_t *pkbuf)
@ -891,6 +947,30 @@ c_int16_t nas_encode_nonce(pkbuf_t *pkbuf, nas_nonce_t *nonce)
return size;
}
/* 9.9.3.25A Paging identity
* M V 1 */
c_int16_t nas_decode_paging_identity(nas_paging_identity_t *paging_identity, pkbuf_t *pkbuf)
{
c_uint16_t size = sizeof(nas_paging_identity_t);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(paging_identity, pkbuf->payload - size, size);
return size;
}
c_int16_t nas_encode_paging_identity(pkbuf_t *pkbuf, nas_paging_identity_t *paging_identity)
{
c_uint16_t size = sizeof(nas_paging_identity_t);
nas_paging_identity_t target;
memcpy(&target, paging_identity, size);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(pkbuf->payload - size, &target, size);
return size;
}
/* 9.9.3.26 P-TMSI signature
* O TV 4 */
c_int16_t nas_decode_p_tmsi_signature(nas_p_tmsi_signature_t *p_tmsi_signature, pkbuf_t *pkbuf)
@ -1268,6 +1348,58 @@ c_int16_t nas_encode_emergency_number_list(pkbuf_t *pkbuf, nas_emergency_number_
return size;
}
/* 9.9.3.38 CLI
* O TLV 3-14 */
c_int16_t nas_decode_cli(nas_cli_t *cli, pkbuf_t *pkbuf)
{
c_uint16_t size = 0;
nas_cli_t *source = pkbuf->payload;
cli->length = source->length;
size = cli->length + sizeof(cli->length);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(cli, pkbuf->payload - size, size);
return size;
}
c_int16_t nas_encode_cli(pkbuf_t *pkbuf, nas_cli_t *cli)
{
c_uint16_t size = cli->length + sizeof(cli->length);
nas_cli_t target;
memcpy(&target, cli, sizeof(nas_cli_t));
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(pkbuf->payload - size, &target, size);
return size;
}
/* 9.9.3.39 SS Code
* O TV 2 */
c_int16_t nas_decode_ss_code(nas_ss_code_t *ss_code, pkbuf_t *pkbuf)
{
c_uint16_t size = sizeof(nas_ss_code_t);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(ss_code, pkbuf->payload - size, size);
return size;
}
c_int16_t nas_encode_ss_code(pkbuf_t *pkbuf, nas_ss_code_t *ss_code)
{
c_uint16_t size = sizeof(nas_ss_code_t);
nas_ss_code_t target;
memcpy(&target, ss_code, size);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(pkbuf->payload - size, &target, size);
return size;
}
/* 9.9.3.4 Authentication response parameter
* M LV 5-17 */
c_int16_t nas_decode_authentication_response_parameter(nas_authentication_response_parameter_t *authentication_response_parameter, pkbuf_t *pkbuf)
@ -1296,6 +1428,118 @@ c_int16_t nas_encode_authentication_response_parameter(pkbuf_t *pkbuf, nas_authe
return size;
}
/* 9.9.3.40 LCS indicator
* O TV 2 */
c_int16_t nas_decode_lcs_indicator(nas_lcs_indicator_t *lcs_indicator, pkbuf_t *pkbuf)
{
c_uint16_t size = sizeof(nas_lcs_indicator_t);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(lcs_indicator, pkbuf->payload - size, size);
return size;
}
c_int16_t nas_encode_lcs_indicator(pkbuf_t *pkbuf, nas_lcs_indicator_t *lcs_indicator)
{
c_uint16_t size = sizeof(nas_lcs_indicator_t);
nas_lcs_indicator_t target;
memcpy(&target, lcs_indicator, size);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(pkbuf->payload - size, &target, size);
return size;
}
/* 9.9.3.41 LCS client identity
* O TLV 3-257 */
c_int16_t nas_decode_lcs_client_identity(nas_lcs_client_identity_t *lcs_client_identity, pkbuf_t *pkbuf)
{
c_uint16_t size = 0;
nas_lcs_client_identity_t *source = pkbuf->payload;
lcs_client_identity->length = source->length;
size = lcs_client_identity->length + sizeof(lcs_client_identity->length);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(lcs_client_identity, pkbuf->payload - size, size);
return size;
}
c_int16_t nas_encode_lcs_client_identity(pkbuf_t *pkbuf, nas_lcs_client_identity_t *lcs_client_identity)
{
c_uint16_t size = lcs_client_identity->length + sizeof(lcs_client_identity->length);
nas_lcs_client_identity_t target;
memcpy(&target, lcs_client_identity, sizeof(nas_lcs_client_identity_t));
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(pkbuf->payload - size, &target, size);
return size;
}
/* 9.9.3.42 Generic message container type
* M V 1 */
c_int16_t nas_decode_generic_message_container_type(nas_generic_message_container_type_t *generic_message_container_type, pkbuf_t *pkbuf)
{
c_uint16_t size = sizeof(nas_generic_message_container_type_t);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(generic_message_container_type, pkbuf->payload - size, size);
return size;
}
c_int16_t nas_encode_generic_message_container_type(pkbuf_t *pkbuf, nas_generic_message_container_type_t *generic_message_container_type)
{
c_uint16_t size = sizeof(nas_generic_message_container_type_t);
nas_generic_message_container_type_t target;
memcpy(&target, generic_message_container_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.3.43 Generic message container
* M LV-E 3-n */
c_int16_t nas_decode_generic_message_container(nas_generic_message_container_t *generic_message_container, pkbuf_t *pkbuf)
{
c_uint16_t size = 0;
nas_generic_message_container_t *source = pkbuf->payload;
generic_message_container->len = ntohs(source->len);
size = generic_message_container->len + sizeof(generic_message_container->len);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
generic_message_container->data = pkbuf->payload - size + sizeof(generic_message_container->len);
return size;
}
c_int16_t nas_encode_generic_message_container(pkbuf_t *pkbuf, nas_generic_message_container_t *generic_message_container)
{
c_uint16_t size = 0;
c_uint16_t target;
d_assert(generic_message_container, return -1, "Null param");
d_assert(generic_message_container->data, return -1, "Null param");
size = sizeof(generic_message_container->len);
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
target = htons(generic_message_container->len);
memcpy(pkbuf->payload - size, &target, size);
size = generic_message_container->len;
d_assert(pkbuf_header(pkbuf, -size) == CORE_OK, return -1, "pkbuf_header error");
memcpy(pkbuf->payload - size, generic_message_container->data, size);
return generic_message_container->len + sizeof(generic_message_container->len);
}
/* 9.9.3.44 Voice domain preference and UE usage setting
* O TLV 3 */
c_int16_t nas_decode_voice_domain_preference_and_ue_usage_setting(nas_voice_domain_preference_and_ue_usage_setting_t *voice_domain_preference_and_ue_usage_setting, pkbuf_t *pkbuf)

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-26 12:23:52.079646 by acetcom
* Created on: 2017-04-26 14:51:04.114843 by acetcom
* from 24301-d80.docx
******************************************************************************/
@ -42,6 +42,7 @@ extern "C" {
CORE_DECLARE(c_int16_t) nas_encode_optional_type(pkbuf_t *pkbuf, c_uint8_t type);
CORE_DECLARE(c_int16_t) nas_decode_additional_information(nas_additional_information_t *additional_information, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_device_properties(nas_device_properties_t *device_properties, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_eps_bearer_context_status(nas_eps_bearer_context_status_t *eps_bearer_context_status, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_supported_codec_list(nas_supported_codec_list_t *supported_codec_list, pkbuf_t *pkbuf);
@ -70,10 +71,12 @@ CORE_DECLARE(c_int16_t) nas_decode_authentication_parameter_autn(nas_authenticat
CORE_DECLARE(c_int16_t) nas_decode_ms_network_capability(nas_ms_network_capability_t *ms_network_capability, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_ms_network_feature_support(nas_ms_network_feature_support_t *ms_network_feature_support, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_key_set_identifier(nas_key_set_identifier_t *key_set_identifier, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_message_container(nas_message_container_t *message_container, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_security_algorithms(nas_security_algorithms_t *security_algorithms, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_network_name(nas_network_name_t *network_name, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_network_resource_identifier_container(nas_network_resource_identifier_container_t *network_resource_identifier_container, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_nonce(nas_nonce_t *nonce, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_paging_identity(nas_paging_identity_t *paging_identity, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_p_tmsi_signature(nas_p_tmsi_signature_t *p_tmsi_signature, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_extended_emm_cause(nas_extended_emm_cause_t *extended_emm_cause, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_service_type(nas_service_type_t *service_type, pkbuf_t *pkbuf);
@ -88,7 +91,13 @@ CORE_DECLARE(c_int16_t) nas_decode_ue_network_capability(nas_ue_network_capabili
CORE_DECLARE(c_int16_t) nas_decode_ue_radio_capability_information_update_needed(nas_ue_radio_capability_information_update_needed_t *ue_radio_capability_information_update_needed, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_ue_security_capability(nas_ue_security_capability_t *ue_security_capability, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_emergency_number_list(nas_emergency_number_list_t *emergency_number_list, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_cli(nas_cli_t *cli, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_ss_code(nas_ss_code_t *ss_code, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_authentication_response_parameter(nas_authentication_response_parameter_t *authentication_response_parameter, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_lcs_indicator(nas_lcs_indicator_t *lcs_indicator, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_lcs_client_identity(nas_lcs_client_identity_t *lcs_client_identity, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_generic_message_container_type(nas_generic_message_container_type_t *generic_message_container_type, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_generic_message_container(nas_generic_message_container_t *generic_message_container, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_voice_domain_preference_and_ue_usage_setting(nas_voice_domain_preference_and_ue_usage_setting_t *voice_domain_preference_and_ue_usage_setting, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_guti_type(nas_guti_type_t *guti_type, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_extended_drx_parameters(nas_extended_drx_parameters_t *extended_drx_parameters, pkbuf_t *pkbuf);
@ -122,6 +131,7 @@ CORE_DECLARE(c_int16_t) nas_decode_llc_service_access_point_identifier(nas_llc_s
CORE_DECLARE(c_int16_t) nas_decode_packet_flow_identifier(nas_packet_flow_identifier_t *packet_flow_identifier, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_decode_pdn_address(nas_pdn_address_t *pdn_address, pkbuf_t *pkbuf);
CORE_DECLARE(c_int16_t) nas_encode_additional_information(pkbuf_t *pkbuf, nas_additional_information_t *additional_information);
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_eps_bearer_context_status(pkbuf_t *pkbuf, nas_eps_bearer_context_status_t *eps_bearer_context_status);
CORE_DECLARE(c_int16_t) nas_encode_supported_codec_list(pkbuf_t *pkbuf, nas_supported_codec_list_t *supported_codec_list);
@ -150,10 +160,12 @@ CORE_DECLARE(c_int16_t) nas_encode_authentication_parameter_autn(pkbuf_t *pkbuf,
CORE_DECLARE(c_int16_t) nas_encode_ms_network_capability(pkbuf_t *pkbuf, nas_ms_network_capability_t *ms_network_capability);
CORE_DECLARE(c_int16_t) nas_encode_ms_network_feature_support(pkbuf_t *pkbuf, nas_ms_network_feature_support_t *ms_network_feature_support);
CORE_DECLARE(c_int16_t) nas_encode_key_set_identifier(pkbuf_t *pkbuf, nas_key_set_identifier_t *key_set_identifier);
CORE_DECLARE(c_int16_t) nas_encode_message_container(pkbuf_t *pkbuf, nas_message_container_t *message_container);
CORE_DECLARE(c_int16_t) nas_encode_security_algorithms(pkbuf_t *pkbuf, nas_security_algorithms_t *security_algorithms);
CORE_DECLARE(c_int16_t) nas_encode_network_name(pkbuf_t *pkbuf, nas_network_name_t *network_name);
CORE_DECLARE(c_int16_t) nas_encode_network_resource_identifier_container(pkbuf_t *pkbuf, nas_network_resource_identifier_container_t *network_resource_identifier_container);
CORE_DECLARE(c_int16_t) nas_encode_nonce(pkbuf_t *pkbuf, nas_nonce_t *nonce);
CORE_DECLARE(c_int16_t) nas_encode_paging_identity(pkbuf_t *pkbuf, nas_paging_identity_t *paging_identity);
CORE_DECLARE(c_int16_t) nas_encode_p_tmsi_signature(pkbuf_t *pkbuf, nas_p_tmsi_signature_t *p_tmsi_signature);
CORE_DECLARE(c_int16_t) nas_encode_extended_emm_cause(pkbuf_t *pkbuf, nas_extended_emm_cause_t *extended_emm_cause);
CORE_DECLARE(c_int16_t) nas_encode_service_type(pkbuf_t *pkbuf, nas_service_type_t *service_type);
@ -168,7 +180,13 @@ CORE_DECLARE(c_int16_t) nas_encode_ue_network_capability(pkbuf_t *pkbuf, nas_ue_
CORE_DECLARE(c_int16_t) nas_encode_ue_radio_capability_information_update_needed(pkbuf_t *pkbuf, nas_ue_radio_capability_information_update_needed_t *ue_radio_capability_information_update_needed);
CORE_DECLARE(c_int16_t) nas_encode_ue_security_capability(pkbuf_t *pkbuf, nas_ue_security_capability_t *ue_security_capability);
CORE_DECLARE(c_int16_t) nas_encode_emergency_number_list(pkbuf_t *pkbuf, nas_emergency_number_list_t *emergency_number_list);
CORE_DECLARE(c_int16_t) nas_encode_cli(pkbuf_t *pkbuf, nas_cli_t *cli);
CORE_DECLARE(c_int16_t) nas_encode_ss_code(pkbuf_t *pkbuf, nas_ss_code_t *ss_code);
CORE_DECLARE(c_int16_t) nas_encode_authentication_response_parameter(pkbuf_t *pkbuf, nas_authentication_response_parameter_t *authentication_response_parameter);
CORE_DECLARE(c_int16_t) nas_encode_lcs_indicator(pkbuf_t *pkbuf, nas_lcs_indicator_t *lcs_indicator);
CORE_DECLARE(c_int16_t) nas_encode_lcs_client_identity(pkbuf_t *pkbuf, nas_lcs_client_identity_t *lcs_client_identity);
CORE_DECLARE(c_int16_t) nas_encode_generic_message_container_type(pkbuf_t *pkbuf, nas_generic_message_container_type_t *generic_message_container_type);
CORE_DECLARE(c_int16_t) nas_encode_generic_message_container(pkbuf_t *pkbuf, nas_generic_message_container_t *generic_message_container);
CORE_DECLARE(c_int16_t) nas_encode_voice_domain_preference_and_ue_usage_setting(pkbuf_t *pkbuf, nas_voice_domain_preference_and_ue_usage_setting_t *voice_domain_preference_and_ue_usage_setting);
CORE_DECLARE(c_int16_t) nas_encode_guti_type(pkbuf_t *pkbuf, nas_guti_type_t *guti_type);
CORE_DECLARE(c_int16_t) nas_encode_extended_drx_parameters(pkbuf_t *pkbuf, nas_extended_drx_parameters_t *extended_drx_parameters);

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-26 12:23:52.097586 by acetcom
* Created on: 2017-04-26 14:51:04.133462 by acetcom
* from 24301-d80.docx
******************************************************************************/
@ -544,6 +544,22 @@ typedef struct _nas_service_reject_t {
} nas_service_reject_t;
/*******************************************************
* GUTI REALLOCATION COMMAND
******************************************************/
#define NAS_GUTI_REALLOCATION_COMMAND_TAI_LIST_PRESENT (1<<0)
#define NAS_GUTI_REALLOCATION_COMMAND_TAI_LIST_TYPE 0x54
typedef struct _nas_guti_reallocation_command_t {
/* Mandatory fields */
nas_eps_mobile_identity_t guti;
/* Optional fields */
c_uint32_t presencemask;
nas_tracking_area_identity_list_t tai_list;
} nas_guti_reallocation_command_t;
/*******************************************************
* AUTHENTICATION REQUEST
******************************************************/
@ -686,6 +702,85 @@ typedef struct _nas_emm_information_t {
} nas_emm_information_t;
/*******************************************************
* DOWNLINK NAS TRANSPORT
******************************************************/
typedef struct _nas_downlink_nas_transport_t {
/* Mandatory fields */
nas_message_container_t nas_message_container;
} nas_downlink_nas_transport_t;
/*******************************************************
* UPLINK NAS TRANSPORT
******************************************************/
typedef struct _nas_uplink_nas_transport_t {
/* Mandatory fields */
nas_message_container_t nas_message_container;
} nas_uplink_nas_transport_t;
/*******************************************************
* CS SERVICE NOTIFICATION
******************************************************/
#define NAS_CS_SERVICE_NOTIFICATION_CLI_PRESENT (1<<0)
#define NAS_CS_SERVICE_NOTIFICATION_SS_CODE_PRESENT (1<<1)
#define NAS_CS_SERVICE_NOTIFICATION_LCS_INDICATOR_PRESENT (1<<2)
#define NAS_CS_SERVICE_NOTIFICATION_LCS_CLIENT_IDENTITY_PRESENT (1<<3)
#define NAS_CS_SERVICE_NOTIFICATION_CLI_TYPE 0x60
#define NAS_CS_SERVICE_NOTIFICATION_SS_CODE_TYPE 0x61
#define NAS_CS_SERVICE_NOTIFICATION_LCS_INDICATOR_TYPE 0x62
#define NAS_CS_SERVICE_NOTIFICATION_LCS_CLIENT_IDENTITY_TYPE 0x63
typedef struct _nas_cs_service_notification_t {
/* Mandatory fields */
nas_paging_identity_t paging_identity;
/* Optional fields */
c_uint32_t presencemask;
nas_cli_t cli;
nas_ss_code_t ss_code;
nas_lcs_indicator_t lcs_indicator;
nas_lcs_client_identity_t lcs_client_identity;
} nas_cs_service_notification_t;
/*******************************************************
* UPLINK GENERIC NAS TRANSPORT
******************************************************/
#define NAS_UPLINK_GENERIC_NAS_TRANSPORT_ADDITIONAL_INFORMATION_PRESENT (1<<0)
#define NAS_UPLINK_GENERIC_NAS_TRANSPORT_ADDITIONAL_INFORMATION_TYPE 0x65
typedef struct _nas_uplink_generic_nas_transport_t {
/* Mandatory fields */
nas_generic_message_container_type_t generic_message_container_type;
nas_generic_message_container_t generic_message_container;
/* Optional fields */
c_uint32_t presencemask;
nas_additional_information_t additional_information;
} nas_uplink_generic_nas_transport_t;
/*******************************************************
* DOWNLINK GENERIC NAS TRANSPORT
******************************************************/
#define NAS_DOWNLINK_GENERIC_NAS_TRANSPORT_ADDITIONAL_INFORMATION_PRESENT (1<<0)
#define NAS_DOWNLINK_GENERIC_NAS_TRANSPORT_ADDITIONAL_INFORMATION_TYPE 0x65
typedef struct _nas_downlink_generic_nas_transport_t {
/* Mandatory fields */
nas_generic_message_container_type_t generic_message_container_type;
nas_generic_message_container_t generic_message_container;
/* Optional fields */
c_uint32_t presencemask;
nas_additional_information_t additional_information;
} nas_downlink_generic_nas_transport_t;
/*******************************************************
* ACTIVATE DEFAULT EPS BEARER CONTEXT REQUEST
******************************************************/
@ -917,6 +1012,7 @@ typedef struct _nas_emm_message_t {
nas_extended_service_request_t extended_service_request;
nas_service_request_t service_request;
nas_service_reject_t service_reject;
nas_guti_reallocation_command_t guti_reallocation_command;
nas_authentication_request_t authentication_request;
nas_authentication_response_t authentication_response;
nas_identity_request_t identity_request;
@ -927,6 +1023,11 @@ typedef struct _nas_emm_message_t {
nas_security_mode_reject_t security_mode_reject;
nas_emm_status_t emm_status;
nas_emm_information_t emm_information;
nas_downlink_nas_transport_t downlink_nas_transport;
nas_uplink_nas_transport_t uplink_nas_transport;
nas_cs_service_notification_t cs_service_notification;
nas_uplink_generic_nas_transport_t uplink_generic_nas_transport;
nas_downlink_generic_nas_transport_t downlink_generic_nas_transport;
};
} nas_emm_message_t;

View File

@ -7,6 +7,14 @@
extern "C" {
#endif /* __cplusplus */
/* 9.9.2.0 Additional information
* O TLV 3-n */
#define NAX_MAX_ADDITIONAL_INFORMATION_LEN 255
typedef struct _nas_additional_information_t {
c_uint8_t length;
c_uint32_t buffer[NAX_MAX_ADDITIONAL_INFORMATION_LEN];
} __attribute__ ((packed)) nas_additional_information_t;
/* 9.9.2.0A Device properties
* See subclause 10.5.7.8 in 3GPP TS 24.008 [13].
* O TV 1 */
@ -144,7 +152,7 @@ ED8(c_uint8_t cm3:1;,
/*9.9.2.5 Mobile station classmark 3
* See subclause 10.5.1.7 in 3GPP TS 24.008 [13].
* O TLV 2-34 */
#define NAS_MAX_MOBILE_STATION_CLASSMARK_3_LEN 34
#define NAS_MAX_MOBILE_STATION_CLASSMARK_3_LEN 32
typedef struct _nas_mobile_station_classmark_3_t {
c_uint8_t length;
c_uint8_t buffer[NAS_MAX_MOBILE_STATION_CLASSMARK_3_LEN];
@ -575,6 +583,14 @@ ED3(c_uint8_t type:4;,
c_uint8_t nas_key_set_identifier:3;)
} __attribute__ ((packed)) nas_key_set_identifier_t;
/* 9.9.3.22 message container
* M LV 3-252 */
#define NAS_MAX_MESSAGE_CONTAINER_LEN 250
typedef struct _nas_message_container_t {
c_uint8_t length;
c_uint16_t buffer[NAS_MAX_MESSAGE_CONTAINER_LEN];
} __attribute__ ((packed)) nas_message_container_t;
/* 9.9.3.23 NAS security algorithms
* M V 1 */
#define NAS_SECURITY_ALGORITHMS_EIA0 0
@ -619,6 +635,15 @@ ED2(c_uint8_t nri_container_value2:2;,
* O TV 5 */
typedef c_uint32_t nas_nonce_t;
/* 9.9.3.25A Paging identity
* M V 1 */
#define NAS_PAGING_IDENTITY_IMSI 0
#define NAS_PAGING_IDENTITY_TMSI 1
typedef struct _nas_paging_identity_t {
ED2(c_uint8_t spare:7;,
c_uint8_t identity:1;)
} nas_paging_identity_t;
/* 9.9.3.26 P-TMSI signature
* See subclause 10.5.5.8 in 3GPP TS 24.008
* O TV 4 */
@ -872,12 +897,55 @@ typedef struct _nas_ue_security_capability_t {
/* buffer : 9.9.3.37 Emergency number list
* See subclause 10.5.3.13 in 3GPP TS 24.008 [13].
* O TLV 5-50 */
#define MAX_NAS_EMERGENCY_NUMBER_LIST_LEN 50
#define NAS_MAX_EMERGENCY_NUMBER_LIST_LEN 48
typedef struct _nas_emergency_number_list_t {
c_uint16_t length;
c_uint8_t buffer[MAX_NAS_EMERGENCY_NUMBER_LIST_LEN];
c_uint8_t buffer[NAS_MAX_EMERGENCY_NUMBER_LIST_LEN];
} __attribute__ ((packed)) nas_emergency_number_list_t;
/* 9.9.3.38 CLI
* O TLV 3-14
* The coding of the CLI value part is the same as for
* octets 3 to 14 of the Calling party BCD number information element
* defined in subclause 10.5.4.9 of 3GPP TS 24.008 [13]. */
#define NAX_MAX_CLI_LEN 12
typedef struct _nas_cli_t {
c_uint8_t length;
c_uint8_t buffer[NAX_MAX_CLI_LEN];
} __attribute__ ((packed)) nas_cli_t;
/* 9.9.3.39 SS Code
* O TV 2
* The coding of the SS Code value is given in subclause 17.7.5 of
* 3GPP TS 29.002 [15C] */
typedef c_uint8_t nas_ss_code_t;
/* 9.9.3.40 LCS indicator
* O TV 2 */
#define NAS_LCS_INDICATOR_MT_LR 1
typedef c_uint8_t nas_lcs_indicator_t;
/* 9.9.3.41 LCS client identity
* O TLV 3-257 */
#define NAS_MAX_LCS_CLIENT_IDENTITY_LEN 255
typedef struct _nas_lcs_client_identity_t {
c_uint8_t length;
c_uint8_t buffer[NAS_MAX_LCS_CLIENT_IDENTITY_LEN];
} __attribute__ ((packed)) nas_lcs_client_identity_t;
/* 9.9.3.42 Generic message container type
* M V 1 */
#define NAS_GENERIC_MESSAGE_CONTAINER_TYPE_LTE_POSITIONING_PROTOCOL 1
#define NAS_GENERIC_MESSAGE_CONTAINER_TYPE_LTE_LOCATION_SERVICES_MESSAGE 2
typedef c_uint8_t nas_generic_message_container_type_t;
/* 9.9.3.43 Generic message container
* M LV-E 3-n */
typedef struct _nas_generic_message_container_t {
c_uint16_t len;
c_uint8_t *data;
} nas_generic_message_container_t;
/* 9.9.3.44 Voice domain preference and UE's usage setting
* See subclause 10.5.5.28 in 3GPP TS 24.008 [13].
* O TLV 3 */

Binary file not shown.

7
lib/nas/support/cache/nas_msg_100.py vendored Normal file
View File

@ -0,0 +1,7 @@
ies = []
ies.append({ "iei" : "", "value" : "Paging identity", "type" : "Paging identity", "reference" : "9.9.3.25A", "presence" : "M", "format" : "V", "length" : "1"})
ies.append({ "iei" : "60", "value" : "CLI", "type" : "CLI", "reference" : "9.9.3.38", "presence" : "O", "format" : "TLV", "length" : "3-14"})
ies.append({ "iei" : "61", "value" : "SS Code", "type" : "SS Code", "reference" : "9.9.3.39", "presence" : "O", "format" : "TV", "length" : "2"})
ies.append({ "iei" : "62", "value" : "LCS indicator", "type" : "LCS indicator", "reference" : "9.9.3.40", "presence" : "O", "format" : "TV", "length" : "2"})
ies.append({ "iei" : "63", "value" : "LCS client identity", "type" : "LCS client identity", "reference" : "9.9.3.41", "presence" : "O", "format" : "TLV", "length" : "3-257"})
msg_list[key]["ies"] = ies

5
lib/nas/support/cache/nas_msg_101.py vendored Normal file
View File

@ -0,0 +1,5 @@
ies = []
ies.append({ "iei" : "", "value" : "Generic message container type", "type" : "Generic message container type", "reference" : "9.9.3.42", "presence" : "M", "format" : "V", "length" : "1"})
ies.append({ "iei" : "", "value" : "Generic message container", "type" : "Generic message container", "reference" : "9.9.3.43", "presence" : "M", "format" : "LV-E", "length" : "3-n"})
ies.append({ "iei" : "65", "value" : "Additional information", "type" : "Additional information", "reference" : "9.9.2.0", "presence" : "O", "format" : "TLV", "length" : "3-n"})
msg_list[key]["ies"] = ies

5
lib/nas/support/cache/nas_msg_104.py vendored Normal file
View File

@ -0,0 +1,5 @@
ies = []
ies.append({ "iei" : "", "value" : "Generic message container type", "type" : "Generic message container type", "reference" : "9.9.3.42", "presence" : "M", "format" : "V", "length" : "1"})
ies.append({ "iei" : "", "value" : "Generic message container", "type" : "Generic message container", "reference" : "9.9.3.43", "presence" : "M", "format" : "LV-E", "length" : "3-n"})
ies.append({ "iei" : "65", "value" : "Additional information", "type" : "Additional information", "reference" : "9.9.2.0", "presence" : "O", "format" : "TLV", "length" : "3-n"})
msg_list[key]["ies"] = ies

4
lib/nas/support/cache/nas_msg_80.py vendored Normal file
View File

@ -0,0 +1,4 @@
ies = []
ies.append({ "iei" : "", "value" : "GUTI", "type" : "EPS mobile identity", "reference" : "9.9.3.12", "presence" : "M", "format" : "LV", "length" : "12"})
ies.append({ "iei" : "54", "value" : "TAI list", "type" : "Tracking area identity list", "reference" : "9.9.3.33", "presence" : "O", "format" : "TLV", "length" : "8-98"})
msg_list[key]["ies"] = ies

2
lib/nas/support/cache/nas_msg_81.py vendored Normal file
View File

@ -0,0 +1,2 @@
ies = []
msg_list[key]["ies"] = ies

3
lib/nas/support/cache/nas_msg_98.py vendored Normal file
View File

@ -0,0 +1,3 @@
ies = []
ies.append({ "iei" : "", "value" : "NAS message container", "type" : "message container", "reference" : "9.9.3.22", "presence" : "M", "format" : "LV", "length" : "3-252"})
msg_list[key]["ies"] = ies

3
lib/nas/support/cache/nas_msg_99.py vendored Normal file
View File

@ -0,0 +1,3 @@
ies = []
ies.append({ "iei" : "", "value" : "NAS message container", "type" : "message container", "reference" : "9.9.3.22", "presence" : "M", "format" : "LV", "length" : "3-252"})
msg_list[key]["ies"] = ies

View File

@ -218,12 +218,16 @@ msg_list["AUTHENTICATION FAILURE"]["table"] = 4
msg_list["AUTHENTICATION REJECT"]["table"] = 5
msg_list["AUTHENTICATION REQUEST"]["table"] = 6
msg_list["AUTHENTICATION RESPONSE"]["table"] = 7
msg_list["CS SERVICE NOTIFICATION"]["table"] = 8
msg_list["DETACH ACCEPT"]["table"] = 9
msg_list["DETACH REQUEST FROM UE"]["table"] = 11
msg_list["DETACH REQUEST TO UE"]["table"] = 12
msg_list["DOWNLINK NAS TRANSPORT"]["table"] = 13
msg_list["EMM INFORMATION"]["table"] = 14
msg_list["EMM STATUS"]["table"] = 15
msg_list["EXTENDED SERVICE REQUEST"]["table"] = 16
msg_list["GUTI REALLOCATION COMMAND"]["table"] = 17
msg_list["GUTI REALLOCATION COMPLETE"]["table"] = 18
msg_list["IDENTITY REQUEST"]["table"] = 19
msg_list["IDENTITY RESPONSE"]["table"] = 20
msg_list["SECURITY MODE COMMAND"]["table"] = 21
@ -235,6 +239,9 @@ msg_list["TRACKING AREA UPDATE ACCEPT"]["table"] = 27
msg_list["TRACKING AREA UPDATE COMPLETE"]["table"] = 28
msg_list["TRACKING AREA UPDATE REJECT"]["table"] = 29
msg_list["TRACKING AREA UPDATE REQUEST"]["table"] = 30
msg_list["UPLINK NAS TRANSPORT"]["table"] = 31
msg_list["DOWNLINK GENERIC NAS TRANSPORT"]["table"] = 32
msg_list["UPLINK GENERIC NAS TRANSPORT"]["table"] = 33
msg_list["ACTIVATE DEFAULT EPS BEARER CONTEXT ACCEPT"]["table"] = 39
msg_list["ACTIVATE DEFAULT EPS BEARER CONTEXT REJECT"]["table"] = 40