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,12 +57,12 @@ WITH SYNTAX { ...@@ -57,12 +57,12 @@ 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
...@@ -80,10 +80,10 @@ WITH SYNTAX { ...@@ -80,10 +80,10 @@ 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
...@@ -99,10 +99,10 @@ WITH SYNTAX { ...@@ -99,10 +99,10 @@ 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
......
...@@ -19,83 +19,82 @@ BEGIN ...@@ -19,83 +19,82 @@ BEGIN
-- ************************************************************** -- **************************************************************
IMPORTS IMPORTS
Criticality, S1ap-Criticality,
ProcedureCode S1ap-ProcedureCode
FROM S1AP-CommonDataTypes FROM S1AP-CommonDataTypes
CellTrafficTrace, S1ap-CellTrafficTrace,
DeactivateTrace, S1ap-DeactivateTrace,
DownlinkUEAssociatedLPPaTransport, S1ap-DownlinkUEAssociatedLPPaTransport,
DownlinkNASTransport, S1ap-DownlinkNASTransport,
DownlinkNonUEAssociatedLPPaTransport, S1ap-DownlinkNonUEAssociatedLPPaTransport,
DownlinkS1cdma2000tunneling, S1ap-DownlinkS1cdma2000tunneling,
ENBDirectInformationTransfer, S1ap-ENBDirectInformationTransfer,
ENBStatusTransfer, S1ap-ENBStatusTransfer,
ENBConfigurationUpdate, S1ap-ENBConfigurationUpdate,
ENBConfigurationUpdateAcknowledge, S1ap-ENBConfigurationUpdateAcknowledge,
ENBConfigurationUpdateFailure, S1ap-ENBConfigurationUpdateFailure,
ErrorIndication, S1ap-ErrorIndication,
HandoverCancel, S1ap-HandoverCancel,
HandoverCancelAcknowledge, S1ap-HandoverCancelAcknowledge,
HandoverCommand, S1ap-HandoverCommand,
HandoverFailure, S1ap-HandoverFailure,
HandoverNotify, S1ap-HandoverNotify,
HandoverPreparationFailure, S1ap-HandoverPreparationFailure,
HandoverRequest, S1ap-HandoverRequest,
HandoverRequestAcknowledge, S1ap-HandoverRequestAcknowledge,
HandoverRequired, S1ap-HandoverRequired,
InitialContextSetupFailure, S1ap-InitialContextSetupFailure,
InitialContextSetupRequest, S1ap-InitialContextSetupRequest,
InitialContextSetupResponse, S1ap-InitialContextSetupResponse,
InitialUEMessage, S1ap-InitialUEMessage,
KillRequest, S1ap-KillRequest,
KillResponse, S1ap-KillResponse,
LocationReportingControl, S1ap-LocationReportingControl,
LocationReportingFailureIndication, S1ap-LocationReportingFailureIndication,
LocationReport, S1ap-LocationReport,
MMEConfigurationUpdate, S1ap-MMEConfigurationUpdate,
MMEConfigurationUpdateAcknowledge, S1ap-MMEConfigurationUpdateAcknowledge,
MMEConfigurationUpdateFailure, S1ap-MMEConfigurationUpdateFailure,
MMEDirectInformationTransfer, S1ap-MMEDirectInformationTransfer,
MMEStatusTransfer, S1ap-MMEStatusTransfer,
NASNonDeliveryIndication, S1ap-NASNonDeliveryIndication,
OverloadStart, S1ap-OverloadStart,
OverloadStop, S1ap-OverloadStop,
Paging, S1ap-Paging,
PathSwitchRequest, S1ap-PathSwitchRequest,
PathSwitchRequestAcknowledge, S1ap-PathSwitchRequestAcknowledge,
PathSwitchRequestFailure, S1ap-PathSwitchRequestFailure,
PrivateMessage, S1ap-PrivateMessage,
Reset, S1ap-Reset,
ResetAcknowledge, S1ap-ResetAcknowledge,
S1SetupFailure, S1ap-S1SetupFailure,
S1SetupRequest, S1ap-S1SetupRequest,
S1SetupResponse, S1ap-S1SetupResponse,
E-RABModifyRequest, E-S1ap-RABModifyRequest,
E-RABModifyResponse, E-S1ap-RABModifyResponse,
E-RABReleaseCommand, E-S1ap-RABReleaseCommand,
E-RABReleaseResponse, E-S1ap-RABReleaseResponse,
E-RABReleaseIndication, E-S1ap-RABReleaseIndication,
E-RABSetupRequest, E-S1ap-RABSetupRequest,
E-RABSetupResponse, E-S1ap-RABSetupResponse,
TraceFailureIndication, S1ap-TraceFailureIndication,
TraceStart, S1ap-TraceStart,
UECapabilityInfoIndication, S1ap-UECapabilityInfoIndication,
UEContextModificationFailure, S1ap-UEContextModificationFailure,
UEContextModificationRequest, S1ap-UEContextModificationRequest,
UEContextModificationResponse, S1ap-UEContextModificationResponse,
UEContextReleaseCommand, S1ap-UEContextReleaseCommand,
UEContextReleaseComplete, S1ap-UEContextReleaseComplete,
UEContextReleaseRequest, S1ap-UEContextReleaseRequest,
UplinkUEAssociatedLPPaTransport, S1ap-UplinkUEAssociatedLPPaTransport,
UplinkNASTransport, S1ap-UplinkNASTransport,
UplinkNonUEAssociatedLPPaTransport, S1ap-UplinkNonUEAssociatedLPPaTransport,
UplinkS1cdma2000tunneling, S1ap-UplinkS1cdma2000tunneling,
WriteReplaceWarningRequest, S1ap-WriteReplaceWarningRequest,
WriteReplaceWarningResponse, S1ap-WriteReplaceWarningResponse,
ENBConfigurationTransfer, S1ap-ENBConfigurationTransfer,
MMEConfigurationTransfer S1ap-MMEConfigurationTransfer
FROM S1AP-PDU-Contents FROM S1AP-PDU-Contents
......
...@@ -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")
...@@ -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,8 +226,8 @@ for key in iesDefs: ...@@ -223,8 +226,8 @@ 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")
...@@ -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,8 +500,8 @@ for key in iesDefs: ...@@ -497,8 +500,8 @@ 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")
...@@ -511,8 +514,8 @@ for key in iesDefs: ...@@ -511,8 +514,8 @@ 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))
...@@ -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.
...@@ -260,9 +260,11 @@ static int s1ap_eNB_generate_s1_setup_request( ...@@ -260,9 +260,11 @@ 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;
S1ap_SupportedTAs_Item_t ta;
uint8_t *buffer; uint8_t *buffer;
uint32_t len; uint32_t len;
int ret = 0; int ret = 0;
...@@ -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);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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