Commit 44355e1a authored by gauthier's avatar gauthier

Receiving setupresponse success, TBC

parent 610e07a9
...@@ -283,6 +283,22 @@ const char * const et_chunk_type_cid2str(const sctp_cid_t chunk_type) ...@@ -283,6 +283,22 @@ const char * const et_chunk_type_cid2str(const sctp_cid_t chunk_type)
} }
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
const char * const et_error_match2str(const int err)
{
switch (err) {
case -ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE: return "SCTP_CHUNK_TYPE"; break;
case -ET_ERROR_MATCH_PACKET_SCTP_PPID: return "SCTP_PPID"; break;
case -ET_ERROR_MATCH_PACKET_SCTP_ASSOC_ID: return "SCTP_ASSOC_ID"; break;
case -ET_ERROR_MATCH_PACKET_SCTP_STREAM_ID: return "SCTP_STREAM_ID"; break;
case -ET_ERROR_MATCH_PACKET_SCTP_SSN: return "SCTP_SSN"; break;
case -ET_ERROR_MATCH_PACKET_S1AP_PRESENT: return "S1AP_PRESENT"; break;
case -ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE: return "S1AP_PROCEDURE_CODE"; break;
case -ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY: return "S1AP_CRITICALITY"; break;
default:
AssertFatal (0, "ERROR: Unknown match error %d!(TODO handle an1c error codes)\n", err);
}
}
//------------------------------------------------------------------------------
et_packet_action_t et_action_str2et_action_t(const xmlChar * const action) et_packet_action_t et_action_str2et_action_t(const xmlChar * const action)
{ {
if ((!xmlStrcmp(action, (const xmlChar *)"SEND"))) { return ET_PACKET_ACTION_S1C_SEND;} if ((!xmlStrcmp(action, (const xmlChar *)"SEND"))) { return ET_PACKET_ACTION_S1C_SEND;}
......
...@@ -178,6 +178,19 @@ typedef enum { ...@@ -178,6 +178,19 @@ typedef enum {
ET_FSM_STATE_END ET_FSM_STATE_END
} et_fsm_state_t; } et_fsm_state_t;
typedef enum {
ET_ERROR_MATCH_START = 1,
ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE = ET_ERROR_MATCH_START,
ET_ERROR_MATCH_PACKET_SCTP_PPID,
ET_ERROR_MATCH_PACKET_SCTP_ASSOC_ID,
ET_ERROR_MATCH_PACKET_SCTP_STREAM_ID,
ET_ERROR_MATCH_PACKET_SCTP_SSN,
ET_ERROR_MATCH_PACKET_S1AP_PRESENT,
ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE,
ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY,
ET_ERROR_MATCH_END
} et_error_match_code_t;
...@@ -332,9 +345,9 @@ typedef struct et_scenario_s { ...@@ -332,9 +345,9 @@ typedef struct et_scenario_s {
hash_table_t *hash_old_ue_mme_id2ue_mme_id; hash_table_t *hash_old_ue_mme_id2ue_mme_id;
struct timeval time_last_tx_packet; struct timeval time_last_tx_packet;
struct timeval time_last_rx_packet; struct timeval time_last_rx_packet;
et_packet_t *last_rx_packet; et_packet_t *last_rx_packet; // last packet received with all previous scenario RX packet received.
et_packet_t *last_tx_packet; et_packet_t *last_tx_packet; // last sent packet
et_packet_t *next_packet; et_packet_t *next_packet; // next packet to be handled in the scenario (RX or TX packet)
} et_scenario_t; } et_scenario_t;
...@@ -402,6 +415,7 @@ s1ap_eNB_instance_t *et_s1ap_eNB_get_instance(instance_t instance); ...@@ -402,6 +415,7 @@ s1ap_eNB_instance_t *et_s1ap_eNB_get_instance(instance_t instance);
void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,uint32_t buffer_length, uint16_t stream); void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,uint32_t buffer_length, uint16_t stream);
int et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints); int et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints);
et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const s1ap_data_ind); et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const s1ap_data_ind);
void et_scenario_set_packet_received(et_packet_t * const packet);
void et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const sctp_data_ind); void et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const sctp_data_ind);
void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t * const sctp_data_ind); void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t * const sctp_data_ind);
void et_s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, void et_s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
...@@ -450,6 +464,7 @@ int et_compare_et_ip_to_net_ip_address(const et_ip_t * const ip, const net_ip_ad ...@@ -450,6 +464,7 @@ int et_compare_et_ip_to_net_ip_address(const et_ip_t * const ip, const net_ip_ad
int et_hex2data(unsigned char * const data, const unsigned char * const hexstring, const unsigned int len); int et_hex2data(unsigned char * const data, const unsigned char * const hexstring, const unsigned int len);
sctp_cid_t et_chunk_type_str2cid(const xmlChar * const chunk_type_str); sctp_cid_t et_chunk_type_str2cid(const xmlChar * const chunk_type_str);
const char * const et_chunk_type_cid2str(const sctp_cid_t chunk_type); const char * const et_chunk_type_cid2str(const sctp_cid_t chunk_type);
const char * const et_error_match2str(const int err);
et_packet_action_t et_action_str2et_action_t(const xmlChar * const action); et_packet_action_t et_action_str2et_action_t(const xmlChar * const action);
void et_ip_str2et_ip(const xmlChar * const ip_str, et_ip_t * const ip); void et_ip_str2et_ip(const xmlChar * const ip_str, et_ip_t * const ip);
void et_enb_config_init(const char const * lib_config_file_name_pP); void et_enb_config_init(const char const * lib_config_file_name_pP);
......
...@@ -273,6 +273,28 @@ void et_display_packet(const et_packet_t * const packet) ...@@ -273,6 +273,28 @@ void et_display_packet(const et_packet_t * const packet)
default: default:
fprintf(stdout, "\tPacket:\tAction UNKNOWN\n"); fprintf(stdout, "\tPacket:\tAction UNKNOWN\n");
} }
switch(packet->status) {
case ET_PACKET_STATUS_NONE:
fprintf(stdout, "\tPacket:\tStatus NONE\n");
break;
case ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT:
fprintf(stdout, "\tPacket:\tStatus NOT_TAKEN_IN_ACCOUNT\n");
break;
case ET_PACKET_STATUS_SCHEDULED_FOR_SENDING:
fprintf(stdout, "\tPacket:\tStatus SCHEDULED_FOR_SENDING\n");
break;
case ET_PACKET_STATUS_SENT:
fprintf(stdout, "\tPacket:\tStatus SENT\n");
break;
case ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING:
fprintf(stdout, "\tPacket:\tStatus SCHEDULED_FOR_RECEIVING\n");
break;
case ET_PACKET_STATUS_RECEIVED:
fprintf(stdout, "\tPacket:\tStatus RECEIVED\n");
break;
default:
fprintf(stdout, "\tPacket:\tStatus UNKNOWN\n");
}
et_display_packet_ip(&packet->ip_hdr); et_display_packet_ip(&packet->ip_hdr);
et_display_packet_sctp(&packet->sctp_hdr); et_display_packet_sctp(&packet->sctp_hdr);
} }
......
...@@ -292,7 +292,10 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event) ...@@ -292,7 +292,10 @@ et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event)
case ET_EVENT_INIT: case ET_EVENT_INIT:
AssertFatal(NULL == g_scenario, "Current scenario not ended"); AssertFatal(NULL == g_scenario, "Current scenario not ended");
g_scenario = event.u.init.scenario; g_scenario = event.u.init.scenario;
g_scenario->next_packet = g_scenario->list_packet; g_scenario->next_packet = g_scenario->list_packet;
g_scenario->last_rx_packet = NULL;
g_scenario->last_tx_packet = NULL;
while (NULL != g_scenario->next_packet) { while (NULL != g_scenario->next_packet) {
switch (g_scenario->next_packet->sctp_hdr.chunk_type) { switch (g_scenario->next_packet->sctp_hdr.chunk_type) {
......
...@@ -191,21 +191,21 @@ void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, ...@@ -191,21 +191,21 @@ void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id,
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints) int et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints)
{ {
if (s1ap1->pdu.present != s1ap2->pdu.present) return -6; if (s1ap1->pdu.present != s1ap2->pdu.present) return -ET_ERROR_MATCH_PACKET_S1AP_PRESENT;
switch (s1ap1->pdu.present) { switch (s1ap1->pdu.present) {
case S1AP_PDU_PR_NOTHING: case S1AP_PDU_PR_NOTHING:
break; break;
case S1AP_PDU_PR_initiatingMessage: case S1AP_PDU_PR_initiatingMessage:
if (s1ap1->pdu.choice.initiatingMessage.procedureCode != s1ap2->pdu.choice.initiatingMessage.procedureCode) return -7; if (s1ap1->pdu.choice.initiatingMessage.procedureCode != s1ap2->pdu.choice.initiatingMessage.procedureCode) return -ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE;
if (s1ap1->pdu.choice.initiatingMessage.criticality != s1ap2->pdu.choice.initiatingMessage.criticality) return -8; if (s1ap1->pdu.choice.initiatingMessage.criticality != s1ap2->pdu.choice.initiatingMessage.criticality) return -ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY;
break; break;
case S1AP_PDU_PR_successfulOutcome: case S1AP_PDU_PR_successfulOutcome:
if (s1ap1->pdu.choice.successfulOutcome.procedureCode != s1ap2->pdu.choice.successfulOutcome.procedureCode) return -7; if (s1ap1->pdu.choice.successfulOutcome.procedureCode != s1ap2->pdu.choice.successfulOutcome.procedureCode) return -ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE;
if (s1ap1->pdu.choice.successfulOutcome.criticality != s1ap2->pdu.choice.successfulOutcome.criticality) return -8; if (s1ap1->pdu.choice.successfulOutcome.criticality != s1ap2->pdu.choice.successfulOutcome.criticality) return -ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY;
break; break;
case S1AP_PDU_PR_unsuccessfulOutcome: case S1AP_PDU_PR_unsuccessfulOutcome:
if (s1ap1->pdu.choice.unsuccessfulOutcome.procedureCode != s1ap2->pdu.choice.unsuccessfulOutcome.procedureCode) return -7; if (s1ap1->pdu.choice.unsuccessfulOutcome.procedureCode != s1ap2->pdu.choice.unsuccessfulOutcome.procedureCode) return -ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE;
if (s1ap1->pdu.choice.unsuccessfulOutcome.criticality != s1ap2->pdu.choice.unsuccessfulOutcome.criticality) return -8; if (s1ap1->pdu.choice.unsuccessfulOutcome.criticality != s1ap2->pdu.choice.unsuccessfulOutcome.criticality) return -ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY;
break; break;
default: default:
AssertFatal(0, "Unknown pdu.present %d", s1ap1->pdu.present); AssertFatal(0, "Unknown pdu.present %d", s1ap1->pdu.present);
...@@ -236,7 +236,8 @@ et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const ...@@ -236,7 +236,8 @@ et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const
packet->enb_instance = 0; //TODO packet->enb_instance = 0; //TODO
//packet->ip_hdr; //packet->ip_hdr;
// keep in mind: allocated buffer: sctp_datahdr.payload.binary_stream // keep in mind: allocated buffer: sctp_datahdr.payload.binary_stream
memcpy((void*)&packet->sctp_hdr, (void*)&s1ap_data_ind->sctp_datahdr, sizeof(packet->sctp_hdr)); packet->sctp_hdr.chunk_type = SCTP_CID_DATA;
memcpy((void*)&packet->sctp_hdr.u.data_hdr, (void*)&s1ap_data_ind->sctp_datahdr, sizeof(packet->sctp_hdr));
//packet->next = NULL; //packet->next = NULL;
packet->status = ET_PACKET_STATUS_RECEIVED; packet->status = ET_PACKET_STATUS_RECEIVED;
//packet->timer_id = 0; //packet->timer_id = 0;
...@@ -245,23 +246,54 @@ et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const ...@@ -245,23 +246,54 @@ et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const
} }
//------------------------------------------------------------------------------
void et_scenario_set_packet_received(et_packet_t * const packet)
{
int rc = 0;
packet->status = ET_PACKET_STATUS_RECEIVED;
S1AP_DEBUG("Packet num %d received\n", packet->packet_number);
if (packet->timer_id != 0) {
rc = timer_remove(packet->timer_id);
AssertFatal(rc == 0, "Timer on Rx packet num %d unknown", packet->packet_number);
}
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) void et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind)
{ {
et_packet_t * packet = NULL; et_packet_t * packet = NULL;
et_packet_t * rx_packet = NULL; et_packet_t * rx_packet = NULL;
unsigned long int not_found = 1; unsigned long int not_found = 1;
long rv = 0;
AssertFatal (NULL != s1ap_data_ind, "Bad parameter sctp_data_ind\n"); AssertFatal (NULL != s1ap_data_ind, "Bad parameter sctp_data_ind\n");
rx_packet = et_build_packet_from_s1ap_data_ind(s1ap_data_ind); rx_packet = et_build_packet_from_s1ap_data_ind(s1ap_data_ind);
packet = g_scenario->next_packet; if (NULL == g_scenario->last_rx_packet) {
packet = g_scenario->list_packet;
while (NULL != packet) {
if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) {
if (packet->status == ET_PACKET_STATUS_RECEIVED) {
g_scenario->last_rx_packet = packet;
} else {
break;
}
}
packet = packet->next;
}
packet = g_scenario->list_packet;
} else {
packet = g_scenario->last_rx_packet;
}
// not_found threshold may sure depend on number of mme, may be not sure on number of UE // not_found threshold may sure depend on number of mme, may be not sure on number of UE
while ((NULL != packet) && (not_found < 5)) { while ((NULL != packet) && (not_found < 5)) {
if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) {
//TODO rv = et_sctp_is_matching(&packet->sctp_hdr, &rx_packet->sctp_hdr, g_constraints);
if (et_sctp_is_matching(&packet->sctp_hdr, &rx_packet->sctp_hdr, g_constraints) == 0) { if (0 == rv) {
S1AP_DEBUG("Compare RX packet with packet num %d succeeded\n", packet->packet_number);
et_scenario_set_packet_received(packet); et_scenario_set_packet_received(packet);
} else {
S1AP_DEBUG("Compare RX packet with packet num %d failed %s\n", packet->packet_number, et_error_match2str(rv));
} }
} }
not_found += 1; not_found += 1;
...@@ -388,9 +420,9 @@ void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id, ...@@ -388,9 +420,9 @@ void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id,
case SCTP_CID_DATA : case SCTP_CID_DATA :
S1AP_DEBUG("%s for SCTP association (%u) SCTP_CID_DATA\n",__FUNCTION__,assoc_id); S1AP_DEBUG("%s for SCTP association (%u) SCTP_CID_DATA\n",__FUNCTION__,assoc_id);
if (ET_PACKET_STATUS_NONE == packet->status) { if ((ET_PACKET_STATUS_NONE == packet->status) || (ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING == packet->status)) {
if (0 < old_mme_port) { if (0 < old_mme_port) {
if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) { if (packet->action == ET_PACKET_ACTION_S1C_SEND) {
ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &mme_desc_p->mme_net_ip_address); ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &mme_desc_p->mme_net_ip_address);
if (0 == ret) { if (0 == ret) {
ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &s1ap_eNB_instance->s1c_net_ip_address); ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &s1ap_eNB_instance->s1c_net_ip_address);
...@@ -403,7 +435,7 @@ void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id, ...@@ -403,7 +435,7 @@ void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id,
} }
} }
} }
} else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { } else if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) {
ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &mme_desc_p->mme_net_ip_address); ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &mme_desc_p->mme_net_ip_address);
if (0 == ret) { if (0 == ret) {
ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &s1ap_eNB_instance->s1c_net_ip_address); ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &s1ap_eNB_instance->s1c_net_ip_address);
...@@ -474,6 +506,7 @@ void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id, ...@@ -474,6 +506,7 @@ void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id,
break; break;
default: default:
AssertFatal(0, "Unknown chunk_type %d packet num %d", packet->sctp_hdr.chunk_type, packet->packet_number);
; ;
} }
packet = packet->next; packet = packet->next;
......
...@@ -63,86 +63,156 @@ int et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, ...@@ -63,86 +63,156 @@ int et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1,
long ret = 0; long ret = 0;
AssertFatal(m1 != NULL, "bad parameter m1"); AssertFatal(m1 != NULL, "bad parameter m1");
AssertFatal(m2 != NULL, "bad parameter m2"); AssertFatal(m2 != NULL, "bad parameter m2");
if (m1->procedureCode != m2->procedureCode) return -1; AssertFatal((present == S1AP_PDU_PR_initiatingMessage) ||
(present == S1AP_PDU_PR_successfulOutcome) ||
(present == S1AP_PDU_PR_unsuccessfulOutcome) , "bad parameter S1AP_PDU_PR present ");
if (m1->procedureCode != m2->procedureCode) return -ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE;
// some cases can never occur since uplink only. // some cases can never occur since uplink only.
switch (m1->procedureCode) { switch (m1->procedureCode) {
case S1ap_ProcedureCode_id_HandoverPreparation: case S1ap_ProcedureCode_id_HandoverPreparation:
AssertFatal(0, "S1ap_ProcedureCode_id_InitialContextSetup not implemented"); if (present == S1AP_PDU_PR_initiatingMessage) {
ret = s1ap_compare_s1ap_handoverrequiredies(
&m1->msg.s1ap_HandoverRequiredIEs,
&m2->msg.s1ap_HandoverRequiredIEs);
} else {
ret = s1ap_compare_s1ap_handovercommandies(
&m1->msg.s1ap_HandoverCommandIEs,
&m2->msg.s1ap_HandoverCommandIEs);
}
break; break;
case S1ap_ProcedureCode_id_HandoverResourceAllocation: case S1ap_ProcedureCode_id_HandoverResourceAllocation:
AssertFatal(0, "S1ap_ProcedureCode_id_InitialContextSetup not implemented"); if (present == S1AP_PDU_PR_initiatingMessage) {
ret = s1ap_compare_s1ap_handoverrequesties(
&m1->msg.s1ap_HandoverRequestIEs,
&m2->msg.s1ap_HandoverRequestIEs);
} else if (present == S1AP_PDU_PR_successfulOutcome) {
ret = s1ap_compare_s1ap_handoverrequestacknowledgeies(
&m1->msg.s1ap_HandoverRequestAcknowledgeIEs,
&m2->msg.s1ap_HandoverRequestAcknowledgeIEs);
} else if (present == S1AP_PDU_PR_unsuccessfulOutcome) {
ret = s1ap_compare_s1ap_handoverfailureies(
&m1->msg.s1ap_HandoverFailureIEs,
&m2->msg.s1ap_HandoverFailureIEs);
}
break; break;
case S1ap_ProcedureCode_id_HandoverNotification: case S1ap_ProcedureCode_id_HandoverNotification:
AssertFatal(0, "S1ap_ProcedureCode_id_HandoverNotification not implemented"); ret = s1ap_compare_s1ap_handovernotifyies(
&m1->msg.s1ap_HandoverNotifyIEs,
&m2->msg.s1ap_HandoverNotifyIEs);
break; break;
case S1ap_ProcedureCode_id_PathSwitchRequest: case S1ap_ProcedureCode_id_PathSwitchRequest:
ret = s1ap_compare_s1ap_pathswitchrequesties( ret = s1ap_compare_s1ap_pathswitchrequesties(
&m1->msg.s1ap_PathSwitchRequestIEs, &m1->msg.s1ap_PathSwitchRequestIEs,
&m2->msg.s1ap_PathSwitchRequestIEs); &m2->msg.s1ap_PathSwitchRequestIEs);
break; break;
case S1ap_ProcedureCode_id_HandoverCancel: case S1ap_ProcedureCode_id_HandoverCancel:
ret = s1ap_compare_s1ap_handovercancelies( ret = s1ap_compare_s1ap_handovercancelies(
&m1->msg.s1ap_HandoverCancelIEs, &m1->msg.s1ap_HandoverCancelIEs,
&m2->msg.s1ap_HandoverCancelIEs); &m2->msg.s1ap_HandoverCancelIEs);
break; break;
case S1ap_ProcedureCode_id_E_RABSetup: case S1ap_ProcedureCode_id_E_RABSetup:
if (present == S1AP_PDU_PR_initiatingMessage) {
ret = s1ap_compare_s1ap_e_rabsetuprequesties(
&m1->msg.s1ap_E_RABSetupRequestIEs,
&m2->msg.s1ap_E_RABSetupRequestIEs);
} else {
ret = s1ap_compare_s1ap_e_rabsetupresponseies(
&m1->msg.s1ap_E_RABSetupResponseIEs,
&m2->msg.s1ap_E_RABSetupResponseIEs);
}
break;
case S1ap_ProcedureCode_id_E_RABModify: case S1ap_ProcedureCode_id_E_RABModify:
if (present == S1AP_PDU_PR_initiatingMessage) {
ret = s1ap_compare_s1ap_e_rabmodifyrequesties(
&m1->msg.s1ap_E_RABModifyRequestIEs,
&m2->msg.s1ap_E_RABModifyRequestIEs);
} else {
ret = s1ap_compare_s1ap_e_rabmodifyresponseies(
&m1->msg.s1ap_E_RABModifyResponseIEs,
&m2->msg.s1ap_E_RABModifyResponseIEs);
}
break;
case S1ap_ProcedureCode_id_E_RABRelease: case S1ap_ProcedureCode_id_E_RABRelease:
if (present == S1AP_PDU_PR_initiatingMessage) { if (present == S1AP_PDU_PR_initiatingMessage) {
ret = s1ap_compare_s1ap_e_rabreleasecommandies( ret = s1ap_compare_s1ap_e_rabreleasecommandies(
&m1->msg.s1ap_E_RABReleaseCommandIEs, &m1->msg.s1ap_E_RABReleaseCommandIEs,
&m2->msg.s1ap_E_RABReleaseCommandIEs); &m2->msg.s1ap_E_RABReleaseCommandIEs);
} else if (present == S1AP_PDU_PR_successfulOutcome) { } else {
ret = s1ap_compare_s1ap_e_rabreleaseresponseies( ret = s1ap_compare_s1ap_e_rabreleaseresponseies(
&m1->msg.s1ap_E_RABReleaseResponseIEs, &m1->msg.s1ap_E_RABReleaseResponseIEs,
&m2->msg.s1ap_E_RABReleaseResponseIEs); &m2->msg.s1ap_E_RABReleaseResponseIEs);
} }
break; break;
case S1ap_ProcedureCode_id_E_RABReleaseIndication: case S1ap_ProcedureCode_id_E_RABReleaseIndication:
ret = s1ap_compare_s1ap_e_rabreleaseindicationies( ret = s1ap_compare_s1ap_e_rabreleaseindicationies(
&m1->msg.s1ap_E_RABReleaseIndicationIEs, &m1->msg.s1ap_E_RABReleaseIndicationIEs,
&m2->msg.s1ap_E_RABReleaseIndicationIEs); &m2->msg.s1ap_E_RABReleaseIndicationIEs);
break; break;
case S1ap_ProcedureCode_id_InitialContextSetup: case S1ap_ProcedureCode_id_InitialContextSetup:
AssertFatal(0, "S1ap_ProcedureCode_id_InitialContextSetup not implemented"); if (present == S1AP_PDU_PR_initiatingMessage) {
ret = s1ap_compare_s1ap_initialcontextsetuprequesties(
&m1->msg.s1ap_InitialContextSetupRequestIEs,
&m2->msg.s1ap_InitialContextSetupRequestIEs);
} else {
ret = s1ap_compare_s1ap_initialcontextsetupresponseies(
&m1->msg.s1ap_InitialContextSetupResponseIEs,
&m2->msg.s1ap_InitialContextSetupResponseIEs);
}
break; break;
case S1ap_ProcedureCode_id_Paging: case S1ap_ProcedureCode_id_Paging:
ret = s1ap_compare_s1ap_pagingies( ret = s1ap_compare_s1ap_pagingies(
&m1->msg.s1ap_PagingIEs, &m1->msg.s1ap_PagingIEs,
&m2->msg.s1ap_PagingIEs); &m2->msg.s1ap_PagingIEs);
break; break;
case S1ap_ProcedureCode_id_downlinkNASTransport: case S1ap_ProcedureCode_id_downlinkNASTransport:
ret = s1ap_compare_s1ap_downlinknastransporties( ret = s1ap_compare_s1ap_downlinknastransporties(
&m1->msg.s1ap_DownlinkNASTransportIEs, &m1->msg.s1ap_DownlinkNASTransportIEs,
&m2->msg.s1ap_DownlinkNASTransportIEs); &m2->msg.s1ap_DownlinkNASTransportIEs);
break; break;
case S1ap_ProcedureCode_id_initialUEMessage: case S1ap_ProcedureCode_id_initialUEMessage:
ret = s1ap_compare_s1ap_initialuemessageies( ret = s1ap_compare_s1ap_initialuemessageies(
&m1->msg.s1ap_InitialUEMessageIEs, &m1->msg.s1ap_InitialUEMessageIEs,
&m2->msg.s1ap_InitialUEMessageIEs); &m2->msg.s1ap_InitialUEMessageIEs);
break; break;
case S1ap_ProcedureCode_id_uplinkNASTransport: case S1ap_ProcedureCode_id_uplinkNASTransport:
ret = s1ap_compare_s1ap_uplinknastransporties( ret = s1ap_compare_s1ap_uplinknastransporties(
&m1->msg.s1ap_UplinkNASTransportIEs, &m1->msg.s1ap_UplinkNASTransportIEs,
&m2->msg.s1ap_UplinkNASTransportIEs); &m2->msg.s1ap_UplinkNASTransportIEs);
break; break;
case S1ap_ProcedureCode_id_Reset: case S1ap_ProcedureCode_id_Reset:
ret = s1ap_compare_s1ap_reseties( ret = s1ap_compare_s1ap_reseties(
&m1->msg.s1ap_ResetIEs, &m1->msg.s1ap_ResetIEs,
&m2->msg.s1ap_ResetIEs); &m2->msg.s1ap_ResetIEs);
break; break;
case S1ap_ProcedureCode_id_ErrorIndication: case S1ap_ProcedureCode_id_ErrorIndication:
ret = s1ap_compare_s1ap_errorindicationies( ret = s1ap_compare_s1ap_errorindicationies(
&m1->msg.s1ap_ErrorIndicationIEs, &m1->msg.s1ap_ErrorIndicationIEs,
&m2->msg.s1ap_ErrorIndicationIEs); &m2->msg.s1ap_ErrorIndicationIEs);
break; break;
case S1ap_ProcedureCode_id_NASNonDeliveryIndication: case S1ap_ProcedureCode_id_NASNonDeliveryIndication:
ret = s1ap_compare_s1ap_nasnondeliveryindication_ies( ret = s1ap_compare_s1ap_nasnondeliveryindication_ies(
&m1->msg.s1ap_NASNonDeliveryIndication_IEs, &m1->msg.s1ap_NASNonDeliveryIndication_IEs,
&m2->msg.s1ap_NASNonDeliveryIndication_IEs); &m2->msg.s1ap_NASNonDeliveryIndication_IEs);
break; break;
case S1ap_ProcedureCode_id_S1Setup: case S1ap_ProcedureCode_id_S1Setup:
if (present == S1AP_PDU_PR_initiatingMessage) { if (present == S1AP_PDU_PR_initiatingMessage) {
ret = s1ap_compare_s1ap_s1setuprequesties( ret = s1ap_compare_s1ap_s1setuprequesties(
...@@ -158,21 +228,25 @@ int et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, ...@@ -158,21 +228,25 @@ int et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1,
&m2->msg.s1ap_S1SetupFailureIEs); &m2->msg.s1ap_S1SetupFailureIEs);
} }
break; break;
case S1ap_ProcedureCode_id_UEContextReleaseRequest: case S1ap_ProcedureCode_id_UEContextReleaseRequest:
ret = s1ap_compare_s1ap_uecontextreleaserequesties( ret = s1ap_compare_s1ap_uecontextreleaserequesties(
&m1->msg.s1ap_UEContextReleaseRequestIEs, &m1->msg.s1ap_UEContextReleaseRequestIEs,
&m2->msg.s1ap_UEContextReleaseRequestIEs); &m2->msg.s1ap_UEContextReleaseRequestIEs);
break; break;
case S1ap_ProcedureCode_id_DownlinkS1cdma2000tunneling: case S1ap_ProcedureCode_id_DownlinkS1cdma2000tunneling:
ret = s1ap_compare_s1ap_downlinks1cdma2000tunnelingies( ret = s1ap_compare_s1ap_downlinks1cdma2000tunnelingies(
&m1->msg.s1ap_DownlinkS1cdma2000tunnelingIEs, &m1->msg.s1ap_DownlinkS1cdma2000tunnelingIEs,
&m2->msg.s1ap_DownlinkS1cdma2000tunnelingIEs); &m2->msg.s1ap_DownlinkS1cdma2000tunnelingIEs);
break; break;
case S1ap_ProcedureCode_id_UplinkS1cdma2000tunneling: case S1ap_ProcedureCode_id_UplinkS1cdma2000tunneling:
ret = s1ap_compare_s1ap_uplinks1cdma2000tunnelingies( ret = s1ap_compare_s1ap_uplinks1cdma2000tunnelingies(
&m1->msg.s1ap_UplinkS1cdma2000tunnelingIEs, &m1->msg.s1ap_UplinkS1cdma2000tunnelingIEs,
&m2->msg.s1ap_UplinkS1cdma2000tunnelingIEs); &m2->msg.s1ap_UplinkS1cdma2000tunnelingIEs);
break; break;
case S1ap_ProcedureCode_id_UEContextModification: case S1ap_ProcedureCode_id_UEContextModification:
if (present == S1AP_PDU_PR_initiatingMessage) { if (present == S1AP_PDU_PR_initiatingMessage) {
ret = s1ap_compare_s1ap_uecontextmodificationrequesties( ret = s1ap_compare_s1ap_uecontextmodificationrequesties(
...@@ -188,53 +262,152 @@ int et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, ...@@ -188,53 +262,152 @@ int et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1,
&m2->msg.s1ap_UEContextModificationFailureIEs); &m2->msg.s1ap_UEContextModificationFailureIEs);
} }
break; break;
case S1ap_ProcedureCode_id_UECapabilityInfoIndication: case S1ap_ProcedureCode_id_UECapabilityInfoIndication:
ret = s1ap_compare_s1ap_uecapabilityinfoindicationies( ret = s1ap_compare_s1ap_uecapabilityinfoindicationies(
&m1->msg.s1ap_UECapabilityInfoIndicationIEs, &m1->msg.s1ap_UECapabilityInfoIndicationIEs,
&m2->msg.s1ap_UECapabilityInfoIndicationIEs); &m2->msg.s1ap_UECapabilityInfoIndicationIEs);
break; break;
case S1ap_ProcedureCode_id_UEContextRelease:
case S1ap_ProcedureCode_id_UEContextRelease:
if (present == S1AP_PDU_PR_initiatingMessage) {
ret = s1ap_compare_s1ap_uecontextreleasecommandies(
&m1->msg.s1ap_UEContextReleaseCommandIEs,
&m2->msg.s1ap_UEContextReleaseCommandIEs);
} else {
ret = s1ap_compare_s1ap_uecontextreleasecompleteies(
&m1->msg.s1ap_UEContextReleaseCompleteIEs,
&m2->msg.s1ap_UEContextReleaseCompleteIEs);
}
break; break;
case S1ap_ProcedureCode_id_eNBStatusTransfer: case S1ap_ProcedureCode_id_eNBStatusTransfer:
ret = s1ap_compare_s1ap_enbstatustransferies( ret = s1ap_compare_s1ap_enbstatustransferies(
&m1->msg.s1ap_ENBStatusTransferIEs, &m1->msg.s1ap_ENBStatusTransferIEs,
&m2->msg.s1ap_ENBStatusTransferIEs); &m2->msg.s1ap_ENBStatusTransferIEs);
break; break;
case S1ap_ProcedureCode_id_MMEStatusTransfer: case S1ap_ProcedureCode_id_MMEStatusTransfer:
ret = s1ap_compare_s1ap_mmestatustransferies( ret = s1ap_compare_s1ap_mmestatustransferies(
&m1->msg.s1ap_MMEStatusTransferIEs, &m1->msg.s1ap_MMEStatusTransferIEs,
&m2->msg.s1ap_MMEStatusTransferIEs); &m2->msg.s1ap_MMEStatusTransferIEs);
break; break;
case S1ap_ProcedureCode_id_DeactivateTrace: case S1ap_ProcedureCode_id_DeactivateTrace:
ret = s1ap_compare_s1ap_deactivatetraceies( ret = s1ap_compare_s1ap_deactivatetraceies(
&m1->msg.s1ap_DeactivateTraceIEs, &m1->msg.s1ap_DeactivateTraceIEs,
&m2->msg.s1ap_DeactivateTraceIEs); &m2->msg.s1ap_DeactivateTraceIEs);
break; break;
case S1ap_ProcedureCode_id_TraceStart: case S1ap_ProcedureCode_id_TraceStart:
ret = s1ap_compare_s1ap_tracestarties( ret = s1ap_compare_s1ap_tracestarties(
&m1->msg.s1ap_TraceStartIEs, &m1->msg.s1ap_TraceStartIEs,
&m2->msg.s1ap_TraceStartIEs); &m2->msg.s1ap_TraceStartIEs);
break; break;
case S1ap_ProcedureCode_id_TraceFailureIndication: case S1ap_ProcedureCode_id_TraceFailureIndication:
ret = s1ap_compare_s1ap_tracefailureindicationies( ret = s1ap_compare_s1ap_tracefailureindicationies(
&m1->msg.s1ap_TraceFailureIndicationIEs, &m1->msg.s1ap_TraceFailureIndicationIEs,
&m2->msg.s1ap_TraceFailureIndicationIEs); &m2->msg.s1ap_TraceFailureIndicationIEs);
break; break;
case S1ap_ProcedureCode_id_ENBConfigurationUpdate: case S1ap_ProcedureCode_id_ENBConfigurationUpdate:
if (present == S1AP_PDU_PR_initiatingMessage) {
ret = s1ap_compare_s1ap_enbconfigurationupdateies(
&m1->msg.s1ap_ENBConfigurationUpdateIEs,
&m2->msg.s1ap_ENBConfigurationUpdateIEs);
} else if (present == S1AP_PDU_PR_successfulOutcome) {
ret = s1ap_compare_s1ap_enbconfigurationupdateacknowledgeies(
&m1->msg.s1ap_ENBConfigurationUpdateAcknowledgeIEs,
&m2->msg.s1ap_ENBConfigurationUpdateAcknowledgeIEs);
} else {
ret = s1ap_compare_s1ap_enbconfigurationupdatefailureies(
&m1->msg.s1ap_ENBConfigurationUpdateFailureIEs,
&m2->msg.s1ap_ENBConfigurationUpdateFailureIEs);
}
break;
case S1ap_ProcedureCode_id_MMEConfigurationUpdate: case S1ap_ProcedureCode_id_MMEConfigurationUpdate:
if (present == S1AP_PDU_PR_initiatingMessage) {
ret = s1ap_compare_s1ap_mmeconfigurationupdateies(
&m1->msg.s1ap_MMEConfigurationUpdateIEs,
&m2->msg.s1ap_MMEConfigurationUpdateIEs);
} else if (present == S1AP_PDU_PR_successfulOutcome) {
ret = s1ap_compare_s1ap_mmeconfigurationupdateacknowledgeies(
&m1->msg.s1ap_MMEConfigurationUpdateAcknowledgeIEs,
&m2->msg.s1ap_MMEConfigurationUpdateAcknowledgeIEs);
} else {
ret = s1ap_compare_s1ap_mmeconfigurationupdatefailureies(
&m1->msg.s1ap_MMEConfigurationUpdateFailureIEs,
&m2->msg.s1ap_MMEConfigurationUpdateFailureIEs);
}
break;
case S1ap_ProcedureCode_id_LocationReportingControl: case S1ap_ProcedureCode_id_LocationReportingControl:
ret = s1ap_compare_s1ap_locationreportingcontrolies(
&m1->msg.s1ap_LocationReportingControlIEs,
&m2->msg.s1ap_LocationReportingControlIEs);
break;
case S1ap_ProcedureCode_id_LocationReportingFailureIndication: case S1ap_ProcedureCode_id_LocationReportingFailureIndication:
ret = s1ap_compare_s1ap_locationreportingfailureindicationies(
&m1->msg.s1ap_LocationReportingFailureIndicationIEs,
&m2->msg.s1ap_LocationReportingFailureIndicationIEs);
break;
case S1ap_ProcedureCode_id_LocationReport: case S1ap_ProcedureCode_id_LocationReport:
ret = s1ap_compare_s1ap_locationreporties(
&m1->msg.s1ap_LocationReportIEs,
&m2->msg.s1ap_LocationReportIEs);
break;
case S1ap_ProcedureCode_id_OverloadStart: case S1ap_ProcedureCode_id_OverloadStart:
ret = s1ap_compare_s1ap_overloadstarties(
&m1->msg.s1ap_OverloadStartIEs,
&m2->msg.s1ap_OverloadStartIEs);
break;
case S1ap_ProcedureCode_id_OverloadStop: case S1ap_ProcedureCode_id_OverloadStop:
ret = s1ap_compare_s1ap_overloadstopies(
&m1->msg.s1ap_OverloadStopIEs,
&m2->msg.s1ap_OverloadStopIEs);
break;
case S1ap_ProcedureCode_id_WriteReplaceWarning: case S1ap_ProcedureCode_id_WriteReplaceWarning:
if (present == S1AP_PDU_PR_initiatingMessage) {
ret = s1ap_compare_s1ap_writereplacewarningrequesties(
&m1->msg.s1ap_WriteReplaceWarningRequestIEs,
&m2->msg.s1ap_WriteReplaceWarningRequestIEs);
} else {
ret = s1ap_compare_s1ap_writereplacewarningresponseies(
&m1->msg.s1ap_WriteReplaceWarningResponseIEs,
&m2->msg.s1ap_WriteReplaceWarningResponseIEs);
}
break;
case S1ap_ProcedureCode_id_eNBDirectInformationTransfer: case S1ap_ProcedureCode_id_eNBDirectInformationTransfer:
ret = s1ap_compare_s1ap_enbdirectinformationtransferies(
&m1->msg.s1ap_ENBDirectInformationTransferIEs,
&m2->msg.s1ap_ENBDirectInformationTransferIEs);
break;
case S1ap_ProcedureCode_id_MMEDirectInformationTransfer: case S1ap_ProcedureCode_id_MMEDirectInformationTransfer:
ret = s1ap_compare_s1ap_mmedirectinformationtransferies(
&m1->msg.s1ap_MMEDirectInformationTransferIEs,
&m2->msg.s1ap_MMEDirectInformationTransferIEs);
break;
case S1ap_ProcedureCode_id_PrivateMessage: case S1ap_ProcedureCode_id_PrivateMessage:
case S1ap_ProcedureCode_id_eNBConfigurationTransfer: case S1ap_ProcedureCode_id_eNBConfigurationTransfer:
case S1ap_ProcedureCode_id_MMEConfigurationTransfer: case S1ap_ProcedureCode_id_MMEConfigurationTransfer:
case S1ap_ProcedureCode_id_CellTrafficTrace: case S1ap_ProcedureCode_id_CellTrafficTrace:
ret = s1ap_compare_s1ap_celltraffictraceies(
&m1->msg.s1ap_CellTrafficTraceIEs,
&m2->msg.s1ap_CellTrafficTraceIEs);
break;
case S1ap_ProcedureCode_id_Kill: case S1ap_ProcedureCode_id_Kill:
if (present == S1AP_PDU_PR_initiatingMessage) { if (present == S1AP_PDU_PR_initiatingMessage) {
ret = s1ap_compare_s1ap_killrequesties( ret = s1ap_compare_s1ap_killrequesties(
...@@ -246,28 +419,33 @@ int et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, ...@@ -246,28 +419,33 @@ int et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1,
&m2->msg.s1ap_KillResponseIEs); &m2->msg.s1ap_KillResponseIEs);
} }
break; break;
case S1ap_ProcedureCode_id_downlinkUEAssociatedLPPaTransport: case S1ap_ProcedureCode_id_downlinkUEAssociatedLPPaTransport:
ret = s1ap_compare_s1ap_downlinkueassociatedlppatransport_ies( ret = s1ap_compare_s1ap_downlinkueassociatedlppatransport_ies(
&m1->msg.s1ap_DownlinkUEAssociatedLPPaTransport_IEs, &m1->msg.s1ap_DownlinkUEAssociatedLPPaTransport_IEs,
&m2->msg.s1ap_DownlinkUEAssociatedLPPaTransport_IEs); &m2->msg.s1ap_DownlinkUEAssociatedLPPaTransport_IEs);
break; break;
case S1ap_ProcedureCode_id_uplinkUEAssociatedLPPaTransport: case S1ap_ProcedureCode_id_uplinkUEAssociatedLPPaTransport:
ret = s1ap_compare_s1ap_uplinkueassociatedlppatransport_ies( ret = s1ap_compare_s1ap_uplinkueassociatedlppatransport_ies(
&m1->msg.s1ap_UplinkUEAssociatedLPPaTransport_IEs, &m1->msg.s1ap_UplinkUEAssociatedLPPaTransport_IEs,
&m2->msg.s1ap_UplinkUEAssociatedLPPaTransport_IEs); &m2->msg.s1ap_UplinkUEAssociatedLPPaTransport_IEs);
break; break;
case S1ap_ProcedureCode_id_downlinkNonUEAssociatedLPPaTransport: case S1ap_ProcedureCode_id_downlinkNonUEAssociatedLPPaTransport:
ret = s1ap_compare_s1ap_downlinknonueassociatedlppatransport_ies( ret = s1ap_compare_s1ap_downlinknonueassociatedlppatransport_ies(
&m1->msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs, &m1->msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs,
&m2->msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs); &m2->msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs);
break; break;
case S1ap_ProcedureCode_id_uplinkNonUEAssociatedLPPaTransport: case S1ap_ProcedureCode_id_uplinkNonUEAssociatedLPPaTransport:
ret = s1ap_compare_s1ap_uplinknonueassociatedlppatransport_ies( ret = s1ap_compare_s1ap_uplinknonueassociatedlppatransport_ies(
&m1->msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs, &m1->msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs,
&m2->msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs); &m2->msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs);
break; break;
default: default:
AssertFatal(0, "Unknown procedure code %ld", m1->procedureCode); AssertFatal(0, "Unknown procedure code %ld", m1->procedureCode);
} }
return 0; return ret;
} }
...@@ -47,20 +47,26 @@ ...@@ -47,20 +47,26 @@
int et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * const sctp2, const uint32_t constraints) int et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * const sctp2, const uint32_t constraints)
{ {
// no comparison for ports // no comparison for ports
if (sctp1->ppid != sctp2->ppid) return -4; if (sctp1->ppid != sctp2->ppid) {
if (sctp1->assoc_id != sctp2->assoc_id) return -5; S1AP_WARN("No Matching SCTP PPID %u %u\n", sctp1->ppid, sctp2->ppid);
return -ET_ERROR_MATCH_PACKET_SCTP_PPID;
}
if (sctp1->assoc_id != sctp2->assoc_id) {
S1AP_WARN("No Matching SCTP assoc id %u %u\n", sctp1->assoc_id, sctp2->assoc_id);
return -ET_ERROR_MATCH_PACKET_SCTP_ASSOC_ID;
}
if (sctp1->stream != sctp2->stream) { if (sctp1->stream != sctp2->stream) {
if (constraints & ET_BIT_MASK_MATCH_SCTP_STREAM) { if (constraints & ET_BIT_MASK_MATCH_SCTP_STREAM) {
return -2; return -ET_ERROR_MATCH_PACKET_SCTP_STREAM_ID;
} else { } else {
S1AP_WARN("No Matching SCTP stream %u %u\n", sctp1->stream, sctp2->stream); S1AP_WARN("No Matching SCTP stream %u %u\n", sctp1->stream, sctp2->stream);
} }
} }
if (sctp1->ssn != sctp2->ssn) { if (sctp1->ssn != sctp2->ssn) {
if (constraints & ET_BIT_MASK_MATCH_SCTP_SSN) { if (constraints & ET_BIT_MASK_MATCH_SCTP_SSN) {
return -3; return -ET_ERROR_MATCH_PACKET_SCTP_SSN;
} else { } else {
S1AP_WARN("No Matching SCTP ssn %u %u\n", sctp1->ssn, sctp2->ssn); S1AP_WARN("No Matching SCTP STREAM SN %u %u\n", sctp1->ssn, sctp2->ssn);
} }
} }
return et_s1ap_is_matching(&sctp1->payload, &sctp2->payload, constraints); return et_s1ap_is_matching(&sctp1->payload, &sctp2->payload, constraints);
...@@ -70,7 +76,7 @@ int et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * cons ...@@ -70,7 +76,7 @@ int et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * cons
int et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t * const sctp2, const uint32_t constraints) int et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t * const sctp2, const uint32_t constraints)
{ {
// no comparison for ports // no comparison for ports
if (sctp1->chunk_type != sctp2->chunk_type) return -1; if (sctp1->chunk_type != sctp2->chunk_type) return -ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE;
switch (sctp1->chunk_type) { switch (sctp1->chunk_type) {
case SCTP_CID_DATA: case SCTP_CID_DATA:
return et_sctp_data_is_matching(&sctp1->u.data_hdr, &sctp2->u.data_hdr, constraints); return et_sctp_data_is_matching(&sctp1->u.data_hdr, &sctp2->u.data_hdr, constraints);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment