Commit 45f52474 authored by Cedric Roux's avatar Cedric Roux

- Prefix-ed Informations Elements for S1AP to avoid types redefinitions with RRC

EPC/eNB builds OK

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4373 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 55337aa6
......@@ -12,16 +12,16 @@ DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
Criticality ::= ENUMERATED { reject, ignore, notify }
S1ap-Criticality ::= ENUMERATED { reject, ignore, notify }
Presence ::= ENUMERATED { optional, conditional, mandatory }
S1ap-Presence ::= ENUMERATED { optional, conditional, mandatory }
PrivateIE-ID ::= CHOICE {
S1ap-PrivateIE-ID ::= CHOICE {
local INTEGER (0..65535),
global OBJECT IDENTIFIER
}
ProcedureCode ::= INTEGER {
S1ap-ProcedureCode ::= INTEGER {
id-HandoverPreparation(0),
id-HandoverResourceAllocation(1),
id-HandoverNotification(2),
......@@ -72,9 +72,9 @@ ProcedureCode ::= INTEGER {
id-uplinkNonUEAssociatedLPPaTransport(47)
} (0..255)
ProtocolExtensionID ::= INTEGER (0..65535)
S1ap-ProtocolExtensionID ::= INTEGER (0..65535)
ProtocolIE-ID ::= INTEGER {
S1ap-ProtocolIE-ID ::= INTEGER {
id-MME-UE-S1AP-ID (0),
id-HandoverType (1),
id-Cause (2),
......@@ -227,6 +227,6 @@ ProtocolIE-ID ::= INTEGER {
id-PrivacyIndicator (166)
} (0..65535)
TriggeringMessage ::= ENUMERATED { initiating-message, successful-outcome, unsuccessfull-outcome }
S1ap-TriggeringMessage ::= ENUMERATED { initiating-message, successful-outcome, unsuccessfull-outcome }
END
......@@ -19,16 +19,16 @@ BEGIN
-- **************************************************************
IMPORTS
Criticality,
Presence,
PrivateIE-ID,
ProtocolExtensionID,
ProtocolIE-ID
S1ap-Criticality,
S1ap-Presence,
S1ap-PrivateIE-ID,
S1ap-ProtocolExtensionID,
S1ap-ProtocolIE-ID
FROM S1AP-CommonDataTypes
maxPrivateIEs,
maxProtocolExtensions,
maxProtocolIEs
s1ap-maxPrivateIEs,
s1ap-maxProtocolExtensions,
s1ap-maxProtocolIEs
FROM S1AP-Constants;
-- **************************************************************
......@@ -38,10 +38,10 @@ FROM S1AP-Constants;
-- **************************************************************
S1AP-PROTOCOL-IES ::= CLASS {
&id ProtocolIE-ID UNIQUE,
&criticality Criticality,
&Value,
&presence Presence
&id S1ap-ProtocolIE-ID UNIQUE,
&criticality S1ap-Criticality,
&Value,
&presence S1ap-Presence
}
WITH SYNTAX {
ID &id
......@@ -57,20 +57,20 @@ WITH SYNTAX {
-- **************************************************************
S1AP-PROTOCOL-IES-PAIR ::= CLASS {
&id ProtocolIE-ID UNIQUE,
&firstCriticality Criticality,
&FirstValue,
&secondCriticality Criticality,
&SecondValue,
&presence Presence
&id S1ap-ProtocolIE-ID UNIQUE,
&firstCriticality S1ap-Criticality,
&FirstValue,
&secondCriticality S1ap-Criticality,
&SecondValue,
&presence S1ap-Presence
}
WITH SYNTAX {
ID &id
FIRST CRITICALITY &firstCriticality
FIRST TYPE &FirstValue
SECOND CRITICALITY &secondCriticality
SECOND TYPE &SecondValue
PRESENCE &presence
ID &id
FIRST CRITICALITY &firstCriticality
FIRST TYPE &FirstValue
SECOND CRITICALITY &secondCriticality
SECOND TYPE &SecondValue
PRESENCE &presence
}
-- **************************************************************
......@@ -80,16 +80,16 @@ WITH SYNTAX {
-- **************************************************************
S1AP-PROTOCOL-EXTENSION ::= CLASS {
&id ProtocolExtensionID UNIQUE,
&criticality Criticality,
&Extension,
&presence Presence
&id S1ap-ProtocolExtensionID UNIQUE,
&criticality S1ap-Criticality,
&Extension,
&presence S1ap-Presence
}
WITH SYNTAX {
ID &id
CRITICALITY &criticality
EXTENSION &Extension
PRESENCE &presence
ID &id
CRITICALITY &criticality
EXTENSION &Extension
PRESENCE &presence
}
-- **************************************************************
......@@ -99,16 +99,16 @@ WITH SYNTAX {
-- **************************************************************
S1AP-PRIVATE-IES ::= CLASS {
&id PrivateIE-ID,
&criticality Criticality,
&Value,
&presence Presence
&id S1ap-PrivateIE-ID,
&criticality S1ap-Criticality,
&Value,
&presence S1ap-Presence
}
WITH SYNTAX {
ID &id
CRITICALITY &criticality
TYPE &Value
PRESENCE &presence
ID &id
CRITICALITY &criticality
TYPE &Value
PRESENCE &presence
}
-- **************************************************************
......
......@@ -3,7 +3,7 @@ import datetime
import getopt
import getpass
version = "1.0.0"
version = "1.0.1"
lines = ""
iesDefs = {}
......@@ -19,6 +19,7 @@ WARN = '\033[93m'
ENDC = '\033[0m'
fileprefix = ""
fileprefix_first_upper = ""
def printFail(string):
sys.stderr.write(FAIL + string + ENDC + "\n")
......@@ -87,7 +88,7 @@ def lowerFirstCamelWord(word):
for c in swapped:
if c in string.lowercase:
newstr += c
idx += 1
idx += 1
else:
break
if idx < 2:
......@@ -164,6 +165,8 @@ if len(iesDefs) == 0:
printFail("No Information Element parsed, exiting")
sys.exit(0)
fileprefix_first_upper = fileprefix[0].upper() + fileprefix[1:]
f = open(outdir + fileprefix + '_ies_defs.h', 'w')
outputHeaderToFile(f, filename)
f.write("#include \"%s_common.h\"\n\n" % (fileprefix))
......@@ -223,9 +226,9 @@ for key in iesDefs:
f.write("} %s_t;\n\n" % (re.sub('-', '_', key)))
f.write("typedef struct %s_message_s {\n" % (fileprefix))
f.write(" ProcedureCode_t procedureCode;\n")
f.write(" Criticality_t criticality;\n")
f.write(" uint8_t direction;\n")
f.write(" %s_ProcedureCode_t procedureCode;\n" % (fileprefix_first_upper))
f.write(" %s_Criticality_t criticality;\n" % (fileprefix_first_upper))
f.write(" uint8_t direction;\n")
f.write(" union {\n")
messageList = iesDefs.keys()
......@@ -353,7 +356,7 @@ for key in iesDefs:
f.write(" %s_DEBUG(\"Decoding message %s (%%s:%%d)\\n\", __FILE__, __LINE__);\n\n" % (fileprefix.upper(), re.sub('-', '_', keyName)))
f.write(" ANY_to_type_aper(any_p, &asn_DEF_%s, (void**)&%s_p);\n\n" % (asn1cStruct, asn1cStructfirstlower))
f.write(" for (i = 0; i < %s_p->%slist.count; i++) {\n" % (asn1cStructfirstlower, iesaccess))
f.write(" IE_t *ie_p;\n")
f.write(" %s_IE_t *ie_p;\n" % (fileprefix[0].upper() + fileprefix[1:]))
f.write(" ie_p = %s_p->%slist.array[i];\n" % (asn1cStructfirstlower, iesaccess))
f.write(" switch(ie_p->id) {\n")
for ie in iesDefs[key]["ies"]:
......@@ -368,7 +371,7 @@ for key in iesDefs:
f.write(" /* Optional field */\n")
elif ie[3] == "conditional":
f.write(" /* Conditional field */\n")
f.write(" case ProtocolIE_ID_%s:\n" % (re.sub('-', '_', ie[0])))
f.write(" case %s_ProtocolIE_ID_%s:\n" % (fileprefix_first_upper, re.sub('-', '_', ie[0])))
f.write(" {\n")
f.write(" %s_t *%s_p = NULL;\n" % (ietypeunderscore, lowerFirstCamelWord(ietypesubst)))
if ie[3] != "mandatory":
......@@ -416,12 +419,12 @@ for key in iesDefs:
f.write(" assert(%sIEs != NULL);\n\n" % (lowerFirstCamelWord(re.sub('-', '_', keyname))));
f.write(" for (i = 0; i < %s->list.count; i++) {\n" % (lowerFirstCamelWord(re.sub('-', '_', keyname))))
f.write(" IE_t *ie_p = %s->list.array[i];\n" % (lowerFirstCamelWord(re.sub('-', '_', keyname))))
f.write(" %s_IE_t *ie_p = %s->list.array[i];\n" % (fileprefix[0].upper() + fileprefix[1:], lowerFirstCamelWord(re.sub('-', '_', keyname))))
f.write(" switch (ie_p->id) {\n")
for ie in iesDefs[key]["ies"]:
iename = re.sub('id-', '', ie[0])
ienameunderscore = lowerFirstCamelWord(re.sub('-', '_', iename))
f.write(" case ProtocolIE_ID_%s:\n" % (re.sub('-', '_', ie[0])))
f.write(" case %s_ProtocolIE_ID_%s:\n" % (fileprefix_first_upper, re.sub('-', '_', ie[0])))
f.write(" {\n")
f.write(" %s_t *%s_p = NULL;\n" % (re.sub('-', '_', ie[2]), lowerFirstCamelWord(re.sub('-', '', ie[2]))))
f.write(" tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_%s, (void**)&%s_p);\n" % (re.sub('-', '_', ie[2]), lowerFirstCamelWord(re.sub('-', '', ie[2]))))
......@@ -478,7 +481,7 @@ for key in iesDefs:
f.write(" %s_t *%s,\n" % (asn1cStruct, firstwordlower))
f.write(" %s_t *%s) {\n\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key))))
f.write(" IE_t *ie;\n\n")
f.write(" %s_IE_t *ie;\n\n" % (fileprefix_first_upper))
f.write(" assert(%s != NULL);\n" % (firstwordlower));
f.write(" assert(%s != NULL);\n\n" % (lowerFirstCamelWord(re.sub('-', '_', key))));
......@@ -497,10 +500,10 @@ for key in iesDefs:
f.write(" /* Conditional field */\n")
f.write(" if (%s->presenceMask & %s_%s_PRESENT) {\n" % (lowerFirstCamelWord(re.sub('-', '_', key)), keyupperunderscore, ieupperunderscore))
#f.write(" == %s_%s_PRESENT) {\n" % (keyupperunderscore, ieupperunderscore))
f.write(" if ((ie = %s_new_ie(ProtocolIE_ID_%s,\n" % (fileprefix, re.sub('-', '_', ie[0])))
f.write(" Criticality_%s,\n" % (ie[1]))
f.write(" &asn_DEF_%s,\n" % (ietypeunderscore))
f.write(" &%s->%s)) == NULL) {\n" % (lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower))
f.write(" if ((ie = %s_new_ie(%s_ProtocolIE_ID_%s,\n" % (fileprefix, fileprefix_first_upper, re.sub('-', '_', ie[0])))
f.write(" %s_Criticality_%s,\n" % (fileprefix_first_upper, ie[1]))
f.write(" &asn_DEF_%s,\n" % (ietypeunderscore))
f.write(" &%s->%s)) == NULL) {\n" % (lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower))
f.write(" return -1;\n")
f.write(" }\n")
f.write(" ASN_SEQUENCE_ADD(&%s->%slist, ie);\n" % (firstwordlower, iesaccess))
......@@ -511,9 +514,9 @@ for key in iesDefs:
f.write(" memset(&%s, 0, sizeof(%s_t));\n" % (ienamefirstwordlower, ietypeunderscore))
f.write("\n")
f.write(" if (%s_encode_%s(&%s, &%s->%s) < 0) return -1;\n" % (fileprefix, ietypeunderscore.lower(), ienamefirstwordlower, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower))
f.write(" if ((ie = %s_new_ie(ProtocolIE_ID_%s,\n" % (fileprefix, re.sub('-', '_', ie[0])))
f.write(" Criticality_%s,\n" % (ie[1]))
f.write(" &asn_DEF_%s,\n" % (ietypeunderscore))
f.write(" if ((ie = %s_new_ie(%s_ProtocolIE_ID_%s,\n" % (fileprefix, fileprefix_first_upper, re.sub('-', '_', ie[0])))
f.write(" %s_Criticality_%s,\n" % (fileprefix_first_upper, ie[1]))
f.write(" &asn_DEF_%s,\n" % (ietypeunderscore))
if ie[2] in ieofielist.keys():
f.write(" &%s)) == NULL) {\n" % (ienamefirstwordlower))
else:
......@@ -546,14 +549,14 @@ for (key, value) in iesDefs.items():
f.write(" %sIEs_t *%sIEs) {\n\n" % (re.sub('-', '_', i), lowerFirstCamelWord(re.sub('-', '_', i))))
f.write(" int i;\n")
f.write(" IE_t *ie;\n\n")
f.write(" %s_IE_t *ie;\n\n" % (fileprefix_first_upper))
f.write(" assert(%s != NULL);\n" % (firstwordlower));
f.write(" assert(%sIEs != NULL);\n\n" % (lowerFirstCamelWord(re.sub('-', '_', i))));
f.write(" for (i = 0; i < %sIEs->%s.count; i++) {\n" % (firstwordlower, re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key)))))
f.write(" if ((ie = %s_new_ie(ProtocolIE_ID_%s,\n" % (fileprefix, re.sub('-', '_', ie[0])))
f.write(" Criticality_%s,\n" % (ie[1]))
f.write(" if ((ie = %s_new_ie(%s_ProtocolIE_ID_%s,\n" % (fileprefix, fileprefix_first_upper, re.sub('-', '_', ie[0])))
f.write(" %s_Criticality_%s,\n" % (fileprefix_first_upper, ie[1]))
f.write(" &asn_DEF_%s,\n" % (ietypeunderscore))
f.write(" %sIEs->%s.array[i])) == NULL) {\n" % (firstwordlower, re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key)))))
f.write(" return -1;\n")
......@@ -644,8 +647,8 @@ for (key, value) in iesDefs.items():
f.write(" }\n")
else:
f.write(" fprintf(file, \"<%s-PDU>\\n\");\n" % (fileprefix.upper()))
f.write(" xer_encode_local(&asn_DEF_Criticality, &message_p->criticality, cb, app_key, 1);\n")
f.write(" xer_encode_local(&asn_DEF_ProcedureCode, &message_p->procedureCode, cb, app_key, 1);\n")
f.write(" xer_encode_local(&asn_DEF_%s_Criticality, &message_p->criticality, cb, app_key, 1);\n" % fileprefix_first_upper)
f.write(" xer_encode_local(&asn_DEF_%s_ProcedureCode, &message_p->procedureCode, cb, app_key, 1);\n" % fileprefix_first_upper)
f.write(" fprintf(file, \" <%s>\\n\");\n" % (key))
for ie in iesDefs[key]["ies"]:
......
This diff is collapsed.
This diff is collapsed.
......@@ -73,6 +73,8 @@ $(S1AP_OBJDIR)/s1ap_asn1regen.stamp: $(ASN1DIR)/$(ASN1RELDIR)/S1AP-CommonDataTyp
(cd $(ASN1MESSAGESDIR) && asn1c -fhave_native64 -gen-PER $^)
echo Timestamp > $@
.INTERMEDIATE = $(S1AP_OBJDIR)/s1ap_ieregen.stamp $(S1AP_OBJDIR)/s1ap_asn1regen.stamp
libs1ap.a: $(S1AP_OBJDIR)/s1ap_ieregen.stamp $(S1AP_OBJDIR)/s1ap_asn1regen.stamp $(libs1ap_OBJECTS)
@echo Creating S1AP archive
@$(AR) rcs $@ $(libs1ap_OBJECTS)
......
......@@ -62,8 +62,8 @@ inline void ASN_DEBUG(const char *fmt, ...)
ssize_t s1ap_generate_initiating_message(
uint8_t **buffer,
uint32_t *length,
e_ProcedureCode procedureCode,
Criticality_t criticality,
e_S1ap_ProcedureCode procedureCode,
S1ap_Criticality_t criticality,
asn_TYPE_descriptor_t *td,
void *sptr)
{
......@@ -96,8 +96,8 @@ ssize_t s1ap_generate_initiating_message(
ssize_t s1ap_generate_successfull_outcome(
uint8_t **buffer,
uint32_t *length,
e_ProcedureCode procedureCode,
Criticality_t criticality,
e_S1ap_ProcedureCode procedureCode,
S1ap_Criticality_t criticality,
asn_TYPE_descriptor_t *td,
void *sptr)
{
......@@ -131,8 +131,8 @@ ssize_t s1ap_generate_successfull_outcome(
ssize_t s1ap_generate_unsuccessfull_outcome(
uint8_t **buffer,
uint32_t *length,
e_ProcedureCode procedureCode,
Criticality_t criticality,
e_S1ap_ProcedureCode procedureCode,
S1ap_Criticality_t criticality,
asn_TYPE_descriptor_t *td,
void *sptr)
{
......@@ -163,19 +163,19 @@ ssize_t s1ap_generate_unsuccessfull_outcome(
return encoded;
}
IE_t *s1ap_new_ie(
ProtocolIE_ID_t id,
Criticality_t criticality,
S1ap_IE_t *s1ap_new_ie(
S1ap_ProtocolIE_ID_t id,
S1ap_Criticality_t criticality,
asn_TYPE_descriptor_t *type,
void *sptr)
{
IE_t *buff;
S1ap_IE_t *buff;
if ((buff = malloc(sizeof(IE_t))) == NULL) {
if ((buff = malloc(sizeof(S1ap_IE_t))) == NULL) {
// Possible error on malloc
return NULL;
}
memset((void *)buff, 0, sizeof(IE_t));
memset((void *)buff, 0, sizeof(S1ap_IE_t));
buff->id = id;
buff->criticality = criticality;
......@@ -187,7 +187,7 @@ IE_t *s1ap_new_ie(
}
if (asn1_xer_print)
if (xer_fprint(stdout, &asn_DEF_IE, buff) < 0) {
if (xer_fprint(stdout, &asn_DEF_S1ap_IE, buff) < 0) {
free(buff);
return NULL;
}
......@@ -195,7 +195,7 @@ IE_t *s1ap_new_ie(
return buff;
}
void s1ap_handle_criticality(e_Criticality criticality)
void s1ap_handle_criticality(S1ap_Criticality_t criticality)
{
}
This diff is collapsed.
......@@ -259,13 +259,15 @@ void *s1ap_eNB_task(void *arg)
static int s1ap_eNB_generate_s1_setup_request(
s1ap_eNB_instance_t *instance_p, s1ap_eNB_mme_data_t *s1ap_mme_data_p)
{
s1ap_message message;
S1SetupRequestIEs_t *s1SetupRequest_p;
PLMNidentity_t plmnIdentity;
SupportedTAs_Item_t ta;
uint8_t *buffer;
uint32_t len;
int ret = 0;
s1ap_message message;
S1ap_S1SetupRequestIEs_t *s1SetupRequest_p;
S1ap_PLMNidentity_t plmnIdentity;
S1ap_SupportedTAs_Item_t ta;
uint8_t *buffer;
uint32_t len;
int ret = 0;
DevAssert(instance_p != NULL);
DevAssert(s1ap_mme_data_p != NULL);
......@@ -273,17 +275,17 @@ static int s1ap_eNB_generate_s1_setup_request(
memset(&message, 0, sizeof(s1ap_message));
message.direction = S1AP_PDU_PR_initiatingMessage;
message.procedureCode = ProcedureCode_id_S1Setup;
message.criticality = Criticality_reject;
message.procedureCode = S1ap_ProcedureCode_id_S1Setup;
message.criticality = S1ap_Criticality_reject;
s1SetupRequest_p = &message.msg.s1SetupRequestIEs;
memset((void *)&plmnIdentity, 0, sizeof(PLMNidentity_t));
s1SetupRequest_p = &message.msg.s1ap_S1SetupRequestIEs;
memset((void *)&plmnIdentity, 0, sizeof(S1ap_PLMNidentity_t));
memset((void *)&ta, 0, sizeof(SupportedTAs_Item_t));
memset((void *)&ta, 0, sizeof(S1ap_SupportedTAs_Item_t));
s1ap_mme_data_p->state = S1AP_ENB_STATE_WAITING;
s1SetupRequest_p->global_ENB_ID.eNB_ID.present = ENB_ID_PR_macroENB_ID;
s1SetupRequest_p->global_ENB_ID.eNB_ID.present = S1ap_ENB_ID_PR_macroENB_ID;
MACRO_ENB_ID_TO_BIT_STRING(instance_p->eNB_id,
&s1SetupRequest_p->global_ENB_ID.eNB_ID.choice.macroENB_ID);
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc,
......@@ -298,7 +300,7 @@ static int s1ap_eNB_generate_s1_setup_request(
s1SetupRequest_p->defaultPagingDRX = instance_p->default_drx;
if (instance_p->eNB_name != NULL) {
s1SetupRequest_p->presenceMask |= S1SETUPREQUESTIES_ENBNAME_PRESENT;
s1SetupRequest_p->presenceMask |= S1AP_S1SETUPREQUESTIES_ENBNAME_PRESENT;
OCTET_STRING_fromBuf(&s1SetupRequest_p->eNBname, instance_p->eNB_name,
strlen(instance_p->eNB_name));
}
......
......@@ -44,7 +44,7 @@
#include "s1ap_eNB_decoder.h"
static int s1ap_eNB_decode_initiating_message(s1ap_message *message,
InitiatingMessage_t *initiating_p)
S1ap_InitiatingMessage_t *initiating_p)
{
DevAssert(initiating_p != NULL);
......@@ -52,12 +52,14 @@ static int s1ap_eNB_decode_initiating_message(s1ap_message *message,
message->criticality = initiating_p->criticality;
switch(initiating_p->procedureCode) {
case ProcedureCode_id_downlinkNASTransport:
return s1ap_decode_downlinknastransporties(&message->msg.downlinkNASTransportIEs,
&initiating_p->value);
case ProcedureCode_id_InitialContextSetup:
return s1ap_decode_initialcontextsetuprequesties(
&message->msg.initialContextSetupRequestIEs, &initiating_p->value);
case S1ap_ProcedureCode_id_downlinkNASTransport:
return s1ap_decode_s1ap_downlinknastransporties(
&message->msg.s1ap_DownlinkNASTransportIEs, &initiating_p->value);
case S1ap_ProcedureCode_id_InitialContextSetup:
return s1ap_decode_s1ap_initialcontextsetuprequesties(
&message->msg.s1ap_InitialContextSetupRequestIEs, &initiating_p->value);
default:
S1AP_DEBUG("Unknown procedure ID (%d) for initiating message\n",
(int)initiating_p->procedureCode);
......@@ -67,7 +69,7 @@ static int s1ap_eNB_decode_initiating_message(s1ap_message *message,
}
static int s1ap_eNB_decode_successful_outcome(s1ap_message *message,
SuccessfulOutcome_t *successfullOutcome_p)
S1ap_SuccessfulOutcome_t *successfullOutcome_p)
{
DevAssert(successfullOutcome_p != NULL);
......@@ -75,9 +77,10 @@ static int s1ap_eNB_decode_successful_outcome(s1ap_message *message,
message->criticality = successfullOutcome_p->criticality;
switch(successfullOutcome_p->procedureCode) {
case ProcedureCode_id_S1Setup:
return s1ap_decode_s1setupresponseies(&message->msg.s1SetupResponseIEs,
&successfullOutcome_p->value);
case S1ap_ProcedureCode_id_S1Setup:
return s1ap_decode_s1ap_s1setupresponseies(
&message->msg.s1ap_S1SetupResponseIEs, &successfullOutcome_p->value);
default:
S1AP_DEBUG("Unknown procedure ID (%d) for successfull outcome message\n",
(int)successfullOutcome_p->procedureCode);
......@@ -87,7 +90,7 @@ static int s1ap_eNB_decode_successful_outcome(s1ap_message *message,
}
static int s1ap_eNB_decode_unsuccessful_outcome(s1ap_message *message,
UnsuccessfulOutcome_t *unSuccessfullOutcome_p)
S1ap_UnsuccessfulOutcome_t *unSuccessfullOutcome_p)
{
DevAssert(unSuccessfullOutcome_p != NULL);
......@@ -95,9 +98,10 @@ static int s1ap_eNB_decode_unsuccessful_outcome(s1ap_message *message,
message->criticality = unSuccessfullOutcome_p->criticality;
switch(unSuccessfullOutcome_p->procedureCode) {
case ProcedureCode_id_S1Setup:
return s1ap_decode_s1setupfailureies(&message->msg.s1SetupFailureIEs,
&unSuccessfullOutcome_p->value);
case S1ap_ProcedureCode_id_S1Setup:
return s1ap_decode_s1ap_s1setupfailureies(
&message->msg.s1ap_S1SetupFailureIEs, &unSuccessfullOutcome_p->value);
default:
S1AP_DEBUG("Unknown procedure ID (%d) for unsuccessfull outcome message\n",
(int)unSuccessfullOutcome_p->procedureCode);
......
......@@ -200,7 +200,7 @@ typedef struct s1ap_eNB_mme_data_s {
uint16_t in_streams;
uint16_t out_streams;
/* Connexion id used when SCTP association is not established yet */
/* Connexion id used between SCTP/S1AP */
uint16_t cnx_id;
/* SCTP association id */
......@@ -270,10 +270,6 @@ inline int s1ap_eNB_compare_assoc_id(
RB_PROTOTYPE(s1ap_mme_map, s1ap_eNB_mme_data_s, entry,
s1ap_eNB_compare_assoc_id);
inline struct s1ap_eNB_mme_data_s *s1ap_eNB_get_MME(
s1ap_eNB_instance_t *instance_p,
int32_t assoc_id, uint16_t cnx_id);
int s1ap_eNB_init(s1ap_eNB_instance_t *eNB_desc_p,
char *local_ip_addr[], int nb_local_ip,
char *remote_ip_addr[], int nb_remote_ip);
......
This diff is collapsed.
......@@ -49,6 +49,7 @@
#include "s1ap_eNB_ue_context.h"
#include "s1ap_eNB_trace.h"
#include "s1ap_eNB_nas_procedures.h"
#include "s1ap_eNB_management_procedures.h"
#include "s1ap_eNB_default_values.h"
......@@ -185,13 +186,13 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
uint32_t stream,
struct s1ap_message_s *message_p)
{
S1SetupResponseIEs_t *s1SetupResponse_p;
s1ap_eNB_mme_data_t *mme_desc_p;
S1ap_S1SetupResponseIEs_t *s1SetupResponse_p;
s1ap_eNB_mme_data_t *mme_desc_p;
int i;
DevAssert(message_p != NULL);
s1SetupResponse_p = &message_p->msg.s1SetupResponseIEs;
s1SetupResponse_p = &message_p->msg.s1ap_S1SetupResponseIEs;
/* S1 Setup Response == Non UE-related procedure -> stream 0 */
if (stream != 0) {
......@@ -212,11 +213,11 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
DevAssert(s1SetupResponse_p->servedGUMMEIs.list.count == 1);
for (i = 0; i < s1SetupResponse_p->servedGUMMEIs.list.count; i++) {
struct ServedGUMMEIsItem *gummei_item_p;
struct served_gummei_s *new_gummei_p;
struct S1ap_ServedGUMMEIsItem *gummei_item_p;
struct served_gummei_s *new_gummei_p;
int j;
gummei_item_p = (struct ServedGUMMEIsItem *)
gummei_item_p = (struct S1ap_ServedGUMMEIsItem *)
s1SetupResponse_p->servedGUMMEIs.list.array[i];
new_gummei_p = calloc(1, sizeof(struct served_gummei_s));
......@@ -225,7 +226,7 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
STAILQ_INIT(&new_gummei_p->mme_codes);
for (j = 0; j < gummei_item_p->servedPLMNs.list.count; j++) {
PLMNidentity_t *plmn_identity_p;
S1ap_PLMNidentity_t *plmn_identity_p;
struct plmn_identity_s *new_plmn_identity_p;
plmn_identity_p = gummei_item_p->servedPLMNs.list.array[i];
......@@ -236,7 +237,7 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
new_gummei_p->nb_served_plmns++;
}
for (j = 0; j < gummei_item_p->servedGroupIDs.list.count; j++) {
MME_Group_ID_t *mme_group_id_p;
S1ap_MME_Group_ID_t *mme_group_id_p;
struct served_group_id_s *new_group_id_p;
mme_group_id_p = gummei_item_p->servedGroupIDs.list.array[i];
......@@ -246,7 +247,7 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
new_gummei_p->nb_group_id++;
}
for (j = 0; j < gummei_item_p->servedMMECs.list.count; j++) {
MME_Code_t *mme_code_p;
S1ap_MME_Code_t *mme_code_p;
struct mme_code_s *new_mme_code_p;
mme_code_p = gummei_item_p->servedMMECs.list.array[i];
......@@ -259,12 +260,12 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
STAILQ_INSERT_TAIL(&mme_desc_p->served_gummei, new_gummei_p, next);
}
/* Free contents of the list */
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_ServedGUMMEIs,
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_S1ap_ServedGUMMEIs,
(void *)&s1SetupResponse_p->servedGUMMEIs);
/* Set the capacity of this MME */
mme_desc_p->relative_mme_capacity = s1SetupResponse_p->relativeMMECapacity;
/* Optionaly set the mme name */
if (s1SetupResponse_p->presenceMask & S1SETUPRESPONSEIES_MMENAME_PRESENT) {
if (s1SetupResponse_p->presenceMask & S1AP_S1SETUPRESPONSEIES_MMENAME_PRESENT) {
mme_desc_p->mme_name = calloc(s1SetupResponse_p->mmEname.size + 1, sizeof(char));
memcpy(mme_desc_p->mme_name, s1SetupResponse_p->mmEname.buf,
s1SetupResponse_p->mmEname.size);
......@@ -340,10 +341,10 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
s1ap_eNB_mme_data_t *mme_desc_p;
s1ap_eNB_ue_context_t *ue_desc_p;
InitialContextSetupRequestIEs_t *initialContextSetupRequest_p;
S1ap_InitialContextSetupRequestIEs_t *initialContextSetupRequest_p;
DevAssert(message_p != NULL);
initialContextSetupRequest_p = &message_p->msg.initialContextSetupRequestIEs;
initialContextSetupRequest_p = &message_p->msg.s1ap_InitialContextSetupRequestIEs;
if ((mme_desc_p = s1ap_eNB_get_MME(NULL, assoc_id, 0)) == NULL) {
S1AP_ERROR("[SCTP %d] Received initial context setup request for non "
......
......@@ -55,8 +55,9 @@ int s1ap_eNB_handle_nas_first_req(s1ap_nas_first_req_t *s1ap_nas_first_req_p)
struct s1ap_eNB_mme_data_s *mme_desc_p;
struct s1ap_eNB_ue_context_s *ue_desc_p;
s1ap_message message;
InitialUEMessageIEs_t *initial_ue_message_p;
s1ap_message message;
S1ap_InitialUEMessageIEs_t *initial_ue_message_p;
uint8_t *buffer;
uint32_t length;
......@@ -69,10 +70,10 @@ int s1ap_eNB_handle_nas_first_req(s1ap_nas_first_req_t *s1ap_nas_first_req_p)
memset(&message, 0, sizeof(s1ap_message));
message.direction = S1AP_PDU_PR_initiatingMessage;
message.procedureCode = ProcedureCode_id_initialUEMessage;
message.direction = S1AP_PDU_PR_initiatingMessage;
message.procedureCode = S1ap_ProcedureCode_id_initialUEMessage;
initial_ue_message_p = &message.msg.initialUEMessageIEs;
initial_ue_message_p = &message.msg.s1ap_InitialUEMessageIEs;
/* Select the MME corresponding to the provided GUMMEI.
* If no MME corresponds to the GUMMEI, the function selects the MME with the
......@@ -132,14 +133,14 @@ int s1ap_eNB_handle_nas_first_req(s1ap_nas_first_req_t *s1ap_nas_first_req_p)
initial_ue_message_p->rrC_Establishment_Cause = s1ap_nas_first_req_p->establishment_cause;
if (s1ap_nas_first_req_p->ue_identity.present == S_TMSI_PROVIDED) {
initial_ue_message_p->presenceMask |= INITIALUEMESSAGEIES_S_TMSI_PRESENT;
initial_ue_message_p->presenceMask |= S1AP_INITIALUEMESSAGEIES_S_TMSI_PRESENT;
MME_CODE_TO_OCTET_STRING(s1ap_nas_first_req_p->ue_identity.identity.s_tmsi.mme_code,
&initial_ue_message_p->s_tmsi.mMEC);
M_TMSI_TO_OCTET_STRING(s1ap_nas_first_req_p->ue_identity.identity.s_tmsi.m_tmsi,
&initial_ue_message_p->s_tmsi.m_TMSI);
} else {
initial_ue_message_p->presenceMask |= INITIALUEMESSAGEIES_GUMMEI_ID_PRESENT;
initial_ue_message_p->presenceMask |= S1AP_INITIALUEMESSAGEIES_GUMMEI_ID_PRESENT;
MCC_MNC_TO_PLMNID(s1ap_nas_first_req_p->ue_identity.identity.gummei.mcc,
s1ap_nas_first_req_p->ue_identity.identity.gummei.mnc,
......@@ -186,14 +187,15 @@ int s1ap_eNB_handle_nas_downlink(uint32_t assoc_id,
uint32_t stream,
struct s1ap_message_s *message_p)
{
DownlinkNASTransportIEs_t *downlink_NAS_transport_p;
s1ap_eNB_mme_data_t *mme_desc_p;
s1ap_eNB_ue_context_t *ue_desc_p;
s1ap_eNB_instance_t *s1ap_eNB_instance;
S1ap_DownlinkNASTransportIEs_t *downlink_NAS_transport_p;
s1ap_eNB_mme_data_t *