|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(OGS_GTP_INSIDE) && !defined(OGS_GTP_COMPILATION) |
|
|
#error "This header cannot be included directly." |
|
|
#endif |
|
|
|
|
|
#ifndef OGS_GTP_XACT_H |
|
|
#define OGS_GTP_XACT_H |
|
|
|
|
|
#ifdef __cplusplus |
|
|
extern "C" { |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define OGS_GTP_MIN_XACT_ID 1 |
|
|
#define OGS_GTP_CMD_XACT_ID 0x800000 |
|
|
|
|
|
#define OGS_GTP1_MIN_XACT_ID 0 |
|
|
#define OGS_GTP1_MAX_XACT_ID 65535 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct ogs_gtp_xact_s { |
|
|
ogs_lnode_t node; |
|
|
|
|
|
ogs_pool_id_t id; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ogs_lnode_t to_update_node; |
|
|
|
|
|
ogs_pool_id_t index; |
|
|
|
|
|
uint8_t gtp_version; |
|
|
|
|
|
#define OGS_GTP_LOCAL_ORIGINATOR 0 |
|
|
#define OGS_GTP_REMOTE_ORIGINATOR 1 |
|
|
uint8_t org; |
|
|
|
|
|
|
|
|
uint32_t xid; |
|
|
ogs_gtp_node_t *gnode; |
|
|
|
|
|
void (*cb)(ogs_gtp_xact_t *, void *); |
|
|
void *data; |
|
|
|
|
|
int step; |
|
|
|
|
|
|
|
|
|
|
|
struct { |
|
|
uint8_t type; |
|
|
ogs_pkbuf_t *pkbuf; |
|
|
} seq[3]; |
|
|
|
|
|
ogs_timer_t *tm_response; |
|
|
uint8_t response_rcount; |
|
|
ogs_timer_t *tm_holding; |
|
|
uint8_t holding_rcount; |
|
|
|
|
|
ogs_timer_t *tm_peer; |
|
|
void (*peer_cb)(ogs_gtp_xact_t *, void *); |
|
|
void *peer_data; |
|
|
|
|
|
uint32_t local_teid; |
|
|
|
|
|
|
|
|
ogs_pool_id_t assoc_xact_id; |
|
|
void *pfcp_xact; |
|
|
|
|
|
#define OGS_GTP_MODIFY_TFT_UPDATE ((uint64_t)1<<0) |
|
|
#define OGS_GTP_MODIFY_QOS_UPDATE ((uint64_t)1<<1) |
|
|
uint64_t update_flags; |
|
|
|
|
|
#define OGS_GTP_DELETE_NO_ACTION 1 |
|
|
#define OGS_GTP_DELETE_SEND_AUTHENTICATION_REQUEST 2 |
|
|
#define OGS_GTP_DELETE_SEND_DETACH_ACCEPT 3 |
|
|
#define OGS_GTP_DELETE_SEND_DEACTIVATE_BEARER_CONTEXT_REQUEST 4 |
|
|
#define OGS_GTP_DELETE_SEND_RELEASE_WITH_UE_CONTEXT_REMOVE 5 |
|
|
#define OGS_GTP_DELETE_SEND_RELEASE_WITH_S1_REMOVE_AND_UNLINK 6 |
|
|
#define OGS_GTP_DELETE_HANDLE_PDN_CONNECTIVITY_REQUEST 7 |
|
|
#define OGS_GTP_DELETE_IN_PATH_SWITCH_REQUEST 8 |
|
|
|
|
|
int delete_action; |
|
|
|
|
|
#define OGS_GTP_RELEASE_SEND_UE_CONTEXT_RELEASE_COMMAND 1 |
|
|
#define OGS_GTP_RELEASE_S1_CONTEXT_REMOVE_BY_LO_CONNREFUSED 2 |
|
|
#define OGS_GTP_RELEASE_S1_CONTEXT_REMOVE_BY_RESET_ALL 3 |
|
|
#define OGS_GTP_RELEASE_S1_CONTEXT_REMOVE_BY_RESET_PARTIAL 4 |
|
|
int release_action; |
|
|
|
|
|
#define OGS_GTP_DELETE_INDIRECT_HANDOVER_COMPLETE 1 |
|
|
#define OGS_GTP_DELETE_INDIRECT_HANDOVER_CANCEL 2 |
|
|
int delete_indirect_action; |
|
|
|
|
|
#define OGS_GTP_CREATE_IN_ATTACH_REQUEST 1 |
|
|
#define OGS_GTP_CREATE_IN_UPLINK_NAS_TRANSPORT 2 |
|
|
#define OGS_GTP_CREATE_IN_PATH_SWITCH_REQUEST 3 |
|
|
#define OGS_GTP_CREATE_IN_TRACKING_AREA_UPDATE 4 |
|
|
int create_action; |
|
|
|
|
|
#define OGS_GTP_MODIFY_IN_PATH_SWITCH_REQUEST 1 |
|
|
#define OGS_GTP_MODIFY_IN_E_RAB_MODIFICATION 2 |
|
|
int modify_action; |
|
|
} ogs_gtp_xact_t; |
|
|
|
|
|
int ogs_gtp_xact_init(void); |
|
|
void ogs_gtp_xact_final(void); |
|
|
|
|
|
ogs_gtp_xact_t *ogs_gtp1_xact_local_create(ogs_gtp_node_t *gnode, |
|
|
ogs_gtp1_header_t *hdesc, ogs_pkbuf_t *pkbuf, |
|
|
void (*cb)(ogs_gtp_xact_t *xact, void *data), void *data); |
|
|
ogs_gtp_xact_t *ogs_gtp_xact_local_create(ogs_gtp_node_t *gnode, |
|
|
ogs_gtp2_header_t *hdesc, ogs_pkbuf_t *pkbuf, |
|
|
void (*cb)(ogs_gtp_xact_t *xact, void *data), void *data); |
|
|
|
|
|
ogs_gtp_xact_t *ogs_gtp_xact_find_by_id(ogs_pool_id_t id); |
|
|
void ogs_gtp_xact_delete_all(ogs_gtp_node_t *gnode); |
|
|
|
|
|
int ogs_gtp1_xact_update_tx(ogs_gtp_xact_t *xact, |
|
|
ogs_gtp1_header_t *hdesc, ogs_pkbuf_t *pkbuf); |
|
|
int ogs_gtp_xact_update_tx(ogs_gtp_xact_t *xact, |
|
|
ogs_gtp2_header_t *hdesc, ogs_pkbuf_t *pkbuf); |
|
|
|
|
|
int ogs_gtp_xact_commit(ogs_gtp_xact_t *xact); |
|
|
|
|
|
int ogs_gtp1_xact_receive(ogs_gtp_node_t *gnode, |
|
|
ogs_gtp1_header_t *h, ogs_gtp_xact_t **xact); |
|
|
int ogs_gtp_xact_receive(ogs_gtp_node_t *gnode, |
|
|
ogs_gtp2_header_t *h, ogs_gtp_xact_t **xact); |
|
|
|
|
|
void ogs_gtp_xact_associate(ogs_gtp_xact_t *xact1, ogs_gtp_xact_t *xact2); |
|
|
void ogs_gtp_xact_deassociate(ogs_gtp_xact_t *xact1, ogs_gtp_xact_t *xact2); |
|
|
|
|
|
#ifdef __cplusplus |
|
|
} |
|
|
#endif |
|
|
|
|
|
#endif |
|
|
|