forked from acouzens/open5gs
Session-Id diameter encoder is added
This commit is contained in:
parent
5ca708deab
commit
64268232b1
|
@ -7,6 +7,7 @@
|
|||
|
||||
#define FD_3GPP_VENDOR_ID 10415
|
||||
|
||||
struct dict_object *fd_session_id = NULL;
|
||||
struct dict_object *fd_origin_host = NULL;
|
||||
struct dict_object *fd_origin_realm = NULL;
|
||||
struct dict_object *fd_destination_host = NULL;
|
||||
|
@ -32,6 +33,7 @@ int fd_message_init()
|
|||
CHECK_dict_search( DICT_VENDOR, VENDOR_BY_ID, (void *)&id, &fd_vendor);
|
||||
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Vendor-Id", &fd_vendor_id);
|
||||
|
||||
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Session-Id", &fd_session_id);
|
||||
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Origin-Host", &fd_origin_host);
|
||||
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Origin-Realm", &fd_origin_realm);
|
||||
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Destination-Host", &fd_destination_host);
|
||||
|
@ -50,6 +52,27 @@ int fd_message_init()
|
|||
return 0;
|
||||
}
|
||||
|
||||
int fd_message_session_id_set(
|
||||
struct msg *msg, c_uint8_t *sid, size_t sidlen)
|
||||
{
|
||||
struct avp *avp;
|
||||
union avp_value val;
|
||||
|
||||
/* Create an AVP to hold it */
|
||||
CHECK_FCT( fd_msg_avp_new( fd_session_id, 0, &avp ) );
|
||||
|
||||
/* Set its value */
|
||||
memset(&val, 0, sizeof(val));
|
||||
val.os.data = sid;
|
||||
val.os.len = sidlen;
|
||||
CHECK_FCT( fd_msg_avp_setvalue( avp, &val ) );
|
||||
|
||||
/* Add it to the message */
|
||||
CHECK_FCT( fd_msg_avp_add( msg, MSG_BRW_FIRST_CHILD, avp ) );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int fd_message_experimental_rescode_set(
|
||||
struct msg *msg, c_uint32_t result_code)
|
||||
{
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
extern struct dict_object *fd_session_id;
|
||||
extern struct dict_object *fd_origin_host;
|
||||
extern struct dict_object *fd_origin_realm;
|
||||
extern struct dict_object *fd_destination_host;
|
||||
|
@ -29,6 +30,8 @@ extern struct dict_object *fd_vendor;
|
|||
extern struct dict_object *fd_vendor_id;
|
||||
|
||||
CORE_DECLARE(int) fd_message_init(void);
|
||||
CORE_DECLARE(int) fd_message_session_id_set(
|
||||
struct msg *msg, c_uint8_t *sid, size_t sidlen);
|
||||
CORE_DECLARE(int) fd_message_experimental_rescode_set(
|
||||
struct msg *msg, c_uint32_t result_code);
|
||||
CORE_DECLARE(int) fd_message_vendor_specific_appid_set(
|
||||
|
|
|
@ -110,6 +110,9 @@ typedef struct _pgw_sess_t {
|
|||
c_uint32_t pgw_s5c_teid; /* PGW-S5C-TEID is derived from INDEX */
|
||||
c_uint32_t sgw_s5c_teid; /* SGW-S5C-TEID is received from SGW */
|
||||
|
||||
c_uint8_t *gx_sid; /* Gx Session ID */
|
||||
size_t gx_sidlen; /* Gx Session ID Length */
|
||||
|
||||
/* IMSI */
|
||||
c_uint8_t imsi[MAX_IMSI_LEN];
|
||||
int imsi_len;
|
||||
|
|
Loading…
Reference in New Issue