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