Added GTP-C cause value enum.

master
Pedro Alvarez 7 years ago
parent 2e6050bf38
commit d76daf3db5

@ -163,18 +163,77 @@ enum gtpc_ie_type
enum gtpc_cause_value
{
//Reserved
LOCAL_DETACH = 2,
COMPLETE_DETACH = 3,
RAT_CHANGED_FROM_3GPP_TO_NON_3GPP = 4,
ISR_DEACTIVATION = 5,
ERROR_INDICATION_RECEIVED_FROM_RNC_ENODEB_S4_SGSN = 6,
IMSI_DETACH_ONLY = 7,
REACTIVATION_REQUESTED = 8,
PDN_RECONNECTION_TO_THIS_APN_DISALLOWED = 9,
ACCESS_CHANGED_FROM_NON_3GPP_TO_3GPP = 10,
PDN_CONNECTION_INACTIVITY_TIMER_EXPIRES = 11
GTPC_CAUSE_VALUE_LOCAL_DETACH = 2,
GTPC_CAUSE_VALUE_COMPLETE_DETACH = 3,
GTPC_CAUSE_VALUE_RAT_CHANGED_FROM_3GPP_TO_NON_3GPP = 4,
GTPC_CAUSE_VALUE_ISR_DEACTIVATION = 5,
GTPC_CAUSE_VALUE_ERROR_INDICATION_RECEIVED_FROM_RNC_ENODEB_S4_SGSN = 6,
GTPC_CAUSE_VALUE_IMSI_DETACH_ONLY = 7,
GTPC_CAUSE_VALUE_REACTIVATION_REQUESTED = 8,
GTPC_CAUSE_VALUE_PDN_RECONNECTION_TO_THIS_APN_DISALLOWED = 9,
GTPC_CAUSE_VALUE_ACCESS_CHANGED_FROM_NON_3GPP_TO_3GPP = 10,
GTPC_CAUSE_VALUE_PDN_CONNECTION_INACTIVITY_TIMER_EXPIRES = 11,
//Spare. This value range shall be used by Cause values in an initial/request message.
GTPC_CAUSE_VALUE_REQUEST_ACCEPTED = 16,
GTPC_CAUSE_VALUE_REQUEST_ACCEPTED_PARTIALLY = 17,
GTPC_CAUSE_VALUE_NEW_PDN_TYPE_DUE_TO_NETWORK_PREFERENCE = 18,
GTPC_CAUSE_VALUE_NEW_PDN_TYPE_DUE_TO_SINGLE_ADDRESS_BEARER_ONLY = 19,
//20-63 Spare.
GTPC_CAUSE_VALUE_CONTEXT_NOT_FOUND = 64,
GTPC_CAUSE_VALUE_INVALID_MESSAGE_FORMAT = 65,
GTPC_CAUSE_VALUE_VERSION_NOT_SUPPORTED_BY_NEXT_PEER = 66,
GTPC_CAUSE_VALUE_INVALID_LENGTH = 67,
GTPC_CAUSE_VALUE_SERVICE_NOT_SUPPORTED = 68,
GTPC_CAUSE_VALUE_MANDATORY_IE_INCORRECT = 69,
GTPC_CAUSE_VALUE_MANDATORY_IE_MISSING = 70,
//71 Shall not be used.
GTPC_CAUSE_VALUE_SYSTEM_FAILURE = 72,
GTPC_CAUSE_VALUE_NO_RESOURCES_AVAILABLE = 73,
GTPC_CAUSE_VALUE_SEMANTIC_ERROR_IN_THE_TFT_OPERATION = 74,
GTPC_CAUSE_VALUE_SYNTACTIC_ERROR_IN_THE_TFT_OPERATION = 75,
GTPC_CAUSE_VALUE_SEMANTIC_ERRORS_IN_PACKET_FILTER = 76,
GTPC_CAUSE_VALUE_SYNTACTIC_ERRORS_IN_PACKET_FILTER = 77,
GTPC_CAUSE_VALUE_MISSING_OR_UNKNOWN_APN = 78,
//79 Shall not be used.
GTPC_CAUSE_VALUE_GRE_KEY_NOT_FOUND = 80,
GTPC_CAUSE_VALUE_RELOCATION_FAILURE = 81,
GTPC_CAUSE_VALUE_DENIED_IN_RAT = 82,
GTPC_CAUSE_VALUE_PREFERRED_PDN_TYPE_NOT_SUPPORTED = 83,
GTPC_CAUSE_VALUE_ALL_DYNAMIC_ADDRESSES_ARE_OCCUPIED = 84,
GTPC_CAUSE_VALUE_UE_CONTEXT_WITHOUT_TFT_ALREADY_ACTIVATED = 85,
GTPC_CAUSE_VALUE_PROTOCOL_TYPE_NOT_SUPPORTED = 86,
GTPC_CAUSE_VALUE_UE_NOT_RESPONDING = 87,
GTPC_CAUSE_VALUE_UE_REFUSES = 88,
GTPC_CAUSE_VALUE_SERVICE_DENIED = 89,
GTPC_CAUSE_VALUE_UNABLE_TO_PAGE_UE = 90,
GTPC_CAUSE_VALUE_NO_MEMORY_AVAILABLE = 91,
GTPC_CAUSE_VALUE_USER_AUTHENTICATION_FAILED = 92,
GTPC_CAUSE_VALUE_APN_ACCESS_DENIED_NO_SUBSCRIPTION = 93,
GTPC_CAUSE_VALUE_REQUEST_REJECTED = 94,
GTPC_CAUSE_VALUE_P_TMSI_SIGNATURE_MISMATCH = 95,
GTPC_CAUSE_VALUE_IMSI_IMEI_NOT_KNOWN = 96,
GTPC_CAUSE_VALUE_SEMANTIC_ERROR_IN_THE_TAD_OPERATION = 97,
GTPC_CAUSE_VALUE_SYNTACTIC_ERROR_IN_THE_TAD_OPERATION = 98,
//99 Shall not be used.
GTPC_CAUSE_VALUE_REMOTE_PEER_NOT_RESPONDING = 100,
GTPC_CAUSE_VALUE_COLLISION_WITH_NETWORK_INITIATED_REQUEST = 101,
GTPC_CAUSE_VALUE_UNABLE_TO_PAGE_UE_DUE_TO_SUSPENSION = 102,
GTPC_CAUSE_VALUE_CONDITIONAL_IE_MISSING = 103,
GTPC_CAUSE_VALUE_APN_RESTRICTION_TYPE_INCOMPATIBLE_WITH_CURRENTLY_ACTIVE_PDN_CONNECTION = 104,
GTPC_CAUSE_VALUE_INVALID_OVERALL_LENGTH_OF_THE_TRIGGERED_RESPONSE_MSG_AND_A_PIGGYBACKED_INITIAL_MSG = 105,
GTPC_CAUSE_VALUE_DATA_FORWARDING_NOT_SUPPORTED = 106,
GTPC_CAUSE_VALUE_INVALID_REPLY_FROM_REMOTE_PEER = 107,
GTPC_CAUSE_VALUE_FALLBACK_TO_GTPV1 = 108,
GTPC_CAUSE_VALUE_INVALID_PEER = 109,
GTPC_CAUSE_VALUE_TEMPORARILY_REJECTED_DUE_TO_HANDOVER_PROCEDURE_IN_PROGRESS = 110,
GTPC_CAUSE_VALUE_MODIFICATIONS_NOT_LIMITED_TO_S1_U_BEARERS = 111,
GTPC_CAUSE_VALUE_REQUEST_REJECTED_FOR_A_PMIPV6_REASON = 112,
GTPC_CAUSE_VALUE_APN_CONGESTION = 113,
GTPC_CAUSE_VALUE_BEARER_HANDLING_NOT_SUPPORTED = 114,
GTPC_CAUSE_VALUE_UE_ALREADY_RE_ATTACHED = 115,
GTPC_CAUSE_VALUE_MULTIPLE_PDN_CONNECTIONS_FOR_A_GIVEN_APN_NOT_ALLOWED = 116
//117-239 Spare. For future use in a triggered/response message.
//240-255 Spare. For future use in an initial/request message.
};
struct gtpc_cause_ie

