forked from acouzens/open5gs
update it
This commit is contained in:
parent
60c4d0fd55
commit
18368fe600
|
@ -26,7 +26,7 @@
|
|||
/*******************************************************************************
|
||||
* This file had been created by gtp_tlv.py script v0.1.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2017-03-31 09:04:32.632717 by acetcom
|
||||
* Created on: 2017-04-02 20:45:50.222446 by acetcom
|
||||
* from 29274-d80.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -1910,12 +1910,14 @@ tlv_desc_t tlv_desc_create_session_response =
|
|||
|
||||
|
||||
status_t gtp_parse_msg(
|
||||
c_uint8_t type, gtp_message_t *gtp_message, pkbuf_t *pkbuf)
|
||||
gtp_message_t *gtp_message, c_uint8_t type, pkbuf_t *pkbuf)
|
||||
{
|
||||
status_t rv = CORE_ERROR;
|
||||
|
||||
memset(gtp_message, 0, sizeof(gtp_message_t));
|
||||
switch(type)
|
||||
|
||||
gtp_message->type = type;
|
||||
switch(gtp_message->type)
|
||||
{
|
||||
case GTP_ECHO_REQUEST_TYPE:
|
||||
rv = tlv_parse_msg(>p_message->echo_request,
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
/*******************************************************************************
|
||||
* This file had been created by gtp_tlv.py script v0.1.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2017-03-31 09:04:32.623628 by acetcom
|
||||
* Created on: 2017-04-02 20:45:50.211794 by acetcom
|
||||
* from 29274-d80.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -714,6 +714,7 @@ typedef struct _gtp_create_session_response_t {
|
|||
} gtp_create_session_response_t;
|
||||
|
||||
typedef struct _gtp_message_t {
|
||||
c_uint8_t type;
|
||||
union {
|
||||
gtp_echo_request_t echo_request;
|
||||
gtp_echo_response_t echo_response;
|
||||
|
@ -723,7 +724,7 @@ typedef struct _gtp_message_t {
|
|||
} gtp_message_t;
|
||||
|
||||
CORE_DECLARE(status_t) gtp_parse_msg(
|
||||
c_uint8_t type, gtp_message_t *gtp_message, pkbuf_t *pkbuf);
|
||||
gtp_message_t *gtp_message, c_uint8_t type, pkbuf_t *pkbuf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "core_event.h"
|
||||
|
||||
#include "gtp_xact.h"
|
||||
#include "gtp_tlv.h"
|
||||
|
||||
#define SIZE_OF_GTP_XACT_POOL 32
|
||||
|
||||
|
@ -318,8 +317,9 @@ gtp_xact_t *gtp_xact_find(gtp_node_t *gnode, pkbuf_t *pkbuf)
|
|||
return xact;
|
||||
}
|
||||
|
||||
gtp_xact_t *gtp_xact_recv(gtp_xact_ctx_t *context,
|
||||
net_sock_t *sock, gtp_node_t *gnode, pkbuf_t *pkbuf)
|
||||
gtp_xact_t *gtp_xact_recv(
|
||||
gtp_xact_ctx_t *context, net_sock_t *sock, gtp_node_t *gnode,
|
||||
gtp_message_t *gtp_message, pkbuf_t *pkbuf)
|
||||
{
|
||||
gtp_xact_t *xact = NULL;
|
||||
gtpv2c_header_t *h = NULL;
|
||||
|
@ -344,6 +344,9 @@ gtp_xact_t *gtp_xact_recv(gtp_xact_ctx_t *context,
|
|||
else
|
||||
pkbuf_header(pkbuf, -(GTPV2C_HEADER_LEN-GTPV2C_TEID_LEN));
|
||||
|
||||
d_assert(gtp_parse_msg(gtp_message, h->type, pkbuf) == CORE_OK,
|
||||
goto out, "parse error");
|
||||
|
||||
d_trace(1, "[%d]%s Receive : xid = 0x%x\n",
|
||||
gnode->port,
|
||||
xact->org == GTP_LOCAL_ORIGINATOR ? "LOCAL " : "REMOTE",
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "core_timer.h"
|
||||
|
||||
#include "gtp_path.h"
|
||||
#include "gtp_tlv.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -69,8 +70,9 @@ CORE_DECLARE(gtp_xact_t *) gtp_xact_find(gtp_node_t *gnode, pkbuf_t *pkbuf);
|
|||
CORE_DECLARE(status_t) gtp_xact_commit(gtp_xact_t *xact, pkbuf_t *pkbuf);
|
||||
CORE_DECLARE(status_t) gtp_xact_timeout(gtp_xact_t *xact);
|
||||
|
||||
CORE_DECLARE(gtp_xact_t *) gtp_xact_recv(gtp_xact_ctx_t *context,
|
||||
net_sock_t *sock, gtp_node_t *gnode, pkbuf_t *pkbuf);
|
||||
CORE_DECLARE(gtp_xact_t *) gtp_xact_recv(
|
||||
gtp_xact_ctx_t *context, net_sock_t *sock, gtp_node_t *gnode,
|
||||
gtp_message_t *gtp_message, pkbuf_t *pkbuf);
|
||||
CORE_DECLARE(gtp_xact_t *) gtp_xact_associated_send(gtp_xact_ctx_t *context,
|
||||
net_sock_t *sock, gtp_node_t *gnode, c_uint8_t type, pkbuf_t *pkbuf,
|
||||
gtp_xact_t *associated_xact);
|
||||
|
|
|
@ -454,6 +454,7 @@ for (k, v) in sorted_msg_list:
|
|||
f.write("\n")
|
||||
|
||||
f.write("typedef struct _gtp_message_t {\n")
|
||||
f.write(" c_uint8_t type;\n")
|
||||
f.write(" union {\n")
|
||||
for (k, v) in sorted_msg_list:
|
||||
if "ies" in msg_list[k]:
|
||||
|
@ -462,7 +463,7 @@ f.write(" };\n");
|
|||
f.write("} gtp_message_t;\n\n")
|
||||
|
||||
f.write("""CORE_DECLARE(status_t) gtp_parse_msg(
|
||||
c_uint8_t type, gtp_message_t *gtp_message, pkbuf_t *pkbuf);
|
||||
gtp_message_t *gtp_message, c_uint8_t type, pkbuf_t *pkbuf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -540,12 +541,14 @@ for (k, v) in sorted_msg_list:
|
|||
f.write("\n")
|
||||
|
||||
f.write("""status_t gtp_parse_msg(
|
||||
c_uint8_t type, gtp_message_t *gtp_message, pkbuf_t *pkbuf)
|
||||
gtp_message_t *gtp_message, c_uint8_t type, pkbuf_t *pkbuf)
|
||||
{
|
||||
status_t rv = CORE_ERROR;
|
||||
|
||||
memset(gtp_message, 0, sizeof(gtp_message_t));
|
||||
switch(type)
|
||||
|
||||
gtp_message->type = type;
|
||||
switch(gtp_message->type)
|
||||
{
|
||||
""")
|
||||
for (k, v) in sorted_msg_list:
|
||||
|
|
|
@ -65,13 +65,11 @@ void pgw_state_operational(pgw_sm_t *s, event_t *e)
|
|||
d_assert(gnode, break, "Null param");
|
||||
d_assert(pkbuf, break, "Null param");
|
||||
|
||||
xact = gtp_xact_recv(&pgw_self()->gtp_xact_ctx, sock, gnode, pkbuf);
|
||||
xact = gtp_xact_recv(&pgw_self()->gtp_xact_ctx, sock, gnode,
|
||||
>p_message, pkbuf);
|
||||
d_assert(xact, break, "Null param");
|
||||
|
||||
rv = gtp_parse_msg(xact->type, >p_message, pkbuf);
|
||||
d_assert(rv == CORE_OK, break, "parse error");
|
||||
|
||||
switch(xact->type)
|
||||
switch(gtp_message.type)
|
||||
{
|
||||
case GTP_CREATE_SESSION_REQUEST_TYPE:
|
||||
{
|
||||
|
|
|
@ -66,13 +66,11 @@ void sgw_state_operational(sgw_sm_t *s, event_t *e)
|
|||
d_assert(gnode, break, "Null param");
|
||||
d_assert(pkbuf, break, "Null param");
|
||||
|
||||
xact = gtp_xact_recv(&sgw_self()->gtp_xact_ctx, sock, gnode, pkbuf);
|
||||
xact = gtp_xact_recv(&sgw_self()->gtp_xact_ctx, sock, gnode,
|
||||
>p_message, pkbuf);
|
||||
d_assert(xact, break, "Null param");
|
||||
|
||||
rv = gtp_parse_msg(xact->type, >p_message, pkbuf);
|
||||
d_assert(rv == CORE_OK, break, "parse error");
|
||||
|
||||
switch(xact->type)
|
||||
switch(gtp_message.type)
|
||||
{
|
||||
case GTP_CREATE_SESSION_REQUEST_TYPE:
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue