Merge remote-tracking branch 'origin/develop' into develop-entv

This commit is contained in:
Javier Morgade
2019-05-17 18:11:55 +02:00
596 changed files with 85160 additions and 52024 deletions
@@ -0,0 +1,32 @@
-- **************************************************************
--
-- Common definitions
--
-- **************************************************************
F1AP-CommonDataTypes {
itu-t (0) identified-organization (4) etsi (0) mobileDomain (0)
ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-CommonDataTypes (3) }
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
Criticality ::= ENUMERATED { reject, ignore, notify }
Presence ::= ENUMERATED { optional, conditional, mandatory }
PrivateIE-ID ::= CHOICE {
local INTEGER (0..65535),
global OBJECT IDENTIFIER
}
ProcedureCode ::= INTEGER (0..255)
ProtocolExtensionID ::= INTEGER (0..65535)
ProtocolIE-ID ::= INTEGER (0..65535)
TriggeringMessage ::= ENUMERATED { initiating-message, successful-outcome, unsuccessfull-outcome }
END
@@ -0,0 +1,179 @@
-- **************************************************************
--
-- Constant definitions
--
-- **************************************************************
F1AP-Constants {
itu-t (0) identified-organization (4) etsi (0) mobileDomain (0)
ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-Constants (4) }
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
-- **************************************************************
--
-- IE parameter types from other modules.
--
-- **************************************************************
IMPORTS
ProcedureCode,
ProtocolIE-ID
FROM F1AP-CommonDataTypes;
-- **************************************************************
--
-- Elementary Procedures
--
-- **************************************************************
id-Reset ProcedureCode ::= 0
id-F1Setup ProcedureCode ::= 1
id-ErrorIndication ProcedureCode ::= 2
id-gNBDUConfigurationUpdate ProcedureCode ::= 3
id-gNBCUConfigurationUpdate ProcedureCode ::= 4
id-UEContextSetup ProcedureCode ::= 5
id-UEContextRelease ProcedureCode ::= 6
id-UEContextModification ProcedureCode ::= 7
id-UEContextModificationRequired ProcedureCode ::= 8
id-UEMobilityCommand ProcedureCode ::= 9
id-UEContextReleaseRequest ProcedureCode ::= 10
id-InitialULRRCMessageTransfer ProcedureCode ::= 11
id-DLRRCMessageTransfer ProcedureCode ::= 12
id-ULRRCMessageTransfer ProcedureCode ::= 13
id-privateMessage ProcedureCode ::= 14
-- **************************************************************
--
-- Extension constants
--
-- **************************************************************
maxPrivateIEs INTEGER ::= 65535
maxProtocolExtensions INTEGER ::= 65535
maxProtocolIEs INTEGER ::= 65535
-- **************************************************************
--
-- Lists
--
-- **************************************************************
maxNRARFCN INTEGER ::= 3266667
maxnoofErrors INTEGER ::= 256
maxnoofIndividualF1ConnectionsToReset INTEGER ::= 65536
maxCellingNBDU INTEGER ::= 512
maxnoofSCells INTEGER ::= 64
maxnoofSRBs INTEGER ::= 8
maxnoofDRBs INTEGER ::= 64
maxnoofULTunnels INTEGER ::= 2
maxnoofDLTunnels INTEGER ::= 2
maxnoofBPLMNs INTEGER ::= 6
maxnoofCandidateSpCells INTEGER ::= 64
maxnoofPotentialSpCells INTEGER ::= 64
-- **************************************************************
--
-- IEs
--
-- **************************************************************
id-Cause ProtocolIE-ID ::= 0
id-Cells-Failed-to-be-Activated-List ProtocolIE-ID ::= 1
id-Cells-Failed-to-be-Activated-List-Item ProtocolIE-ID ::= 2
id-Cells-to-be-Activated-List ProtocolIE-ID ::= 3
id-Cells-to-be-Activated-List-Item ProtocolIE-ID ::= 4
id-Cells-to-be-Deactivated-List ProtocolIE-ID ::= 5
id-Cells-to-be-Deactivated-List-Item ProtocolIE-ID ::= 6
id-CriticalityDiagnostics ProtocolIE-ID ::= 7
id-CUtoDURRCInformation ProtocolIE-ID ::= 9
id-DRBs-FailedToBeModifiedConf-Item ProtocolIE-ID ::= 10
id-DRBs-FailedToBeModifiedConf-List ProtocolIE-ID ::= 11
id-DRBs-FailedToBeModified-Item ProtocolIE-ID ::= 12
id-DRBs-FailedToBeModified-List ProtocolIE-ID ::= 13
id-DRBs-FailedToBeSetup-Item ProtocolIE-ID ::= 14
id-DRBs-FailedToBeSetup-List ProtocolIE-ID ::= 15
id-DRBs-FailedToBeSetupMod-Item ProtocolIE-ID ::= 16
id-DRBs-FailedToBeSetupMod-List ProtocolIE-ID ::= 17
id-DRBs-ModifiedConf-Item ProtocolIE-ID ::= 18
id-DRBs-ModifiedConf-List ProtocolIE-ID ::= 19
id-DRBs-Modified-Item ProtocolIE-ID ::= 20
id-DRBs-Modified-List ProtocolIE-ID ::= 21
id-DRBs-Required-ToBeModified-Item ProtocolIE-ID ::= 22
id-DRBs-Required-ToBeModified-List ProtocolIE-ID ::= 23
id-DRBs-Required-ToBeReleased-Item ProtocolIE-ID ::= 24
id-DRBs-Required-ToBeReleased-List ProtocolIE-ID ::= 25
id-DRBs-Setup-Item ProtocolIE-ID ::= 26
id-DRBs-Setup-List ProtocolIE-ID ::= 27
id-DRBs-SetupMod-Item ProtocolIE-ID ::= 28
id-DRBs-SetupMod-List ProtocolIE-ID ::= 29
id-DRBs-ToBeModified-Item ProtocolIE-ID ::= 30
id-DRBs-ToBeModified-List ProtocolIE-ID ::= 31
id-DRBs-ToBeReleased-Item ProtocolIE-ID ::= 32
id-DRBs-ToBeReleased-List ProtocolIE-ID ::= 33
id-DRBs-ToBeSetup-Item ProtocolIE-ID ::= 34
id-DRBs-ToBeSetup-List ProtocolIE-ID ::= 35
id-DRBs-ToBeSetupMod-Item ProtocolIE-ID ::= 36
id-DRBs-ToBeSetupMod-List ProtocolIE-ID ::= 37
id-DRXCycle ProtocolIE-ID ::= 38
id-DUtoCURRCInformation ProtocolIE-ID ::= 39
id-gNB-CU-UE-F1AP-ID ProtocolIE-ID ::= 40
id-gNB-DU-UE-F1AP-ID ProtocolIE-ID ::= 41
id-gNB-DU-ID ProtocolIE-ID ::= 42
id-GNB-DU-Served-Cells-Item ProtocolIE-ID ::= 43
id-gNB-DU-Served-Cells-List ProtocolIE-ID ::= 44
id-gNB-DU-Name ProtocolIE-ID ::= 45
id-NRCellID ProtocolIE-ID ::= 46
id-oldgNB-DU-UE-F1AP-ID ProtocolIE-ID ::= 47
id-ResetType ProtocolIE-ID ::= 48
id-ResourceCoordinationTransferContainer ProtocolIE-ID ::= 49
id-RRCContainer ProtocolIE-ID ::= 50
id-SCell-ToBeRemoved-Item ProtocolIE-ID ::= 51
id-SCell-ToBeRemoved-List ProtocolIE-ID ::= 52
id-SCell-ToBeSetup-Item ProtocolIE-ID ::= 53
id-SCell-ToBeSetup-List ProtocolIE-ID ::= 54
id-SCell-ToBeSetupMod-Item ProtocolIE-ID ::= 55
id-SCell-ToBeSetupMod-List ProtocolIE-ID ::= 56
id-Served-Cells-To-Add-Item ProtocolIE-ID ::= 57
id-Served-Cells-To-Add-List ProtocolIE-ID ::= 58
id-Served-Cells-To-Delete-Item ProtocolIE-ID ::= 59
id-Served-Cells-To-Delete-List ProtocolIE-ID ::= 60
id-Served-Cells-To-Modify-Item ProtocolIE-ID ::= 61
id-Served-Cells-To-Modify-List ProtocolIE-ID ::= 62
id-SpCell-ID ProtocolIE-ID ::= 63
id-SRBID ProtocolIE-ID ::= 64
id-SRBs-FailedToBeSetup-Item ProtocolIE-ID ::= 65
id-SRBs-FailedToBeSetup-List ProtocolIE-ID ::= 66
id-SRBs-FailedToBeSetupMod-Item ProtocolIE-ID ::= 67
id-SRBs-FailedToBeSetupMod-List ProtocolIE-ID ::= 68
id-SRBs-Required-ToBeReleased-Item ProtocolIE-ID ::= 69
id-SRBs-Required-ToBeReleased-List ProtocolIE-ID ::= 70
id-SRBs-ToBeReleased-Item ProtocolIE-ID ::= 71
id-SRBs-ToBeReleased-List ProtocolIE-ID ::= 72
id-SRBs-ToBeSetup-Item ProtocolIE-ID ::= 73
id-SRBs-ToBeSetup-List ProtocolIE-ID ::= 74
id-SRBs-ToBeSetupMod-Item ProtocolIE-ID ::= 75
id-SRBs-ToBeSetupMod-List ProtocolIE-ID ::= 76
id-TimeToWait ProtocolIE-ID ::= 77
id-TransactionID ProtocolIE-ID ::= 78
id-TransmissionStopIndicator ProtocolIE-ID ::= 79
id-UE-associatedLogicalF1-ConnectionItem ProtocolIE-ID ::= 80
id-UE-associatedLogicalF1-ConnectionListResAck ProtocolIE-ID ::= 81
id-gNB-CU-Name ProtocolIE-ID ::= 82
id-SCell-FailedtoSetup-List ProtocolIE-ID ::= 83
id-SCell-FailedtoSetup-Item ProtocolIE-ID ::= 84
id-SCell-FailedtoSetupMod-List ProtocolIE-ID ::= 85
id-SCell-FailedtoSetupMod-Item ProtocolIE-ID ::= 86
id-RRCRconfigurationCompleteIndicator ProtocolIE-ID ::= 87
id-Active-Cells-Item ProtocolIE-ID ::= 88
id-Active-Cells-List ProtocolIE-ID ::= 89
id-Candidate-SpCell-List ProtocolIE-ID ::= 90
id-Candidate-SpCell-Item ProtocolIE-ID ::= 91
id-Potential-SpCell-List ProtocolIE-ID ::= 92
id-Potential-SpCell-Item ProtocolIE-ID ::= 93
END
@@ -0,0 +1,184 @@
-- **************************************************************
--
-- Container definitions
--
-- **************************************************************
F1AP-Containers {
itu-t (0) identified-organization (4) etsi (0) mobileDomain (0)
ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-Containers (5) }
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
-- **************************************************************
--
-- IE parameter types from other modules.
--
-- **************************************************************
IMPORTS
Criticality,
Presence,
PrivateIE-ID,
ProtocolExtensionID,
ProtocolIE-ID
FROM F1AP-CommonDataTypes
maxPrivateIEs,
maxProtocolExtensions,
maxProtocolIEs
FROM F1AP-Constants;
-- **************************************************************
--
-- Class Definition for Protocol IEs
--
-- **************************************************************
F1AP-PROTOCOL-IES ::= CLASS {
&id ProtocolIE-ID UNIQUE,
&criticality Criticality,
&Value,
&presence Presence
}
WITH SYNTAX {
ID &id
CRITICALITY &criticality
TYPE &Value
PRESENCE &presence
}
-- **************************************************************
--
-- Class Definition for Protocol IEs
--
-- **************************************************************
F1AP-PROTOCOL-IES-PAIR ::= CLASS {
&id ProtocolIE-ID UNIQUE,
&firstCriticality Criticality,
&FirstValue,
&secondCriticality Criticality,
&SecondValue,
&presence Presence
}
WITH SYNTAX {
ID &id
FIRST CRITICALITY &firstCriticality
FIRST TYPE &FirstValue
SECOND CRITICALITY &secondCriticality
SECOND TYPE &SecondValue
PRESENCE &presence
}
-- **************************************************************
--
-- Class Definition for Protocol Extensions
--
-- **************************************************************
F1AP-PROTOCOL-EXTENSION ::= CLASS {
&id ProtocolExtensionID UNIQUE,
&criticality Criticality,
&Extension,
&presence Presence
}
WITH SYNTAX {
ID &id
CRITICALITY &criticality
EXTENSION &Extension
PRESENCE &presence
}
-- **************************************************************
--
-- Class Definition for Private IEs
--
-- **************************************************************
F1AP-PRIVATE-IES ::= CLASS {
&id PrivateIE-ID,
&criticality Criticality,
&Value,
&presence Presence
}
WITH SYNTAX {
ID &id
CRITICALITY &criticality
TYPE &Value
PRESENCE &presence
}
-- **************************************************************
--
-- Container for Protocol IEs
--
-- **************************************************************
ProtocolIE-Container {F1AP-PROTOCOL-IES : IEsSetParam} ::=
SEQUENCE (SIZE (0..maxProtocolIEs)) OF
ProtocolIE-Field {{IEsSetParam}}
ProtocolIE-SingleContainer {F1AP-PROTOCOL-IES : IEsSetParam} ::=
ProtocolIE-Field {{IEsSetParam}}
ProtocolIE-Field {F1AP-PROTOCOL-IES : IEsSetParam} ::= SEQUENCE {
id F1AP-PROTOCOL-IES.&id ({IEsSetParam}),
criticality F1AP-PROTOCOL-IES.&criticality ({IEsSetParam}{@id}),
value F1AP-PROTOCOL-IES.&Value ({IEsSetParam}{@id})
}
-- **************************************************************
--
-- Container for Protocol IE Pairs
--
-- **************************************************************
ProtocolIE-ContainerPair {F1AP-PROTOCOL-IES-PAIR : IEsSetParam} ::=
SEQUENCE (SIZE (0..maxProtocolIEs)) OF
ProtocolIE-FieldPair {{IEsSetParam}}
ProtocolIE-FieldPair {F1AP-PROTOCOL-IES-PAIR : IEsSetParam} ::= SEQUENCE {
id F1AP-PROTOCOL-IES-PAIR.&id ({IEsSetParam}),
firstCriticality F1AP-PROTOCOL-IES-PAIR.&firstCriticality ({IEsSetParam}{@id}),
firstValue F1AP-PROTOCOL-IES-PAIR.&FirstValue ({IEsSetParam}{@id}),
secondCriticality F1AP-PROTOCOL-IES-PAIR.&secondCriticality ({IEsSetParam}{@id}),
secondValue F1AP-PROTOCOL-IES-PAIR.&SecondValue ({IEsSetParam}{@id})
}
-- **************************************************************
--
-- Container for Protocol Extensions
--
-- **************************************************************
ProtocolExtensionContainer {F1AP-PROTOCOL-EXTENSION : ExtensionSetParam} ::=
SEQUENCE (SIZE (1..maxProtocolExtensions)) OF
ProtocolExtensionField {{ExtensionSetParam}}
ProtocolExtensionField {F1AP-PROTOCOL-EXTENSION : ExtensionSetParam} ::= SEQUENCE {
id F1AP-PROTOCOL-EXTENSION.&id ({ExtensionSetParam}),
criticality F1AP-PROTOCOL-EXTENSION.&criticality ({ExtensionSetParam}{@id}),
extensionValue F1AP-PROTOCOL-EXTENSION.&Extension ({ExtensionSetParam}{@id})
}
-- **************************************************************
--
-- Container for Private IEs
--
-- **************************************************************
PrivateIE-Container {F1AP-PRIVATE-IES : IEsSetParam } ::=
SEQUENCE (SIZE (1.. maxPrivateIEs)) OF
PrivateIE-Field {{IEsSetParam}}
PrivateIE-Field {F1AP-PRIVATE-IES : IEsSetParam} ::= SEQUENCE {
id F1AP-PRIVATE-IES.&id ({IEsSetParam}),
criticality F1AP-PRIVATE-IES.&criticality ({IEsSetParam}{@id}),
value F1AP-PRIVATE-IES.&Value ({IEsSetParam}{@id})
}
END
@@ -0,0 +1,870 @@
-- **************************************************************
--
-- Information Element Definitions
--
-- **************************************************************
F1AP-IEs {
itu-t (0) identified-organization (4) etsi (0) mobileDomain (0)
ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-IEs (2) }
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
IMPORTS
maxNRARFCN,
maxnoofErrors,
maxnoofBPLMNs,
maxnoofDLTunnels,
maxnoofULTunnels
FROM F1AP-Constants
Criticality,
ProcedureCode,
ProtocolIE-ID,
TriggeringMessage
FROM F1AP-CommonDataTypes
ProtocolExtensionContainer{},
F1AP-PROTOCOL-EXTENSION,
ProtocolIE-SingleContainer{},
F1AP-PROTOCOL-IES
FROM F1AP-Containers;
-- A
Active-Cells-Item ::= SEQUENCE {
nRCGI NRCGI ,
iE-Extensions ProtocolExtensionContainer { { Active-Cells-ItemExtIEs } } OPTIONAL,
...
}
Active-Cells-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
AllocationAndRetentionPriority ::= SEQUENCE {
priorityLevel PriorityLevel,
pre-emptionCapability Pre-emptionCapability,
pre-emptionVulnerability Pre-emptionVulnerability,
iE-Extensions ProtocolExtensionContainer { {AllocationAndRetentionPriority-ExtIEs} } OPTIONAL,
...
}
AllocationAndRetentionPriority-ExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
-- B
BitRate ::= INTEGER (0..4000000000000,...)
BroadcastPLMNs-Item ::= SEQUENCE (SIZE(1..maxnoofBPLMNs)) OF PLMN-Identity
-- C
Candidate-SpCell-Item ::= SEQUENCE {
candidate-SpCell-ID NRCGI ,
iE-Extensions ProtocolExtensionContainer { { Candidate-SpCell-ItemExtIEs } } OPTIONAL,
...
}
Candidate-SpCell-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
Cause ::= CHOICE {
radioNetwork CauseRadioNetwork,
transport CauseTransport,
protocol CauseProtocol,
misc CauseMisc,
...
}
CauseMisc ::= ENUMERATED {
control-processing-overload,
not-enough-user-plane-processing-resources,
hardware-failure,
om-intervention,
unspecified,
...
}
CauseProtocol ::= ENUMERATED {
transfer-syntax-error,
abstract-syntax-error-reject,
abstract-syntax-error-ignore-and-notify,
message-not-compatible-with-receiver-state,
semantic-error,
abstract-syntax-error-falsely-constructed-message,
unspecified,
...
}
CauseRadioNetwork ::= ENUMERATED {
unspecified,
rlc-failure,
unknown-or-already-allocated-gnb-cu-ue-f1ap-id,
unknown-or-already-allocated-gnd-du-ue-f1ap-id,
unknown-or-inconsistent-pair-of-ue-f1ap-id,
interaction-with-other-procedure,
not-supported-qci-Value,
action-desirable-for-radio-reasons,
no-radio-resources-available,
procedure-cancelled,
normal-release,
...
}
CauseTransport ::= ENUMERATED {
unspecified,
transport-resource-unavailable,
...
}
CellGroupConfig ::= OCTET STRING
Cells-Failed-to-be-Activated-List-Item ::= SEQUENCE {
nRCGI NRCGI,
cause Cause,
iE-Extensions ProtocolExtensionContainer { { Cells-Failed-to-be-Activated-List-ItemExtIEs } } OPTIONAL,
...
}
Cells-Failed-to-be-Activated-List-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
Cells-to-be-Activated-List-Item ::= SEQUENCE {
nRCGI NRCGI,
nRPCI NRPCI OPTIONAL,
iE-Extensions ProtocolExtensionContainer { { Cells-to-be-Activated-List-ItemExtIEs} } OPTIONAL,
...
}
Cells-to-be-Activated-List-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
Cells-to-be-Deactivated-List-Item ::= SEQUENCE {
nRCGI NRCGI ,
iE-Extensions ProtocolExtensionContainer { { Cells-to-be-Deactivated-List-ItemExtIEs } } OPTIONAL,
...
}
Cells-to-be-Deactivated-List-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
CriticalityDiagnostics ::= SEQUENCE {
procedureCode ProcedureCode OPTIONAL,
triggeringMessage TriggeringMessage OPTIONAL,
procedureCriticality Criticality OPTIONAL,
transactionID TransactionID OPTIONAL,
iEsCriticalityDiagnostics CriticalityDiagnostics-IE-List OPTIONAL,
iE-Extensions ProtocolExtensionContainer {{CriticalityDiagnostics-ExtIEs}} OPTIONAL,
...
}
CriticalityDiagnostics-ExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
CriticalityDiagnostics-IE-List ::= SEQUENCE (SIZE (1.. maxnoofErrors)) OF CriticalityDiagnostics-IE-Item
CriticalityDiagnostics-IE-Item ::= SEQUENCE {
iECriticality Criticality,
iE-ID ProtocolIE-ID,
typeOfError TypeOfError,
iE-Extensions ProtocolExtensionContainer {{CriticalityDiagnostics-IE-Item-ExtIEs}} OPTIONAL,
...
}
CriticalityDiagnostics-IE-Item-ExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
CUtoDURRCInformation ::= SEQUENCE {
cG-ConfigInfo CG-ConfigInfo OPTIONAL,
uE-CapabilityRAT-ContainerList UE-CapabilityRAT-ContainerList OPTIONAL,
iE-Extensions ProtocolExtensionContainer { { CUtoDURRCInformation-ExtIEs} } OPTIONAL,
...
}
CUtoDURRCInformation-ExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
-- D
DLTunnels-ToBeSetup-List ::= SEQUENCE (SIZE(1..maxnoofDLTunnels)) OF DLTunnels-ToBeSetup-Item
DLTunnels-ToBeSetup-Item ::= SEQUENCE {
dL-GTP-Tunnel-EndPoint GTPTunnelEndpoint ,
iE-Extensions ProtocolExtensionContainer { { DLTunnels-ToBeSetup-ItemExtIEs } } OPTIONAL,
...
}
DLTunnels-ToBeSetup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
DRBID ::= INTEGER (1..32, ...)
DRBs-FailedToBeModified-Item ::= SEQUENCE {
dRBID DRBID ,
cause Cause OPTIONAL,
iE-Extensions ProtocolExtensionContainer { { DRBs-FailedToBeModified-ItemExtIEs } } OPTIONAL,
...
}
DRBs-FailedToBeModified-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
DRBs-FailedToBeModifiedConf-Item ::= SEQUENCE {
dRBID DRBID ,
cause Cause OPTIONAL,
iE-Extensions ProtocolExtensionContainer { { DRBs-FailedToBeModifiedConf-ItemExtIEs } } OPTIONAL,
...
}
DRBs-FailedToBeModifiedConf-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
DRBs-FailedToBeSetup-Item ::= SEQUENCE {
dRBID DRBID,
cause Cause OPTIONAL,
iE-Extensions ProtocolExtensionContainer { { DRBs-FailedToBeSetup-ItemExtIEs } } OPTIONAL,
...
}
DRBs-FailedToBeSetup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
DRBs-FailedToBeSetupMod-Item ::= SEQUENCE {
dRBID DRBID ,
cause Cause OPTIONAL ,
iE-Extensions ProtocolExtensionContainer { { DRBs-FailedToBeSetupMod-ItemExtIEs } } OPTIONAL,
...
}
DRBs-FailedToBeSetupMod-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
DRBs-Modified-Item ::= SEQUENCE {
dRBID DRBID,
dLTunnels-ToBeSetup-List DLTunnels-ToBeSetup-List,
iE-Extensions ProtocolExtensionContainer { { DRBs-Modified-ItemExtIEs } } OPTIONAL,
...
}
DRBs-Modified-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
DRBs-ModifiedConf-Item ::= SEQUENCE {
dRBID DRBID,
uLTunnels-ToBeSetup-List ULTunnels-ToBeSetup-List ,
iE-Extensions ProtocolExtensionContainer { { DRBs-ModifiedConf-ItemExtIEs } } OPTIONAL,
...
}
DRBs-ModifiedConf-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
DRBs-Required-ToBeModified-Item ::= SEQUENCE {
dRBID DRBID,
dLTunnels-ToBeSetup-List DLTunnels-ToBeSetup-List ,
iE-Extensions ProtocolExtensionContainer { { DRBs-Required-ToBeModified-ItemExtIEs } } OPTIONAL,
...
}
DRBs-Required-ToBeModified-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
DRBs-Required-ToBeReleased-Item ::= SEQUENCE {
dRBID DRBID,
iE-Extensions ProtocolExtensionContainer { { DRBs-Required-ToBeReleased-ItemExtIEs } } OPTIONAL,
...
}
DRBs-Required-ToBeReleased-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
DRBs-Setup-Item ::= SEQUENCE {
dRBID DRBID,
dLTunnels-ToBeSetup-List DLTunnels-ToBeSetup-List ,
iE-Extensions ProtocolExtensionContainer { { DRBs-Setup-ItemExtIEs } } OPTIONAL,
...
}
DRBs-Setup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
DRBs-SetupMod-Item ::= SEQUENCE {
dRBID DRBID,
dLTunnels-ToBeSetup-List DLTunnels-ToBeSetup-List ,
iE-Extensions ProtocolExtensionContainer { { DRBs-SetupMod-ItemExtIEs } } OPTIONAL,
...
}
DRBs-SetupMod-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
DRBs-ToBeModified-Item ::= SEQUENCE {
dRBID DRBID,
eUTRANQoS EUTRANQoS OPTIONAL,
uLTunnels-ToBeSetup-List ULTunnels-ToBeSetup-List ,
uLConfiguration ULConfiguration OPTIONAL,
iE-Extensions ProtocolExtensionContainer { { DRBs-ToBeModified-ItemExtIEs } } OPTIONAL,
...
}
DRBs-ToBeModified-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
DRBs-ToBeReleased-Item ::= SEQUENCE {
dRBID DRBID,
iE-Extensions ProtocolExtensionContainer { { DRBs-ToBeReleased-ItemExtIEs } } OPTIONAL,
...
}
DRBs-ToBeReleased-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
DRBs-ToBeSetup-Item ::= SEQUENCE {
dRBID DRBID,
eUTRANQoS EUTRANQoS OPTIONAL,
uLTunnels-ToBeSetup-List ULTunnels-ToBeSetup-List ,
rLCMode RLCMode,
uLConfiguration ULConfiguration OPTIONAL,
iE-Extensions ProtocolExtensionContainer { { DRBs-ToBeSetup-ItemExtIEs } } OPTIONAL,
...
}
DRBs-ToBeSetup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
DRBs-ToBeSetupMod-Item ::= SEQUENCE {
dRBID DRBID,
eUTRANQoS EUTRANQoS OPTIONAL,
rLCMode RLCMode,
uLConfiguration ULConfiguration OPTIONAL,
uLTunnels-ToBeSetup-List ULTunnels-ToBeSetup-List,
iE-Extensions ProtocolExtensionContainer { { DRBs-ToBeSetupMod-ItemExtIEs } } OPTIONAL,
...
}
DRBs-ToBeSetupMod-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
DRXCycle ::= SEQUENCE {
longDRXCycleLength LongDRXCycleLength,
shortDRXCycleLength ShortDRXCycleLength OPTIONAL,
shortDRXCycleTimer ShortDRXCycleTimer OPTIONAL,
iE-Extensions ProtocolExtensionContainer { { DRXCycle-ExtIEs} } OPTIONAL,
...
}
DRXCycle-ExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
DUtoCURRCInformation ::= SEQUENCE {
cellGroupConfig CellGroupConfig,
gapOffset GapOffset OPTIONAL,
iE-Extensions ProtocolExtensionContainer { { DUtoCURRCInformation-ExtIEs} } OPTIONAL,
...
}
DUtoCURRCInformation-ExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
-- E
EUTRANQoS ::= SEQUENCE {
qCI QCI,
allocationAndRetentionPriority AllocationAndRetentionPriority,
gbrQosInformation GBR-QosInformation OPTIONAL,
iE-Extensions ProtocolExtensionContainer { { EUTRANQoS-ExtIEs} } OPTIONAL,
...
}
EUTRANQoS-ExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
Extended-TAC ::= OCTET STRING (SIZE(3))
-- F
FDD-Info ::= SEQUENCE {
uL-NRARFCN NRARFCN,
dL-NRARFCN NRARFCN,
uL-Transmission-Bandwidth Transmission-Bandwidth,
dL-Transmission-Bandwidth Transmission-Bandwidth,
iE-Extensions ProtocolExtensionContainer { {FDD-Info-ExtIEs} } OPTIONAL,
...
}
FDD-Info-ExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
-- G
GapOffset ::= OCTET STRING
GBR-QosInformation ::= SEQUENCE {
e-RAB-MaximumBitrateDL BitRate,
e-RAB-MaximumBitrateUL BitRate,
e-RAB-GuaranteedBitrateDL BitRate,
e-RAB-GuaranteedBitrateUL BitRate,
iE-Extensions ProtocolExtensionContainer { { GBR-QosInformation-ExtIEs} } OPTIONAL,
...
}
GBR-QosInformation-ExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
GNB-CU-UE-F1AP-ID ::= INTEGER (0..4294967295)
GNB-DU-UE-F1AP-ID ::= INTEGER (0..4294967295)
GNB-DU-ID ::= INTEGER (0..68719476735)
GNB-CU-Name ::= PrintableString(SIZE(1..150,...))
GNB-DU-Name ::= PrintableString(SIZE(1..150,...))
GNB-DU-Served-Cells-Item ::= SEQUENCE {
served-Cell-Information Served-Cell-Information,
gNB-DU-System-Information GNB-DU-System-Information OPTIONAL,
iE-Extensions ProtocolExtensionContainer { { GNB-DU-Served-Cells-ItemExtIEs} } OPTIONAL,
...
}
GNB-DU-Served-Cells-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
GNB-DU-System-Information ::= SEQUENCE {
mIB-message MIB-message,
sIB1-message SIB1-message,
iE-Extensions ProtocolExtensionContainer { { GNB-DU-System-Information-ExtIEs } } OPTIONAL,
...
}
GNB-DU-System-Information-ExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
GTP-TEID ::= OCTET STRING (SIZE (4))
GTPTunnelEndpoint ::= SEQUENCE {
transportLayerAddress TransportLayerAddress,
gTP-TEID GTP-TEID,
iE-Extensions ProtocolExtensionContainer { { GTPTunnelEndpoint-ExtIEs} } OPTIONAL,
...
}
GTPTunnelEndpoint-ExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
-- H
-- I
-- J
-- K
-- L
LongDRXCycleLength ::= ENUMERATED
{ms10, ms20, ms32, ms40, ms60, ms64, ms70, ms80, ms128, ms160, ms256, ms320, ms512, ms640, ms1024, ms1280, ms2048, ms2560, ms5120, ms10240, ...}
-- M
MIB-message ::= OCTET STRING
-- N
NRARFCN ::= INTEGER (0..maxNRARFCN)
NRCGI ::= SEQUENCE {
pLMN-Identity PLMN-Identity,
nRCellIdentity NRCellIdentity,
iE-Extensions ProtocolExtensionContainer { {NRCGI-ExtIEs} } OPTIONAL,
...
}
NRCGI-ExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
NR-Mode-Info ::= CHOICE {
fDD FDD-Info,
tDD TDD-Info,
...
}
NRCellIdentity ::= BIT STRING (SIZE(36))
NRNRB ::= ENUMERATED { nrb11, nrb18, nrb24, nrb25, nrb31, nrb32, nrb38, nrb51, nrb52, nrb65, nrb66, nrb78, nrb79, nrb93, nrb106, nrb107, nrb121, nrb132, nrb133, nrb135, nrb160, nrb162, nrb189, nrb216, nrb217, nrb245, nrb264, nrb270, nrb273, ...}
NRPCI ::= INTEGER(0..1007)
NRSCS ::= ENUMERATED { scs15, scs30, scs60, scs120, ...}
-- O
-- P
PLMN-Identity ::= OCTET STRING (SIZE(3))
Pre-emptionCapability ::= ENUMERATED {
shall-not-trigger-pre-emption,
may-trigger-pre-emption
}
Pre-emptionVulnerability ::= ENUMERATED {
not-pre-emptable,
pre-emptable
}
PriorityLevel ::= INTEGER { spare (0), highest (1), lowest (14), no-priority (15) } (0..15)
Potential-SpCell-Item ::= SEQUENCE {
potential-SpCell-ID NRCGI ,
iE-Extensions ProtocolExtensionContainer { { Potential-SpCell-ItemExtIEs } } OPTIONAL,
...
}
Potential-SpCell-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
-- Q
QCI ::= INTEGER (0..255)
-- R
ResourceCoordinationTransferContainer ::= OCTET STRING
RLCMode ::= ENUMERATED {
rlc-am,
rlc-um
}
RRCContainer ::= OCTET STRING
RRCRconfigurationCompleteIndicator ::= ENUMERATED {true, ...}
-- S
SCell-FailedtoSetup-Item ::= SEQUENCE {
sCell-ID NRCGI ,
cause Cause OPTIONAL ,
iE-Extensions ProtocolExtensionContainer { { SCell-FailedtoSetup-ItemExtIEs } } OPTIONAL,
...
}
SCell-FailedtoSetup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
SCell-FailedtoSetupMod-Item ::= SEQUENCE {
sCell-ID NRCGI ,
cause Cause OPTIONAL ,
iE-Extensions ProtocolExtensionContainer { { SCell-FailedtoSetupMod-ItemExtIEs } } OPTIONAL,
...
}
SCell-FailedtoSetupMod-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
SCell-ToBeRemoved-Item ::= SEQUENCE {
sCell-ID NRCGI ,
iE-Extensions ProtocolExtensionContainer { { SCell-ToBeRemoved-ItemExtIEs } } OPTIONAL,
...
}
SCell-ToBeRemoved-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
SCell-ToBeSetup-Item ::= SEQUENCE {
sCell-ID NRCGI ,
sCellIndex SCellIndex,
iE-Extensions ProtocolExtensionContainer { { SCell-ToBeSetup-ItemExtIEs } } OPTIONAL,
...
}
SCell-ToBeSetup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
SCell-ToBeSetupMod-Item ::= SEQUENCE {
sCell-ID NRCGI ,
sCellIndex SCellIndex,
iE-Extensions ProtocolExtensionContainer { { SCell-ToBeSetupMod-ItemExtIEs } } OPTIONAL,
...
}
SCell-ToBeSetupMod-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
SCellIndex ::=INTEGER (0..31, ...)
CG-ConfigInfo ::= OCTET STRING
Served-Cell-Information ::= SEQUENCE {
nRCGI NRCGI,
nRPCI NRPCI,
extended-TAC Extended-TAC,
broadcastPLMNs BroadcastPLMNs-Item,
nR-Mode-Info NR-Mode-Info,
sUL-Information SUL-Information OPTIONAL,
measurementTimingConfiguration OCTET STRING,
iE-Extensions ProtocolExtensionContainer { {Served-Cell-Information-ExtIEs} } OPTIONAL,
...
}
Served-Cell-Information-ExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
Served-Cells-To-Add-Item ::= SEQUENCE {
served-Cell-Information Served-Cell-Information,
gNB-DU-System-Information GNB-DU-System-Information OPTIONAL,
iE-Extensions ProtocolExtensionContainer { { Served-Cells-To-Add-ItemExtIEs} } OPTIONAL,
...
}
Served-Cells-To-Add-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
Served-Cells-To-Delete-Item ::= SEQUENCE {
oldNRCGI NRCGI ,
iE-Extensions ProtocolExtensionContainer { { Served-Cells-To-Delete-ItemExtIEs } } OPTIONAL,
...
}
Served-Cells-To-Delete-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
Served-Cells-To-Modify-Item ::= SEQUENCE {
oldNRCGI NRCGI ,
served-Cell-Information Served-Cell-Information ,
gNB-DU-System-Information GNB-DU-System-Information OPTIONAL ,
iE-Extensions ProtocolExtensionContainer { { Served-Cells-To-Modify-ItemExtIEs } } OPTIONAL,
...
}
Served-Cells-To-Modify-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
ShortDRXCycleLength ::= ENUMERATED {ms2, ms3, ms4, ms5, ms6, ms7, ms8, ms10, ms14, ms16, ms20, ms30, ms32, ms35, ms40, ms64, ms80, ms128, ms160, ms256, ms320, ms512, ms640, ...}
ShortDRXCycleTimer ::= INTEGER (1..16)
SIB1-message ::= OCTET STRING
SRBID ::= INTEGER (1..3, ...)
SRBs-FailedToBeSetup-Item ::= SEQUENCE {
sRBID SRBID ,
cause Cause OPTIONAL,
iE-Extensions ProtocolExtensionContainer { { SRBs-FailedToBeSetup-ItemExtIEs } } OPTIONAL,
...
}
SRBs-FailedToBeSetup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
SRBs-FailedToBeSetupMod-Item ::= SEQUENCE {
sRBID SRBID ,
cause Cause OPTIONAL,
iE-Extensions ProtocolExtensionContainer { { SRBs-FailedToBeSetupMod-ItemExtIEs } } OPTIONAL,
...
}
SRBs-FailedToBeSetupMod-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
SRBs-Required-ToBeReleased-Item ::= SEQUENCE {
sRBID SRBID,
iE-Extensions ProtocolExtensionContainer { { SRBs-Required-ToBeReleased-ItemExtIEs } } OPTIONAL,
...
}
SRBs-Required-ToBeReleased-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
SRBs-ToBeReleased-Item ::= SEQUENCE {
sRBID SRBID,
iE-Extensions ProtocolExtensionContainer { { SRBs-ToBeReleased-ItemExtIEs } } OPTIONAL,
...
}
SRBs-ToBeReleased-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
SRBs-ToBeSetup-Item ::= SEQUENCE {
sRBID SRBID ,
iE-Extensions ProtocolExtensionContainer { { SRBs-ToBeSetup-ItemExtIEs } } OPTIONAL,
...
}
SRBs-ToBeSetup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
SRBs-ToBeSetupMod-Item ::= SEQUENCE {
sRBID SRBID,
iE-Extensions ProtocolExtensionContainer { { SRBs-ToBeSetupMod-ItemExtIEs } } OPTIONAL,
...
}
SRBs-ToBeSetupMod-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
SUL-Information ::= SEQUENCE {
sUL-NRARFCN NRARFCN,
sUL-transmission-Bandwidth Transmission-Bandwidth,
iE-Extensions ProtocolExtensionContainer { { SUL-InformationExtIEs} } OPTIONAL,
...
}
SUL-InformationExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
-- T
TDD-Info ::= SEQUENCE {
nRARFCN NRARFCN,
transmission-Bandwidth Transmission-Bandwidth,
iE-Extensions ProtocolExtensionContainer { {TDD-Info-ExtIEs} } OPTIONAL,
...
}
TDD-Info-ExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
TimeToWait ::= ENUMERATED {v1s, v2s, v5s, v10s, v20s, v60s, ...}
TransportLayerAddress ::= BIT STRING (SIZE(1..160, ...))
TransactionID ::= INTEGER (0..255, ...)
Transmission-Bandwidth ::= SEQUENCE {
nRSCS NRSCS,
nRNRB NRNRB,
iE-Extensions ProtocolExtensionContainer { { Transmission-Bandwidth-ExtIEs} } OPTIONAL,
...
}
Transmission-Bandwidth-ExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
TransmissionStopIndicator ::= ENUMERATED {true, ...}
TypeOfError ::= ENUMERATED {
not-understood,
missing,
...
}
-- U
UE-associatedLogicalF1-ConnectionItem ::= SEQUENCE {
gNB-CU-UE-F1AP-ID GNB-CU-UE-F1AP-ID OPTIONAL,
gNB-DU-UE-F1AP-ID GNB-DU-UE-F1AP-ID OPTIONAL,
iE-Extensions ProtocolExtensionContainer { { UE-associatedLogicalF1-ConnectionItemExtIEs} } OPTIONAL,
...
}
UE-associatedLogicalF1-ConnectionItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
UE-CapabilityRAT-ContainerList::= OCTET STRING
ULConfiguration ::= SEQUENCE {
uLUEConfiguration ULUEConfiguration,
iE-Extensions ProtocolExtensionContainer { { ULConfigurationExtIEs } } OPTIONAL,
...
}
ULConfigurationExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
ULUEConfiguration ::= ENUMERATED {no-data, shared, only, ...}
ULTunnels-ToBeSetup-List ::= SEQUENCE (SIZE(1..maxnoofULTunnels)) OF ULTunnels-ToBeSetup-Item
ULTunnels-ToBeSetup-Item ::=SEQUENCE {
uL-GTP-Tunnel-EndPoint GTPTunnelEndpoint,
iE-Extensions ProtocolExtensionContainer { { ULTunnels-ToBeSetup-ItemExtIEs } } OPTIONAL,
...
}
ULTunnels-ToBeSetup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
...
}
-- V
-- W
-- X
-- Y
-- Z
END
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,258 @@
-- **************************************************************
--
-- Elementary Procedure definitions
--
-- **************************************************************
F1AP-PDU-Descriptions {
itu-t (0) identified-organization (4) etsi (0) mobileDomain (0)
ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-PDU-Descriptions (0)}
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
-- **************************************************************
--
-- IE parameter types from other modules.
--
-- **************************************************************
IMPORTS
Criticality,
ProcedureCode
FROM F1AP-CommonDataTypes
Reset,
ResetAcknowledge,
F1SetupRequest,
F1SetupResponse,
F1SetupFailure,
GNBDUConfigurationUpdate,
GNBDUConfigurationUpdateAcknowledge,
GNBDUConfigurationUpdateFailure,
GNBCUConfigurationUpdate,
GNBCUConfigurationUpdateAcknowledge,
GNBCUConfigurationUpdateFailure,
UEContextSetupRequest,
UEContextSetupResponse,
UEContextSetupFailure,
UEContextReleaseCommand,
UEContextReleaseComplete,
UEContextModificationRequest,
UEContextModificationResponse,
UEContextModificationFailure,
UEContextModificationRequired,
UEContextModificationConfirm,
ErrorIndication,
UEContextReleaseRequest,
DLRRCMessageTransfer,
ULRRCMessageTransfer,
PrivateMessage
FROM F1AP-PDU-Contents
id-Reset,
id-F1Setup,
id-gNBDUConfigurationUpdate,
id-gNBCUConfigurationUpdate,
id-UEContextSetup,
id-UEContextRelease,
id-UEContextModification,
id-UEContextModificationRequired,
id-ErrorIndication,
id-UEContextReleaseRequest,
id-DLRRCMessageTransfer,
id-ULRRCMessageTransfer,
id-privateMessage
FROM F1AP-Constants;
-- **************************************************************
--
-- Interface Elementary Procedure Class
--
-- **************************************************************
F1AP-ELEMENTARY-PROCEDURE ::= CLASS {
&InitiatingMessage ,
&SuccessfulOutcome OPTIONAL,
&UnsuccessfulOutcome OPTIONAL,
&procedureCode ProcedureCode UNIQUE,
&criticality Criticality DEFAULT ignore
}
WITH SYNTAX {
INITIATING MESSAGE &InitiatingMessage
[SUCCESSFUL OUTCOME &SuccessfulOutcome]
[UNSUCCESSFUL OUTCOME &UnsuccessfulOutcome]
PROCEDURE CODE &procedureCode
[CRITICALITY &criticality]
}
-- **************************************************************
--
-- Interface PDU Definition
--
-- **************************************************************
F1AP-PDU ::= CHOICE {
initiatingMessage InitiatingMessage,
successfulOutcome SuccessfulOutcome,
unsuccessfulOutcome UnsuccessfulOutcome,
...
}
InitiatingMessage ::= SEQUENCE {
procedureCode F1AP-ELEMENTARY-PROCEDURE.&procedureCode ({F1AP-ELEMENTARY-PROCEDURES}),
criticality F1AP-ELEMENTARY-PROCEDURE.&criticality ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode}),
value F1AP-ELEMENTARY-PROCEDURE.&InitiatingMessage ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode})
}
SuccessfulOutcome ::= SEQUENCE {
procedureCode F1AP-ELEMENTARY-PROCEDURE.&procedureCode ({F1AP-ELEMENTARY-PROCEDURES}),
criticality F1AP-ELEMENTARY-PROCEDURE.&criticality ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode}),
value F1AP-ELEMENTARY-PROCEDURE.&SuccessfulOutcome ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode})
}
UnsuccessfulOutcome ::= SEQUENCE {
procedureCode F1AP-ELEMENTARY-PROCEDURE.&procedureCode ({F1AP-ELEMENTARY-PROCEDURES}),
criticality F1AP-ELEMENTARY-PROCEDURE.&criticality ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode}),
value F1AP-ELEMENTARY-PROCEDURE.&UnsuccessfulOutcome ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode})
}
-- **************************************************************
--
-- Interface Elementary Procedure List
--
-- **************************************************************
F1AP-ELEMENTARY-PROCEDURES F1AP-ELEMENTARY-PROCEDURE ::= {
F1AP-ELEMENTARY-PROCEDURES-CLASS-1 |
F1AP-ELEMENTARY-PROCEDURES-CLASS-2,
...
}
F1AP-ELEMENTARY-PROCEDURES-CLASS-1 F1AP-ELEMENTARY-PROCEDURE ::= {
reset |
f1Setup |
gNBDUConfigurationUpdate |
gNBCUConfigurationUpdate |
uEContextSetup |
uEContextRelease |
uEContextModification |
uEContextModificationRequired ,
...}
F1AP-ELEMENTARY-PROCEDURES-CLASS-2 F1AP-ELEMENTARY-PROCEDURE ::= {
errorIndication |
uEContextReleaseRequest |
dLRRCMessageTransfer |
uLRRCMessageTransfer |
privateMessage ,
...
}
-- **************************************************************
--
-- Interface Elementary Procedures
--
-- **************************************************************
reset F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE Reset
SUCCESSFUL OUTCOME ResetAcknowledge
PROCEDURE CODE id-Reset
CRITICALITY reject
}
f1Setup F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE F1SetupRequest
SUCCESSFUL OUTCOME F1SetupResponse
UNSUCCESSFUL OUTCOME F1SetupFailure
PROCEDURE CODE id-F1Setup
CRITICALITY reject
}
gNBDUConfigurationUpdate F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE GNBDUConfigurationUpdate
SUCCESSFUL OUTCOME GNBDUConfigurationUpdateAcknowledge
UNSUCCESSFUL OUTCOME GNBDUConfigurationUpdateFailure
PROCEDURE CODE id-gNBDUConfigurationUpdate
CRITICALITY reject
}
gNBCUConfigurationUpdate F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE GNBCUConfigurationUpdate
SUCCESSFUL OUTCOME GNBCUConfigurationUpdateAcknowledge
UNSUCCESSFUL OUTCOME GNBCUConfigurationUpdateFailure
PROCEDURE CODE id-gNBCUConfigurationUpdate
CRITICALITY reject
}
uEContextSetup F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE UEContextSetupRequest
SUCCESSFUL OUTCOME UEContextSetupResponse
UNSUCCESSFUL OUTCOME UEContextSetupFailure
PROCEDURE CODE id-UEContextSetup
CRITICALITY reject
}
uEContextRelease F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE UEContextReleaseCommand
SUCCESSFUL OUTCOME UEContextReleaseComplete
PROCEDURE CODE id-UEContextRelease
CRITICALITY reject
}
uEContextModification F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE UEContextModificationRequest
SUCCESSFUL OUTCOME UEContextModificationResponse
UNSUCCESSFUL OUTCOME UEContextModificationFailure
PROCEDURE CODE id-UEContextModification
CRITICALITY reject
}
uEContextModificationRequired F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE UEContextModificationRequired
SUCCESSFUL OUTCOME UEContextModificationConfirm
PROCEDURE CODE id-UEContextModificationRequired
CRITICALITY reject
}
errorIndication F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE ErrorIndication
PROCEDURE CODE id-ErrorIndication
CRITICALITY ignore
}
uEContextReleaseRequest F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE UEContextReleaseRequest
PROCEDURE CODE id-UEContextReleaseRequest
CRITICALITY ignore
}
dLRRCMessageTransfer F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE DLRRCMessageTransfer
PROCEDURE CODE id-DLRRCMessageTransfer
CRITICALITY ignore
}
uLRRCMessageTransfer F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE ULRRCMessageTransfer
PROCEDURE CODE id-ULRRCMessageTransfer
CRITICALITY ignore
}
privateMessage F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE PrivateMessage
PROCEDURE CODE id-privateMessage
CRITICALITY ignore
}
END
@@ -0,0 +1,3 @@
#ifndef __ASN1_CONSTANTS_H__
#define __ASN1_CONSTANTS_H__
#endif
@@ -0,0 +1,32 @@
-- **************************************************************
--
-- Common definitions
--
-- **************************************************************
F1AP-CommonDataTypes {
itu-t (0) identified-organization (4) etsi (0) mobileDomain (0)
ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-CommonDataTypes (3) }
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
Criticality ::= ENUMERATED { reject, ignore, notify }
Presence ::= ENUMERATED { optional, conditional, mandatory }
PrivateIE-ID ::= CHOICE {
local INTEGER (0..65535),
global OBJECT IDENTIFIER
}
ProcedureCode ::= INTEGER (0..255)
ProtocolExtensionID ::= INTEGER (0..65535)
ProtocolIE-ID ::= INTEGER (0..65535)
TriggeringMessage ::= ENUMERATED { initiating-message, successful-outcome, unsuccessfull-outcome }
END
@@ -0,0 +1,256 @@
-- **************************************************************
--
-- Constant definitions
--
-- **************************************************************
F1AP-Constants {
itu-t (0) identified-organization (4) etsi (0) mobileDomain (0)
ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-Constants (4) }
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
-- **************************************************************
--
-- IE parameter types from other modules.
--
-- **************************************************************
IMPORTS
ProcedureCode,
ProtocolIE-ID
FROM F1AP-CommonDataTypes;
-- **************************************************************
--
-- Elementary Procedures
--
-- **************************************************************
id-Reset ProcedureCode ::= 0
id-F1Setup ProcedureCode ::= 1
id-ErrorIndication ProcedureCode ::= 2
id-gNBDUConfigurationUpdate ProcedureCode ::= 3
id-gNBCUConfigurationUpdate ProcedureCode ::= 4
id-UEContextSetup ProcedureCode ::= 5
id-UEContextRelease ProcedureCode ::= 6
id-UEContextModification ProcedureCode ::= 7
id-UEContextModificationRequired ProcedureCode ::= 8
id-UEMobilityCommand ProcedureCode ::= 9
id-UEContextReleaseRequest ProcedureCode ::= 10
id-InitialULRRCMessageTransfer ProcedureCode ::= 11
id-DLRRCMessageTransfer ProcedureCode ::= 12
id-ULRRCMessageTransfer ProcedureCode ::= 13
id-privateMessage ProcedureCode ::= 14
id-UEInactivityNotification ProcedureCode ::= 15
id-GNBDUResourceCoordination ProcedureCode ::= 16
id-SystemInformationDeliveryCommand ProcedureCode ::= 17
id-Paging ProcedureCode ::= 18
id-Notify ProcedureCode ::= 19
id-WriteReplaceWarning ProcedureCode ::= 20
id-PWSCancel ProcedureCode ::= 21
id-PWSRestartIndication ProcedureCode ::= 22
id-PWSFailureIndication ProcedureCode ::= 23
-- **************************************************************
--
-- Extension constants
--
-- **************************************************************
maxPrivateIEs INTEGER ::= 65535
maxProtocolExtensions INTEGER ::= 65535
maxProtocolIEs INTEGER ::= 65535
-- **************************************************************
--
-- Lists
--
-- **************************************************************
maxNRARFCN INTEGER ::= 3279165
maxnoofErrors INTEGER ::= 256
maxnoofIndividualF1ConnectionsToReset INTEGER ::= 65536
maxCellingNBDU INTEGER ::= 512
maxnoofSCells INTEGER ::= 32
maxnoofSRBs INTEGER ::= 8
maxnoofDRBs INTEGER ::= 64
maxnoofULUPTNLInformation INTEGER ::= 2
maxnoofDLUPTNLInformation INTEGER ::= 2
maxnoofBPLMNs INTEGER ::= 6
maxnoofCandidateSpCells INTEGER ::= 64
maxnoofPotentialSpCells INTEGER ::= 64
maxnoofNrCellBands INTEGER ::= 32
maxnoofSIBTypes INTEGER ::= 16
maxnoofPagingCells INTEGER ::= 512
maxnoofTNLAssociations INTEGER ::= 32
maxnoofQoSFlows INTEGER ::= 64
maxnoofSliceItems INTEGER ::= 1024
maxCellineNB INTEGER ::= 256
-- **************************************************************
--
-- IEs
--
-- **************************************************************
id-Cause ProtocolIE-ID ::= 0
id-Cells-Failed-to-be-Activated-List ProtocolIE-ID ::= 1
id-Cells-Failed-to-be-Activated-List-Item ProtocolIE-ID ::= 2
id-Cells-to-be-Activated-List ProtocolIE-ID ::= 3
id-Cells-to-be-Activated-List-Item ProtocolIE-ID ::= 4
id-Cells-to-be-Deactivated-List ProtocolIE-ID ::= 5
id-Cells-to-be-Deactivated-List-Item ProtocolIE-ID ::= 6
id-CriticalityDiagnostics ProtocolIE-ID ::= 7
id-CUtoDURRCInformation ProtocolIE-ID ::= 9
id-DRBs-FailedToBeModified-Item ProtocolIE-ID ::= 12
id-DRBs-FailedToBeModified-List ProtocolIE-ID ::= 13
id-DRBs-FailedToBeSetup-Item ProtocolIE-ID ::= 14
id-DRBs-FailedToBeSetup-List ProtocolIE-ID ::= 15
id-DRBs-FailedToBeSetupMod-Item ProtocolIE-ID ::= 16
id-DRBs-FailedToBeSetupMod-List ProtocolIE-ID ::= 17
id-DRBs-ModifiedConf-Item ProtocolIE-ID ::= 18
id-DRBs-ModifiedConf-List ProtocolIE-ID ::= 19
id-DRBs-Modified-Item ProtocolIE-ID ::= 20
id-DRBs-Modified-List ProtocolIE-ID ::= 21
id-DRBs-Required-ToBeModified-Item ProtocolIE-ID ::= 22
id-DRBs-Required-ToBeModified-List ProtocolIE-ID ::= 23
id-DRBs-Required-ToBeReleased-Item ProtocolIE-ID ::= 24
id-DRBs-Required-ToBeReleased-List ProtocolIE-ID ::= 25
id-DRBs-Setup-Item ProtocolIE-ID ::= 26
id-DRBs-Setup-List ProtocolIE-ID ::= 27
id-DRBs-SetupMod-Item ProtocolIE-ID ::= 28
id-DRBs-SetupMod-List ProtocolIE-ID ::= 29
id-DRBs-ToBeModified-Item ProtocolIE-ID ::= 30
id-DRBs-ToBeModified-List ProtocolIE-ID ::= 31
id-DRBs-ToBeReleased-Item ProtocolIE-ID ::= 32
id-DRBs-ToBeReleased-List ProtocolIE-ID ::= 33
id-DRBs-ToBeSetup-Item ProtocolIE-ID ::= 34
id-DRBs-ToBeSetup-List ProtocolIE-ID ::= 35
id-DRBs-ToBeSetupMod-Item ProtocolIE-ID ::= 36
id-DRBs-ToBeSetupMod-List ProtocolIE-ID ::= 37
id-DRXCycle ProtocolIE-ID ::= 38
id-DUtoCURRCInformation ProtocolIE-ID ::= 39
id-gNB-CU-UE-F1AP-ID ProtocolIE-ID ::= 40
id-gNB-DU-UE-F1AP-ID ProtocolIE-ID ::= 41
id-gNB-DU-ID ProtocolIE-ID ::= 42
id-GNB-DU-Served-Cells-Item ProtocolIE-ID ::= 43
id-gNB-DU-Served-Cells-List ProtocolIE-ID ::= 44
id-gNB-DU-Name ProtocolIE-ID ::= 45
id-NRCellID ProtocolIE-ID ::= 46
id-oldgNB-DU-UE-F1AP-ID ProtocolIE-ID ::= 47
id-ResetType ProtocolIE-ID ::= 48
id-ResourceCoordinationTransferContainer ProtocolIE-ID ::= 49
id-RRCContainer ProtocolIE-ID ::= 50
id-SCell-ToBeRemoved-Item ProtocolIE-ID ::= 51
id-SCell-ToBeRemoved-List ProtocolIE-ID ::= 52
id-SCell-ToBeSetup-Item ProtocolIE-ID ::= 53
id-SCell-ToBeSetup-List ProtocolIE-ID ::= 54
id-SCell-ToBeSetupMod-Item ProtocolIE-ID ::= 55
id-SCell-ToBeSetupMod-List ProtocolIE-ID ::= 56
id-Served-Cells-To-Add-Item ProtocolIE-ID ::= 57
id-Served-Cells-To-Add-List ProtocolIE-ID ::= 58
id-Served-Cells-To-Delete-Item ProtocolIE-ID ::= 59
id-Served-Cells-To-Delete-List ProtocolIE-ID ::= 60
id-Served-Cells-To-Modify-Item ProtocolIE-ID ::= 61
id-Served-Cells-To-Modify-List ProtocolIE-ID ::= 62
id-SpCell-ID ProtocolIE-ID ::= 63
id-SRBID ProtocolIE-ID ::= 64
id-SRBs-FailedToBeSetup-Item ProtocolIE-ID ::= 65
id-SRBs-FailedToBeSetup-List ProtocolIE-ID ::= 66
id-SRBs-FailedToBeSetupMod-Item ProtocolIE-ID ::= 67
id-SRBs-FailedToBeSetupMod-List ProtocolIE-ID ::= 68
id-SRBs-Required-ToBeReleased-Item ProtocolIE-ID ::= 69
id-SRBs-Required-ToBeReleased-List ProtocolIE-ID ::= 70
id-SRBs-ToBeReleased-Item ProtocolIE-ID ::= 71
id-SRBs-ToBeReleased-List ProtocolIE-ID ::= 72
id-SRBs-ToBeSetup-Item ProtocolIE-ID ::= 73
id-SRBs-ToBeSetup-List ProtocolIE-ID ::= 74
id-SRBs-ToBeSetupMod-Item ProtocolIE-ID ::= 75
id-SRBs-ToBeSetupMod-List ProtocolIE-ID ::= 76
id-TimeToWait ProtocolIE-ID ::= 77
id-TransactionID ProtocolIE-ID ::= 78
id-TransmissionStopIndicator ProtocolIE-ID ::= 79
id-UE-associatedLogicalF1-ConnectionItem ProtocolIE-ID ::= 80
id-UE-associatedLogicalF1-ConnectionListResAck ProtocolIE-ID ::= 81
id-gNB-CU-Name ProtocolIE-ID ::= 82
id-SCell-FailedtoSetup-List ProtocolIE-ID ::= 83
id-SCell-FailedtoSetup-Item ProtocolIE-ID ::= 84
id-SCell-FailedtoSetupMod-List ProtocolIE-ID ::= 85
id-SCell-FailedtoSetupMod-Item ProtocolIE-ID ::= 86
id-RRCRconfigurationCompleteIndicator ProtocolIE-ID ::= 87
id-Active-Cells-Item ProtocolIE-ID ::= 88
id-Active-Cells-List ProtocolIE-ID ::= 89
id-Candidate-SpCell-List ProtocolIE-ID ::= 90
id-Candidate-SpCell-Item ProtocolIE-ID ::= 91
id-Potential-SpCell-List ProtocolIE-ID ::= 92
id-Potential-SpCell-Item ProtocolIE-ID ::= 93
id-FullConfiguration ProtocolIE-ID ::= 94
id-C-RNTI ProtocolIE-ID ::= 95
id-SpCellULConfigured ProtocolIE-ID ::= 96
id-InactivityMonitoringRequest ProtocolIE-ID ::= 97
id-InactivityMonitoringResponse ProtocolIE-ID ::= 98
id-DRB-Activity-Item ProtocolIE-ID ::= 99
id-DRB-Activity-List ProtocolIE-ID ::= 100
id-EUTRA-NR-CellResourceCoordinationReq-Container ProtocolIE-ID ::= 101
id-EUTRA-NR-CellResourceCoordinationReqAck-Container ProtocolIE-ID ::= 102
id-SpectrumSharingGroupID ProtocolIE-ID ::= 103
id-ListofEUTRACellsinGNBDUCoordination ProtocolIE-ID ::= 104
id-Protected-EUTRA-Resources-List ProtocolIE-ID ::= 105
id-RequestType ProtocolIE-ID ::= 106
id-ServCellndex ProtocolIE-ID ::= 107
id-RAT-FrequencyPriorityInformation ProtocolIE-ID ::= 108
id-ExecuteDuplication ProtocolIE-ID ::= 109
id-NRCGI ProtocolIE-ID ::= 111
id-PagingCell-Item ProtocolIE-ID ::= 112
id-PagingCell-List ProtocolIE-ID ::= 113
id-PagingDRX ProtocolIE-ID ::= 114
id-PagingPriority ProtocolIE-ID ::= 115
id-SIBtype-List ProtocolIE-ID ::= 116
id-UEIdentityIndexValue ProtocolIE-ID ::= 117
id-gNB-CUSystemInformation ProtocolIE-ID ::= 118
id-HandoverPreparationInformation ProtocolIE-ID ::= 119
id-GNB-CU-TNL-Association-To-Add-Item ProtocolIE-ID ::= 120
id-GNB-CU-TNL-Association-To-Add-List ProtocolIE-ID ::= 121
id-GNB-CU-TNL-Association-To-Remove-Item ProtocolIE-ID ::= 122
id-GNB-CU-TNL-Association-To-Remove-List ProtocolIE-ID ::= 123
id-GNB-CU-TNL-Association-To-Update-Item ProtocolIE-ID ::= 124
id-GNB-CU-TNL-Association-To-Update-List ProtocolIE-ID ::= 125
id-MaskedIMEISV ProtocolIE-ID ::= 126
id-PagingIdentity ProtocolIE-ID ::= 127
id-DUtoCURRCContainer ProtocolIE-ID ::= 128
id-Cells-to-be-Barred-List ProtocolIE-ID ::= 129
id-Cells-to-be-Barred-Item ProtocolIE-ID ::= 130
id-TAISliceSupportList ProtocolIE-ID ::= 131
id-GNB-CU-TNL-Association-Setup-List ProtocolIE-ID ::= 132
id-GNB-CU-TNL-Association-Setup-Item ProtocolIE-ID ::= 133
id-GNB-CU-TNL-Association-Failed-To-Setup-List ProtocolIE-ID ::= 134
id-GNB-CU-TNL-Association-Failed-To-Setup-Item ProtocolIE-ID ::= 135
id-DRB-Notify-Item ProtocolIE-ID ::= 136
id-DRB-Notify-List ProtocolIE-ID ::= 137
id-NotficationControl ProtocolIE-ID ::= 138
id-RANAC ProtocolIE-ID ::= 139
id-PWSSystemInformation ProtocolIE-ID ::= 140
id-RepetitionPeriod ProtocolIE-ID ::= 141
id-NumberofBroadcastRequest ProtocolIE-ID ::= 142
id-ConcurrentWarningMessageIndicator ProtocolIE-ID ::= 143
id-Cells-To-Be-Broadcast-List ProtocolIE-ID ::= 144
id-Cells-To-Be-Broadcast-Item ProtocolIE-ID ::= 145
id-Cells-Broadcast-Completed-List ProtocolIE-ID ::= 146
id-Cells-Broadcast-Completed-Item ProtocolIE-ID ::= 147
id-Broadcast-To-Be-Cancelled-List ProtocolIE-ID ::= 148
id-Broadcast-To-Be-Cancelled-Item ProtocolIE-ID ::= 149
id-Cells-Broadcast-Cancelled-List ProtocolIE-ID ::= 150
id-Cells-Broadcast-Cancelled-Item ProtocolIE-ID ::= 151
id-NR-CGI-List-For-Restart-List ProtocolIE-ID ::= 152
id-NR-CGI-List-For-Restart-Item ProtocolIE-ID ::= 153
id-PWS-Failed-NR-CGI-List ProtocolIE-ID ::= 154
id-PWS-Failed-NR-CGI-Item ProtocolIE-ID ::= 155
id-ConfirmedUEID ProtocolIE-ID ::= 156
id-Cancel-all-Warning-Messages-Indicator ProtocolIE-ID ::= 157
END
@@ -0,0 +1,184 @@
-- **************************************************************
--
-- Container definitions
--
-- **************************************************************
F1AP-Containers {
itu-t (0) identified-organization (4) etsi (0) mobileDomain (0)
ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-Containers (5) }
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
-- **************************************************************
--
-- IE parameter types from other modules.
--
-- **************************************************************
IMPORTS
Criticality,
Presence,
PrivateIE-ID,
ProtocolExtensionID,
ProtocolIE-ID
FROM F1AP-CommonDataTypes
maxPrivateIEs,
maxProtocolExtensions,
maxProtocolIEs
FROM F1AP-Constants;
-- **************************************************************
--
-- Class Definition for Protocol IEs
--
-- **************************************************************
F1AP-PROTOCOL-IES ::= CLASS {
&id ProtocolIE-ID UNIQUE,
&criticality Criticality,
&Value,
&presence Presence
}
WITH SYNTAX {
ID &id
CRITICALITY &criticality
TYPE &Value
PRESENCE &presence
}
-- **************************************************************
--
-- Class Definition for Protocol IEs
--
-- **************************************************************
F1AP-PROTOCOL-IES-PAIR ::= CLASS {
&id ProtocolIE-ID UNIQUE,
&firstCriticality Criticality,
&FirstValue,
&secondCriticality Criticality,
&SecondValue,
&presence Presence
}
WITH SYNTAX {
ID &id
FIRST CRITICALITY &firstCriticality
FIRST TYPE &FirstValue
SECOND CRITICALITY &secondCriticality
SECOND TYPE &SecondValue
PRESENCE &presence
}
-- **************************************************************
--
-- Class Definition for Protocol Extensions
--
-- **************************************************************
F1AP-PROTOCOL-EXTENSION ::= CLASS {
&id ProtocolExtensionID UNIQUE,
&criticality Criticality,
&Extension,
&presence Presence
}
WITH SYNTAX {
ID &id
CRITICALITY &criticality
EXTENSION &Extension
PRESENCE &presence
}
-- **************************************************************
--
-- Class Definition for Private IEs
--
-- **************************************************************
F1AP-PRIVATE-IES ::= CLASS {
&id PrivateIE-ID,
&criticality Criticality,
&Value,
&presence Presence
}
WITH SYNTAX {
ID &id
CRITICALITY &criticality
TYPE &Value
PRESENCE &presence
}
-- **************************************************************
--
-- Container for Protocol IEs
--
-- **************************************************************
ProtocolIE-Container {F1AP-PROTOCOL-IES : IEsSetParam} ::=
SEQUENCE (SIZE (0..maxProtocolIEs)) OF
ProtocolIE-Field {{IEsSetParam}}
ProtocolIE-SingleContainer {F1AP-PROTOCOL-IES : IEsSetParam} ::=
ProtocolIE-Field {{IEsSetParam}}
ProtocolIE-Field {F1AP-PROTOCOL-IES : IEsSetParam} ::= SEQUENCE {
id F1AP-PROTOCOL-IES.&id ({IEsSetParam}),
criticality F1AP-PROTOCOL-IES.&criticality ({IEsSetParam}{@id}),
value F1AP-PROTOCOL-IES.&Value ({IEsSetParam}{@id})
}
-- **************************************************************
--
-- Container for Protocol IE Pairs
--
-- **************************************************************
ProtocolIE-ContainerPair {F1AP-PROTOCOL-IES-PAIR : IEsSetParam} ::=
SEQUENCE (SIZE (0..maxProtocolIEs)) OF
ProtocolIE-FieldPair {{IEsSetParam}}
ProtocolIE-FieldPair {F1AP-PROTOCOL-IES-PAIR : IEsSetParam} ::= SEQUENCE {
id F1AP-PROTOCOL-IES-PAIR.&id ({IEsSetParam}),
firstCriticality F1AP-PROTOCOL-IES-PAIR.&firstCriticality ({IEsSetParam}{@id}),
firstValue F1AP-PROTOCOL-IES-PAIR.&FirstValue ({IEsSetParam}{@id}),
secondCriticality F1AP-PROTOCOL-IES-PAIR.&secondCriticality ({IEsSetParam}{@id}),
secondValue F1AP-PROTOCOL-IES-PAIR.&SecondValue ({IEsSetParam}{@id})
}
-- **************************************************************
--
-- Container for Protocol Extensions
--
-- **************************************************************
ProtocolExtensionContainer {F1AP-PROTOCOL-EXTENSION : ExtensionSetParam} ::=
SEQUENCE (SIZE (1..maxProtocolExtensions)) OF
ProtocolExtensionField {{ExtensionSetParam}}
ProtocolExtensionField {F1AP-PROTOCOL-EXTENSION : ExtensionSetParam} ::= SEQUENCE {
id F1AP-PROTOCOL-EXTENSION.&id ({ExtensionSetParam}),
criticality F1AP-PROTOCOL-EXTENSION.&criticality ({ExtensionSetParam}{@id}),
extensionValue F1AP-PROTOCOL-EXTENSION.&Extension ({ExtensionSetParam}{@id})
}
-- **************************************************************
--
-- Container for Private IEs
--
-- **************************************************************
PrivateIE-Container {F1AP-PRIVATE-IES : IEsSetParam } ::=
SEQUENCE (SIZE (1.. maxPrivateIEs)) OF
PrivateIE-Field {{IEsSetParam}}
PrivateIE-Field {F1AP-PRIVATE-IES : IEsSetParam} ::= SEQUENCE {
id F1AP-PRIVATE-IES.&id ({IEsSetParam}),
criticality F1AP-PRIVATE-IES.&criticality ({IEsSetParam}{@id}),
value F1AP-PRIVATE-IES.&Value ({IEsSetParam}{@id})
}
END
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,353 @@
-- **************************************************************
--
-- Elementary Procedure definitions
--
-- **************************************************************
F1AP-PDU-Descriptions {
itu-t (0) identified-organization (4) etsi (0) mobileDomain (0)
ngran-access (22) modules (3) f1ap (3) version1 (1) f1ap-PDU-Descriptions (0)}
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
-- **************************************************************
--
-- IE parameter types from other modules.
--
-- **************************************************************
IMPORTS
Criticality,
ProcedureCode
FROM F1AP-CommonDataTypes
Reset,
ResetAcknowledge,
F1SetupRequest,
F1SetupResponse,
F1SetupFailure,
GNBDUConfigurationUpdate,
GNBDUConfigurationUpdateAcknowledge,
GNBDUConfigurationUpdateFailure,
GNBCUConfigurationUpdate,
GNBCUConfigurationUpdateAcknowledge,
GNBCUConfigurationUpdateFailure,
UEContextSetupRequest,
UEContextSetupResponse,
UEContextSetupFailure,
UEContextReleaseCommand,
UEContextReleaseComplete,
UEContextModificationRequest,
UEContextModificationResponse,
UEContextModificationFailure,
UEContextModificationRequired,
UEContextModificationConfirm,
ErrorIndication,
UEContextReleaseRequest,
DLRRCMessageTransfer,
ULRRCMessageTransfer,
GNBDUResourceCoordinationRequest,
GNBDUResourceCoordinationResponse,
PrivateMessage,
UEInactivityNotification,
InitialULRRCMessageTransfer,
SystemInformationDeliveryCommand,
Paging,
Notify,
WriteReplaceWarningRequest,
WriteReplaceWarningResponse,
PWSCancelRequest,
PWSCancelResponse,
PWSRestartIndication,
PWSFailureIndication
FROM F1AP-PDU-Contents
id-Reset,
id-F1Setup,
id-gNBDUConfigurationUpdate,
id-gNBCUConfigurationUpdate,
id-UEContextSetup,
id-UEContextRelease,
id-UEContextModification,
id-UEContextModificationRequired,
id-ErrorIndication,
id-UEContextReleaseRequest,
id-DLRRCMessageTransfer,
id-ULRRCMessageTransfer,
id-GNBDUResourceCoordination,
id-privateMessage,
id-UEInactivityNotification,
id-InitialULRRCMessageTransfer,
id-SystemInformationDeliveryCommand,
id-Paging,
id-Notify,
id-WriteReplaceWarning,
id-PWSCancel,
id-PWSRestartIndication,
id-PWSFailureIndication
FROM F1AP-Constants;
-- **************************************************************
--
-- Interface Elementary Procedure Class
--
-- **************************************************************
F1AP-ELEMENTARY-PROCEDURE ::= CLASS {
&InitiatingMessage ,
&SuccessfulOutcome OPTIONAL,
&UnsuccessfulOutcome OPTIONAL,
&procedureCode ProcedureCode UNIQUE,
&criticality Criticality DEFAULT ignore
}
WITH SYNTAX {
INITIATING MESSAGE &InitiatingMessage
[SUCCESSFUL OUTCOME &SuccessfulOutcome]
[UNSUCCESSFUL OUTCOME &UnsuccessfulOutcome]
PROCEDURE CODE &procedureCode
[CRITICALITY &criticality]
}
-- **************************************************************
--
-- Interface PDU Definition
--
-- **************************************************************
F1AP-PDU ::= CHOICE {
initiatingMessage InitiatingMessage,
successfulOutcome SuccessfulOutcome,
unsuccessfulOutcome UnsuccessfulOutcome,
...
}
InitiatingMessage ::= SEQUENCE {
procedureCode F1AP-ELEMENTARY-PROCEDURE.&procedureCode ({F1AP-ELEMENTARY-PROCEDURES}),
criticality F1AP-ELEMENTARY-PROCEDURE.&criticality ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode}),
value F1AP-ELEMENTARY-PROCEDURE.&InitiatingMessage ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode})
}
SuccessfulOutcome ::= SEQUENCE {
procedureCode F1AP-ELEMENTARY-PROCEDURE.&procedureCode ({F1AP-ELEMENTARY-PROCEDURES}),
criticality F1AP-ELEMENTARY-PROCEDURE.&criticality ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode}),
value F1AP-ELEMENTARY-PROCEDURE.&SuccessfulOutcome ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode})
}
UnsuccessfulOutcome ::= SEQUENCE {
procedureCode F1AP-ELEMENTARY-PROCEDURE.&procedureCode ({F1AP-ELEMENTARY-PROCEDURES}),
criticality F1AP-ELEMENTARY-PROCEDURE.&criticality ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode}),
value F1AP-ELEMENTARY-PROCEDURE.&UnsuccessfulOutcome ({F1AP-ELEMENTARY-PROCEDURES}{@procedureCode})
}
-- **************************************************************
--
-- Interface Elementary Procedure List
--
-- **************************************************************
F1AP-ELEMENTARY-PROCEDURES F1AP-ELEMENTARY-PROCEDURE ::= {
F1AP-ELEMENTARY-PROCEDURES-CLASS-1 |
F1AP-ELEMENTARY-PROCEDURES-CLASS-2,
...
}
F1AP-ELEMENTARY-PROCEDURES-CLASS-1 F1AP-ELEMENTARY-PROCEDURE ::= {
reset |
f1Setup |
gNBDUConfigurationUpdate |
gNBCUConfigurationUpdate |
uEContextSetup |
uEContextRelease |
uEContextModification |
uEContextModificationRequired |
writeReplaceWarning |
pWSCancel |
gNBDUResourceCoordination ,
...}
F1AP-ELEMENTARY-PROCEDURES-CLASS-2 F1AP-ELEMENTARY-PROCEDURE ::= {
errorIndication |
uEContextReleaseRequest |
dLRRCMessageTransfer |
uLRRCMessageTransfer |
uEInactivityNotification |
privateMessage |
initialULRRCMessageTransfer |
systemInformationDelivery |
paging |
notify |
pWSRestartIndication |
pWSFailureIndication ,
...
}
-- **************************************************************
--
-- Interface Elementary Procedures
--
-- **************************************************************
reset F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE Reset
SUCCESSFUL OUTCOME ResetAcknowledge
PROCEDURE CODE id-Reset
CRITICALITY reject
}
f1Setup F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE F1SetupRequest
SUCCESSFUL OUTCOME F1SetupResponse
UNSUCCESSFUL OUTCOME F1SetupFailure
PROCEDURE CODE id-F1Setup
CRITICALITY reject
}
gNBDUConfigurationUpdate F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE GNBDUConfigurationUpdate
SUCCESSFUL OUTCOME GNBDUConfigurationUpdateAcknowledge
UNSUCCESSFUL OUTCOME GNBDUConfigurationUpdateFailure
PROCEDURE CODE id-gNBDUConfigurationUpdate
CRITICALITY reject
}
gNBCUConfigurationUpdate F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE GNBCUConfigurationUpdate
SUCCESSFUL OUTCOME GNBCUConfigurationUpdateAcknowledge
UNSUCCESSFUL OUTCOME GNBCUConfigurationUpdateFailure
PROCEDURE CODE id-gNBCUConfigurationUpdate
CRITICALITY reject
}
uEContextSetup F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE UEContextSetupRequest
SUCCESSFUL OUTCOME UEContextSetupResponse
UNSUCCESSFUL OUTCOME UEContextSetupFailure
PROCEDURE CODE id-UEContextSetup
CRITICALITY reject
}
uEContextRelease F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE UEContextReleaseCommand
SUCCESSFUL OUTCOME UEContextReleaseComplete
PROCEDURE CODE id-UEContextRelease
CRITICALITY reject
}
uEContextModification F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE UEContextModificationRequest
SUCCESSFUL OUTCOME UEContextModificationResponse
UNSUCCESSFUL OUTCOME UEContextModificationFailure
PROCEDURE CODE id-UEContextModification
CRITICALITY reject
}
uEContextModificationRequired F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE UEContextModificationRequired
SUCCESSFUL OUTCOME UEContextModificationConfirm
PROCEDURE CODE id-UEContextModificationRequired
CRITICALITY reject
}
writeReplaceWarning F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE WriteReplaceWarningRequest
SUCCESSFUL OUTCOME WriteReplaceWarningResponse
PROCEDURE CODE id-WriteReplaceWarning
CRITICALITY reject
}
pWSCancel F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE PWSCancelRequest
SUCCESSFUL OUTCOME PWSCancelResponse
PROCEDURE CODE id-PWSCancel
CRITICALITY reject
}
errorIndication F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE ErrorIndication
PROCEDURE CODE id-ErrorIndication
CRITICALITY ignore
}
uEContextReleaseRequest F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE UEContextReleaseRequest
PROCEDURE CODE id-UEContextReleaseRequest
CRITICALITY ignore
}
initialULRRCMessageTransfer F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE InitialULRRCMessageTransfer
PROCEDURE CODE id-InitialULRRCMessageTransfer
CRITICALITY ignore
}
dLRRCMessageTransfer F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE DLRRCMessageTransfer
PROCEDURE CODE id-DLRRCMessageTransfer
CRITICALITY ignore
}
uLRRCMessageTransfer F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE ULRRCMessageTransfer
PROCEDURE CODE id-ULRRCMessageTransfer
CRITICALITY ignore
}
uEInactivityNotification F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE UEInactivityNotification
PROCEDURE CODE id-UEInactivityNotification
CRITICALITY ignore
}
gNBDUResourceCoordination F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE GNBDUResourceCoordinationRequest
SUCCESSFUL OUTCOME GNBDUResourceCoordinationResponse
PROCEDURE CODE id-GNBDUResourceCoordination
CRITICALITY reject
}
privateMessage F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE PrivateMessage
PROCEDURE CODE id-privateMessage
CRITICALITY ignore
}
systemInformationDelivery F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE SystemInformationDeliveryCommand
PROCEDURE CODE id-SystemInformationDeliveryCommand
CRITICALITY ignore
}
paging F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE Paging
PROCEDURE CODE id-Paging
CRITICALITY ignore
}
notify F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE Notify
PROCEDURE CODE id-Notify
CRITICALITY ignore
}
pWSRestartIndication F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE PWSRestartIndication
PROCEDURE CODE id-PWSRestartIndication
CRITICALITY ignore
}
pWSFailureIndication F1AP-ELEMENTARY-PROCEDURE ::= {
INITIATING MESSAGE PWSFailureIndication
PROCEDURE CODE id-PWSFailureIndication
CRITICALITY ignore
}
END
+697
View File
@@ -0,0 +1,697 @@
import re, os, sys, string
import datetime
import getopt
import getpass
version = "1.0.2"
lines = ""
iesDefs = {}
ieofielist = {}
outdir = './'
filenames = []
verbosity = 0
prefix = ""
FAIL = '\033[91m'
WARN = '\033[93m'
ENDC = '\033[0m'
fileprefix = ""
fileprefix_first_upper = ""
def printFail(string):
sys.stderr.write(FAIL + string + ENDC + "\n")
def printWarning(string):
print WARN + string + ENDC
def printDebug(string):
if verbosity > 0:
print string
def outputHeaderToFile(f, filename):
now = datetime.datetime.now()
f.write("""/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
""")
f.write("/*******************************************************************************\n")
f.write(" * This file had been created by asn1tostruct.py script v%s\n" % (version))
f.write(" * Please do not modify this file but regenerate it via script.\n")
f.write(" * Created on: %s by %s\n * from %s\n" % (str(now), getpass.getuser(), filenames))
f.write(" ******************************************************************************/\n")
def lowerFirstCamelWord(word):
""" puts the first word in a CamelCase Word in lowercase.
I.e. CustomerID becomes customerID, XMLInfoTest becomes xmlInfoTest
"""
newstr = ''
swapped = word.swapcase()
idx = 0
# if it's all-caps, return an all-lowered version
lowered = word.lower()
if swapped == lowered:
return lowered
for c in swapped:
if c in string.lowercase:
newstr += c
idx += 1
else:
break
if idx < 2:
newstr += word[idx:]
else:
newstr = newstr[:-1]+ word[idx-1:]
return newstr
def usage():
print "Python parser for asn1 v%s" % (version)
print "Usage: python asn1tostruct.py [options]"
print "Available options:"
print "-d Enable script debug"
print "-f [file] Input file to parse"
print "-o [dir] Output files to given directory"
print "-h Print this help and return"
try:
opts, args = getopt.getopt(sys.argv[1:], "df:ho:", ["debug", "file", "help", "outdir"])
except getopt.GetoptError as err:
# print help information and exit:
usage()
sys.exit(2)
for o, a in opts:
if o in ("-f", "--file"):
filenames.append(a)
if o in ("-d", "--debug"):
verbosity = 1
if o in ("-o", "--outdir"):
outdir = a
if outdir.rfind('/') != len(outdir):
outdir += '/'
if o in ("-h", "--help"):
usage()
sys.exit(2)
for filename in filenames:
file = open(filename, 'r')
for line in file:
# Removing any comment
if line.find('--') >= 0:
line = line[:line.find('--')]
# Removing any carriage return
lines += re.sub('\r', '', line)
for m in re.findall(r'([a-zA-Z0-9-]+)\s*::=\s+SEQUENCE\s+\(\s*SIZE\s*\(\s*\d+\s*\.\.\s*[0-9a-zA-Z-]+\s*\)\s*\)\s*OF\s+[a-zA-Z-]+\s*\{\s*\{\s*([0-9a-zA-Z-]+)\s*\}\s*\}', lines, re.MULTILINE):
ieofielist[m[0]] = m[1]
for m in re.findall(r'([a-zA-Z0-9-]+)\s*::=\s+E-RAB-IE-ContainerList\s*\{\s*\{\s*([a-zA-Z0-9-]+)\s*\}\s*\}', lines, re.MULTILINE):
ieofielist[m[0]] = m[1]
for i in re.findall(r'([a-zA-Z0-9-]+)\s+([A-Z0-9-]+)\s*::=\s*\{\s+([\,\|\{\}\t\n\.{3}\ \-a-zA-Z0-9]+)\s+}\n?', lines, re.MULTILINE):
ies = []
maxLength = 0
# TODO: handle extensions
if i[1].find('EXTENSION') >= 0:
continue
if fileprefix == "":
fileprefix = i[1][:i[1].find('-')].lower()
for j in re.findall(r'\s*\{\s*([a-zA-Z0-9-\ \t]+)\s*\}\s*[\|,]*', i[2], re.MULTILINE):
for k in re.findall(r'ID\s*([a-zA-Z0-9\-]+)\s*CRITICALITY\s*([a-zA-Z0-9\-]+)\s+[A-Z]+\s+([a-zA-Z0-9\-]+)\s*PRESENCE\s*([a-zA-Z0-9\-]+)', j, re.MULTILINE):
printDebug("Got new ie for message " + i[0] + ": " + str(k))
if len(k[2]) > maxLength:
maxLength = len(k[2])
ies.append(k)
if len(ies) > 0:
iesDefs[i[0]] = { "length": maxLength, "ies": ies }
else:
printWarning("Didn't find any information element for message: " + i[0])
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))
f.write("#ifndef %s_IES_DEFS_H_\n#define %s_IES_DEFS_H_\n\n" % (fileprefix.upper(), fileprefix.upper()))
f.write("/* Define the version of script used to generate this file */\n")
f.write("#define %s_SCRIPT_VERSION (%s)\n\n" % (fileprefix.upper(), re.sub('\.', '', version)))
for key in iesDefs:
if key not in ieofielist.values():
continue
for (i, j) in ieofielist.items():
if j == key:
break
f.write("typedef struct %sIEs_s {\n" % (re.sub('-', '_', i)))
f.write(" A_SEQUENCE_OF(struct %s_s) %s;\n" % (re.sub('IEs', '', re.sub('-', '_', ieofielist[i])), lowerFirstCamelWord(re.sub('IEs', '', re.sub('-', '_', ieofielist[i])))))
f.write("} %sIEs_t;\n\n" % (re.sub('-', '_', i)))
for key in iesDefs:
keyupperunderscore = re.sub('-', '_', key.upper())
keylowerunderscore = re.sub('-', '_', key.lower())
shift = 0
if len(iesDefs[key]["ies"]) == 0:
continue
# Presence mask
for ie in iesDefs[key]["ies"]:
ieupperunderscore = re.sub('-', '_', re.sub('id-', '', ie[0])).upper()
if ie[3] == "optional" or ie[3] == "conditional":
f.write("#define {0:<{pad}} {1}\n".format("%s_%s_PRESENT" % (keyupperunderscore, ieupperunderscore), "(1 << %d)" % shift,
pad=iesDefs[key]["length"] + len(keyupperunderscore) + 9))
shift += 1
if (shift > 0):
f.write("\n")
f.write("typedef struct %s_s {\n" % (re.sub('-', '_', key)))
if (shift > 0):
f.write(" {0:<{pad}} {1};\n".format("uint16_t", "presenceMask", pad=iesDefs[key]["length"] + 2))
for ie in iesDefs[key]["ies"]:
ieunderscore = re.sub('-', '_', ie[2])
iename = re.sub('id-', '', ie[0])
ienameunderscore = lowerFirstCamelWord(re.sub('-', '_', iename))
if ie[2] in ieofielist:
f.write(" %sIEs_t %s;" % (re.sub('-', '_', ie[2]), ienameunderscore))
else:
f.write(" {0:<{pad}} {1};".format("%s_t" % ieunderscore, ienameunderscore, pad=iesDefs[key]["length"] + 2))
if ie[3] == "optional":
f.write(" ///< Optional field")
elif ie[3] == "conditional":
f.write(" ///< Conditional field")
f.write("\n")
f.write("} %s_t;\n\n" % (re.sub('-', '_', key)))
f.write("typedef struct %s_message_s {\n" % (fileprefix))
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()
messageList.sort()
for message in messageList:
if message in ieofielist.values():
continue
if len(iesDefs[message]["ies"]) == 0:
continue
f.write(" %s_t %s;\n" % (re.sub('-', '_', message), lowerFirstCamelWord(re.sub('-', '_', message))))
f.write(" } msg;\n")
f.write("} %s_message;\n\n" % (fileprefix))
for key in iesDefs:
if key in ieofielist.values():
continue
structName = re.sub('ies', '', key)
asn1cStruct = re.sub('-', '_', re.sub('IEs', '', re.sub('-IEs', '', key)))
asn1cStruct = re.sub('Item', 'List', asn1cStruct)
keylowerunderscore = re.sub('-', '_', key.lower())
firstlower = re.sub('Item', 'List', re.sub('enb', 'eNB', lowerFirstCamelWord(asn1cStruct)))
f.write("/** \\brief Decode function for %s ies.\n" % (key))
if len(iesDefs[key]["ies"]) != 0:
f.write(" * \\param %s Pointer to ASN1 structure in which data will be stored\n" % (lowerFirstCamelWord(re.sub('-', '_', key))))
f.write(" * \\param any_p Pointer to the ANY value to decode.\n")
f.write(" **/\n")
f.write("int %s_decode_%s(\n" % (fileprefix, keylowerunderscore))
if len(iesDefs[key]["ies"]) != 0:
f.write(" %s_t *%s,\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key))))
f.write(" ANY_t *any_p);\n\n")
if len(iesDefs[key]["ies"]) == 0:
continue
f.write("/** \\brief Encode function for %s ies.\n" % (key))
f.write(" * \\param %s Pointer to the ASN1 structure.\n" % (firstlower))
f.write(" * \\param %s Pointer to the IES structure.\n" % (lowerFirstCamelWord(re.sub('-', '_', key))))
f.write(" **/\n")
f.write("int %s_encode_%s(\n" % (fileprefix, re.sub('-', '_', structName.lower())))
f.write(" %s_t *%s,\n" % (asn1cStruct, firstlower))
f.write(" %s_t *%s);\n\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key))))
for key in iesDefs:
if key not in ieofielist.values():
continue
asn1cStruct = re.sub('-', '_', re.sub('IEs', '', key))
asn1cStruct = re.sub('Item', 'List', asn1cStruct)
firstlower = re.sub('Item', 'List', re.sub('enb', 'eNB', lowerFirstCamelWord(asn1cStruct)))
f.write("/** \\brief Encode function for %s ies.\n" % (key))
f.write(" * \\param %s Pointer to the ASN1 structure.\n" % (firstlower))
f.write(" * \\param %s Pointer to the IES structure.\n" % (lowerFirstCamelWord(re.sub('-', '_', key))))
f.write(" **/\n")
f.write("int %s_encode_%s(\n" % (fileprefix, firstlower.lower()))
f.write(" %s_t *%s,\n" % (asn1cStruct, firstlower))
f.write(" %sIEs_t *%sIEs);\n\n" % (asn1cStruct, firstlower))
f.write("/** \\brief Decode function for %s ies.\n" % (key))
f.write(" * \\param any_p Pointer to the ANY value to decode.\n")
f.write(" * \\param callback Callback function called when any_p is successfully decoded.\n")
f.write(" **/\n")
f.write("int %s_decode_%s(\n" % (fileprefix, firstlower.lower()))
f.write(" %sIEs_t *%sIEs,\n" % (asn1cStruct, firstlower))
f.write(" %s_t *%s);\n\n" % (asn1cStruct, lowerFirstCamelWord(asn1cStruct)))
for key in iesDefs:
asn1cStruct = re.sub('-', '_', re.sub('IEs', '', key))
asn1cStruct = re.sub('Item', 'List', asn1cStruct)
firstlower = re.sub('Item', 'List', re.sub('enb', 'eNB', lowerFirstCamelWord(asn1cStruct)))
if key in ieofielist.values():
f.write("/** \\brief Display %s encapsulated IE using XER encoding.\n" % (asn1cStruct))
f.write(" * \\param %s Pointer to the IES structure.\n" % (lowerFirstCamelWord(re.sub('-', '_', key))))
f.write(" * \\param file File descriptor to write output.\n")
f.write(" **/\n")
f.write("asn_enc_rval_t %s_xer_print_%s(\n" % (fileprefix, re.sub('item', 'list', firstlower.lower())))
f.write(" asn_app_consume_bytes_f *cb,\n")
f.write(" void *app_key,\n")
f.write(" %sIEs_t *%sIEs);\n\n" % (re.sub('item', 'list', asn1cStruct), firstlower))
else:
f.write("/** \\brief Display %s message using XER encoding.\n" % (asn1cStruct))
f.write(" * \\param message_p Pointer to root message.\n")
f.write(" * \\param file File descriptor to write output.\n")
f.write(" **/\n")
f.write("asn_enc_rval_t %s_xer_print_%s(\n" % (fileprefix, firstlower.lower()))
f.write(" asn_app_consume_bytes_f *cb,\n")
f.write(" void *app_key,\n")
f.write(" %s_message *message_p);\n\n" % (fileprefix))
f.write("int %s_xer__print2sp(const void *buffer, size_t size, void *app_key);\n\n" % (fileprefix.lower()))
f.write("int %s_xer__print2fp(const void *buffer, size_t size, void *app_key);\n\n" % (fileprefix.lower()))
f.write("extern size_t %s_string_total_size;\n\n" % (fileprefix.lower()))
f.write("#endif /* %s_IES_DEFS_H_ */\n\n" % (fileprefix.upper()))
#Generate Decode functions
f = open(outdir + fileprefix + '_decoder.c', 'w')
outputHeaderToFile(f, filename)
f.write("#include \"%s_common.h\"\n#include \"%s_ies_defs.h\"\n\n" % (fileprefix, fileprefix))
for key in iesDefs:
if key in ieofielist.values():
continue
structName = re.sub('ies', '', key)
asn1cStruct = re.sub('-', '_', re.sub('IEs', '', key))
if asn1cStruct.rfind('_') == len(asn1cStruct) - 1:
asn1cStruct = asn1cStruct[:-1]
asn1cStruct = re.sub('Item', 'List', asn1cStruct)
ielistname = re.sub('UE', 'ue', asn1cStruct)
ielistnamefirstlower = ielistname[:1].lower() + ielistname[1:]
asn1cStructfirstlower = asn1cStruct[:1].lower() + asn1cStruct[1:]
keyName = re.sub('-', '_', key)
keyupperunderscore = keyName.upper()
firstlower = re.sub('Item', 'List', re.sub('enb', 'eNB', lowerFirstCamelWord(asn1cStruct)))
iesaccess = ""
if key not in ieofielist.values():
iesaccess = "%s_ies." % (firstlower)
f.write("int %s_decode_%s(\n" % (fileprefix, re.sub('-', '_', structName.lower())))
if len(iesDefs[key]["ies"]) != 0:
f.write(" %s_t *%s,\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key))))
f.write(" ANY_t *any_p) {\n\n")
f.write(" %s_t %s;\n %s_t *%s_p = &%s;\n" % (asn1cStruct, asn1cStructfirstlower, asn1cStruct, asn1cStructfirstlower, asn1cStructfirstlower))
f.write(" int i, decoded = 0;\n")
if len(iesDefs[key]["ies"]) != 0:
f.write(" int tempDecoded = 0;\n")
f.write(" assert(any_p != NULL);\n")
if len(iesDefs[key]["ies"]) != 0:
f.write(" assert(%s != NULL);\n\n" % (lowerFirstCamelWord(re.sub('-', '_', key))))
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(" %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"]:
iename = re.sub('id-', '', ie[0])
ienameunderscore = lowerFirstCamelWord(re.sub('-', '_', iename))
ienameunderscorefirstlower = lowerFirstCamelWord(ienameunderscore)
ietypesubst = re.sub('-', '', ie[2])
ietypeunderscore = re.sub('-', '_', ie[2])
ieupperunderscore = re.sub('-', '_', re.sub('id-', '', ie[0])).upper()
if ie[3] == "optional":
f.write(" /* Optional field */\n")
elif ie[3] == "conditional":
f.write(" /* Conditional field */\n")
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":
f.write(" %s->presenceMask |= %s_%s_PRESENT;\n" % (lowerFirstCamelWord(re.sub('-', '_', key)), keyupperunderscore, ieupperunderscore))
f.write(" tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_%s, (void**)&%s_p);\n" % (ietypeunderscore, lowerFirstCamelWord(ietypesubst)))
f.write(" if (tempDecoded < 0 || %s_p == NULL) {\n" % (lowerFirstCamelWord(ietypesubst)))
f.write(" %s_ERROR(\"Decoding of IE %s failed\\n\");\n" % (fileprefix.upper(), ienameunderscore))
f.write(" if (%s_p)\n" % (lowerFirstCamelWord(ietypesubst)))
f.write(" ASN_STRUCT_FREE(asn_DEF_%s, %s_p);\n" % (ietypeunderscore, lowerFirstCamelWord(ietypesubst)))
f.write(" return -1;\n")
f.write(" }\n")
f.write(" decoded += tempDecoded;\n")
f.write(" if (asn1_xer_print)\n")
f.write(" xer_fprint(stdout, &asn_DEF_%s, %s_p);\n" % (ietypeunderscore, lowerFirstCamelWord(ietypesubst)))
if ie[2] in ieofielist.keys():
f.write(" if (%s_decode_%s(&%s->%s, %s_p) < 0) {\n" % (fileprefix, ietypeunderscore.lower(), lowerFirstCamelWord(re.sub('-', '_', key)), ienameunderscore, lowerFirstCamelWord(ietypesubst)))
f.write(" %s_ERROR(\"Decoding of encapsulated IE %s failed\\n\");\n" % (fileprefix.upper(), lowerFirstCamelWord(ietypesubst)))
f.write(" ASN_STRUCT_FREE(asn_DEF_%s, %s_p);\n" % (ietypeunderscore, lowerFirstCamelWord(ietypesubst)))
f.write(" }\n")
else:
f.write(" memcpy(&%s->%s, %s_p, sizeof(%s_t));\n" % (lowerFirstCamelWord(re.sub('-', '_', key)), ienameunderscore, lowerFirstCamelWord(ietypesubst), ietypeunderscore))
#f.write(" ASN_STRUCT_FREE(asn_DEF_%s, %s_p);\n" % (ietypeunderscore, lowerFirstCamelWord(ietypesubst)))
f.write(" } break;\n")
f.write(" default:\n")
f.write(" %s_ERROR(\"Unknown protocol IE id (%%d) for message %s\\n\", (int)ie_p->id);\n" % (fileprefix.upper(), re.sub('-', '_', structName.lower())))
f.write(" return -1;\n")
f.write(" }\n")
f.write(" }\n")
f.write(" return decoded;\n")
f.write("}\n\n")
for key in iesDefs:
if key not in ieofielist.values():
continue
keyname = re.sub('IEs', '', re.sub('Item', 'List', key))
f.write("int %s_decode_%s(\n" % (fileprefix, re.sub('-', '_', keyname).lower()))
f.write(" %sIEs_t *%sIEs,\n" % (re.sub('-', '_', keyname), lowerFirstCamelWord(re.sub('-', '_', keyname))))
f.write(" %s_t *%s) {\n\n" % (re.sub('-', '_', keyname), lowerFirstCamelWord(re.sub('-', '_', keyname))))
f.write(" int i, decoded = 0;\n")
f.write(" int tempDecoded = 0;\n\n")
f.write(" assert(%s != NULL);\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(" %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 %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]))))
f.write(" if (tempDecoded < 0 || %s_p == NULL) {\n" % (lowerFirstCamelWord(re.sub('-', '', ie[2]))))
f.write(" %s_ERROR(\"Decoding of IE %s for message %s failed\\n\");\n" % (fileprefix.upper(), ienameunderscore, re.sub('-', '_', keyname)))
f.write(" if (%s_p)\n" % (lowerFirstCamelWord(re.sub('-', '', ie[2]))))
#f.write(" free(%s_p);\n" % (lowerFirstCamelWord(re.sub('-', '', ie[2]))))
f.write(" ASN_STRUCT_FREE(asn_DEF_%s, %s_p);\n" % (re.sub('-', '_', ie[2]), lowerFirstCamelWord(re.sub('-', '', ie[2]))))
f.write(" return -1;\n")
f.write(" }\n")
f.write(" decoded += tempDecoded;\n")
f.write(" if (asn1_xer_print)\n")
f.write(" xer_fprint(stdout, &asn_DEF_%s, %s_p);\n" % (re.sub('-', '_', ie[2]), lowerFirstCamelWord(re.sub('-', '', ie[2]))))
f.write(" ASN_SEQUENCE_ADD(&%sIEs->%s, %s_p);\n" % (lowerFirstCamelWord(re.sub('-', '_', keyname)),
re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key))), lowerFirstCamelWord(re.sub('-', '', ie[2]))))
f.write(" } break;\n")
f.write(" default:\n")
f.write(" %s_ERROR(\"Unknown protocol IE id (%%d) for message %s\\n\", (int)ie_p->id);\n" % (fileprefix.upper(), re.sub('-', '_', structName.lower())))
f.write(" return -1;\n")
f.write(" }\n")
f.write(" }\n")
f.write(" return decoded;\n")
f.write("}\n\n")
#Generate IES Encode functions
f = open(outdir + fileprefix + '_encoder.c', 'w')
outputHeaderToFile(f,filename)
f.write("#include \"%s_common.h\"\n" % (fileprefix))
f.write("#include \"%s_ies_defs.h\"\n\n" % (fileprefix))
for key in iesDefs:
if key in ieofielist.values():
continue
structName = re.sub('ies', '', key)
asn1cStruct = re.sub('-', '_', re.sub('IEs', '', key))
asn1cStruct = re.sub('Item', 'List', asn1cStruct)
if asn1cStruct.rfind('_') == len(asn1cStruct) - 1:
asn1cStruct = asn1cStruct[:-1]
asn1cStructfirstlower = asn1cStruct[:1].lower() + asn1cStruct[1:]
firstwordlower = re.sub('Item', 'List', re.sub('enb', 'eNB', lowerFirstCamelWord(asn1cStruct)))
iesaccess = ""
if key not in ieofielist.values():
iesaccess = "%s_ies." % (firstwordlower)
keyName = re.sub('-', '_', key)
keyupperunderscore = keyName.upper()
# No IE to encode...
if len(iesDefs[key]["ies"]) == 0:
continue
f.write("int %s_encode_%s(\n" % (fileprefix, re.sub('-', '_', structName.lower())))
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_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))));
for ie in iesDefs[key]["ies"]:
iename = re.sub('-', '_', re.sub('id-', '', ie[0]))
ienameunderscore = re.sub('-', '_', iename)
ienamefirstwordlower = lowerFirstCamelWord(iename)
ieupperunderscore = re.sub('-', '_', re.sub('id-', '', ie[0])).upper()
ietypeunderscore = re.sub('-', '_', ie[2])
if ie[3] != "mandatory":
if ie[3] == "optional":
f.write(" /* Optional field */\n")
elif ie[3] == "conditional":
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(%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))
f.write(" }\n\n")
else:
if ie[2] in ieofielist.keys():
f.write(" %s_t %s;\n\n" % (ietypeunderscore, ienamefirstwordlower))
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(%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:
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\n" % (firstwordlower, iesaccess))
if ie[2] in ieofielist.keys():
f.write(" /* Free any dynamic allocation that is no more used */\n")
f.write(" ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_%s, &%s);\n\n" % (ietypeunderscore, ienamefirstwordlower))
f.write(" return 0;\n")
f.write("}\n\n")
for (key, value) in iesDefs.items():
if key not in ieofielist.values():
continue
ie = value["ies"][0]
ietypeunderscore = re.sub('-', '_', ie[2])
asn1cStruct = re.sub('-', '_', re.sub('IEs', '', re.sub('-IEs', '', key)))
asn1cStruct = re.sub('Item', 'List', asn1cStruct)
firstwordlower = re.sub('Item', 'List', re.sub('enb', 'eNB', lowerFirstCamelWord(asn1cStruct)))
for (i, j) in ieofielist.items():
if j == key:
break
f.write("int %s_encode_%s(\n" % (fileprefix, re.sub('-', '_', i).lower()))
f.write(" %s_t *%s,\n" % (asn1cStruct, firstwordlower))
f.write(" %sIEs_t *%sIEs) {\n\n" % (re.sub('-', '_', i), lowerFirstCamelWord(re.sub('-', '_', i))))
f.write(" int i;\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(%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")
f.write(" }\n")
f.write(" ASN_SEQUENCE_ADD(&%s->list, ie);\n" % (firstwordlower))
f.write(" }\n")
f.write(" return 0;\n")
f.write("}\n\n")
#Generate xer print functions
f = open(outdir + fileprefix + '_xer_print.c', 'w')
outputHeaderToFile(f, filename)
f.write("#include <stdlib.h>\n")
f.write("#include <stdio.h>\n\n")
f.write("#include <asn_application.h>\n#include <asn_internal.h>\n\n")
f.write("#include \"%s_common.h\"\n#include \"%s_ies_defs.h\"\n\n" % (fileprefix, fileprefix))
f.write("size_t %s_string_total_size = 0;\n\n" % (fileprefix.lower()))
f.write("""int
%s_xer__print2fp(const void *buffer, size_t size, void *app_key) {
FILE *stream = (FILE *)app_key;
if(fwrite(buffer, 1, size, stream) != size)
return -1;
return 0;
}
""" % (fileprefix.lower()))
f.write("""int %s_xer__print2sp(const void *buffer, size_t size, void *app_key) {
char *string = (char *)app_key;
/* Copy buffer to the formatted string */
memcpy(&string[%s_string_total_size], buffer, size);
%s_string_total_size += size;
return 0;
}
""" % (fileprefix.lower(), fileprefix.lower(), fileprefix.lower()))
f.write("""static asn_enc_rval_t
xer_encode_local(asn_TYPE_descriptor_t *td, void *sptr,
asn_app_consume_bytes_f *cb, void *app_key, int indent) {
asn_enc_rval_t er, tmper;
const char *mname;
size_t mlen;
int xcan = 2;
if(!td || !sptr) goto cb_failed;
mname = td->xml_tag;
mlen = strlen(mname);
_i_ASN_TEXT_INDENT(0, indent);
_ASN_CALLBACK3("<", 1, mname, mlen, ">", 1);
tmper = td->xer_encoder(td, sptr, indent + 1, XER_F_BASIC, cb, app_key);
if(tmper.encoded == -1) return tmper;
_ASN_CALLBACK3("</", 2, mname, mlen, ">\\n", xcan);
er.encoded = 4 + xcan + (2 * mlen) + tmper.encoded;
_ASN_ENCODED_OK(er);
cb_failed:
_ASN_ENCODE_FAILED;
}
""")
for (key, value) in iesDefs.items():
keyName = re.sub('-', '_', key)
keyupperunderscore = keyName.upper()
iesStructName = lowerFirstCamelWord(re.sub('-', '_', key))
ie = value["ies"][0]
ietypeunderscore = re.sub('-', '_', ie[2])
if key in ieofielist.values():
f.write("asn_enc_rval_t %s_xer_print_%s(\n" % (fileprefix, re.sub('ies', '', re.sub('item', 'list', re.sub('-', '_', key).lower()))))
else:
f.write("asn_enc_rval_t %s_xer_print_%s(\n" % (fileprefix, re.sub('ies', '', re.sub('-', '_', key).lower())))
#f.write(" FILE *file,\n")
f.write(" asn_app_consume_bytes_f *cb,\n")
f.write(" void *app_key,\n")
if key in ieofielist.values():
iesStructName = lowerFirstCamelWord(re.sub('Item', 'List', re.sub('-', '_', key)))
f.write(" %sIEs_t *%s) {\n\n" % (re.sub('IEs', '', re.sub('Item', 'List', re.sub('-', '_', key))), iesStructName))
f.write(" int i;\n")
f.write(" asn_enc_rval_t er;\n")
else:
f.write(" %s_message *message_p)\n{\n" % (fileprefix))
f.write(" %s_t *%s;\n" % (re.sub('-', '_', key), iesStructName))
f.write(" asn_enc_rval_t er;\n")
#f.write(" void *app_key = (void *)file;\n")
#f.write(" asn_app_consume_bytes_f *cb = %s_xer__print2fp;\n\n" % (fileprefix.lower()))
f.write(" %s = &message_p->msg.%s;\n\n" % (iesStructName, iesStructName))
if key in ieofielist.values():
# Increase indentation level
f.write(" for (i = 0; i < %s->%s.count; i++) {\n" % (iesStructName, re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key)))))
#f.write(" xer_fprint(file, &asn_DEF_%s, %s->%s.array[i]);\n" % (ietypeunderscore, iesStructName, re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key)))))
f.write(" er = xer_encode(&asn_DEF_%s, %s->%s.array[i], XER_F_BASIC, cb, app_key);\n" % (ietypeunderscore, iesStructName, re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key)))))
f.write(" }\n")
else:
f.write(" cb(\"<%s-PDU>\\n\", %d, app_key);\n" % (key, len("<%s-PDU>\n" % (key))))
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(" cb(\" <%s>\\n\", %d, app_key);\n" % (key, len(" <%s>\n" % (key))))
for ie in iesDefs[key]["ies"]:
iename = re.sub('-', '_', re.sub('id-', '', ie[0]))
ienameunderscore = re.sub('-', '_', iename)
ienamefirstwordlower = lowerFirstCamelWord(iename)
ietypeunderscore = re.sub('-', '_', ie[2])
ieupperunderscore = re.sub('-', '_', re.sub('id-', '', ie[0])).upper()
if ie[3] != "mandatory":
if ie[3] == "optional":
f.write(" /* Optional field */\n")
elif ie[3] == "conditional":
f.write(" /* Conditional field */\n")
f.write(" if (%s->presenceMask & %s_%s_PRESENT)\n " % (iesStructName, keyupperunderscore, ieupperunderscore))
# Is it an encapsulated IE ?
if ie[2] in ieofielist.keys():
f.write(" %s_xer_print_%s(cb, app_key, &%s->%s);\n" % (fileprefix, re.sub('ies', '', re.sub('-', '_', ie[2]).lower()), iesStructName, ienamefirstwordlower))
else:
f.write(" xer_encode_local(&asn_DEF_%s, &%s->%s, cb, app_key, 2);\n" % (ietypeunderscore, iesStructName, ienamefirstwordlower))
f.write(" cb(\" </%s>\\n\", %d, app_key);\n" % (key, len(" </%s>\n" % (key))))
f.write(" cb(\"</%s-PDU>\\n\", %d, app_key);\n" % (key, len("</%s-PDU>\n" % (key))))
f.write(" _ASN_ENCODED_OK(er);\n")
#if key not in ieofielist.values():
#f.write("cb_failed:\n")
#f.write(" return er;\n")
f.write("}\n\n")
+194
View File
@@ -0,0 +1,194 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_common.c
* \brief f1ap procedures for both CU and DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#include "f1ap_common.h"
#if defined(EMIT_ASN_DEBUG_EXTERN)
int asn_debug = 0;
int asn1_xer_print = 0;
inline void ASN_DEBUG(const char *fmt, ...)
{
if (asn_debug) {
int adi = asn_debug_indent;
va_list ap;
va_start(ap, fmt);
fprintf(stderr, "[ASN1]");
while(adi--) fprintf(stderr, " ");
vfprintf(stderr, fmt, ap);
fprintf(stderr, "\n");
va_end(ap);
}
}
#endif
uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_t cu_mod_idP)
{
static uint8_t transaction_identifier[NUMBER_OF_eNB_MAX];
transaction_identifier[enb_mod_idP+cu_mod_idP] =
(transaction_identifier[enb_mod_idP+cu_mod_idP] + 1) % F1AP_TRANSACTION_IDENTIFIER_NUMBER;
//LOG_T(F1AP,"generated xid is %d\n",transaction_identifier[enb_mod_idP+cu_mod_idP]);
return transaction_identifier[enb_mod_idP+cu_mod_idP];
}
int f1ap_add_ue(f1ap_cudu_inst_t *f1_inst,
module_id_t module_idP,
int CC_idP,
int UE_id,
rnti_t rntiP) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
f1_inst->f1ap_ue[i].f1ap_uid = i;
f1_inst->f1ap_ue[i].mac_uid = UE_id;
LOG_I(F1AP, "Updating the index of UE with RNTI %x and du_ue_f1ap_id %d\n", f1_inst->f1ap_ue[i].rnti, f1_inst->f1ap_ue[i].du_ue_f1ap_id);
return i;
}
}
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == 0 ) {
f1_inst->f1ap_ue[i].rnti = rntiP;
f1_inst->f1ap_ue[i].f1ap_uid = i;
f1_inst->f1ap_ue[i].mac_uid = UE_id;
f1_inst->f1ap_ue[i].du_ue_f1ap_id = rntiP;
f1_inst->f1ap_ue[i].cu_ue_f1ap_id = rntiP;
f1_inst->num_ues++;
LOG_I(F1AP, "Adding a new UE with RNTI %x and cu/du ue_f1ap_id %d\n", f1_inst->f1ap_ue[i].rnti, f1_inst->f1ap_ue[i].du_ue_f1ap_id);
return i;
}
}
return -1;
}
int f1ap_remove_ue(f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
f1_inst->f1ap_ue[i].rnti = 0;
break;
}
}
f1_inst->num_ues--;
return 0;
}
int f1ap_get_du_ue_f1ap_id(f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
return f1_inst->f1ap_ue[i].du_ue_f1ap_id;
}
}
return -1;
}
int f1ap_get_cu_ue_f1ap_id(f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
return f1_inst->f1ap_ue[i].cu_ue_f1ap_id;
}
}
return -1;
}
int f1ap_get_rnti_by_du_id(f1ap_cudu_inst_t *f1_inst,
module_id_t du_ue_f1ap_id ) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].du_ue_f1ap_id == du_ue_f1ap_id) {
return f1_inst->f1ap_ue[i].rnti;
}
}
return -1;
}
int f1ap_get_rnti_by_cu_id(f1ap_cudu_inst_t *f1_inst,
module_id_t cu_ue_f1ap_id ) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].cu_ue_f1ap_id == cu_ue_f1ap_id) {
return f1_inst->f1ap_ue[i].rnti;
}
}
return -1;
}
int f1ap_get_du_uid(f1ap_cudu_inst_t *f1_inst,
module_id_t du_ue_f1ap_id ) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].du_ue_f1ap_id == du_ue_f1ap_id) {
return i;
}
}
return -1;
}
int f1ap_get_cu_uid(f1ap_cudu_inst_t *f1_inst,
module_id_t cu_ue_f1ap_id ) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].cu_ue_f1ap_id == cu_ue_f1ap_id) {
return i;
}
}
return -1;
}
int f1ap_get_uid_by_rnti(f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP ) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (f1_inst->f1ap_ue[i].rnti == rntiP) {
return i;
}
}
return -1;
}
int f1ap_du_add_cu_ue_id(f1ap_cudu_inst_t *f1_inst,
module_id_t du_ue_f1ap_id,
module_id_t cu_ue_f1ap_id) {
module_id_t f1ap_uid = f1ap_get_du_uid(f1_inst,du_ue_f1ap_id);
if (f1ap_uid < 0) return -1;
f1_inst->f1ap_ue[f1ap_uid].cu_ue_f1ap_id = cu_ue_f1ap_id;
LOG_I(F1AP, "Adding cu_ue_f1ap_id %d for UE with RNTI %x\n", cu_ue_f1ap_id, f1_inst->f1ap_ue[f1ap_uid].rnti);
return 0;
}
int f1ap_cu_add_du_ue_id(f1ap_cudu_inst_t *f1_inst,
module_id_t cu_ue_f1ap_id,
module_id_t du_ue_f1ap_id) {
module_id_t f1ap_uid = f1ap_get_cu_uid(f1_inst,cu_ue_f1ap_id);
if (f1ap_uid < 0) return -1;
f1_inst->f1ap_ue[f1ap_uid].du_ue_f1ap_id = du_ue_f1ap_id;
LOG_I(F1AP, "Adding du_ue_f1ap_id %d for UE with RNTI %x\n", du_ue_f1ap_id, f1_inst->f1ap_ue[f1ap_uid].rnti);
return 0;
}
+488
View File
@@ -0,0 +1,488 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_common.h
* \brief f1ap procedures for both CU and DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#if HAVE_CONFIG_H_
# include "config.h"
#endif
#ifndef F1AP_COMMON_H_
#define F1AP_COMMON_H_
#include "openairinterface5g_limits.h"
#define F1AP_UE_IDENTIFIER_NUMBER 3
#define F1AP_TRANSACTION_IDENTIFIER_NUMBER 3
#if defined(EMIT_ASN_DEBUG_EXTERN)
inline void ASN_DEBUG(const char *fmt, ...);
#endif
#include "F1AP_Active-Cells-List.h"
#include "F1AP_RAT-FrequencyPriorityInformation.h"
#include "F1AP_DLUPTNLInformation-ToBeSetup-Item.h"
#include "F1AP_PrivateMessage.h"
#include "F1AP_Cause.h"
#include "F1AP_Pre-emptionVulnerability.h"
#include "F1AP_NRPCI.h"
#include "F1AP_Transmission-Bandwidth.h"
#include "F1AP_SIB1-message.h"
#include "F1AP_GNBCUConfigurationUpdateAcknowledge.h"
#include "F1AP_DRBs-Setup-Item.h"
#include "F1AP_EUTRA-NR-CellResourceCoordinationReqAck-Container.h"
#include "F1AP_NR-CGI-List-For-Restart-Item.h"
#include "F1AP_GNB-CU-Name.h"
#include "F1AP_PagingDRX.h"
#include "F1AP_RepetitionPeriod.h"
#include "F1AP_DRBs-ToBeModified-List.h"
#include "F1AP_ExecuteDuplication.h"
#include "F1AP_SCell-FailedtoSetupMod-List.h"
#include "F1AP_NRNRB.h"
#include "F1AP_SCell-ToBeSetup-List.h"
#include "F1AP_F1AP-PDU.h"
#include "F1AP_MaskedIMEISV.h"
#include "F1AP_ProtocolIE-Container.h"
#include "F1AP_GNB-CU-TNL-Association-To-Update-Item.h"
#include "F1AP_Cells-to-be-Activated-List-Item.h"
#include "F1AP_DRBs-Required-ToBeModified-Item.h"
#include "F1AP_BitRate.h"
#include "F1AP_SRBs-ToBeSetup-List.h"
#include "F1AP_ConcurrentWarningMessageIndicator.h"
#include "F1AP_CriticalityDiagnostics-IE-Item.h"
#include "F1AP_GNB-CU-TNL-Association-To-Update-List.h"
#include "F1AP_DRB-Notify-List.h"
#include "F1AP_UEContextReleaseCommand.h"
#include "F1AP_ProtocolIE-SingleContainer.h"
#include "F1AP_DRBs-ToBeReleased-List.h"
#include "F1AP_PWS-Failed-NR-CGI-List.h"
#include "F1AP_InitialULRRCMessageTransfer.h"
#include "F1AP_Served-Cell-Information.h"
#include "F1AP_Served-EUTRA-Cells-Information.h"
#include "F1AP_Cells-Broadcast-Cancelled-Item.h"
#include "F1AP_F1SetupRequest.h"
#include "F1AP_Served-Cells-To-Add-Item.h"
#include "F1AP_F1SetupFailure.h"
#include "F1AP_ULUPTNLInformation-ToBeSetup-Item.h"
#include "F1AP_GNB-CU-TNL-Association-To-Add-Item.h"
#include "F1AP_DUtoCURRCContainer.h"
#include "F1AP_GNBDUResourceCoordinationRequest.h"
#include "F1AP_DRBs-FailedToBeSetup-List.h"
#include "F1AP_UPTransportLayerInformation.h"
#include "F1AP_RRCContainer.h"
#include "F1AP_Notification-Cause.h"
#include "F1AP_UEIdentityIndexValue.h"
#include "F1AP_SRBs-ToBeSetupMod-List.h"
#include "F1AP_GNB-DU-Served-Cells-Item.h"
#include "F1AP_RLCMode.h"
#include "F1AP_NRSCS.h"
#include "F1AP_SliceSupportList.h"
#include "F1AP_GTP-TEID.h"
#include "F1AP_UEContextModificationRequest.h"
#include "F1AP_MeasConfig.h"
#include "F1AP_Flows-Mapped-To-DRB-List.h"
#include "F1AP_Cells-to-be-Deactivated-List-Item.h"
#include "F1AP_QoSFlowLevelQoSParameters.h"
#include "F1AP_GNB-CU-UE-F1AP-ID.h"
#include "F1AP_CauseTransport.h"
#include "F1AP_DRBs-ToBeReleased-Item.h"
#include "F1AP_SCell-ToBeSetupMod-Item.h"
#include "F1AP_CellGroupConfig.h"
#include "F1AP_PWSSystemInformation.h"
#include "F1AP_DRBs-Modified-List.h"
#include "F1AP_HandoverPreparationInformation.h"
#include "F1AP_InactivityMonitoringResponse.h"
#include "F1AP_Served-Cells-To-Delete-List.h"
#include "F1AP_ProtocolExtensionField.h"
#include "F1AP_GNB-CU-TNL-Association-To-Remove-List.h"
#include "F1AP_SRBID.h"
#include "F1AP_DRB-Activity-List.h"
#include "F1AP_DRBs-FailedToBeModified-Item.h"
#include "F1AP_TransactionID.h"
#include "F1AP_AllocationAndRetentionPriority.h"
#include "F1AP_ShortDRXCycleLength.h"
#include "F1AP_BroadcastPLMNs-Item.h"
#include "F1AP_DRB-Information.h"
#include "F1AP_TimeToWait.h"
#include "F1AP_NonDynamic5QIDescriptor.h"
#include "F1AP_C-RNTI.h"
#include "F1AP_MIB-message.h"
#include "F1AP_SIBtype-Item.h"
#include "F1AP_Served-Cells-To-Modify-List.h"
#include "F1AP_NRCGI.h"
#include "F1AP_DuplicationActivation.h"
#include "F1AP_CauseProtocol.h"
#include "F1AP_SCell-FailedtoSetup-Item.h"
#include "F1AP_PagingIdentity.h"
#include "F1AP_NGRANAllocationAndRetentionPriority.h"
#include "F1AP_TypeOfError.h"
#include "F1AP_GNB-CU-TNL-Association-To-Add-List.h"
#include "F1AP_DRBs-Required-ToBeReleased-Item.h"
#include "F1AP_EUTRA-Mode-Info.h"
#include "F1AP_FiveGS-TAC.h"
#include "F1AP_Cells-to-be-Activated-List.h"
#include "F1AP_PagingCell-list.h"
#include "F1AP_NotificationControl.h"
#include "F1AP_ProtectedEUTRAResourceIndication.h"
#include "F1AP_CUtoDURRCInformation.h"
#include "F1AP_SystemInformationDeliveryCommand.h"
#include "F1AP_AveragingWindow.h"
#include "F1AP_SRBs-ToBeSetupMod-Item.h"
#include "F1AP_NumberOfBroadcasts.h"
#include "F1AP_Cells-Broadcast-Completed-List.h"
#include "F1AP_GNB-CU-TNL-Association-Setup-Item.h"
#include "F1AP_PWSCancelResponse.h"
#include "F1AP_SpectrumSharingGroupID.h"
#include "F1AP_RANUEPagingIdentity.h"
#include "F1AP_CG-ConfigInfo.h"
#include "F1AP_PagingCell-Item.h"
#include "F1AP_GNB-CU-TNL-Association-To-Remove-Item.h"
#include "F1AP_UE-CapabilityRAT-ContainerList.h"
#include "F1AP_PWSCancelRequest.h"
#include "F1AP_PriorityLevel.h"
#include "F1AP_ProtocolIE-ContainerPair.h"
#include "F1AP_FullConfiguration.h"
#include "F1AP_NRCellIdentity.h"
#include "F1AP_ProtocolExtensionContainer.h"
#include "F1AP_PWSRestartIndication.h"
#include "F1AP_DRBs-ModifiedConf-List.h"
#include "F1AP_GNB-CU-TNL-Association-Failed-To-Setup-List.h"
#include "F1AP_UEContextSetupRequest.h"
#include "F1AP_PWSFailureIndication.h"
#include "F1AP_UE-associatedLogicalF1-ConnectionListResAck.h"
#include "F1AP_DRBs-ToBeSetupMod-Item.h"
#include "F1AP_SRBs-FailedToBeSetup-List.h"
#include "F1AP_Criticality.h"
#include "F1AP_UEContextModificationConfirm.h"
#include "F1AP_Broadcast-To-Be-Cancelled-List.h"
#include "F1AP_UEContextReleaseComplete.h"
#include "F1AP_PrivateIE-Container.h"
#include "F1AP_CellULConfigured.h"
#include "F1AP_DRB-Activity.h"
#include "F1AP_GNB-CU-TNL-Association-Failed-To-Setup-Item.h"
#include "F1AP_PrivateIE-ID.h"
#include "F1AP_WriteReplaceWarningResponse.h"
#include "F1AP_CauseMisc.h"
#include "F1AP_SRBs-Required-ToBeReleased-Item.h"
#include "F1AP_Cells-Broadcast-Cancelled-List.h"
#include "F1AP_ULUEConfiguration.h"
#include "F1AP_RAT-FrequencySelectionPriority.h"
#include "F1AP_UEInactivityNotification.h"
#include "F1AP_DLRRCMessageTransfer.h"
#include "F1AP_TriggeringMessage.h"
#include "F1AP_DRBs-ToBeSetup-List.h"
#include "F1AP_Cells-to-be-Barred-Item.h"
#include "F1AP_UE-associatedLogicalF1-ConnectionItem.h"
#include "F1AP_Cancel-all-Warning-Messages-Indicator.h"
#include "F1AP_SCell-FailedtoSetupMod-Item.h"
#include "F1AP_DRBs-FailedToBeSetupMod-List.h"
#include "F1AP_ProtocolIE-ID.h"
#include "F1AP_TransportLayerAddress.h"
#include "F1AP_GNB-DU-System-Information.h"
#include "F1AP_PWS-Failed-NR-CGI-Item.h"
#include "F1AP_Notify.h"
#include "F1AP_UEContextModificationResponse.h"
#include "F1AP_DRBID.h"
#include "F1AP_GNBDUResourceCoordinationResponse.h"
#include "F1AP_UEContextModificationRequired.h"
#include "F1AP_InitiatingMessage.h"
#include "F1AP_SliceSupportItem.h"
#include "F1AP_ProtocolIE-FieldPair.h"
#include "F1AP_EUTRA-TDD-Info.h"
#include "F1AP_GNBDUConfigurationUpdateFailure.h"
#include "F1AP_ULUPTNLInformation-ToBeSetup-List.h"
#include "F1AP_WriteReplaceWarningRequest.h"
#include "F1AP_ServCellIndex.h"
#include "F1AP_ResetAcknowledge.h"
#include "F1AP_SRBs-FailedToBeSetupMod-Item.h"
#include "F1AP_OffsetToPointA.h"
#include "F1AP_ProcedureCode.h"
#include "F1AP_GTPTunnel.h"
#include "F1AP_TDD-Info.h"
#include "F1AP_Pre-emptionCapability.h"
#include "F1AP_MaxDataBurstVolume.h"
#include "F1AP_SUL-Information.h"
#include "F1AP_CriticalityDiagnostics-IE-List.h"
#include "F1AP_EUTRA-FDD-Info.h"
#include "F1AP_BroadcastPLMNs-List.h"
#include "F1AP_Served-Cells-To-Delete-Item.h"
#include "F1AP_ListofEUTRACellsinGNBDUCoordination.h"
#include "F1AP_Candidate-SpCell-Item.h"
#include "F1AP_Cells-To-Be-Broadcast-List.h"
#include "F1AP_ULRRCMessageTransfer.h"
#include "F1AP_Cells-to-be-Deactivated-List.h"
#include "F1AP_DRBs-Required-ToBeReleased-List.h"
#include "F1AP_Served-Cells-To-Add-List.h"
#include "F1AP_Potential-SpCell-List.h"
#include "F1AP_EUTRANQoS.h"
#include "F1AP_Dynamic5QIDescriptor.h"
#include "F1AP_GNBCUConfigurationUpdateFailure.h"
#include "F1AP_DuplicationIndication.h"
#include "F1AP_GNB-DU-Served-Cells-List.h"
#include "F1AP_QoS-Characteristics.h"
#include "F1AP_UE-associatedLogicalF1-ConnectionListRes.h"
#include "F1AP_ResourceCoordinationTransferContainer.h"
#include "F1AP_DRXCycle.h"
#include "F1AP_DRBs-FailedToBeSetup-Item.h"
#include "F1AP_PrivateIE-Field.h"
#include "F1AP_SRBs-ToBeReleased-List.h"
#include "F1AP_MeasGapConfig.h"
#include "F1AP_NR-Mode-Info.h"
#include "F1AP_Active-Cells-Item.h"
#include "F1AP_Protected-EUTRA-Resources-List.h"
#include "F1AP_SRBs-FailedToBeSetup-Item.h"
#include "F1AP_ResetAll.h"
#include "F1AP_SCell-FailedtoSetup-List.h"
#include "F1AP_UEContextModificationFailure.h"
#include "F1AP_CNUEPagingIdentity.h"
#include "F1AP_DRBs-ToBeSetupMod-List.h"
#include "F1AP_GNBDUConfigurationUpdate.h"
#include "F1AP_DRBs-ToBeSetup-Item.h"
#include "F1AP_UnsuccessfulOutcome.h"
#include "F1AP_SRBs-FailedToBeSetupMod-List.h"
#include "F1AP_SCell-ToBeRemoved-Item.h"
#include "F1AP_InactivityMonitoringRequest.h"
#include "F1AP_Cells-Failed-to-be-Activated-List-Item.h"
#include "F1AP_DRBs-Modified-Item.h"
#include "F1AP_SRBs-Required-ToBeReleased-List.h"
#include "F1AP_GBR-QosInformation.h"
#include "F1AP_SCell-ToBeRemoved-List.h"
#include "F1AP_RANAC.h"
#include "F1AP_GNB-DU-UE-F1AP-ID.h"
#include "F1AP_CauseRadioNetwork.h"
#include "F1AP_DRB-Notify-Item.h"
#include "F1AP_GNBDUConfigurationUpdateAcknowledge.h"
#include "F1AP_GNB-CUSystemInformation.h"
#include "F1AP_ProtocolIE-Field.h"
#include "F1AP_Served-Cells-To-Modify-Item.h"
#include "F1AP_Flows-Mapped-To-DRB-Item.h"
#include "F1AP_SupportedSULFreqBandItem.h"
#include "F1AP_UEContextReleaseRequest.h"
#include "F1AP_GNB-DU-Name.h"
#include "F1AP_DRBs-ToBeModified-Item.h"
#include "F1AP_SIBtype-List.h"
#include "F1AP_EUTRA-NR-CellResourceCoordinationReq-Container.h"
#include "F1AP_DRBs-SetupMod-List.h"
#include "F1AP_DRBs-Required-ToBeModified-List.h"
#include "F1AP_DUtoCURRCInformation.h"
#include "F1AP_MaxPacketLossRate.h"
#include "F1AP_PacketDelayBudget.h"
#include "F1AP_GNBCUConfigurationUpdate.h"
#include "F1AP_Cells-Broadcast-Completed-Item.h"
#include "F1AP_RRCRconfigurationCompleteIndicator.h"
#include "F1AP_PagingPriority.h"
#include "F1AP_Cells-Failed-to-be-Activated-List.h"
#include "F1AP_Endpoint-IP-address-and-port.h"
#include "F1AP_PacketErrorRate.h"
#include "F1AP_PLMN-Identity.h"
#include "F1AP_asn_constant.h"
#include "F1AP_ResetType.h"
#include "F1AP_FDD-Info.h"
#include "F1AP_DLUPTNLInformation-ToBeSetup-List.h"
#include "F1AP_QoSFlowIndicator.h"
#include "F1AP_NR-CGI-List-For-Restart-List.h"
#include "F1AP_F1SetupResponse.h"
#include "F1AP_UEContextSetupResponse.h"
#include "F1AP_CP-TransportLayerAddress.h"
#include "F1AP_Broadcast-To-Be-Cancelled-Item.h"
#include "F1AP_ErrorIndication.h"
#include "F1AP_SubscriberProfileIDforRFP.h"
#include "F1AP_SNSSAI.h"
#include "F1AP_DRBs-ModifiedConf-Item.h"
#include "F1AP_GNB-CU-TNL-Association-Setup-List.h"
#include "F1AP_DRB-Activity-Item.h"
#include "F1AP_LCID.h"
#include "F1AP_ULConfiguration.h"
#include "F1AP_ShortDRXCycleTimer.h"
#include "F1AP_FreqBandNrItem.h"
#include "F1AP_Cells-to-be-Barred-List.h"
#include "F1AP_Presence.h"
#include "F1AP_CellBarred.h"
#include "F1AP_SIBtype.h"
#include "F1AP_RequestType.h"
#include "F1AP_NRFreqInfo.h"
#include "F1AP_Potential-SpCell-Item.h"
#include "F1AP_NumberofBroadcastRequest.h"
#include "F1AP_TNLAssociationUsage.h"
#include "F1AP_SCell-ToBeSetupMod-List.h"
#include "F1AP_DRBs-Setup-List.h"
#include "F1AP_Reset.h"
#include "F1AP_CriticalityDiagnostics.h"
#include "F1AP_Paging.h"
#include "F1AP_LongDRXCycleLength.h"
#include "F1AP_GNB-DU-ID.h"
#include "F1AP_SuccessfulOutcome.h"
#include "F1AP_Configured-EPS-TAC.h"
#include "F1AP_Candidate-SpCell-List.h"
#include "F1AP_SRBs-ToBeReleased-Item.h"
#include "F1AP_QoSInformation.h"
#include "F1AP_SCell-ToBeSetup-Item.h"
#include "F1AP_SRBs-ToBeSetup-Item.h"
#include "F1AP_GBR-QoSFlowInformation.h"
#include "F1AP_SCellIndex.h"
#include "F1AP_DRBs-SetupMod-Item.h"
#include "F1AP_TransmissionStopIndicator.h"
#include "F1AP_UEContextSetupFailure.h"
#include "F1AP_DRBs-FailedToBeModified-List.h"
#include "F1AP_DRBs-FailedToBeSetupMod-Item.h"
#include "F1AP_ProtocolExtensionID.h"
#include "F1AP_Cells-To-Be-Broadcast-Item.h"
#include "F1AP_QCI.h"
#include "conversions.h"
#include "platform_types.h"
#include "common/utils/LOG/log.h"
#include "intertask_interface.h"
#include "sctp_messages_types.h"
#include "f1ap_messages_types.h"
#include <arpa/inet.h>
#include "T.h"
#include "common/ran_context.h"
#include "msc.h"
/* Checking version of ASN1C compiler */
#if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION)
# error "You are compiling f1ap with the wrong version of ASN1C"
#endif
#ifndef FALSE
# define FALSE (0)
#endif
#ifndef TRUE
# define TRUE (!FALSE)
#endif
#define F1AP_UE_ID_FMT "0x%06"PRIX32
#include "assertions.h"
#if defined(ENB_MODE)
# include "common/utils/LOG/log.h"
# include "f1ap_default_values.h"
# define F1AP_ERROR(x, args...) LOG_E(F1AP, x, ##args)
# define F1AP_WARN(x, args...) LOG_W(F1AP, x, ##args)
# define F1AP_TRAF(x, args...) LOG_I(F1AP, x, ##args)
# define F1AP_INFO(x, args...) LOG_I(F1AP, x, ##args)
# define F1AP_DEBUG(x, args...) LOG_I(F1AP, x, ##args)
#else
//# include "mme_default_values.h"
# define F1AP_ERROR(x, args...) do { fprintf(stdout, "[F1AP][E]"x, ##args); } while(0)
# define F1AP_WARN(x, args...) do { fprintf(stdout, "[F1AP][W]"x, ##args); } while(0)
# define F1AP_TRAF(x, args...) do { fprintf(stdout, "[F1AP][T]"x, ##args); } while(0)
# define F1AP_INFO(x, args...) do { fprintf(stdout, "[F1AP][I]"x, ##args); } while(0)
# define F1AP_DEBUG(x, args...) do { fprintf(stdout, "[F1AP][D]"x, ##args); } while(0)
#endif
//Forward declaration
#define F1AP_FIND_PROTOCOLIE_BY_ID(IE_TYPE, ie, container, IE_ID, mandatory) \
do {\
IE_TYPE **ptr; \
ie = NULL; \
for (ptr = container->protocolIEs.list.array; \
ptr < &container->protocolIEs.list.array[container->protocolIEs.list.count]; \
ptr++) { \
if((*ptr)->id == IE_ID) { \
ie = *ptr; \
break; \
} \
} \
if (mandatory) DevAssert(ie != NULL); \
} while(0)
/** \brief Function callback prototype.
**/
typedef int (*f1ap_message_decoded_callback)(
instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *message_p
);
typedef struct f1ap_cudu_ue_inst_s {
// used for eNB stats generation
rnti_t rnti;
module_id_t f1ap_uid;
module_id_t mac_uid;
module_id_t du_ue_f1ap_id;
module_id_t cu_ue_f1ap_id;
} f1ap_cudu_ue_t;
typedef struct f1ap_cudu_inst_s {
uint16_t num_ues;
f1ap_cudu_ue_t f1ap_ue[MAX_MOBILES_PER_ENB];
} f1ap_cudu_inst_t;
uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_t cu_mod_idP);
int f1ap_add_ue(f1ap_cudu_inst_t *f1_inst,
module_id_t module_idP,
int CC_idP,
int UE_id,
rnti_t rntiP);
int f1ap_remove_ue(f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP);
int f1ap_get_du_ue_f1ap_id (f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP);
int f1ap_get_cu_ue_f1ap_id (f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP);
int f1ap_get_rnti_by_du_id(f1ap_cudu_inst_t *f1_inst,
module_id_t du_ue_f1ap_id );
int f1ap_get_rnti_by_cu_id(f1ap_cudu_inst_t *f1_inst,
module_id_t cu_ue_f1ap_id );
int f1ap_get_du_uid(f1ap_cudu_inst_t *f1_inst,
module_id_t du_ue_f1ap_id );
int f1ap_get_cu_uid(f1ap_cudu_inst_t *f1_inst,
module_id_t cu_ue_f1ap_id );
int f1ap_get_uid_by_rnti(f1ap_cudu_inst_t *f1_inst,
rnti_t rntiP );
int f1ap_du_add_cu_ue_id(f1ap_cudu_inst_t *f1_inst,
module_id_t du_ue_f1ap_id,
module_id_t cu_ue_f1ap_id);
int f1ap_cu_add_du_ue_id(f1ap_cudu_inst_t *f1_inst,
module_id_t cu_ue_f1ap_id,
module_id_t du_ue_f1ap_id);
#endif /* F1AP_COMMON_H_ */
@@ -0,0 +1,905 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_cu_interface_management.c
* \brief f1ap interface management for CU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#include "f1ap_common.h"
#include "f1ap_encoder.h"
#include "f1ap_decoder.h"
#include "f1ap_itti_messaging.h"
#include "f1ap_cu_interface_management.h"
extern f1ap_setup_req_t *f1ap_du_data_from_du;
int CU_send_RESET(instance_t instance, F1AP_Reset_t *Reset) {
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_handle_RESET_ACKKNOWLEDGE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_handle_RESET(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_send_RESET_ACKNOWLEDGE(instance_t instance, F1AP_ResetAcknowledge_t *ResetAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
}
/*
Error Indication
*/
int CU_handle_ERROR_INDICATION(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_send_ERROR_INDICATION(instance_t instance, F1AP_ErrorIndication_t *ErrorIndication) {
AssertFatal(1==0,"Not implemented yet\n");
}
/*
F1 Setup
*/
int CU_handle_F1_SETUP_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu)
{
LOG_D(F1AP, "CU_handle_F1_SETUP_REQUEST\n");
MessageDef *message_p;
F1AP_F1SetupRequest_t *container;
F1AP_F1SetupRequestIEs_t *ie;
int i = 0;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage->value.choice.F1SetupRequest;
/* F1 Setup Request == Non UE-related procedure -> stream 0 */
if (stream != 0) {
LOG_W(F1AP, "[SCTP %d] Received f1 setup request on stream != 0 (%d)\n",
assoc_id, stream);
}
message_p = itti_alloc_new_message(TASK_RRC_ENB, F1AP_SETUP_REQ);
/* assoc_id */
F1AP_SETUP_REQ(message_p).assoc_id = assoc_id;
/* gNB_DU_id */
// this function exits if the ie is mandatory
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_ID, true);
asn_INTEGER2ulong(&ie->value.choice.GNB_DU_ID, &F1AP_SETUP_REQ(message_p).gNB_DU_id);
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).gNB_DU_id %lu \n", F1AP_SETUP_REQ(message_p).gNB_DU_id);
/* gNB_DU_name */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_Name, true);
F1AP_SETUP_REQ(message_p).gNB_DU_name = calloc(ie->value.choice.GNB_DU_Name.size + 1, sizeof(char));
memcpy(F1AP_SETUP_REQ(message_p).gNB_DU_name, ie->value.choice.GNB_DU_Name.buf,
ie->value.choice.GNB_DU_Name.size);
/* Convert the mme name to a printable string */
F1AP_SETUP_REQ(message_p).gNB_DU_name[ie->value.choice.GNB_DU_Name.size] = '\0';
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).gNB_DU_name %s \n", F1AP_SETUP_REQ(message_p).gNB_DU_name);
/* GNB_DU_Served_Cells_List */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_F1SetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_Served_Cells_List, true);
F1AP_SETUP_REQ(message_p).num_cells_available = ie->value.choice.GNB_DU_Served_Cells_List.list.count;
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).num_cells_available %d \n",
F1AP_SETUP_REQ(message_p).num_cells_available);
int num_cells_available = F1AP_SETUP_REQ(message_p).num_cells_available;
for (i=0; i<num_cells_available; i++) {
F1AP_GNB_DU_Served_Cells_Item_t *served_celles_item_p;
served_celles_item_p = &(((F1AP_GNB_DU_Served_Cells_ItemIEs_t *)ie->value.choice.GNB_DU_Served_Cells_List.list.array[i])->value.choice.GNB_DU_Served_Cells_Item);
/* tac */
OCTET_STRING_TO_INT16(&(served_celles_item_p->served_Cell_Information.fiveGS_TAC), F1AP_SETUP_REQ(message_p).tac[i]);
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).tac[%d] %d \n",
i, F1AP_SETUP_REQ(message_p).tac[i]);
/* - nRCGI */
TBCD_TO_MCC_MNC(&(served_celles_item_p->served_Cell_Information.nRCGI.pLMN_Identity), F1AP_SETUP_REQ(message_p).mcc[i],
F1AP_SETUP_REQ(message_p).mnc[i],
F1AP_SETUP_REQ(message_p).mnc_digit_length[i]);
// NR cellID
BIT_STRING_TO_NR_CELL_IDENTITY(&served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity,
F1AP_SETUP_REQ(message_p).nr_cellid[i]);
LOG_D(F1AP, "[SCTP %d] Received nRCGI: MCC %d, MNC %d, CELL_ID %llu\n", assoc_id,
F1AP_SETUP_REQ(message_p).mcc[i],
F1AP_SETUP_REQ(message_p).mnc[i],
(long long unsigned int)F1AP_SETUP_REQ(message_p).nr_cellid[i]);
LOG_D(F1AP, "nr_cellId : %x %x %x %x %x\n",
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[0],
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[1],
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[2],
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[3],
served_celles_item_p->served_Cell_Information.nRCGI.nRCellIdentity.buf[4]);
/* - nRPCI */
F1AP_SETUP_REQ(message_p).nr_pci[i] = served_celles_item_p->served_Cell_Information.nRPCI;
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).nr_pci[%d] %d \n",
i, F1AP_SETUP_REQ(message_p).nr_pci[i]);
// System Information
/* mib */
F1AP_SETUP_REQ(message_p).mib[i] = calloc(served_celles_item_p->gNB_DU_System_Information->mIB_message.size + 1, sizeof(char));
memcpy(F1AP_SETUP_REQ(message_p).mib[i], served_celles_item_p->gNB_DU_System_Information->mIB_message.buf,
served_celles_item_p->gNB_DU_System_Information->mIB_message.size);
/* Convert the mme name to a printable string */
F1AP_SETUP_REQ(message_p).mib[i][served_celles_item_p->gNB_DU_System_Information->mIB_message.size] = '\0';
F1AP_SETUP_REQ(message_p).mib_length[i] = served_celles_item_p->gNB_DU_System_Information->mIB_message.size;
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).mib[%d] %s , len = %d \n",
i, F1AP_SETUP_REQ(message_p).mib[i], F1AP_SETUP_REQ(message_p).mib_length[i]);
/* sib1 */
F1AP_SETUP_REQ(message_p).sib1[i] = calloc(served_celles_item_p->gNB_DU_System_Information->sIB1_message.size + 1, sizeof(char));
memcpy(F1AP_SETUP_REQ(message_p).sib1[i], served_celles_item_p->gNB_DU_System_Information->sIB1_message.buf,
served_celles_item_p->gNB_DU_System_Information->sIB1_message.size);
/* Convert the mme name to a printable string */
F1AP_SETUP_REQ(message_p).sib1[i][served_celles_item_p->gNB_DU_System_Information->sIB1_message.size] = '\0';
F1AP_SETUP_REQ(message_p).sib1_length[i] = served_celles_item_p->gNB_DU_System_Information->sIB1_message.size;
LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).sib1[%d] %s , len = %d \n",
i, F1AP_SETUP_REQ(message_p).sib1[i], F1AP_SETUP_REQ(message_p).sib1_length[i]);
}
*f1ap_du_data_from_du = F1AP_SETUP_REQ(message_p);
// char *measurement_timing_information[F1AP_MAX_NB_CELLS];
// uint8_t ranac[F1AP_MAX_NB_CELLS];
// int fdd_flag = f1ap_setup_req->fdd_flag;
// union {
// struct {
// uint32_t ul_nr_arfcn;
// uint8_t ul_scs;
// uint8_t ul_nrb;
// uint32_t dl_nr_arfcn;
// uint8_t dl_scs;
// uint8_t dl_nrb;
// uint32_t sul_active;
// uint32_t sul_nr_arfcn;
// uint8_t sul_scs;
// uint8_t sul_nrb;
// uint8_t num_frequency_bands;
// uint16_t nr_band[32];
// uint8_t num_sul_frequency_bands;
// uint16_t nr_sul_band[32];
// } fdd;
// struct {
// uint32_t nr_arfcn;
// uint8_t scs;
// uint8_t nrb;
// uint32_t sul_active;
// uint32_t sul_nr_arfcn;
// uint8_t sul_scs;
// uint8_t sul_nrb;
// uint8_t num_frequency_bands;
// uint16_t nr_band[32];
// uint8_t num_sul_frequency_bands;
// uint16_t nr_sul_band[32];
// } tdd;
// } nr_mode_info[F1AP_MAX_NB_CELLS];
MSC_LOG_TX_MESSAGE(
MSC_F1AP_CU,
MSC_RRC_ENB,
0,
0,
MSC_AS_TIME_FMT" CU_handle_F1_SETUP_REQUEST",
0,0//MSC_AS_TIME_ARGS(ctxt_pP),
);
if (num_cells_available > 0) {
itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(instance), message_p);
} else {
CU_send_F1_SETUP_FAILURE(instance);
return -1;
}
return 0;
}
int CU_send_F1_SETUP_RESPONSE(instance_t instance,
f1ap_setup_resp_t *f1ap_setup_resp) {
module_id_t enb_mod_idP;
module_id_t cu_mod_idP;
// This should be fixed
enb_mod_idP = (module_id_t)0;
cu_mod_idP = (module_id_t)0;
F1AP_F1AP_PDU_t pdu;
F1AP_F1SetupResponse_t *out;
F1AP_F1SetupResponseIEs_t *ie;
uint8_t *buffer;
uint32_t len;
int i = 0;
/* Create */
/* 0. Message Type */
memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome = (F1AP_SuccessfulOutcome_t *)calloc(1, sizeof(F1AP_SuccessfulOutcome_t));
pdu.choice.successfulOutcome->procedureCode = F1AP_ProcedureCode_id_F1Setup;
pdu.choice.successfulOutcome->criticality = F1AP_Criticality_reject;
pdu.choice.successfulOutcome->value.present = F1AP_SuccessfulOutcome__value_PR_F1SetupResponse;
out = &pdu.choice.successfulOutcome->value.choice.F1SetupResponse;
/* mandatory */
/* c1. Transaction ID (integer value)*/
ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_F1SetupResponseIEs__value_PR_TransactionID;
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, cu_mod_idP);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
/* c2. GNB_CU_Name */
if (f1ap_setup_resp->gNB_CU_name != NULL) {
ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_Name;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_F1SetupResponseIEs__value_PR_GNB_CU_Name;
OCTET_STRING_fromBuf(&ie->value.choice.GNB_CU_Name, f1ap_setup_resp->gNB_CU_name,
strlen(f1ap_setup_resp->gNB_CU_name));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* mandatory */
/* c3. cells to be Activated list */
ie = (F1AP_F1SetupResponseIEs_t *)calloc(1, sizeof(F1AP_F1SetupResponseIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List;
int num_cells_to_activate = f1ap_setup_resp->num_cells_to_activate;
LOG_D(F1AP, "num_cells_to_activate = %d \n", num_cells_to_activate);
for (i=0;
i<num_cells_to_activate;
i++) {
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies;
cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemIEs_t));
cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject;
cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
/* 3.1 cells to be Activated list item */
F1AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item;
memset((void *)&cells_to_be_activated_list_item, 0, sizeof(F1AP_Cells_to_be_Activated_List_Item_t));
/* - nRCGI */
F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_setup_resp->mcc[i], f1ap_setup_resp->mnc[i], f1ap_setup_resp->mnc_digit_length[i],
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_resp->nr_cellid[i], &nRCGI.nRCellIdentity);
cells_to_be_activated_list_item.nRCGI = nRCGI;
/* optional */
/* - nRPCI */
if (1) {
cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
*cells_to_be_activated_list_item.nRPCI = f1ap_setup_resp->nrpci[i]; // int 0..1007
}
/* optional */
/* - gNB-CU System Information */
if (1) {
/* 3.1.2 gNB-CUSystem Information */
F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs;
cells_to_be_activated_list_itemExtIEs = (F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t));
cells_to_be_activated_list_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation;
cells_to_be_activated_list_itemExtIEs->criticality = F1AP_Criticality_reject;
cells_to_be_activated_list_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation;
F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t *)calloc(1, sizeof(F1AP_GNB_CUSystemInformation_t));
//LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]);
//for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
// printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
//printf("\n");
OCTET_STRING_fromBuf(&gNB_CUSystemInformation->sImessage,
(const char*)f1ap_setup_resp->SI_container[i][0],
f1ap_setup_resp->SI_container_length[i][0]);
LOG_D(F1AP, "f1ap_setup_resp->SI_container_length = %d \n", f1ap_setup_resp->SI_container_length[0][0]);
cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = *gNB_CUSystemInformation;
F1AP_ProtocolExtensionContainer_160P9_t p_160P9_t;
memset((void *)&p_160P9_t, 0, sizeof(F1AP_ProtocolExtensionContainer_160P9_t));
ASN_SEQUENCE_ADD(&p_160P9_t.list,
cells_to_be_activated_list_itemExtIEs);
cells_to_be_activated_list_item.iE_Extensions = (struct F1AP_ProtocolExtensionContainer*)&p_160P9_t;
}
/* ADD */
cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list,
cells_to_be_activated_list_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 setup request\n");
return -1;
}
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0);
return 0;
}
int CU_send_F1_SETUP_FAILURE(instance_t instance) {
LOG_D(F1AP, "CU_send_F1_SETUP_FAILURE\n");
module_id_t enb_mod_idP;
module_id_t cu_mod_idP;
// This should be fixed
enb_mod_idP = (module_id_t)0;
cu_mod_idP = (module_id_t)0;
F1AP_F1AP_PDU_t pdu;
F1AP_F1SetupFailure_t *out;
F1AP_F1SetupFailureIEs_t *ie;
uint8_t *buffer;
uint32_t len;
/* Create */
/* 0. Message Type */
memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_unsuccessfulOutcome;
pdu.choice.unsuccessfulOutcome = (F1AP_UnsuccessfulOutcome_t *)calloc(1, sizeof(F1AP_UnsuccessfulOutcome_t));
pdu.choice.unsuccessfulOutcome->procedureCode = F1AP_ProcedureCode_id_F1Setup;
pdu.choice.unsuccessfulOutcome->criticality = F1AP_Criticality_reject;
pdu.choice.unsuccessfulOutcome->value.present = F1AP_UnsuccessfulOutcome__value_PR_F1SetupFailure;
out = &pdu.choice.unsuccessfulOutcome->value.choice.F1SetupFailure;
/* mandatory */
/* c1. Transaction ID (integer value)*/
ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_F1SetupFailureIEs__value_PR_TransactionID;
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(enb_mod_idP, cu_mod_idP);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c2. Cause */
ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Cause;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_F1SetupFailureIEs__value_PR_Cause;
ie->value.choice.Cause.present = F1AP_Cause_PR_radioNetwork;
ie->value.choice.Cause.choice.radioNetwork = F1AP_CauseRadioNetwork_unspecified;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
/* c3. TimeToWait */
if (0) {
ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_TimeToWait;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_F1SetupFailureIEs__value_PR_TimeToWait;
ie->value.choice.TimeToWait = F1AP_TimeToWait_v10s;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* optional */
/* c4. CriticalityDiagnostics*/
if (0) {
ie = (F1AP_F1SetupFailureIEs_t *)calloc(1, sizeof(F1AP_F1SetupFailureIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_CriticalityDiagnostics;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_F1SetupFailureIEs__value_PR_CriticalityDiagnostics;
ie->value.choice.CriticalityDiagnostics.procedureCode = (F1AP_ProcedureCode_t *)calloc(1, sizeof(F1AP_ProcedureCode_t));
*ie->value.choice.CriticalityDiagnostics.procedureCode = F1AP_ProcedureCode_id_UEContextSetup;
ie->value.choice.CriticalityDiagnostics.triggeringMessage = (F1AP_TriggeringMessage_t *)calloc(1, sizeof(F1AP_TriggeringMessage_t));
*ie->value.choice.CriticalityDiagnostics.triggeringMessage = F1AP_TriggeringMessage_initiating_message;
ie->value.choice.CriticalityDiagnostics.procedureCriticality = (F1AP_Criticality_t *)calloc(1, sizeof(F1AP_Criticality_t));
*ie->value.choice.CriticalityDiagnostics.procedureCriticality = F1AP_Criticality_reject;
ie->value.choice.CriticalityDiagnostics.transactionID = (F1AP_TransactionID_t *)calloc(1, sizeof(F1AP_TransactionID_t));
*ie->value.choice.CriticalityDiagnostics.transactionID = 0;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 setup request\n");
return -1;
}
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0);
return 0;
}
/*
gNB-DU Configuration Update
*/
int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_send_gNB_DU_CONFIGURATION_FAILURE(instance_t instance,
F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure) {
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
}
/*
gNB-CU Configuration Update
*/
//void CU_send_gNB_CU_CONFIGURATION_UPDATE(F1AP_GNBCUConfigurationUpdate_t *GNBCUConfigurationUpdate) {
int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_idP) {
F1AP_F1AP_PDU_t pdu;
F1AP_GNBCUConfigurationUpdate_t *out;
F1AP_GNBCUConfigurationUpdateIEs_t *ie;
uint8_t *buffer;
uint32_t len;
int i = 0;
// for test
int mcc = 208;
int mnc = 93;
int mnc_digit_length = 8;
/* Create */
/* 0. Message Type */
memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t));
pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_gNBCUConfigurationUpdate;
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_ignore;
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate;
out = &pdu.choice.initiatingMessage->value.choice.GNBCUConfigurationUpdate;
/* mandatory */
/* c1. Transaction ID (integer value) */
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID;
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(instance, du_mod_idP);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c2. Cells_to_be_Activated_List */
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List;
for (i=0;
i<1;
i++) {
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies;
cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemIEs_t));
cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject;
cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
/* 2.1 cells to be Activated list item */
F1AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item;
memset((void *)&cells_to_be_activated_list_item, 0, sizeof(F1AP_Cells_to_be_Activated_List_Item_t));
/* - nRCGI */
F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
cells_to_be_activated_list_item.nRCGI = nRCGI;
/* optional */
/* - nRPCI */
if (0) {
cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
*cells_to_be_activated_list_item.nRPCI = 321L; // int 0..1007
}
/* optional */
/* - gNB-CU System Information */
//if (1) {
//}
/* ADD */
cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list,
cells_to_be_activated_list_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c3. Cells_to_be_Deactivated_List */
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Deactivated_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Deactivated_List;
for (i=0;
i<1;
i++) {
F1AP_Cells_to_be_Deactivated_List_ItemIEs_t *cells_to_be_deactivated_list_item_ies;
cells_to_be_deactivated_list_item_ies = (F1AP_Cells_to_be_Deactivated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Deactivated_List_ItemIEs_t));
cells_to_be_deactivated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
cells_to_be_deactivated_list_item_ies->criticality = F1AP_Criticality_reject;
cells_to_be_deactivated_list_item_ies->value.present = F1AP_Cells_to_be_Deactivated_List_ItemIEs__value_PR_Cells_to_be_Deactivated_List_Item;
/* 3.1 cells to be Deactivated list item */
F1AP_Cells_to_be_Deactivated_List_Item_t cells_to_be_deactivated_list_item;
memset((void *)&cells_to_be_deactivated_list_item, 0, sizeof(F1AP_Cells_to_be_Deactivated_List_Item_t));
/* - nRCGI */
F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
cells_to_be_deactivated_list_item.nRCGI = nRCGI;
//}
/* ADD */
cells_to_be_deactivated_list_item_ies->value.choice.Cells_to_be_Deactivated_List_Item = cells_to_be_deactivated_list_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Deactivated_List.list,
cells_to_be_deactivated_list_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c4. GNB_CU_TNL_Association_To_Add_List */
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Add_List;
for (i=0;
i<1;
i++) {
F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t *gnb_cu_tnl_association_to_add_item_ies;
gnb_cu_tnl_association_to_add_item_ies = (F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t));
gnb_cu_tnl_association_to_add_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_Item;
gnb_cu_tnl_association_to_add_item_ies->criticality = F1AP_Criticality_reject;
gnb_cu_tnl_association_to_add_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Add_Item;
/* 4.1 GNB_CU_TNL_Association_To_Add_Item */
F1AP_GNB_CU_TNL_Association_To_Add_Item_t gnb_cu_tnl_association_to_add_item;
memset((void *)&gnb_cu_tnl_association_to_add_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Add_Item_t));
/* 4.1.1 tNLAssociationTransportLayerAddress */
F1AP_CP_TransportLayerAddress_t transportLayerAddress;
memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
// memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
// transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
// transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
// TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
gnb_cu_tnl_association_to_add_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
/* 4.1.2 tNLAssociationUsage */
gnb_cu_tnl_association_to_add_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
/* ADD */
gnb_cu_tnl_association_to_add_item_ies->value.choice.GNB_CU_TNL_Association_To_Add_Item = gnb_cu_tnl_association_to_add_item;
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Add_List.list,
gnb_cu_tnl_association_to_add_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c5. GNB_CU_TNL_Association_To_Remove_List */
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Remove_List;
for (i=0;
i<1;
i++) {
F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t *gnb_cu_tnl_association_to_remove_item_ies;
gnb_cu_tnl_association_to_remove_item_ies = (F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t));
gnb_cu_tnl_association_to_remove_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_Item;
gnb_cu_tnl_association_to_remove_item_ies->criticality = F1AP_Criticality_reject;
gnb_cu_tnl_association_to_remove_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Remove_Item;
/* 4.1 GNB_CU_TNL_Association_To_Remove_Item */
F1AP_GNB_CU_TNL_Association_To_Remove_Item_t gnb_cu_tnl_association_to_remove_item;
memset((void *)&gnb_cu_tnl_association_to_remove_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Remove_Item_t));
/* 4.1.1 tNLAssociationTransportLayerAddress */
F1AP_CP_TransportLayerAddress_t transportLayerAddress;
memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
// memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
// transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
// transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
// TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
gnb_cu_tnl_association_to_remove_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
/* ADD */
gnb_cu_tnl_association_to_remove_item_ies->value.choice.GNB_CU_TNL_Association_To_Remove_Item = gnb_cu_tnl_association_to_remove_item;
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Remove_List.list,
gnb_cu_tnl_association_to_remove_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c6. GNB_CU_TNL_Association_To_Update_List */
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Update_List;
for (i=0;
i<1;
i++) {
F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t *gnb_cu_tnl_association_to_update_item_ies;
gnb_cu_tnl_association_to_update_item_ies = (F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t));
gnb_cu_tnl_association_to_update_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_Item;
gnb_cu_tnl_association_to_update_item_ies->criticality = F1AP_Criticality_reject;
gnb_cu_tnl_association_to_update_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Update_Item;
/* 4.1 GNB_CU_TNL_Association_To_Update_Item */
F1AP_GNB_CU_TNL_Association_To_Update_Item_t gnb_cu_tnl_association_to_update_item;
memset((void *)&gnb_cu_tnl_association_to_update_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Update_Item_t));
/* 4.1.1 tNLAssociationTransportLayerAddress */
F1AP_CP_TransportLayerAddress_t transportLayerAddress;
memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
// memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
// transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
// transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
// TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
gnb_cu_tnl_association_to_update_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
/* 4.1.2 tNLAssociationUsage */
if (1) {
gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = (F1AP_TNLAssociationUsage_t *)calloc(1, sizeof(F1AP_TNLAssociationUsage_t));
*gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
}
/* ADD */
gnb_cu_tnl_association_to_update_item_ies->value.choice.GNB_CU_TNL_Association_To_Update_Item = gnb_cu_tnl_association_to_update_item;
ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Update_List.list,
gnb_cu_tnl_association_to_update_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c7. Cells_to_be_Barred_List */
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Barred_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Barred_List;
for (i=0;
i<1;
i++) {
F1AP_Cells_to_be_Barred_ItemIEs_t *cells_to_be_barred_item_ies;
cells_to_be_barred_item_ies = (F1AP_Cells_to_be_Barred_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Barred_ItemIEs_t));
cells_to_be_barred_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
cells_to_be_barred_item_ies->criticality = F1AP_Criticality_reject;
cells_to_be_barred_item_ies->value.present = F1AP_Cells_to_be_Barred_ItemIEs__value_PR_Cells_to_be_Barred_Item;
/* 7.1 cells to be Deactivated list item */
F1AP_Cells_to_be_Barred_Item_t cells_to_be_barred_item;
memset((void *)&cells_to_be_barred_item, 0, sizeof(F1AP_Cells_to_be_Barred_Item_t));
/* - nRCGI */
F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
cells_to_be_barred_item.nRCGI = nRCGI;
/* 7.2 cellBarred*/
cells_to_be_barred_item.cellBarred = F1AP_CellBarred_not_barred;
/* ADD */
cells_to_be_barred_item_ies->value.choice.Cells_to_be_Barred_Item = cells_to_be_barred_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Barred_List.list,
cells_to_be_barred_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c8. Protected_EUTRA_Resources_List */
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Protected_EUTRA_Resources_List;
for (i=0;
i<1;
i++) {
F1AP_Protected_EUTRA_Resources_ItemIEs_t *protected_eutra_resources_item_ies;
/* 8.1 SpectrumSharingGroupID */
protected_eutra_resources_item_ies = (F1AP_Protected_EUTRA_Resources_ItemIEs_t *)calloc(1, sizeof(F1AP_Protected_EUTRA_Resources_ItemIEs_t));
protected_eutra_resources_item_ies->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
protected_eutra_resources_item_ies->criticality = F1AP_Criticality_reject;
protected_eutra_resources_item_ies->value.present = F1AP_Protected_EUTRA_Resources_ItemIEs__value_PR_SpectrumSharingGroupID;
protected_eutra_resources_item_ies->value.choice.SpectrumSharingGroupID = 1L;
ASN_SEQUENCE_ADD(&ie->value.choice.Protected_EUTRA_Resources_List.list, protected_eutra_resources_item_ies);
/* 8.2 ListofEUTRACellsinGNBDUCoordination */
protected_eutra_resources_item_ies = (F1AP_Protected_EUTRA_Resources_ItemIEs_t *)calloc(1, sizeof(F1AP_Protected_EUTRA_Resources_ItemIEs_t));
protected_eutra_resources_item_ies->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
protected_eutra_resources_item_ies->criticality = F1AP_Criticality_reject;
protected_eutra_resources_item_ies->value.present = F1AP_Protected_EUTRA_Resources_ItemIEs__value_PR_ListofEUTRACellsinGNBDUCoordination;
F1AP_Served_EUTRA_Cells_Information_t served_eutra_cells_information;
memset((void *)&served_eutra_cells_information, 0, sizeof(F1AP_Served_EUTRA_Cells_Information_t));
F1AP_EUTRA_Mode_Info_t eUTRA_Mode_Info;
memset((void *)&eUTRA_Mode_Info, 0, sizeof(F1AP_EUTRA_Mode_Info_t));
// eUTRAFDD
eUTRA_Mode_Info.present = F1AP_EUTRA_Mode_Info_PR_eUTRAFDD;
F1AP_EUTRA_FDD_Info_t *eutra_fdd_info;
eutra_fdd_info = (F1AP_EUTRA_FDD_Info_t *)calloc(1, sizeof(F1AP_EUTRA_FDD_Info_t));
eutra_fdd_info->uL_offsetToPointA = 123L;
eutra_fdd_info->dL_offsetToPointA = 456L;
eUTRA_Mode_Info.choice.eUTRAFDD = eutra_fdd_info;
// eUTRATDD
// eUTRA_Mode_Info.present = F1AP_EUTRA_Mode_Info_PR_eUTRATDD;
// F1AP_EUTRA_TDD_Info_t *eutra_tdd_info;
// eutra_tdd_info = (F1AP_EUTRA_TDD_Info_t *)calloc(1, sizeof(F1AP_EUTRA_TDD_Info_t));
// eutra_tdd_info->uL_offsetToPointA = 123L;
// eutra_tdd_info->dL_offsetToPointA = 456L;
// eUTRA_Mode_Info.choice.eUTRATDD = eutra_tdd_info;
served_eutra_cells_information.eUTRA_Mode_Info = eUTRA_Mode_Info;
OCTET_STRING_fromBuf(&served_eutra_cells_information.protectedEUTRAResourceIndication, "asdsa1d32sa1d31asd31as",
strlen("asdsa1d32sa1d31asd31as"));
ASN_SEQUENCE_ADD(&protected_eutra_resources_item_ies->value.choice.ListofEUTRACellsinGNBDUCoordination.list, &served_eutra_cells_information);
ASN_SEQUENCE_ADD(&ie->value.choice.Protected_EUTRA_Resources_List.list, protected_eutra_resources_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 setup request\n");
return -1;
}
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data_from_du->assoc_id, buffer, len, 0);
return 0;
}
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_handle_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
AssertFatal(0, "Not implemented yet\n");
}
int CU_send_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse) {
AssertFatal(0, "Not implemented yet\n");
}
@@ -0,0 +1,111 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_cu_interface_management.h
* \brief f1ap interface management for CU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#ifndef F1AP_CU_INTERFACE_MANAGEMENT_H_
#define F1AP_CU_INTERFACE_MANAGEMENT_H_
/*
* Reset
*/
int CU_send_RESET(instance_t instance, F1AP_Reset_t *Reset);
int CU_handle_RESET_ACKKNOWLEDGE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_handle_RESET(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_send_RESET_ACKNOWLEDGE(instance_t instance, F1AP_ResetAcknowledge_t *ResetAcknowledge);
/*
* Error Indication
*/
int CU_handle_ERROR_INDICATION(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_send_ERROR_INDICATION(instance_t instance, F1AP_ErrorIndication_t *ErrorIndication);
/*
* F1 Setup
*/
int CU_handle_F1_SETUP_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_send_F1_SETUP_RESPONSE(instance_t instance, f1ap_setup_resp_t *f1ap_setup_resp);
int CU_send_F1_SETUP_FAILURE(instance_t instance);
/*
* gNB-DU Configuration Update
*/
int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_send_gNB_DU_CONFIGURATION_FAILURE(instance_t instance,
F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure);
int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge);
/*
* gNB-CU Configuration Update
*/
int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_idP);
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* gNB-DU Resource Coordination
*/
int CU_handle_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_send_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse);
#endif /* F1AP_CU_INTERFACE_MANAGEMENT_H_ */
+31
View File
@@ -0,0 +1,31 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
+31
View File
@@ -0,0 +1,31 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
@@ -0,0 +1,388 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_cu_rrc_message_transfer.c
* \brief f1ap rrc message transfer for CU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#include "f1ap_common.h"
#include "f1ap_encoder.h"
#include "f1ap_decoder.h"
#include "f1ap_itti_messaging.h"
#include "f1ap_cu_rrc_message_transfer.h"
#include "common/ran_context.h"
#include "openair3/UTILS/conversions.h"
// undefine C_RNTI from
// openair1/PHY/LTE_TRANSPORT/transport_common.h which
// replaces in ie->value.choice.C_RNTI, causing
// a compile error
#undef C_RNTI
// Bing Kai: create CU and DU context, and put all the information there.
uint64_t du_ue_f1ap_id = 0;
uint32_t f1ap_assoc_id = 0;
uint32_t f1ap_stream = 0;
extern f1ap_cudu_inst_t f1ap_cu_inst[MAX_eNB];
/*
Initial UL RRC Message Transfer
*/
extern RAN_CONTEXT_t RC;
int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
LOG_D(F1AP, "CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER\n");
// decode the F1 message
// get the rrc message from the contauiner
// call func rrc_eNB_decode_ccch: <-- needs some update here
MessageDef *message_p;
F1AP_InitialULRRCMessageTransfer_t *container;
F1AP_InitialULRRCMessageTransferIEs_t *ie;
rnti_t rnti;
sdu_size_t ccch_sdu_len;
int CC_id =0;
DevAssert(pdu != NULL);
if (stream != 0) {
LOG_E(F1AP, "[SCTP %d] Received F1 on stream != 0 (%d)\n",
assoc_id, stream);
return -1;
}
// TODO: use context
f1ap_stream = stream;
f1ap_assoc_id = assoc_id;
container = &pdu->choice.initiatingMessage->value.choice.InitialULRRCMessageTransfer;
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
LOG_D(F1AP, "du_ue_f1ap_id %lu \n", du_ue_f1ap_id);
/* NRCGI
* TODO: process NRCGI
*/
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_NRCGI, true);
uint64_t nr_cellid;
BIT_STRING_TO_NR_CELL_IDENTITY(&ie->value.choice.NRCGI.nRCellIdentity,nr_cellid);
/* RNTI */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_C_RNTI, true);
BUFFER_TO_INT16(ie->value.choice.C_RNTI.buf, rnti);
/* RRC Container */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_RRCContainer, true);
// create an ITTI message and copy SDU
message_p = itti_alloc_new_message (TASK_CU_F1, RRC_MAC_CCCH_DATA_IND);
memset (RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE);
ccch_sdu_len = ie->value.choice.RRCContainer.size;
memcpy(RRC_MAC_CCCH_DATA_IND (message_p).sdu, ie->value.choice.RRCContainer.buf,
ccch_sdu_len);
//LOG_I(F1AP, "%s() RRCContainer (CCCH) size %ld: ", __func__,
// ie->value.choice.RRCContainer.size);
//for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
// printf("%02x ", RRC_MAC_CCCH_DATA_IND (message_p).sdu[i]);
//printf("\n");
// Find instance from nr_cellid
int rrc_inst = -1;
for (int i=0;i<RC.nb_inst;i++) {
// first get RRC instance (note, no the ITTI instance)
eNB_RRC_INST *rrc = RC.rrc[i];
if (rrc->nr_cellid == nr_cellid) {
rrc_inst = i;
break;
}
}
AssertFatal(rrc_inst>=0,"couldn't find an RRC instance for nr_cell %llu\n",(unsigned long long int)nr_cellid);
int f1ap_uid = f1ap_add_ue(&f1ap_cu_inst[rrc_inst], rrc_inst, CC_id, 0, rnti);
if (f1ap_uid < 0 ) {
LOG_E(F1AP, "Failed to add UE \n");
return -1;
}
f1ap_cu_inst[rrc_inst].f1ap_ue[f1ap_uid].du_ue_f1ap_id = du_ue_f1ap_id;
RRC_MAC_CCCH_DATA_IND (message_p).frame = 0;
RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = 0;
RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = ccch_sdu_len;
RRC_MAC_CCCH_DATA_IND (message_p).enb_index = rrc_inst; // CU instance
RRC_MAC_CCCH_DATA_IND (message_p).rnti = rnti;
RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id;
itti_send_msg_to_task (TASK_RRC_ENB, instance, message_p);
return 0;
}
/*
DL RRC Message Transfer.
*/
//void CU_send_DL_RRC_MESSAGE_TRANSFER(F1AP_DLRRCMessageTransfer_t *DLRRCMessageTransfer) {
int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
f1ap_dl_rrc_message_t *f1ap_dl_rrc)
{
F1AP_F1AP_PDU_t pdu;
F1AP_DLRRCMessageTransfer_t *out;
F1AP_DLRRCMessageTransferIEs_t *ie;
uint8_t *buffer;
uint32_t len;
/* Create */
/* 0. Message Type */
memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t));
pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_DLRRCMessageTransfer;
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_ignore;
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_DLRRCMessageTransfer;
out = &pdu.choice.initiatingMessage->value.choice.DLRRCMessageTransfer;
/* mandatory */
/* c1. GNB_CU_UE_F1AP_ID */
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(&f1ap_cu_inst[instance], f1ap_dl_rrc->rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
LOG_I(F1AP, "Setting GNB_CU_UE_F1AP_ID %llu associated with UE RNTI %x (instance %d)\n",
(unsigned long long int)ie->value.choice.GNB_CU_UE_F1AP_ID, f1ap_dl_rrc->rnti, instance);
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(&f1ap_cu_inst[instance], f1ap_dl_rrc->rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
LOG_I(F1AP, "GNB_DU_UE_F1AP_ID %llu associated with UE RNTI %x \n", (unsigned long long int)ie->value.choice.GNB_DU_UE_F1AP_ID, f1ap_dl_rrc->rnti);
/* optional */
/* c3. oldgNB_DU_UE_F1AP_ID */
/* if (f1ap_dl_rrc->old_gNB_DU_ue_id != 0xFFFFFFFF) {
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_oldgNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_NOTHING;
ie->value.choice.oldgNB_DU_UE_F1AP_ID = f1ap_dl_rrc->old_gNB_DU_ue_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}*/
/* mandatory */
/* c4. SRBID */
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_SRBID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_SRBID;
ie->value.choice.SRBID = f1ap_dl_rrc->srb_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
/* c5. ExecuteDuplication */
if (f1ap_dl_rrc->execute_duplication) {
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_ExecuteDuplication;
ie->criticality = F1AP_Criticality_ignore;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_ExecuteDuplication;
ie->value.choice.ExecuteDuplication = F1AP_ExecuteDuplication_true;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
// issue in here
/* mandatory */
/* c6. RRCContainer */
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_RRCContainer;
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, (const char*)f1ap_dl_rrc->rrc_container, f1ap_dl_rrc->rrc_container_length);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
//LOG_I(F1AP, "%s() RRCContainer size %d: ", __func__, f1ap_dl_rrc->rrc_container_length);
//for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
// printf("%02x ", f1ap_dl_rrc->rrc_container[i]);
//printf("\n");
/* optional */
/* c7. RAT_FrequencyPriorityInformation */
/* TODO */
if (0) {
ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_RAT_FrequencyPriorityInformation;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_RAT_FrequencyPriorityInformation;
ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_subscriberProfileIDforRFP;
ie->value.choice.RAT_FrequencyPriorityInformation.choice.subscriberProfileIDforRFP = 123L;
//ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_rAT_FrequencySelectionPriority;
//ie->value.choice.RAT_FrequencyPriorityInformation.choice.rAT_FrequencySelectionPriority = 123L;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 setup request\n");
return -1;
}
cu_f1ap_itti_send_sctp_data_req(instance, f1ap_assoc_id /* BK: fix me*/ , buffer, len, 0 /* BK: fix me*/);
return 0;
}
/*
UL RRC Message Transfer
*/
int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
LOG_D(F1AP, "CU_handle_UL_RRC_MESSAGE_TRANSFER \n");
F1AP_ULRRCMessageTransfer_t *container;
F1AP_ULRRCMessageTransferIEs_t *ie;
uint64_t cu_ue_f1ap_id;
uint64_t du_ue_f1ap_id;
uint64_t srb_id;
DevAssert(pdu != NULL);
if (stream != 0) {
LOG_E(F1AP, "[SCTP %d] Received F1 on stream != 0 (%d)\n",
assoc_id, stream);
return -1;
}
container = &pdu->choice.initiatingMessage->value.choice.ULRRCMessageTransfer;
/* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
cu_ue_f1ap_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
LOG_D(F1AP, "cu_ue_f1ap_id %lu associated with RNTI %x\n", cu_ue_f1ap_id, f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance], cu_ue_f1ap_id));
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
LOG_D(F1AP, "du_ue_f1ap_id %lu associated with RNTI %x\n", du_ue_f1ap_id, f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance], du_ue_f1ap_id));
/* mandatory */
/* SRBID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_SRBID, true);
srb_id = ie->value.choice.SRBID;
if (srb_id < 1 )
LOG_E(F1AP, "Unexpected UL RRC MESSAGE for srb_id %lu \n", srb_id);
else
LOG_D(F1AP, "UL RRC MESSAGE for srb_id %lu in DCCH \n", srb_id);
// issue in here
/* mandatory */
/* RRC Container */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ULRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_RRCContainer, true);
// print message in debug mode
// create an ITTI message and copy SDU
/*
message_p = itti_alloc_new_message (TASK_CU_F1, RRC_DCCH_DATA_IND);
RRC_DCCH_DATA_IND (message_p).sdu_p = malloc(ie->value.choice.RRCContainer.size);
RRC_DCCH_DATA_IND (message_p).sdu_size = ie->value.choice.RRCContainer.size;
memcpy(RRC_DCCH_DATA_IND (message_p).sdu_p, ie->value.choice.RRCContainer.buf,
ie->value.choice.RRCContainer.size);
RRC_DCCH_DATA_IND (message_p).dcch_index = srb_id;
RRC_DCCH_DATA_IND (message_p).rnti = f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance], cu_ue_f1ap_id);
RRC_DCCH_DATA_IND (message_p).module_id = instance;
RRC_DCCH_DATA_IND (message_p).eNB_index = instance; // not needed for CU
itti_send_msg_to_task(TASK_RRC_ENB, instance, message_p);
*/
protocol_ctxt_t ctxt;
ctxt.module_id = instance;
ctxt.instance = instance;
ctxt.rnti = f1ap_get_rnti_by_cu_id(&f1ap_cu_inst[instance], cu_ue_f1ap_id);
ctxt.enb_flag = 1;
mem_block_t *mb = get_free_mem_block(ie->value.choice.RRCContainer.size,__func__);
memcpy((void*)mb->data,(void*)ie->value.choice.RRCContainer.buf,ie->value.choice.RRCContainer.size);
LOG_I(F1AP, "Calling pdcp_data_ind for UE RNTI %x srb_id %lu with size %ld (DCCH) \n", ctxt.rnti, srb_id, ie->value.choice.RRCContainer.size);
//LOG_I(F1AP, "%s() RRCContainer size %lu: ", __func__, ie->value.choice.RRCContainer.size);
//for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
// printf("%02x ", mb->data[i]);
//printf("\n");
pdcp_data_ind (&ctxt,
1, // srb_flag
0, // embms_flag
srb_id,
ie->value.choice.RRCContainer.size,
mb);
return 0;
}
@@ -0,0 +1,50 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_cu_rrc_message_transfer.h
* \brief f1ap rrc message transfer for CU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#ifndef F1AP_CU_RRC_MESSAGE_TRANSFER_H_
#define F1AP_CU_RRC_MESSAGE_TRANSFER_H_
int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
f1ap_dl_rrc_message_t *f1ap_dl_rrc);
int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
#endif /* F1AP_CU_RRC_MESSAGE_TRANSFER_H_ */
@@ -0,0 +1,31 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
@@ -0,0 +1,31 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
+206
View File
@@ -0,0 +1,206 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file openair2/F1AP/f1ap_cu_task.c
* \brief data structures for F1 interface modules
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#include "f1ap_common.h"
#include "f1ap_handlers.h"
#include "f1ap_cu_interface_management.h"
#include "f1ap_cu_rrc_message_transfer.h"
#include "f1ap_cu_ue_context_management.h"
#include "f1ap_cu_task.h"
#include "proto_agent.h"
extern RAN_CONTEXT_t RC;
f1ap_setup_req_t *f1ap_du_data_from_du;
f1ap_cudu_inst_t f1ap_cu_inst[MAX_eNB];
void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_association_ind_t *sctp_new_association_ind) {
// Nothing
}
void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) {
DevAssert(sctp_new_association_resp != NULL);
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
LOG_W(F1AP, "Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n",
sctp_new_association_resp->sctp_state,
instance,
sctp_new_association_resp->ulp_cnx_id);
if (sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN)
proto_agent_stop(instance);
//f1ap_handle_setup_message(instance, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
return; // exit -1 for debugging
}
// go to an init func
f1ap_du_data_from_du = (f1ap_setup_req_t *)calloc(1, sizeof(f1ap_setup_req_t));
// save the assoc id
f1ap_du_data_from_du->assoc_id = sctp_new_association_resp->assoc_id;
f1ap_du_data_from_du->sctp_in_streams = sctp_new_association_resp->in_streams;
f1ap_du_data_from_du->sctp_out_streams = sctp_new_association_resp->out_streams;
/* setup parameters for F1U and start the server */
const cudu_params_t params = {
.local_ipv4_address = RC.rrc[instance]->eth_params_s.my_addr,
.local_port = RC.rrc[instance]->eth_params_s.my_portd,
.remote_ipv4_address = RC.rrc[instance]->eth_params_s.remote_addr,
.remote_port = RC.rrc[instance]->eth_params_s.remote_portd
};
AssertFatal(proto_agent_start(instance, &params) == 0,
"could not start PROTO_AGENT for F1U on instance %d!\n", instance);
}
void cu_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind) {
int result;
DevAssert(sctp_data_ind != NULL);
f1ap_handle_message(instance, sctp_data_ind->assoc_id, sctp_data_ind->stream,
sctp_data_ind->buffer, sctp_data_ind->buffer_length);
result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
}
void cu_task_send_sctp_init_req(instance_t enb_id) {
// 1. get the itti msg, and retrive the enb_id from the message
// 2. use RC.rrc[enb_id] to fill the sctp_init_t with the ip, port
// 3. creat an itti message to init
LOG_I(F1AP, "F1AP_CU_SCTP_REQ(create socket)\n");
MessageDef *message_p = NULL;
message_p = itti_alloc_new_message (TASK_CU_F1, SCTP_INIT_MSG);
message_p->ittiMsg.sctp_init.port = F1AP_PORT_NUMBER;
message_p->ittiMsg.sctp_init.ppid = F1AP_SCTP_PPID;
message_p->ittiMsg.sctp_init.ipv4 = 1;
message_p->ittiMsg.sctp_init.ipv6 = 0;
message_p->ittiMsg.sctp_init.nb_ipv4_addr = 1;
message_p->ittiMsg.sctp_init.ipv4_address[0] = inet_addr(RC.rrc[enb_id]->eth_params_s.my_addr);
/*
* SR WARNING: ipv6 multi-homing fails sometimes for localhost.
* * * * Disable it for now.
*/
message_p->ittiMsg.sctp_init.nb_ipv6_addr = 0;
message_p->ittiMsg.sctp_init.ipv6_address[0] = "0:0:0:0:0:0:0:1";
itti_send_msg_to_task(TASK_SCTP, enb_id, message_p);
}
void *F1AP_CU_task(void *arg) {
MessageDef *received_msg = NULL;
int result;
LOG_I(F1AP, "Starting F1AP at CU\n");
// no RLC in CU, initialize mem pool for PDCP
pool_buffer_init();
itti_mark_task_ready(TASK_CU_F1);
cu_task_send_sctp_init_req(0);
while (1) {
itti_receive_msg(TASK_CU_F1, &received_msg);
switch (ITTI_MSG_ID(received_msg)) {
case SCTP_NEW_ASSOCIATION_IND:
LOG_I(F1AP, "CU Task Received SCTP_NEW_ASSOCIATION_IND for instance %d\n",
ITTI_MESSAGE_GET_INSTANCE(received_msg));
cu_task_handle_sctp_association_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_new_association_ind);
break;
case SCTP_NEW_ASSOCIATION_RESP:
LOG_I(F1AP, "CU Task Received SCTP_NEW_ASSOCIATION_RESP for instance %d\n",
ITTI_MESSAGE_GET_INSTANCE(received_msg));
cu_task_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_new_association_resp);
break;
case SCTP_DATA_IND:
LOG_I(F1AP, "CU Task Received SCTP_DATA_IND for Instance %d\n",
ITTI_MESSAGE_GET_INSTANCE(received_msg));
cu_task_handle_sctp_data_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_data_ind);
break;
case F1AP_SETUP_RESP: // from rrc
LOG_I(F1AP, "CU Task Received F1AP_SETUP_RESP\n");
// CU_send_f1setup_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
// &F1AP_SETUP_RESP(received_msg));
CU_send_F1_SETUP_RESPONSE(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&F1AP_SETUP_RESP(received_msg));
break;
case F1AP_DL_RRC_MESSAGE: // from rrc
LOG_I(F1AP, "CU Task Received F1AP_DL_RRC_MESSAGE\n");
CU_send_DL_RRC_MESSAGE_TRANSFER(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&F1AP_DL_RRC_MESSAGE(received_msg));
break;
case F1AP_UE_CONTEXT_RELEASE_CMD: // from rrc
LOG_I(F1AP, "CU Task Received F1AP_UE_CONTEXT_RELEASE_CMD\n");
CU_send_UE_CONTEXT_RELEASE_COMMAND(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&F1AP_UE_CONTEXT_RELEASE_CMD(received_msg));
break;
// case F1AP_SETUP_RESPONSE: // This is from RRC
// CU_send_F1_SETUP_RESPONSE(instance, *f1ap_setup_ind, &(F1AP_SETUP_RESP) f1ap_setup_resp)
// break;
// case F1AP_SETUP_FAILURE: // This is from RRC
// CU_send_F1_SETUP_FAILURE(instance, *f1ap_setup_ind, &(F1AP_SETUP_FAILURE) f1ap_setup_failure)
// break;
case TERMINATE_MESSAGE:
LOG_W(F1AP, " *** Exiting F1AP thread\n");
itti_exit_task();
break;
default:
LOG_E(F1AP, "CU Received unhandled message: %d:%s\n",
ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break;
} // switch
result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
received_msg = NULL;
} // while
return NULL;
}
+32
View File
@@ -0,0 +1,32 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef F1AP_CU_TASK_H_
#define F1AP_CU_TASK_H_
void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_association_ind_t *sctp_new_association_ind);
void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
void cu_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind);
void cu_task_send_sctp_init_req(instance_t enb_id);
void *F1AP_CU_task(void *arg);
#endif /* F1AP_CU_TASK_H_ */
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,103 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_cu_ue_context_management.h
* \brief header file of CU UE Context management
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#ifndef F1AP_CU_UE_CONTEXT_MANAGEMENT_H_
#define F1AP_CU_UE_CONTEXT_MANAGEMENT_H_
/*
* UE Context Setup
*/
int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
f1ap_ue_context_setup_req_t *f1ap_ue_context_setup_req);
int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_handle_UE_CONTEXT_SETUP_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* UE Context Release Request (gNB-DU initiated)
*/
int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* UE Context Release (gNB-CU initiated)
*/
int CU_send_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
f1ap_ue_context_release_cmd_t *cmd);
int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* UE Context Modification (gNB-CU initiated)
*/
int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance);
int CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* UE Context Modification Required (gNB-DU initiated)
*/
int CU_handle_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance,
F1AP_UEContextModificationConfirm_t UEContextModificationConfirm_t);
/*
* UE Inactivity Notification
*/
/*
* Notify
*/
#endif /* F1AP_CU_UE_CONTEXT_MANAGEMENT_H_ */
@@ -0,0 +1,31 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
@@ -0,0 +1,31 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
+181
View File
@@ -0,0 +1,181 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_decoder.c
* \brief f1ap pdu decode procedures
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#include "f1ap_common.h"
#include "f1ap_decoder.h"
int asn1_decoder_xer_print = 0;
static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu)
{
//MessageDef *message_p;
//MessagesIds message_id;
//asn_encode_to_new_buffer_result_t res = { NULL, {0, NULL, NULL} };
DevAssert(pdu != NULL);
switch(pdu->choice.initiatingMessage->procedureCode) {
case F1AP_ProcedureCode_id_F1Setup:
//res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_F1Setup\n", __func__);
break;
case F1AP_ProcedureCode_id_InitialULRRCMessageTransfer:
//res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_InitialULRRCMessageTransfer\n", __func__);
break;
case F1AP_ProcedureCode_id_DLRRCMessageTransfer:
//res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_DLRRCMessageTransfer\n", __func__);
break;
case F1AP_ProcedureCode_id_ULRRCMessageTransfer:
//res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_ULRRCMessageTransfer\n", __func__);
break;
case F1AP_ProcedureCode_id_UEContextRelease:
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextRelease\n", __func__);
break;
case F1AP_ProcedureCode_id_UEContextReleaseRequest:
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextReleaseRequest\n", __func__);
break;
// case F1AP_ProcedureCode_id_InitialContextSetup:
// res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
// message_id = F1AP_INITIAL_CONTEXT_SETUP_LOG;
// message_p = itti_alloc_new_message_sized(TASK_F1AP, message_id,
// res.result.encoded + sizeof (IttiMsgText));
// message_p->ittiMsg.f1ap_initial_context_setup_log.size = res.result.encoded;
// memcpy(&message_p->ittiMsg.f1ap_initial_context_setup_log.text, res.buffer, res.result.encoded);
// itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
// free(res.buffer);
// break;
default:
// F1AP_ERROR("Unknown procedure ID (%d) for initiating message\n",
// (int)pdu->choice.initiatingMessage->procedureCode);
LOG_E(F1AP, "Unknown procedure ID (%d) for initiating message\n",
(int)pdu->choice.initiatingMessage->procedureCode);
AssertFatal( 0, "Unknown procedure ID (%d) for initiating message\n",
(int)pdu->choice.initiatingMessage->procedureCode);
return -1;
}
return 0;
}
static int f1ap_decode_successful_outcome(F1AP_F1AP_PDU_t *pdu)
{
DevAssert(pdu != NULL);
switch(pdu->choice.successfulOutcome->procedureCode) {
case F1AP_ProcedureCode_id_F1Setup:
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_F1Setup\n", __func__);
break;
case F1AP_ProcedureCode_id_UEContextRelease:
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextRelease\n", __func__);
break;
default:
LOG_E(F1AP,"Unknown procedure ID (%d) for successfull outcome message\n",
(int)pdu->choice.successfulOutcome->procedureCode);
return -1;
}
return 0;
}
static int f1ap_decode_unsuccessful_outcome(F1AP_F1AP_PDU_t *pdu)
{
DevAssert(pdu != NULL);
switch(pdu->choice.unsuccessfulOutcome->procedureCode) {
case F1AP_ProcedureCode_id_F1Setup:
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_F1Setup\n", __func__);
break;
default:
// F1AP_ERROR("Unknown procedure ID (%d) for unsuccessfull outcome message\n",
// (int)pdu->choice.unsuccessfulOutcome->procedureCode);
LOG_E(F1AP, "Unknown procedure ID (%d) for unsuccessfull outcome message\n",
(int)pdu->choice.unsuccessfulOutcome->procedureCode);
return -1;
}
return 0;
}
int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length)
{
asn_dec_rval_t dec_ret;
DevAssert(buffer != NULL);
dec_ret = aper_decode(NULL,
&asn_DEF_F1AP_F1AP_PDU,
(void **)&pdu,
buffer,
length,
0,
0);
if (asn1_decoder_xer_print) {
LOG_E(F1AP, "----------------- ASN1 DECODER PRINT START----------------- \n");
xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_E(F1AP, "----------------- ASN1 DECODER PRINT END ----------------- \n");
}
//LOG_I(F1AP, "f1ap_decode_pdu.dec_ret.code = %d\n", dec_ret.code);
if (dec_ret.code != RC_OK) {
LOG_E(F1AP, "Failed to decode pdu\n");
return -1;
}
switch(pdu->present) {
case F1AP_F1AP_PDU_PR_initiatingMessage:
return f1ap_decode_initiating_message(pdu);
case F1AP_F1AP_PDU_PR_successfulOutcome:
return f1ap_decode_successful_outcome(pdu);
case F1AP_F1AP_PDU_PR_unsuccessfulOutcome:
return f1ap_decode_unsuccessful_outcome(pdu);
default:
LOG_E(F1AP, "Unknown presence (%d) or not implemented\n", (int)pdu->present);
break;
}
return -1;
}
+39
View File
@@ -0,0 +1,39 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_decoder.h
* \brief f1ap pdu decode procedures
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#ifndef F1AP_ENB_ENCODER_H_
#define F1AP_ENB_ENCODER_H_
int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length)
__attribute__ ((warn_unused_result));
#endif /* F1AP_ENB_ENCODER_H_ */
+46
View File
@@ -0,0 +1,46 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_default_values.h
* \brief default values for f1ap procedures
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#ifndef F1AP_DEFAULT_VALUES_H_
#define F1AP_DEFAULT_VALUES_H_
#define ENB_TAC (1)
#define ENB_MCC (208)
#define ENB_MNC (92)
#define ENB_NAME "Eurecom ENB"
#define ENB_NAME_FORMAT (ENB_NAME" %u")
#define F1AP_PORT_NUMBER (30923)
#define F1AP_SCTP_PPID (62)
#endif /* F1AP_DEFAULT_VALUES_H_ */
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,118 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#ifndef F1AP_DU_INTERFACE_MANAGEMENT_H_
#define F1AP_DU_INTERFACE_MANAGEMENT_H_
/*
* Reset
*/
int DU_handle_RESET(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_send_RESET_ACKKNOWLEDGE(instance_t instance, F1AP_ResetAcknowledge_t *ResetAcknowledge);
int DU_send_RESET(instance_t instance, F1AP_Reset_t *Reset);
int DU_handle_RESET_ACKNOWLEDGE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* Error Indication
*/
int DU_send_ERROR_INDICATION(instance_t instance, F1AP_F1AP_PDU_t *pdu_p);
int DU_handle_ERROR_INDICATION(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* F1 Setup
*/
int DU_send_F1_SETUP_REQUEST(instance_t instance);
int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_handle_F1_SETUP_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* gNB-DU Configuration Update
*/
int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
instance_t du_mod_idP,
f1ap_setup_req_t *f1ap_du_data);
int DU_handle_gNB_DU_CONFIGURATION_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* gNB-CU Configuration Update
*/
int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
F1AP_GNBCUConfigurationUpdateFailure_t *GNBCUConfigurationUpdateFailure);
int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
F1AP_GNBCUConfigurationUpdateAcknowledge_t *GNBCUConfigurationUpdateAcknowledge);
/*
* gNB-DU Resource Coordination
*/
int DU_send_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
F1AP_GNBDUResourceCoordinationRequest_t *GNBDUResourceCoordinationRequest);
int DU_handle_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
#endif /* F1AP_DU_INTERFACE_MANAGEMENT_H_ */
+31
View File
@@ -0,0 +1,31 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
+31
View File
@@ -0,0 +1,31 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
@@ -0,0 +1,881 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_rrc_message_transfer.c
* \brief f1ap rrc message transfer for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#include "f1ap_common.h"
#include "f1ap_encoder.h"
#include "f1ap_decoder.h"
#include "f1ap_itti_messaging.h"
#include "f1ap_du_rrc_message_transfer.h"
#include "LTE_DL-CCCH-Message.h"
#include "LTE_DL-DCCH-Message.h"
#include "LTE_UL-DCCH-Message.h"
// for SRB1_logicalChannelConfig_defaultValue
#include "rrc_extern.h"
#include "common/ran_context.h"
#include "rrc_eNB_UE_context.h"
// undefine C_RNTI from
// openair1/PHY/LTE_TRANSPORT/transport_common.h which
// replaces in ie->value.choice.C_RNTI, causing
// a compile error
#undef C_RNTI
extern f1ap_setup_req_t *f1ap_du_data;
extern RAN_CONTEXT_t RC;
extern f1ap_cudu_inst_t f1ap_du_inst[MAX_eNB];
/* DL RRC Message Transfer */
int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
LOG_D(F1AP, "DU_handle_DL_RRC_MESSAGE_TRANSFER \n");
F1AP_DLRRCMessageTransfer_t *container;
F1AP_DLRRCMessageTransferIEs_t *ie;
uint64_t cu_ue_f1ap_id;
uint64_t du_ue_f1ap_id;
uint64_t srb_id;
int executeDuplication;
sdu_size_t rrc_dl_sdu_len;
//uint64_t subscriberProfileIDforRFP;
//uint64_t rAT_FrequencySelectionPriority;
DevAssert(pdu != NULL);
if (stream != 0) {
LOG_E(F1AP, "[SCTP %d] Received F1 on stream != 0 (%d)\n",
assoc_id, stream);
return -1;
}
container = &pdu->choice.initiatingMessage->value.choice.DLRRCMessageTransfer;
/* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
cu_ue_f1ap_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
LOG_D(F1AP, "cu_ue_f1ap_id %lu \n", cu_ue_f1ap_id);
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, true);
du_ue_f1ap_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
LOG_D(F1AP, "du_ue_f1ap_id %lu associated with UE RNTI %x \n",
du_ue_f1ap_id,
f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], du_ue_f1ap_id)); // this should be the one transmitted via initial ul rrc message transfer
if (f1ap_du_add_cu_ue_id(&f1ap_du_inst[instance],du_ue_f1ap_id, cu_ue_f1ap_id) < 0 ) {
LOG_E(F1AP, "Failed to find the F1AP UID \n");
//return -1;
}
/* optional */
/* oldgNB_DU_UE_F1AP_ID */
if (0) {
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_oldgNB_DU_UE_F1AP_ID, true);
}
/* mandatory */
/* SRBID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_SRBID, true);
srb_id = ie->value.choice.SRBID;
LOG_D(F1AP, "srb_id %lu \n", srb_id);
/* optional */
/* ExecuteDuplication */
if (0) {
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_ExecuteDuplication, true);
executeDuplication = ie->value.choice.ExecuteDuplication;
LOG_D(F1AP, "ExecuteDuplication %d \n", executeDuplication);
}
// issue in here
/* mandatory */
/* RRC Container */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_RRCContainer, true);
// BK: need check
// create an ITTI message and copy SDU
// message_p = itti_alloc_new_message (TASK_CU_F1, RRC_MAC_CCCH_DATA_IND);
// memset (RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE);
rrc_dl_sdu_len = ie->value.choice.RRCContainer.size;
// memcpy(RRC_MAC_CCCH_DATA_IND (message_p).sdu, ie->value.choice.RRCContainer.buf,
// ccch_sdu_len);
//LOG_I(F1AP, "%s() RRCContainer size %lu: ", __func__, ie->value.choice.RRCContainer.size);
//for (int i = 0;i < ie->value.choice.RRCContainer.size; i++)
// printf("%02x ", ie->value.choice.RRCContainer.buf[i]);
//printf("\n");
/* optional */
/* RAT_FrequencyPriorityInformation */
if (0) {
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_DLRRCMessageTransferIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_RAT_FrequencyPriorityInformation, true);
switch(ie->value.choice.RAT_FrequencyPriorityInformation.present) {
case F1AP_RAT_FrequencyPriorityInformation_PR_subscriberProfileIDforRFP:
//subscriberProfileIDforRFP = ie->value.choice.RAT_FrequencyPriorityInformation.choice.subscriberProfileIDforRFP;
break;
case F1AP_RAT_FrequencyPriorityInformation_PR_rAT_FrequencySelectionPriority:
//rAT_FrequencySelectionPriority = ie->value.choice.RAT_FrequencyPriorityInformation.choice.rAT_FrequencySelectionPriority;
break;
default:
LOG_W(F1AP, "unhandled IE RAT_FrequencyPriorityInformation.present\n");
break;
}
}
// decode RRC Container and act on the message type
AssertFatal(srb_id<3,"illegal srb_id\n");
protocol_ctxt_t ctxt;
ctxt.rnti = f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], du_ue_f1ap_id);
ctxt.module_id = instance;
ctxt.instance = instance;
ctxt.enb_flag = 1;
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(
RC.rrc[ctxt.module_id],
ctxt.rnti);
if (srb_id == 0) {
LTE_DL_CCCH_Message_t* dl_ccch_msg=NULL;
asn_dec_rval_t dec_rval;
dec_rval = uper_decode(NULL,
&asn_DEF_LTE_DL_CCCH_Message,
(void**)&dl_ccch_msg,
ie->value.choice.RRCContainer.buf,
rrc_dl_sdu_len,0,0);
AssertFatal(dec_rval.code == RC_OK, "could not decode F1AP message\n");
switch (dl_ccch_msg->message.choice.c1.present) {
case LTE_DL_CCCH_MessageType__c1_PR_NOTHING:
LOG_I(F1AP, "Received PR_NOTHING on DL-CCCH-Message\n");
break;
case LTE_DL_CCCH_MessageType__c1_PR_rrcConnectionReestablishment:
LOG_I(F1AP,
"Logical Channel DL-CCCH (SRB0), Received RRCConnectionReestablishment\n");
break;
case LTE_DL_CCCH_MessageType__c1_PR_rrcConnectionReestablishmentReject:
LOG_I(F1AP,
"Logical Channel DL-CCCH (SRB0), Received RRCConnectionReestablishmentReject\n");
break;
case LTE_DL_CCCH_MessageType__c1_PR_rrcConnectionReject:
LOG_I(F1AP,
"Logical Channel DL-CCCH (SRB0), Received RRCConnectionReject \n");
break;
case LTE_DL_CCCH_MessageType__c1_PR_rrcConnectionSetup:
{
LOG_I(F1AP,
"Logical Channel DL-CCCH (SRB0), Received RRCConnectionSetup DU_ID %lx/RNTI %x\n",
du_ue_f1ap_id,
f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], du_ue_f1ap_id));
// Get configuration
LTE_RRCConnectionSetup_t* rrcConnectionSetup = &dl_ccch_msg->message.choice.c1.choice.rrcConnectionSetup;
AssertFatal(rrcConnectionSetup!=NULL,"rrcConnectionSetup is null\n");
LTE_RadioResourceConfigDedicated_t* radioResourceConfigDedicated = &rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated;
// get SRB logical channel information
LTE_SRB_ToAddModList_t *SRB_configList;
LTE_SRB_ToAddMod_t *SRB1_config;
LTE_LogicalChannelConfig_t *SRB1_logicalChannelConfig = NULL;
SRB_configList = radioResourceConfigDedicated->srb_ToAddModList;
AssertFatal(SRB_configList!=NULL,"SRB_configList is null\n");
for (int cnt = 0; cnt < (SRB_configList)->list.count; cnt++) {
if ((SRB_configList)->list.array[cnt]->srb_Identity == 1) {
SRB1_config = (SRB_configList)->list.array[cnt];
if (SRB1_config->logicalChannelConfig) {
if (SRB1_config->logicalChannelConfig->present ==
LTE_SRB_ToAddMod__logicalChannelConfig_PR_explicitValue) {
SRB1_logicalChannelConfig = &SRB1_config->logicalChannelConfig->choice.explicitValue;
} else {
SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue;
}
} else {
SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue;
}
}
} // for
rrc_rlc_config_asn1_req(&ctxt,
SRB_configList,
(LTE_DRB_ToAddModList_t*) NULL,
(LTE_DRB_ToReleaseList_t*) NULL
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
, (LTE_PMCH_InfoList_r9_t *) NULL,
0,0
# endif
);
// This should be somewhere in the f1ap_cudu_ue_inst_t
/*int macrlc_instance = 0;
rnti_t rnti = f1ap_get_rnti_by_du_id(&f1ap_du_inst[0], du_ue_f1ap_id);
struct rrc_eNB_ue_context_s *ue_context_p = rrc_eNB_get_ue_context(RC.rrc[macrlc_instance],rnti);
*/
eNB_RRC_UE_t *ue_p = &ue_context_p->ue_context;
AssertFatal(ue_p->Srb0.Active == 1,"SRB0 is not active\n");
memcpy((void*)ue_p->Srb0.Tx_buffer.Payload,
(void*)ie->value.choice.RRCContainer.buf,
rrc_dl_sdu_len); // ie->value.choice.RRCContainer.size
ue_p->Srb0.Tx_buffer.payload_size = rrc_dl_sdu_len;
LTE_MAC_MainConfig_t *mac_MainConfig = NULL;
if (radioResourceConfigDedicated->mac_MainConfig)
mac_MainConfig = &radioResourceConfigDedicated->mac_MainConfig->choice.explicitValue;
rrc_mac_config_req_eNB(
ctxt.module_id,
0, //primaryCC_id,
0,0,0,0,0,
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
0,
#endif
ctxt.rnti,
(LTE_BCCH_BCH_Message_t *) NULL,
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
#endif
radioResourceConfigDedicated->physicalConfigDedicated,
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
(LTE_SCellToAddMod_r10_t *)NULL,
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
#endif
(LTE_MeasObjectToAddMod_t **) NULL,
mac_MainConfig,
1,
SRB1_logicalChannelConfig,
NULL, // measGapConfig,
(LTE_TDD_Config_t *) NULL,
NULL,
(LTE_SchedulingInfoList_t *) NULL,
0, NULL, NULL, (LTE_MBSFN_SubframeConfigList_t *) NULL
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
, 0, (LTE_MBSFN_AreaInfoList_r9_t *) NULL, (LTE_PMCH_InfoList_r9_t *) NULL
#endif
#if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
,
(LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL
#endif
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,
0,
(LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
(LTE_SchedulingInfo_MBMS_r14_t *) NULL,
(struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
(LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
(LTE_MBSFN_AreaInfoList_r9_t *) NULL
#endif
);
break;
} // case
default:
AssertFatal(1==0,
"Unknown message\n");
break;
}// switch case
return(0);
} else if (srb_id == 1) {
LTE_DL_DCCH_Message_t* dl_dcch_msg=NULL;
asn_dec_rval_t dec_rval;
dec_rval = uper_decode(NULL,
&asn_DEF_LTE_DL_DCCH_Message,
(void**)&dl_dcch_msg,
&ie->value.choice.RRCContainer.buf[1], // buf[0] includes the pdcp header
rrc_dl_sdu_len,0,0);
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0))
LOG_E(F1AP," Failed to decode DL-DCCH (%zu bytes)\n",dec_rval.consumed);
else
LOG_D(F1AP, "Received message: present %d and c1 present %d\n",
dl_dcch_msg->message.present, dl_dcch_msg->message.choice.c1.present);
if (dl_dcch_msg->message.present == LTE_DL_DCCH_MessageType_PR_c1) {
switch (dl_dcch_msg->message.choice.c1.present) {
case LTE_DL_DCCH_MessageType__c1_PR_NOTHING:
LOG_I(F1AP, "Received PR_NOTHING on DL-DCCH-Message\n");
return 0;
case LTE_DL_DCCH_MessageType__c1_PR_dlInformationTransfer:
LOG_I(F1AP,"Received NAS DL Information Transfer\n");
break;
case LTE_DL_DCCH_MessageType__c1_PR_csfbParametersResponseCDMA2000:
LOG_I(F1AP,"Received NAS sfbParametersResponseCDMA2000\n");
break;
case LTE_DL_DCCH_MessageType__c1_PR_handoverFromEUTRAPreparationRequest:
LOG_I(F1AP,"Received NAS andoverFromEUTRAPreparationRequest\n");
break;
case LTE_DL_DCCH_MessageType__c1_PR_mobilityFromEUTRACommand:
LOG_I(F1AP,"Received NAS mobilityFromEUTRACommand\n");
break;
case LTE_DL_DCCH_MessageType__c1_PR_rrcConnectionReconfiguration:
// handle RRCConnectionReconfiguration
LOG_I(F1AP,
"Logical Channel DL-DCCH (SRB1), Received RRCConnectionReconfiguration DU_ID %lx/RNTI %x\n",
du_ue_f1ap_id,
f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], du_ue_f1ap_id));
LTE_RRCConnectionReconfiguration_t* rrcConnectionReconfiguration = &dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration;
if (rrcConnectionReconfiguration->criticalExtensions.present == LTE_RRCConnectionReconfiguration__criticalExtensions_PR_c1) {
if (rrcConnectionReconfiguration->criticalExtensions.choice.c1.present ==
LTE_RRCConnectionReconfiguration__criticalExtensions__c1_PR_rrcConnectionReconfiguration_r8) {
LTE_RRCConnectionReconfiguration_r8_IEs_t* rrcConnectionReconfiguration_r8 =
&rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8;
if (rrcConnectionReconfiguration_r8->mobilityControlInfo) {
LOG_I(F1AP, "Mobility Control Information is present\n");
AssertFatal(1==0,"Can't handle this yet in DU\n");
}
if (rrcConnectionReconfiguration_r8->measConfig != NULL) {
LOG_I(F1AP, "Measurement Configuration is present\n");
}
if (rrcConnectionReconfiguration_r8->radioResourceConfigDedicated) {
LOG_I(F1AP, "Radio Resource Configuration is present\n");
uint8_t DRB2LCHAN[8];
long drb_id;
int i;
LTE_DRB_ToAddModList_t *DRB_configList = rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->drb_ToAddModList;
LTE_SRB_ToAddModList_t *SRB_configList = rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->srb_ToAddModList;
LTE_DRB_ToReleaseList_t *DRB_ReleaseList = rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->drb_ToReleaseList;
LTE_MAC_MainConfig_t *mac_MainConfig = NULL;
if (rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->mac_MainConfig)
mac_MainConfig = &rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->mac_MainConfig->choice.explicitValue;
LTE_MeasGapConfig_t *measGapConfig = NULL;
struct LTE_PhysicalConfigDedicated* physicalConfigDedicated = rrcConnectionReconfiguration_r8->radioResourceConfigDedicated->physicalConfigDedicated;
rrc_rlc_config_asn1_req(
&ctxt,
SRB_configList, // NULL, //LG-RK 14/05/2014 SRB_configList,
DRB_configList,
DRB_ReleaseList
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
, (LTE_PMCH_InfoList_r9_t *) NULL
, 0, 0
#endif
);
if (SRB_configList != NULL) {
for (i = 0; (i < SRB_configList->list.count) && (i < 3); i++) {
if (SRB_configList->list.array[i]->srb_Identity == 1 ){
ue_context_p->ue_context.Srb1.Active=1;
}
else if (SRB_configList->list.array[i]->srb_Identity == 2 ) {
ue_context_p->ue_context.Srb2.Active=1;
ue_context_p->ue_context.Srb2.Srb_info.Srb_id=2;
LOG_I(F1AP, "[DU %d] SRB2 is now active\n",ctxt.module_id);
} else {
LOG_W(F1AP, "[DU %d] invalide SRB identity %ld\n",ctxt.module_id,
SRB_configList->list.array[i]->srb_Identity);
}
}
}
if (DRB_configList != NULL) {
for (i = 0; i < DRB_configList->list.count; i++) { // num max DRB (11-3-8)
if (DRB_configList->list.array[i]) {
drb_id = (int)DRB_configList->list.array[i]->drb_Identity;
LOG_I(F1AP,
"[DU %d] Logical Channel UL-DCCH, Received RRCConnectionReconfiguration for UE rnti %x, reconfiguring DRB %d/LCID %d\n",
ctxt.module_id,
ctxt.rnti,
(int)DRB_configList->list.array[i]->drb_Identity,
(int)*DRB_configList->list.array[i]->logicalChannelIdentity);
if (ue_context_p->ue_context.DRB_active[drb_id] == 0) {
ue_context_p->ue_context.DRB_active[drb_id] = 1;
if (DRB_configList->list.array[i]->logicalChannelIdentity) {
DRB2LCHAN[i] = (uint8_t) * DRB_configList->list.array[i]->logicalChannelIdentity;
}
rrc_mac_config_req_eNB(
ctxt.module_id,
0,0,0,0,0,0,
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
0,
#endif
ue_context_p->ue_context.rnti,
(LTE_BCCH_BCH_Message_t *) NULL,
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
#endif
physicalConfigDedicated,
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
(LTE_SCellToAddMod_r10_t *)NULL,
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
#endif
(LTE_MeasObjectToAddMod_t **) NULL,
mac_MainConfig,
DRB2LCHAN[i],
DRB_configList->list.array[i]->logicalChannelConfig,
measGapConfig,
(LTE_TDD_Config_t *) NULL,
NULL,
(LTE_SchedulingInfoList_t *) NULL,
0, NULL, NULL, (LTE_MBSFN_SubframeConfigList_t *) NULL
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
, 0, (LTE_MBSFN_AreaInfoList_r9_t *) NULL, (LTE_PMCH_InfoList_r9_t *) NULL
#endif
#if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
,
(LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL
#endif
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,
0,
(LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
(LTE_SchedulingInfo_MBMS_r14_t *) NULL,
(struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
(LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
(LTE_MBSFN_AreaInfoList_r9_t *) NULL
#endif
);
}
} else { // remove LCHAN from MAC/PHY
AssertFatal(1==0,"Can't handle this yet in DU\n");
}
}
}
}
}
}
break;
case LTE_DL_DCCH_MessageType__c1_PR_rrcConnectionRelease:
// handle RRCConnectionRelease
LOG_I(F1AP, "Received RRCConnectionRelease\n");
break;
case LTE_DL_DCCH_MessageType__c1_PR_securityModeCommand:
LOG_I(F1AP, "Received securityModeCommand\n");
break;
case LTE_DL_DCCH_MessageType__c1_PR_ueCapabilityEnquiry:
LOG_I(F1AP, "Received ueCapabilityEnquiry\n");
break;
case LTE_DL_DCCH_MessageType__c1_PR_counterCheck:
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
case LTE_DL_DCCH_MessageType__c1_PR_loggedMeasurementConfiguration_r10:
case LTE_DL_DCCH_MessageType__c1_PR_rnReconfiguration_r10:
#endif
case LTE_DL_DCCH_MessageType__c1_PR_spare1:
case LTE_DL_DCCH_MessageType__c1_PR_spare2:
case LTE_DL_DCCH_MessageType__c1_PR_spare3:
#if (LTE_RRC_VERSION < MAKE_VERSION(14, 0, 0))
case LTE_DL_DCCH_MessageType__c1_PR_spare4:
#endif
break;
case LTE_DL_DCCH_MessageType__c1_PR_ueInformationRequest_r9:
LOG_I(F1AP, "Received ueInformationRequest_r9\n");
break;
case LTE_DL_DCCH_MessageType__c1_PR_rrcConnectionResume_r13:
LOG_I(F1AP, "Received rrcConnectionResume_r13\n");
}
}
}
else if (srb_id == 2) {
}
LOG_I(F1AP, "Received DL RRC Transfer on srb_id %ld\n", srb_id);
rlc_op_status_t rlc_status;
boolean_t ret = TRUE;
mem_block_t *pdcp_pdu_p = NULL;
pdcp_pdu_p = get_free_mem_block(rrc_dl_sdu_len, __func__);
//LOG_I(F1AP, "PRRCContainer size %lu:", ie->value.choice.RRCContainer.size);
//for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
// printf("%02x ", ie->value.choice.RRCContainer.buf[i]);
//printf (", PDCP PDU size %d:", rrc_dl_sdu_len);
//for (int i=0;i<rrc_dl_sdu_len;i++) printf("%2x ",pdcp_pdu_p->data[i]);
//printf("\n");
if (pdcp_pdu_p != NULL) {
memset(pdcp_pdu_p->data, 0, rrc_dl_sdu_len);
memcpy(&pdcp_pdu_p->data[0], ie->value.choice.RRCContainer.buf, rrc_dl_sdu_len);
rlc_status = rlc_data_req(&ctxt
, 1
, MBMS_FLAG_NO
, srb_id
, 0
, 0
, rrc_dl_sdu_len
, pdcp_pdu_p
#ifdef Rel14
,NULL
,NULL
#endif
);
switch (rlc_status) {
case RLC_OP_STATUS_OK:
//LOG_I(F1AP, "Data sending request over RLC succeeded!\n");
ret=TRUE;
break;
case RLC_OP_STATUS_BAD_PARAMETER:
LOG_W(F1AP, "Data sending request over RLC failed with 'Bad Parameter' reason!\n");
ret= FALSE;
break;
case RLC_OP_STATUS_INTERNAL_ERROR:
LOG_W(F1AP, "Data sending request over RLC failed with 'Internal Error' reason!\n");
ret= FALSE;
break;
case RLC_OP_STATUS_OUT_OF_RESSOURCES:
LOG_W(F1AP, "Data sending request over RLC failed with 'Out of Resources' reason!\n");
ret= FALSE;
break;
default:
LOG_W(F1AP, "RLC returned an unknown status code after PDCP placed the order to send some data (Status Code:%d)\n", rlc_status);
ret= FALSE;
break;
} // switch case
return ret;
} // if pdcp_pdu_p
return 0;
}
int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance, const f1ap_ul_rrc_message_t *msg) {
const rnti_t rnti = msg->rnti;
F1AP_F1AP_PDU_t pdu;
F1AP_ULRRCMessageTransfer_t *out;
F1AP_ULRRCMessageTransferIEs_t *ie;
uint8_t *buffer = NULL;
uint32_t len;
LOG_I(F1AP, "[DU %d] %s: size %d UE RNTI %x in SRB %d\n",
instance, __func__, msg->rrc_container_length, rnti, msg->srb_id);
//LOG_I(F1AP, "%s() RRCContainer size %d: ", __func__, msg->rrc_container_length);
//for (int i = 0;i < msg->rrc_container_length; i++)
// printf("%02x ", msg->rrc_container[i]);
//printf("\n");
/* Create */
/* 0. Message Type */
memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t));
pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_ULRRCMessageTransfer;
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_ignore;
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_ULRRCMessageTransfer;
out = &pdu.choice.initiatingMessage->value.choice.ULRRCMessageTransfer;
/* mandatory */
/* c1. GNB_CU_UE_F1AP_ID */
ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_CU_UE_F1AP_ID;
ie->value.choice.GNB_CU_UE_F1AP_ID = f1ap_get_cu_ue_f1ap_id(&f1ap_du_inst[instance], rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c2. GNB_DU_UE_F1AP_ID */
ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_get_du_ue_f1ap_id(&f1ap_du_inst[instance], rnti);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c3. SRBID */
ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_SRBID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_SRBID;
ie->value.choice.SRBID = msg->srb_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
// issue in here
/* mandatory */
/* c4. RRCContainer */
ie = (F1AP_ULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_ULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_ULRRCMessageTransferIEs__value_PR_RRCContainer;
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer,
(const char *) msg->rrc_container,
msg->rrc_container_length);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
if (msg->srb_id == 1 || msg->srb_id == 2) {
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_get_ue_context(RC.rrc[instance], rnti);
LTE_UL_DCCH_Message_t* ul_dcch_msg=NULL;
asn_dec_rval_t dec_rval;
dec_rval = uper_decode(NULL,
&asn_DEF_LTE_UL_DCCH_Message,
(void**)&ul_dcch_msg,
&ie->value.choice.RRCContainer.buf[1], // buf[0] includes the pdcp header
msg->rrc_container_length, 0, 0);
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0))
LOG_E(F1AP, " Failed to decode UL-DCCH (%zu bytes)\n",dec_rval.consumed);
else
LOG_I(F1AP, "Received message: present %d and c1 present %d\n",
ul_dcch_msg->message.present, ul_dcch_msg->message.choice.c1.present);
if (ul_dcch_msg->message.present == LTE_UL_DCCH_MessageType_PR_c1) {
switch (ul_dcch_msg->message.choice.c1.present) {
case LTE_UL_DCCH_MessageType__c1_PR_NOTHING: /* No components present */
break;
case LTE_UL_DCCH_MessageType__c1_PR_csfbParametersRequestCDMA2000:
break;
case LTE_UL_DCCH_MessageType__c1_PR_measurementReport:
break;
case LTE_UL_DCCH_MessageType__c1_PR_rrcConnectionReconfigurationComplete:
break;
case LTE_UL_DCCH_MessageType__c1_PR_rrcConnectionReestablishmentComplete:
break;
case LTE_UL_DCCH_MessageType__c1_PR_rrcConnectionSetupComplete:
LOG_I(F1AP, "[MSG] RRC UL rrcConnectionSetupComplete \n");
if(!ue_context_p){
LOG_E(F1AP, "Did not find the UE context associated with UE RNTOI %x, ue_context_p is NULL\n", rnti);
}else {
LOG_I(F1AP, "Processing RRCConnectionSetupComplete UE %x\n", rnti);
ue_context_p->ue_context.Status = RRC_CONNECTED;
}
break;
case LTE_UL_DCCH_MessageType__c1_PR_securityModeComplete:
LOG_I(F1AP, "[MSG] RRC securityModeComplete \n");
break;
case LTE_UL_DCCH_MessageType__c1_PR_securityModeFailure:
break;
case LTE_UL_DCCH_MessageType__c1_PR_ueCapabilityInformation:
LOG_I(F1AP, "[MSG] RRC ueCapabilityInformation \n");
break;
case LTE_UL_DCCH_MessageType__c1_PR_ulHandoverPreparationTransfer:
break;
case LTE_UL_DCCH_MessageType__c1_PR_ulInformationTransfer:
LOG_I(F1AP,"[MSG] RRC UL Information Transfer \n");
break;
case LTE_UL_DCCH_MessageType__c1_PR_counterCheckResponse:
break;
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
case LTE_UL_DCCH_MessageType__c1_PR_ueInformationResponse_r9:
break;
case LTE_UL_DCCH_MessageType__c1_PR_proximityIndication_r9:
break;
#endif
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
case LTE_UL_DCCH_MessageType__c1_PR_rnReconfigurationComplete_r10:
break;
case LTE_UL_DCCH_MessageType__c1_PR_mbmsCountingResponse_r10:
break;
case LTE_UL_DCCH_MessageType__c1_PR_interFreqRSTDMeasurementIndication_r10:
break;
#endif
}
}
}
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 setup request\n");
return -1;
}
du_f1ap_itti_send_sctp_data_req(instance, f1ap_du_data->assoc_id, buffer, len, f1ap_du_data->default_sctp_stream_id);
return 0;
}
/* UL RRC Message Transfer */
int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
int CC_idP,
int UE_id,
rnti_t rntiP,
const uint8_t *sduP,
sdu_size_t sdu_lenP) {
F1AP_F1AP_PDU_t pdu;
F1AP_InitialULRRCMessageTransfer_t *out;
F1AP_InitialULRRCMessageTransferIEs_t *ie;
uint8_t *buffer;
uint32_t len;
int f1ap_uid = f1ap_add_ue (&f1ap_du_inst[module_idP], module_idP, CC_idP,UE_id, rntiP);
if (f1ap_uid < 0 ) {
LOG_E(F1AP, "Failed to add UE \n");
return -1;
}
/* Create */
/* 0. Message Type */
memset(&pdu, 0, sizeof(pdu));
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t));
pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_InitialULRRCMessageTransfer;
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_ignore;
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_InitialULRRCMessageTransfer;
out = &pdu.choice.initiatingMessage->value.choice.InitialULRRCMessageTransfer;
/* mandatory */
/* c1. GNB_DU_UE_F1AP_ID */
ie = (F1AP_InitialULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_InitialULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_GNB_DU_UE_F1AP_ID;
ie->value.choice.GNB_DU_UE_F1AP_ID = f1ap_du_inst[module_idP].f1ap_ue[f1ap_uid].du_ue_f1ap_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c2. NRCGI */
ie = (F1AP_InitialULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_InitialULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_NRCGI;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_NRCGI;
F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[0], f1ap_du_data->mnc[0], f1ap_du_data->mnc_digit_length[0],
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_du_data->nr_cellid[0], &nRCGI.nRCellIdentity);
ie->value.choice.NRCGI = nRCGI;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c3. C_RNTI */ // 16
ie = (F1AP_InitialULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_InitialULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_C_RNTI;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_C_RNTI;
C_RNTI_TO_BIT_STRING(rntiP, &ie->value.choice.C_RNTI);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
/* c4. RRCContainer */
ie = (F1AP_InitialULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_InitialULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_RRCContainer;
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, (const char *)sduP, sdu_lenP);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
/* c5. DUtoCURRCContainer */
if (0) {
ie = (F1AP_InitialULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_InitialULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DUtoCURRCContainer;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_DUtoCURRCContainer;
OCTET_STRING_fromBuf(&ie->value.choice.DUtoCURRCContainer, "dummy_val",
strlen("dummy_val"));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 setup request\n");
return -1;
}
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_allocate_new_UE_context(RC.rrc[module_idP]);
ue_context_p->ue_id_rnti = rntiP;
ue_context_p->ue_context.rnti = rntiP;
ue_context_p->ue_context.random_ue_identity = rntiP;
ue_context_p->ue_context.Srb0.Active = 1;
RB_INSERT(rrc_ue_tree_s, &RC.rrc[module_idP]->rrc_ue_head, ue_context_p);
du_f1ap_itti_send_sctp_data_req(module_idP, f1ap_du_data->assoc_id, buffer, len, f1ap_du_data->default_sctp_stream_id);
return 0;
}
void init_f1ap_du_ue_inst (void) {
memset(f1ap_du_inst, 0, sizeof(f1ap_du_inst));
}
@@ -0,0 +1,53 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_rrc_message_transfer.h
* \brief f1ap rrc message transfer for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#ifndef F1AP_DU_RRC_MESSAGE_TRANSFER_H_
#define F1AP_DU_RRC_MESSAGE_TRANSFER_H_
#include "f1ap_common.h"
int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance, const f1ap_ul_rrc_message_t *msg);
int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
int CC_idP,
int UE_id,
rnti_t rntiP,
const uint8_t *sduP,
sdu_size_t sdu_lenP);
#endif /* F1AP_DU_RRC_MESSAGE_TRANSFER_H_ */
@@ -0,0 +1,31 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
@@ -0,0 +1,31 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
+207
View File
@@ -0,0 +1,207 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file openair2/F1AP/f1ap_du_task.c
* \brief data structures for F1 interface modules
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#include "f1ap_common.h"
#include "f1ap_handlers.h"
#include "f1ap_du_interface_management.h"
#include "f1ap_du_ue_context_management.h"
#include "f1ap_du_rrc_message_transfer.h"
#include "f1ap_du_task.h"
#include "proto_agent.h"
extern RAN_CONTEXT_t RC;
f1ap_setup_req_t *f1ap_du_data;
f1ap_cudu_inst_t f1ap_du_inst[MAX_eNB];
void du_task_send_sctp_association_req(instance_t instance, f1ap_setup_req_t *f1ap_setup_req) {
DevAssert(f1ap_setup_req != NULL);
MessageDef *message_p = NULL;
sctp_new_association_req_t *sctp_new_association_req_p = NULL;
message_p = itti_alloc_new_message(TASK_DU_F1, SCTP_NEW_ASSOCIATION_REQ);
sctp_new_association_req_p = &message_p->ittiMsg.sctp_new_association_req;
sctp_new_association_req_p->ulp_cnx_id = instance;
sctp_new_association_req_p->port = F1AP_PORT_NUMBER;
sctp_new_association_req_p->ppid = F1AP_SCTP_PPID;
sctp_new_association_req_p->in_streams = f1ap_setup_req->sctp_in_streams;
sctp_new_association_req_p->out_streams = f1ap_setup_req->sctp_out_streams;
// remote
memcpy(&sctp_new_association_req_p->remote_address,
&f1ap_setup_req->CU_f1_ip_address,
sizeof(f1ap_setup_req->CU_f1_ip_address));
// local
memcpy(&sctp_new_association_req_p->local_address,
&f1ap_setup_req->DU_f1_ip_address,
sizeof(f1ap_setup_req->DU_f1_ip_address));
// store data
f1ap_du_data = (f1ap_setup_req_t *)calloc(1, sizeof(f1ap_setup_req_t));
*f1ap_du_data = *f1ap_setup_req;
//printf("sib itti message %s\n", f1ap_setup_req_t->sib1[0]);
//printf("nr_cellid : %llx (%lld)",f1ap_setup_req->nr_cellid[0],f1ap_setup_req->nr_cellid[0]);
//du_f1ap_register_to_sctp
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) {
DevAssert(sctp_new_association_resp != NULL);
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
LOG_W(F1AP, "Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n",
sctp_new_association_resp->sctp_state,
instance,
sctp_new_association_resp->ulp_cnx_id);
//f1ap_handle_setup_message(instance, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
return; // exit -1 for debugging
}
// save the assoc id
f1ap_du_data->assoc_id = sctp_new_association_resp->assoc_id;
f1ap_du_data->sctp_in_streams = sctp_new_association_resp->in_streams;
f1ap_du_data->sctp_out_streams = sctp_new_association_resp->out_streams;
f1ap_du_data->default_sctp_stream_id = 0;
/* setup parameters for F1U and start the server */
const cudu_params_t params = {
.local_ipv4_address = RC.mac[instance]->eth_params_n.my_addr,
.local_port = RC.mac[instance]->eth_params_n.my_portd,
.remote_ipv4_address = RC.mac[instance]->eth_params_n.remote_addr,
.remote_port = RC.mac[instance]->eth_params_n.remote_portd
};
AssertFatal(proto_agent_start(instance, &params) == 0,
"could not start PROTO_AGENT for F1U on instance %d!\n", instance);
DU_send_F1_SETUP_REQUEST(instance);
}
void du_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind)
{
int result;
DevAssert(sctp_data_ind != NULL);
f1ap_handle_message(instance, sctp_data_ind->assoc_id, sctp_data_ind->stream,
sctp_data_ind->buffer, sctp_data_ind->buffer_length);
result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
}
void *F1AP_DU_task(void *arg) {
//sctp_cu_init();
MessageDef *received_msg = NULL;
int result;
LOG_I(F1AP, "Starting F1AP at DU\n");
//f1ap_eNB_prepare_internal_data();
itti_mark_task_ready(TASK_DU_F1);
// SCTP
while (1) {
itti_receive_msg(TASK_DU_F1, &received_msg);
switch (ITTI_MSG_ID(received_msg)) {
// case TERMINATE_MESSAGE:
// //F1AP_WARN(" *** Exiting F1AP DU thread\n");
// itti_exit_task();
// break;
case F1AP_SETUP_REQ: // this is not a true F1 message, but rather an ITTI message sent by enb_app
// 1. save the itti msg so that you can use it to sen f1ap_setup_req, fill the f1ap_setup_req message,
// 2. store the message in f1ap context, that is also stored in RC
// 2. send a sctp_association req
LOG_I(F1AP, "DU Task Received F1AP_SETUP_REQ\n");
du_task_send_sctp_association_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&F1AP_SETUP_REQ(received_msg));
break;
case SCTP_NEW_ASSOCIATION_RESP:
// 1. store the respon
// 2. send the f1setup_req
LOG_I(F1AP, "DU Task Received SCTP_NEW_ASSOCIATION_RESP\n");
du_task_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_new_association_resp);
break;
case SCTP_DATA_IND:
// ex: any F1 incoming message for DU ends here
LOG_I(F1AP, "DU Task Received SCTP_DATA_IND\n");
du_task_handle_sctp_data_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_data_ind);
break;
case F1AP_UL_RRC_MESSAGE: // from rrc
LOG_I(F1AP, "DU Task Received F1AP_UL_RRC_MESSAGE\n");
DU_send_UL_RRC_MESSAGE_TRANSFER(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&F1AP_UL_RRC_MESSAGE(received_msg));
break;
case F1AP_UE_CONTEXT_RELEASE_REQ: // from MAC
LOG_I(F1AP, "DU Task Received F1AP_UE_CONTEXT_RELEASE_REQ\n");
DU_send_UE_CONTEXT_RELEASE_REQUEST(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&F1AP_UE_CONTEXT_RELEASE_REQ(received_msg));
break;
case TERMINATE_MESSAGE:
LOG_W(F1AP, " *** Exiting F1AP thread\n");
itti_exit_task();
break;
default:
LOG_E(F1AP, "DU Received unhandled message: %d:%s\n",
ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break;
} // switch
result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
received_msg = NULL;
} // while
return NULL;
}
+30
View File
@@ -0,0 +1,30 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef F1AP_DU_TASK_H_
#define F1AP_DU_TASK_H_
void du_task_send_sctp_association_req(instance_t instance, f1ap_setup_req_t *f1ap_setup_req);
void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
void du_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind);
void *F1AP_DU_task(void *arg);
#endif /* F1AP_DU_TASK_H_ */
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,97 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_ue_context_management.h
* \brief f1ap ue context management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#ifndef F1AP_DU_UE_CONTEXT_MANAGEMENT_H_
#define F1AP_DU_UE_CONTEXT_MANAGEMENT_H_
/*
* UE Context Setup
*/
int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance);
int DU_send_UE_CONTEXT_SETUP_FAILURE(instance_t instance);
/*
* UE Context Release Request (gNB-DU initiated)
*/
int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
f1ap_ue_context_release_req_t *req);
/*
* UE Context Release Command (gNB-CU initiated)
*/
int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* UE Context Release Complete (gNB-DU initiated)
*/
int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
f1ap_ue_context_release_cplt_t *cplt);
/*
* UE Context Modification (gNB-CU initiated)
*/
int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance);
int DU_send_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance);
/*
* UE Context Modification Required (gNB-DU initiated)
*/
int DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance);
int DU_handle_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* UE Inactivity Notification
*/
/*
* Notify
*/
#endif /* F1AP_DU_UE_CONTEXT_MANAGEMENT_H_ */
@@ -0,0 +1,31 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
@@ -0,0 +1,31 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
+376
View File
@@ -0,0 +1,376 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_encoder.c
* \brief f1ap pdu encode procedures
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#include "f1ap_common.h"
#include "f1ap_encoder.h"
int asn1_encoder_xer_print = 0;
/*
static inline int f1ap_encode_initiating(f1ap_message *message,
uint8_t **buffer,
uint32_t *len);
static inline int f1ap_encode_successfull_outcome(f1ap_message *message,
uint8_t **buffer, uint32_t *len);
static inline int f1ap_encode_unsuccessfull_outcome(f1ap_message *message,
uint8_t **buffer, uint32_t *len);
static inline int f1ap_encode_f1_setup_request(
F1ap_F1SetupRequestIEs_t *f1SetupRequestIEs, uint8_t **buffer, uint32_t *length);
static inline int f1ap_encode_trace_failure(F1ap_TraceFailureIndicationIEs_t
*trace_failure_ies_p, uint8_t **buffer,
uint32_t *length);
static inline int f1ap_encode_initial_context_setup_response(
F1ap_InitialContextSetupResponseIEs_t *initialContextSetupResponseIEs,
uint8_t **buffer,
uint32_t *length);
static inline
int f1ap_encode_ue_context_release_complete(
F1ap_UEContextReleaseCompleteIEs_t *f1ap_UEContextReleaseCompleteIEs,
uint8_t **buffer,
uint32_t *length);
static inline
int f1ap_encode_ue_context_release_request(
F1ap_UEContextReleaseRequestIEs_t *f1ap_UEContextReleaseRequestIEs,
uint8_t **buffer,
uint32_t *length);
*/
int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length)
{
ssize_t encoded;
DevAssert(pdu != NULL);
DevAssert(buffer != NULL);
DevAssert(length != NULL);
if (asn1_encoder_xer_print) {
LOG_E(F1AP, "----------------- ASN1 ENCODER PRINT START ----------------- \n");
xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_E(F1AP, "----------------- ASN1 ENCODER PRINT END----------------- \n");
}
encoded = aper_encode_to_new_buffer(&asn_DEF_F1AP_F1AP_PDU, 0, pdu, (void **)buffer);
if (encoded < 0) {
LOG_E(F1AP, "Failed to encode F1AP message\n");
return -1;
}
*length = encoded;
return encoded;
}
/*
static inline
int f1ap_encode_initiating(f1ap_message *f1ap_message_p,
uint8_t **buffer, uint32_t *len)
{
int ret = -1;
MessageDef *message_p;
char *message_string = NULL;
size_t message_string_size;
MessagesIds message_id;
DevAssert(f1ap_message_p != NULL);
message_string = calloc(10000, sizeof(char));
f1ap_string_total_size = 0;
switch(f1ap_message_p->procedureCode) {
case F1ap_ProcedureCode_id_F1Setup:
ret = f1ap_encode_f1_setup_request(
&f1ap_message_p->msg.f1ap_F1SetupRequestIEs, buffer, len);
//f1ap_xer_print_f1ap_f1setuprequest(f1ap_xer__print2sp, message_string, f1ap_message_p);
message_id = F1AP_F1_SETUP_LOG;
break;
case F1ap_ProcedureCode_id_UEContextReleaseRequest:
ret = f1ap_encode_ue_context_release_request(
&f1ap_message_p->msg.f1ap_UEContextReleaseRequestIEs, buffer, len);
//f1ap_xer_print_f1ap_uecontextreleaserequest(f1ap_xer__print2sp,
// message_string, f1ap_message_p);
message_id = F1AP_UE_CONTEXT_RELEASE_REQ_LOG;
break;
default:
F1AP_DEBUG("Unknown procedure ID (%d) for initiating message\n",
(int)f1ap_message_p->procedureCode);
return ret;
break;
}
message_string_size = strlen(message_string);
message_p = itti_alloc_new_message_sized(TASK_F1AP, message_id, message_string_size + sizeof (IttiMsgText));
message_p->ittiMsg.f1ap_f1_setup_log.size = message_string_size;
memcpy(&message_p->ittiMsg.f1ap_f1_setup_log.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
free(message_string);
return ret;
}
static inline
int f1ap_encode_successfull_outcome(f1ap_message *f1ap_message_p,
uint8_t **buffer, uint32_t *len)
{
int ret = -1;
MessageDef *message_p;
char *message_string = NULL;
size_t message_string_size;
MessagesIds message_id;
DevAssert(f1ap_message_p != NULL);
message_string = calloc(10000, sizeof(char));
f1ap_string_total_size = 0;
message_string_size = strlen(message_string);
switch(f1ap_message_p->procedureCode) {
case F1ap_ProcedureCode_id_InitialContextSetup:
ret = f1ap_encode_initial_context_setup_response(
&f1ap_message_p->msg.f1ap_InitialContextSetupResponseIEs, buffer, len);
f1ap_xer_print_f1ap_initialcontextsetupresponse(f1ap_xer__print2sp, message_string, f1ap_message_p);
message_id = F1AP_INITIAL_CONTEXT_SETUP_LOG;
message_p = itti_alloc_new_message_sized(TASK_F1AP, message_id, message_string_size + sizeof (IttiMsgText));
message_p->ittiMsg.f1ap_initial_context_setup_log.size = message_string_size;
memcpy(&message_p->ittiMsg.f1ap_initial_context_setup_log.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
free(message_string);
break;
case F1ap_ProcedureCode_id_UEContextRelease:
ret = f1ap_encode_ue_context_release_complete(
&f1ap_message_p->msg.f1ap_UEContextReleaseCompleteIEs, buffer, len);
f1ap_xer_print_f1ap_uecontextreleasecomplete(f1ap_xer__print2sp, message_string, f1ap_message_p);
message_id = F1AP_UE_CONTEXT_RELEASE_COMPLETE_LOG;
message_p = itti_alloc_new_message_sized(TASK_F1AP, message_id, message_string_size + sizeof (IttiMsgText));
message_p->ittiMsg.f1ap_ue_context_release_complete_log.size = message_string_size;
memcpy(&message_p->ittiMsg.f1ap_ue_context_release_complete_log.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
free(message_string);
break;
default:
F1AP_WARN("Unknown procedure ID (%d) for successfull outcome message\n",
(int)f1ap_message_p->procedureCode);
return ret;
break;
}
return ret;
}
static inline
int f1ap_encode_unsuccessfull_outcome(f1ap_message *f1ap_message_p,
uint8_t **buffer, uint32_t *len)
{
int ret = -1;
MessageDef *message_p;
char *message_string = NULL;
size_t message_string_size;
MessagesIds message_id;
DevAssert(f1ap_message_p != NULL);
message_string = calloc(10000, sizeof(char));
f1ap_string_total_size = 0;
switch(f1ap_message_p->procedureCode) {
case F1ap_ProcedureCode_id_InitialContextSetup:
// ret = f1ap_encode_f1ap_initialcontextsetupfailureies(
// &f1ap_message_p->ittiMsg.f1ap_InitialContextSetupFailureIEs, buffer, len);
f1ap_xer_print_f1ap_initialcontextsetupfailure(f1ap_xer__print2sp, message_string, f1ap_message_p);
message_id = F1AP_INITIAL_CONTEXT_SETUP_LOG;
break;
default:
F1AP_DEBUG("Unknown procedure ID (%d) for unsuccessfull outcome message\n",
(int)f1ap_message_p->procedureCode);
return ret;
break;
}
message_string_size = strlen(message_string);
message_p = itti_alloc_new_message_sized(TASK_F1AP, message_id, message_string_size + sizeof (IttiMsgText));
message_p->ittiMsg.f1ap_initial_context_setup_log.size = message_string_size;
memcpy(&message_p->ittiMsg.f1ap_initial_context_setup_log.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
free(message_string);
return ret;
}
static inline
int f1ap_encode_f1_setup_request(
F1ap_F1SetupRequestIEs_t *f1SetupRequestIEs,
uint8_t **buffer,
uint32_t *length)
{
F1ap_F1SetupRequest_t f1SetupRequest;
F1ap_F1SetupRequest_t *f1SetupRequest_p = &f1SetupRequest;
memset((void *)f1SetupRequest_p, 0, sizeof(f1SetupRequest));
if (f1ap_encode_f1ap_f1setuprequesties(f1SetupRequest_p, f1SetupRequestIEs) < 0) {
return -1;
}
return f1ap_generate_initiating_message(buffer,
length,
F1ap_ProcedureCode_id_F1Setup,
F1ap_Criticality_reject,
&asn_DEF_F1ap_F1SetupRequest,
f1SetupRequest_p);
}
static inline
int f1ap_encode_trace_failure(
F1ap_TraceFailureIndicationIEs_t *trace_failure_ies_p,
uint8_t **buffer,
uint32_t *length)
{
F1ap_TraceFailureIndication_t trace_failure;
F1ap_TraceFailureIndication_t *trace_failure_p = &trace_failure;
memset((void *)trace_failure_p, 0, sizeof(trace_failure));
if (f1ap_encode_f1ap_tracefailureindicationies(
trace_failure_p, trace_failure_ies_p) < 0) {
return -1;
}
return f1ap_generate_initiating_message(buffer,
length,
F1ap_ProcedureCode_id_TraceFailureIndication,
F1ap_Criticality_reject,
&asn_DEF_F1ap_TraceFailureIndication,
trace_failure_p);
}
static inline
int f1ap_encode_initial_context_setup_response(
F1ap_InitialContextSetupResponseIEs_t *initialContextSetupResponseIEs,
uint8_t **buffer,
uint32_t *length)
{
F1ap_InitialContextSetupResponse_t initial_context_setup_response;
F1ap_InitialContextSetupResponse_t *initial_context_setup_response_p =
&initial_context_setup_response;
memset((void *)initial_context_setup_response_p, 0,
sizeof(initial_context_setup_response));
if (f1ap_encode_f1ap_initialcontextsetupresponseies(
initial_context_setup_response_p, initialContextSetupResponseIEs) < 0) {
return -1;
}
return f1ap_generate_successfull_outcome(buffer,
length,
F1ap_ProcedureCode_id_InitialContextSetup,
F1ap_Criticality_reject,
&asn_DEF_F1ap_InitialContextSetupResponse,
initial_context_setup_response_p);
}
static inline
int f1ap_encode_ue_context_release_complete(
F1ap_UEContextReleaseCompleteIEs_t *f1ap_UEContextReleaseCompleteIEs,
uint8_t **buffer,
uint32_t *length)
{
F1ap_UEContextReleaseComplete_t ue_context_release_complete;
F1ap_UEContextReleaseComplete_t *ue_context_release_complete_p =
&ue_context_release_complete;
memset((void *)ue_context_release_complete_p, 0,
sizeof(ue_context_release_complete));
if (f1ap_encode_f1ap_uecontextreleasecompleteies(
ue_context_release_complete_p, f1ap_UEContextReleaseCompleteIEs) < 0) {
return -1;
}
return f1ap_generate_successfull_outcome(buffer,
length,
F1ap_ProcedureCode_id_UEContextRelease,
F1ap_Criticality_reject,
&asn_DEF_F1ap_UEContextReleaseComplete,
ue_context_release_complete_p);
}
static inline
int f1ap_encode_ue_context_release_request(
F1ap_UEContextReleaseRequestIEs_t *f1ap_UEContextReleaseRequestIEs,
uint8_t **buffer,
uint32_t *length)
{
F1ap_UEContextReleaseRequest_t ue_context_release_request;
F1ap_UEContextReleaseRequest_t *ue_context_release_request_p =
&ue_context_release_request;
memset((void *)ue_context_release_request_p, 0,
sizeof(ue_context_release_request));
if (f1ap_encode_f1ap_uecontextreleaserequesties(
ue_context_release_request_p, f1ap_UEContextReleaseRequestIEs) < 0) {
return -1;
}
return f1ap_generate_initiating_message(buffer,
length,
F1ap_ProcedureCode_id_UEContextReleaseRequest,
F1ap_Criticality_reject,
&asn_DEF_F1ap_UEContextReleaseRequest,
ue_context_release_request_p);
}
*/
+39
View File
@@ -0,0 +1,39 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_encoder.h
* \brief f1ap pdu encode procedures
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#ifndef F1AP_ENCODER_H_
#define F1AP_ENCODER_H_
int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length)
__attribute__ ((warn_unused_result));
#endif /* F1AP_ENCODER_H_ */
+127
View File
@@ -0,0 +1,127 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_handlers.c
* \brief f1ap messages handlers
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#include "f1ap_common.h"
#include "f1ap_handlers.h"
#include "f1ap_decoder.h"
#include "f1ap_cu_interface_management.h"
#include "f1ap_du_interface_management.h"
#include "f1ap_cu_rrc_message_transfer.h"
#include "f1ap_du_rrc_message_transfer.h"
#include "f1ap_cu_ue_context_management.h"
#include "f1ap_du_ue_context_management.h"
extern f1ap_setup_req_t *f1ap_du_data_from_du;
/* Handlers matrix. Only f1 related procedure present here */
f1ap_message_decoded_callback f1ap_messages_callback[][3] = {
{ 0, 0, 0 }, /* Reset */
{ CU_handle_F1_SETUP_REQUEST, DU_handle_F1_SETUP_RESPONSE, DU_handle_F1_SETUP_FAILURE }, /* F1Setup */
{ 0, 0, 0 }, /* ErrorIndication */
{ 0, 0, 0 }, /* gNBDUConfigurationUpdate */
{ 0, 0, 0 }, /* gNBCUConfigurationUpdate */
{ DU_handle_UE_CONTEXT_SETUP_REQUEST, CU_handle_UE_CONTEXT_SETUP_RESPONSE, 0 }, /* UEContextSetup */
{ DU_handle_UE_CONTEXT_RELEASE_COMMAND, CU_handle_UE_CONTEXT_RELEASE_COMPLETE, 0 }, /* UEContextRelease */
{ 0, 0, 0 }, /* UEContextModification */
{ 0, 0, 0 }, /* UEContextModificationRequired */
{ 0, 0, 0 }, /* UEMobilityCommand */
{ CU_handle_UE_CONTEXT_RELEASE_REQUEST, 0, 0 }, /* UEContextReleaseRequest */
{ CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER, 0, 0 }, /* InitialULRRCMessageTransfer */
{ DU_handle_DL_RRC_MESSAGE_TRANSFER, 0, 0 }, /* DLRRCMessageTransfer */
{ CU_handle_UL_RRC_MESSAGE_TRANSFER, 0, 0 }, /* ULRRCMessageTransfer */
{ 0, 0, 0 }, /* privateMessage */
{ 0, 0, 0 }, /* UEInactivityNotification */
{ 0, 0, 0 }, /* GNBDUResourceCoordination */
{ 0, 0, 0 }, /* SystemInformationDeliveryCommand */
{ 0, 0, 0 }, /* Paging */
{ 0, 0, 0 }, /* Notify */
{ 0, 0, 0 }, /* WriteReplaceWarning */
{ 0, 0, 0 }, /* PWSCancel */
{ 0, 0, 0 }, /* PWSRestartIndication */
{ 0, 0, 0 }, /* PWSFailureIndication */
};
const char *f1ap_direction2String(int f1ap_dir) {
static const char *f1ap_direction_String[] = {
"", /* Nothing */
"Initiating message", /* initiating message */
"Successfull outcome", /* successfull outcome */
"UnSuccessfull outcome", /* successfull outcome */
};
return(f1ap_direction_String[f1ap_dir]);
}
int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
const uint8_t * const data, const uint32_t data_length)
{
F1AP_F1AP_PDU_t pdu;
int ret;
DevAssert(data != NULL);
memset(&pdu, 0, sizeof(pdu));
if (f1ap_decode_pdu(&pdu, data, data_length) < 0) {
LOG_E(F1AP, "Failed to decode PDU\n");
return -1;
}
/* Checking procedure Code and direction of message */
if (pdu.choice.initiatingMessage->procedureCode > sizeof(f1ap_messages_callback) / (3 * sizeof(
f1ap_message_decoded_callback))
|| (pdu.present > F1AP_F1AP_PDU_PR_unsuccessfulOutcome)) {
LOG_E(F1AP, "[SCTP %d] Either procedureCode %ld or direction %d exceed expected\n",
assoc_id, pdu.choice.initiatingMessage->procedureCode, pdu.present);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu);
return -1;
}
/* No handler present.
* This can mean not implemented or no procedure for eNB (wrong direction).
*/
if (f1ap_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1] == NULL) {
LOG_E(F1AP, "[SCTP %d] No handler for procedureCode %ld in %s\n",
assoc_id, pdu.choice.initiatingMessage->procedureCode,
f1ap_direction2String(pdu.present - 1));
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu);
return -1;
}
/* Calling the right handler */
LOG_I(F1AP, "Calling handler with instance %d\n",instance);
ret = (*f1ap_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1])
(instance, assoc_id, stream, &pdu);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu);
return ret;
}
+39
View File
@@ -0,0 +1,39 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_handlers.h
* \brief f1ap messages handlers
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#ifndef F1AP_HANDLERS_H_
#define F1AP_HANDLERS_H_
int f1ap_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
const uint8_t * const data, const uint32_t data_length);
#endif /* F1AP_HANDLERS_H_ */
+73
View File
@@ -0,0 +1,73 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "f1ap_common.h"
#include "f1ap_itti_messaging.h"
void cu_f1ap_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
uint32_t buffer_length, uint16_t stream)
{
MessageDef *message_p;
sctp_data_req_t *sctp_data_req;
message_p = itti_alloc_new_message(TASK_CU_F1, SCTP_DATA_REQ);
sctp_data_req = &message_p->ittiMsg.sctp_data_req;
sctp_data_req->assoc_id = assoc_id;
sctp_data_req->buffer = buffer;
sctp_data_req->buffer_length = buffer_length;
sctp_data_req->stream = stream;
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
void du_f1ap_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
uint32_t buffer_length, uint16_t stream)
{
MessageDef *message_p;
sctp_data_req_t *sctp_data_req;
message_p = itti_alloc_new_message(TASK_DU_F1, SCTP_DATA_REQ);
sctp_data_req = &message_p->ittiMsg.sctp_data_req;
sctp_data_req->assoc_id = assoc_id;
sctp_data_req->buffer = buffer;
sctp_data_req->buffer_length = buffer_length;
sctp_data_req->stream = stream;
LOG_I(F1AP, "Sending ITTI message to SCTP Task\n");
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
void f1ap_itti_send_sctp_close_association(instance_t instance, int32_t assoc_id)
{
MessageDef *message_p = NULL;
sctp_close_association_t *sctp_close_association_p = NULL;
message_p = itti_alloc_new_message(TASK_S1AP, SCTP_CLOSE_ASSOCIATION);
sctp_close_association_p = &message_p->ittiMsg.sctp_close_association;
sctp_close_association_p->assoc_id = assoc_id;
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
+35
View File
@@ -0,0 +1,35 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef F1AP_ITTI_MESSAGING_H_
#define F1AP_ITTI_MESSAGING_H_
void cu_f1ap_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
uint32_t buffer_length, uint16_t stream);
void du_f1ap_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
uint32_t buffer_length, uint16_t stream);
void f1ap_eNB_itti_send_sctp_close_association(instance_t instance,
int32_t assoc_id);
#endif /* F1AP_ITTI_MESSAGING_H_ */
+66
View File
@@ -0,0 +1,66 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_messaging.c
* \brief f1ap procedures
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#include "f1ap_common.h"
#include "f1ap_messaging.h"
// void f1ap_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
// uint32_t buffer_length, uint16_t stream)
// {
// MessageDef *message_p;
// sctp_data_req_t *sctp_data_req;
// message_p = itti_alloc_new_message(TASK_F1AP, SCTP_DATA_REQ);
// sctp_data_req = &message_p->ittiMsg.sctp_data_req;
// sctp_data_req->assoc_id = assoc_id;
// sctp_data_req->buffer = buffer;
// sctp_data_req->buffer_length = buffer_length;
// sctp_data_req->stream = stream;
// itti_send_msg_to_task(TASK_SCTP, instance, message_p);
// }
// void f1ap_send_sctp_close_association(instance_t instance, int32_t assoc_id)
// {
// MessageDef *message_p = NULL;
// sctp_close_association_t *sctp_close_association_p = NULL;
// message_p = itti_alloc_new_message(TASK_F1AP, SCTP_CLOSE_ASSOCIATION);
// sctp_close_association_p = &message_p->ittiMsg.sctp_close_association;
// sctp_close_association_p->assoc_id = assoc_id;
// itti_send_msg_to_task(TASK_SCTP, instance, message_p);
// }
+44
View File
@@ -0,0 +1,44 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_messaging.h
* \brief f1ap procedures
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#ifndef F1AP_MESSAGING_H_
#define F1AP_MESSAGING_H_
void f1ap_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
uint32_t buffer_length, uint16_t stream);
void f1ap_send_sctp_close_association(instance_t instance,
int32_t assoc_id);
#endif /* F1AP_MESSAGING_H_ */