@ -256,8 +256,24 @@ struct gtpc_create_session_response
struct gtpc_bearer_context_created_ie
{
uint8_t ebi;
//
} bearer_context_created; //M
gtpc_cause_ie cause;
bool s1_u_sgw_f_teid_present;
struct gtpc_f_teid_ie s1_u_sgw_f_teid;
bool s4_u_sgw_f_teid_present;
struct gtpc_f_teid_ie s4_u_sgw_f_teid;
bool s5_s8_u_pgw_f_teid_present;
struct gtpc_f_teid_ie s5_s8_u_pgw_f_teid;
bool s12_sgw_f_teid_present;
struct gtpc_f_teid_ie s12_sgw_f_teid;
bool s2b_u_pgw_f_teid_present;
struct gtpc_f_teid_ie s2b_u_pgw_f_teid;
//bearer_level_qos_present
//bearer_level_qos
//charging_id_present
//charging_id
//bearer_flags_present
//bearer_flags
} eps_bearer_context_created; //M
/*
struct gtpc_bearer_context_removed_ie

@ -80,6 +80,9 @@ private:
srslte::error_t init_sgi_if(spgw_args_t *args);
srslte::error_t init_s1u(spgw_args_t *args);
uint64_t get_new_ctrl_teid();
uint64_t get_new_user_teid();
in_addr_t get_new_ue_ipv4();
bool m_running;
srslte::byte_buffer_pool *m_pool;
@ -91,6 +94,8 @@ private:
bool m_s1u_up;
int m_s1u;
uint64_t m_next_ctrl_teid;
uint64_t m_next_user_teid;
/*Logs*/
srslte::log_filter *m_spgw_log;

