forked from acouzens/open5gs
service request is implemented.
This commit is contained in:
parent
cca339eff4
commit
e0a2758dd0
|
@ -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 09:32:08.187786 by acetcom
|
||||
* Created on: 2017-04-26 09:49:09.303927 by acetcom
|
||||
* from 24301-d80.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -1666,6 +1666,16 @@ status_t nas_emm_decode(nas_message_t *message, pkbuf_t *pkbuf)
|
|||
memcpy(&message->emm.h, pkbuf->payload - size, size);
|
||||
decoded += size;
|
||||
|
||||
if (message->emm.h.security_header_type ==
|
||||
NAS_SECURITY_HEADER_FOR_SERVICE_REQUEST_MESSAGE)
|
||||
{
|
||||
size = nas_decode_service_request(message, pkbuf);
|
||||
d_assert(size >= CORE_OK, return CORE_ERROR, "decode error");
|
||||
decoded += size;
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
||||
switch(message->emm.h.message_type)
|
||||
{
|
||||
case NAS_ATTACH_REQUEST:
|
||||
|
@ -1717,11 +1727,6 @@ 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_SERVICE_REQUEST:
|
||||
size = nas_decode_service_request(message, pkbuf);
|
||||
d_assert(size >= CORE_OK, return CORE_ERROR, "decode error");
|
||||
decoded += size;
|
||||
break;
|
||||
case NAS_SERVICE_REJECT:
|
||||
size = nas_decode_service_reject(message, pkbuf);
|
||||
d_assert(size >= CORE_OK, return CORE_ERROR, "decode error");
|
||||
|
@ -1785,6 +1790,7 @@ status_t nas_emm_decode(nas_message_t *message, pkbuf_t *pkbuf)
|
|||
break;
|
||||
}
|
||||
|
||||
out:
|
||||
rv = pkbuf_header(pkbuf, decoded);
|
||||
d_assert(rv == CORE_OK, return CORE_ERROR, "pkbuf_header error");
|
||||
|
||||
|
|
|
@ -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 09:32:08.207370 by acetcom
|
||||
* Created on: 2017-04-26 09:49:09.323438 by acetcom
|
||||
* from 24301-d80.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -1904,6 +1904,16 @@ status_t nas_emm_encode(pkbuf_t **pkbuf, nas_message_t *message)
|
|||
memcpy((*pkbuf)->payload - size, &message->emm.h, size);
|
||||
encoded += size;
|
||||
|
||||
if (message->emm.h.security_header_type ==
|
||||
NAS_SECURITY_HEADER_FOR_SERVICE_REQUEST_MESSAGE)
|
||||
{
|
||||
size = nas_encode_service_request(*pkbuf, message);
|
||||
d_assert(size >= 0, return CORE_ERROR, "decode error");
|
||||
encoded += size;
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
||||
switch(message->emm.h.message_type)
|
||||
{
|
||||
case NAS_ATTACH_REQUEST:
|
||||
|
@ -1955,11 +1965,6 @@ 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_SERVICE_REQUEST:
|
||||
size = nas_encode_service_request(*pkbuf, message);
|
||||
d_assert(size >= 0, return CORE_ERROR, "decode error");
|
||||
encoded += size;
|
||||
break;
|
||||
case NAS_SERVICE_REJECT:
|
||||
size = nas_encode_service_reject(*pkbuf, message);
|
||||
d_assert(size >= 0, return CORE_ERROR, "decode error");
|
||||
|
@ -2024,6 +2029,7 @@ status_t nas_emm_encode(pkbuf_t **pkbuf, nas_message_t *message)
|
|||
return CORE_ERROR;
|
||||
}
|
||||
|
||||
out:
|
||||
rv = pkbuf_header(*pkbuf, encoded);
|
||||
d_assert(rv == CORE_OK, return CORE_ERROR, "pkbuf_header error");
|
||||
|
||||
|
|
|
@ -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 09:32:08.162694 by acetcom
|
||||
* Created on: 2017-04-26 09:49:09.274175 by acetcom
|
||||
* from 24301-d80.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
|
|
@ -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 09:32:08.158008 by acetcom
|
||||
* Created on: 2017-04-26 09:49:09.269775 by acetcom
|
||||
* from 24301-d80.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
|
|
@ -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 09:32:08.173277 by acetcom
|
||||
* Created on: 2017-04-26 09:49:09.287767 by acetcom
|
||||
* from 24301-d80.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -88,7 +88,6 @@ ED2(c_uint8_t security_header_type:4;,
|
|||
#define NAS_TRACKING_AREA_UPDATE_COMPLETE 74
|
||||
#define NAS_TRACKING_AREA_UPDATE_REJECT 75
|
||||
#define NAS_EXTENDED_SERVICE_REQUEST 76
|
||||
#define NAS_SERVICE_REQUEST 77
|
||||
#define NAS_SERVICE_REJECT 78
|
||||
#define NAS_GUTI_REALLOCATION_COMMAND 80
|
||||
#define NAS_GUTI_REALLOCATION_COMPLETE 81
|
||||
|
|
|
@ -165,7 +165,7 @@ msg_list["TRACKING AREA UPDATE ACCEPT"] = { "type" : "73" }
|
|||
msg_list["TRACKING AREA UPDATE COMPLETE"] = { "type" : "74" }
|
||||
msg_list["TRACKING AREA UPDATE REJECT"] = { "type" : "75" }
|
||||
msg_list["EXTENDED SERVICE REQUEST"] = { "type" : "76" }
|
||||
msg_list["SERVICE REQUEST"] = { "type" : "77" }
|
||||
msg_list["SERVICE REQUEST"] = { "type" : "77.1" }
|
||||
msg_list["SERVICE REJECT"] = { "type" : "78" }
|
||||
msg_list["GUTI REALLOCATION COMMAND"] = { "type" : "80" }
|
||||
msg_list["GUTI REALLOCATION COMPLETE"] = { "type" : "81" }
|
||||
|
@ -523,7 +523,7 @@ ED2(c_uint8_t security_header_type:4;,
|
|||
""")
|
||||
|
||||
for (k, v) in sorted_msg_list:
|
||||
if k.find("TO UE") == -1:
|
||||
if k.find("TO UE") == -1 and k != "SERVICE REQUEST":
|
||||
f.write("#define NAS_" + v_upper(k) + " " + v.split('.')[0] + "\n")
|
||||
f.write("\n")
|
||||
|
||||
|
@ -700,13 +700,23 @@ f.write("""status_t nas_emm_decode(nas_message_t *message, pkbuf_t *pkbuf)
|
|||
memcpy(&message->emm.h, pkbuf->payload - size, size);
|
||||
decoded += size;
|
||||
|
||||
if (message->emm.h.security_header_type ==
|
||||
NAS_SECURITY_HEADER_FOR_SERVICE_REQUEST_MESSAGE)
|
||||
{
|
||||
size = nas_decode_service_request(message, pkbuf);
|
||||
d_assert(size >= CORE_OK, return CORE_ERROR, "decode error");
|
||||
decoded += size;
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
||||
switch(message->emm.h.message_type)
|
||||
{
|
||||
""")
|
||||
for (k, v) in sorted_msg_list:
|
||||
if "ies" not in msg_list[k]:
|
||||
continue;
|
||||
if float(msg_list[k]["type"]) < 192 and k.find("TO UE") == -1:
|
||||
if float(msg_list[k]["type"]) < 192 and k.find("TO UE") == -1 and k != "SERVICE REQUEST":
|
||||
f.write(" case NAS_%s:\n" % v_upper(k))
|
||||
if len(msg_list[k]["ies"]) != 0:
|
||||
f.write(" size = nas_decode_%s(message, pkbuf);\n" % v_lower(k))
|
||||
|
@ -720,6 +730,7 @@ f.write(""" default:
|
|||
break;
|
||||
}
|
||||
|
||||
out:
|
||||
rv = pkbuf_header(pkbuf, decoded);
|
||||
d_assert(rv == CORE_OK, return CORE_ERROR, "pkbuf_header error");
|
||||
|
||||
|
@ -858,6 +869,16 @@ f.write("""status_t nas_emm_encode(pkbuf_t **pkbuf, nas_message_t *message)
|
|||
memcpy((*pkbuf)->payload - size, &message->emm.h, size);
|
||||
encoded += size;
|
||||
|
||||
if (message->emm.h.security_header_type ==
|
||||
NAS_SECURITY_HEADER_FOR_SERVICE_REQUEST_MESSAGE)
|
||||
{
|
||||
size = nas_encode_service_request(*pkbuf, message);
|
||||
d_assert(size >= 0, return CORE_ERROR, "decode error");
|
||||
encoded += size;
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
||||
switch(message->emm.h.message_type)
|
||||
{
|
||||
""")
|
||||
|
@ -865,7 +886,7 @@ f.write("""status_t nas_emm_encode(pkbuf_t **pkbuf, nas_message_t *message)
|
|||
for (k, v) in sorted_msg_list:
|
||||
if "ies" not in msg_list[k]:
|
||||
continue;
|
||||
if float(msg_list[k]["type"]) < 192 and k.find("FROM UE") == -1:
|
||||
if float(msg_list[k]["type"]) < 192 and k.find("FROM UE") == -1 and k != "SERVICE REQUEST":
|
||||
f.write(" case NAS_%s:\n" % v_upper(k))
|
||||
if len(msg_list[k]["ies"]) != 0:
|
||||
f.write(" size = nas_encode_%s(*pkbuf, message);\n" % v_lower(k))
|
||||
|
@ -880,6 +901,7 @@ f.write(""" default:
|
|||
return CORE_ERROR;
|
||||
}
|
||||
|
||||
out:
|
||||
rv = pkbuf_header(*pkbuf, encoded);
|
||||
d_assert(rv == CORE_OK, return CORE_ERROR, "pkbuf_header error");
|
||||
|
||||
|
|
Loading…
Reference in New Issue