@ -46,7 +46,9 @@ const uint16_t SPGW_BUFFER_SIZE = 2500;
spgw::spgw():
m_running(false),
m_sgi_up(false),
m_s1u_up(false)
m_s1u_up(false),
m_next_ctrl_teid(1),
m_next_user_teid(1)
{
m_pool = srslte::byte_buffer_pool::get_instance();
return;
@ -285,7 +287,23 @@ spgw::run_thread()
}
uint64_t
spgw::get_new_ctrl_teid()
{
return m_next_ctrl_teid++;
}
uint64_t
spgw::get_new_user_teid()
{
return m_next_user_teid++;
}
in_addr_t
spgw::get_new_ue_ipv4()
{
return inet_addr("172.0.0.2");//FIXME Tmp hack
}
void
spgw::handle_create_session_request(struct srslte::gtpc_create_session_request *cs_req, struct srslte::gtpc_create_session_response *cs_resp)
@ -307,7 +325,7 @@ spgw::handle_create_session_request(struct srslte::gtpc_create_session_request *
//Setup sender F-TEID (ctrl)\\
cs_resp->sender_f_teid.teid_present = true;
cs_resp->sender_f_teid.teid = spgw_uplink_ctrl_teid;
cs_resp->sender_f_teid.ipv4 = m_gtpu_bind_addr;//FIXME This is not relevant, as the GTP-C is not transmitted over sockets yet.
cs_resp->sender_f_teid.ipv4 = 0;//FIXME This is not relevant, as the GTP-C is not transmitted over sockets yet.
//Bearer context created\\
cs_resp->eps_bearer_context_created.ebi = 5;
cs_resp->eps_bearer_context_created.cause = ;

Loading…
Cancel
Save