X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fphy_stub%2Fphy_stub.h;h=8fd85c56fa085b4036039e4b6f6422bc25a12969;hb=6dc8a4c17da24847b3a3aee91b37151f77a8a5bc;hp=6ee1a8fef6b2b5f59b5ac69e950a8cf7256cdfed;hpb=aa2b46912637dd3c7b52af75779f20af79f483e5;p=o-du%2Fl2.git diff --git a/src/phy_stub/phy_stub.h b/src/phy_stub/phy_stub.h index 6ee1a8fef..8fd85c56f 100644 --- a/src/phy_stub/phy_stub.h +++ b/src/phy_stub/phy_stub.h @@ -17,6 +17,14 @@ *******************************************************************************/ #include +/* Changes the IP information +* At DU1, SOURCE_DU_IPV4_ADDR = 192.168.130.81 and DESTINATION_DU_IPV4_ADDR = 192.168.130.83 +* At DU2, SOURCE_DU_IPV4_ADDR = 192.168.130.83 and DESTINATION_DU_IPV4_ADDR = 192.168.130.81 */ +#define SOURCE_DU_IPV4_ADDR "192.168.130.81" +#define DESTINATION_DU_IPV4_ADDR "192.168.130.83" +#define PORT_NUMBER 8080 +#define NUM_THREADS 1 + #ifdef NR_TDD #define MAX_SLOT_VALUE 19 #else @@ -25,13 +33,19 @@ #define MAX_SFN_VALUE 1023 #define NR_PCI 1 #define SLOT_DELAY 3 -#define NUM_DRB_TO_PUMP_DATA 3 -#define NUM_UL_PACKETS 4 +#define NUM_DRB_TO_PUMP_DATA 2 +#define NUM_UL_PACKETS 1 + /*UE Ids for RACH IND*/ #define UE_IDX_0 0 #define UE_IDX_1 1 #define UE_IDX_2 2 +/* Default RA Preamble index to be used when Rach Indication is triggered from + * PHY stub */ +#define CB_RA_PREAMBLE_IDX 3 /* For contention based RA */ +#define CF_RA_PREAMBLE_IDX 8 /* For contention free RA */ + bool slotIndicationStarted; uint16_t sfnValue; uint16_t slotValue; @@ -51,13 +65,18 @@ typedef struct ueCb uint8_t ueId; uint16_t crnti; bool rachIndSent; + bool isCFRA; bool msg3Sent; bool msg5ShortBsrSent; bool msg5Sent; bool dlDedMsg; - bool msgSecurityModeComp; - bool msgRrcReconfiguration; - bool msgRegistrationComp; + bool msgNasAuthenticationComp; + bool msgNasSecurityModeComp; + bool msgRrcSecurityModeComp; + bool msgRrcReconfigComp; + bool msgRegistrationComp; + uint8_t rlcSnForSrb1; /* Sequence number of PDU at RLC for AM mode */ + uint8_t pdcpSn; /* Sequence number of PDU at PDCP */ }UeCb; /* Database to store information for all UE */ @@ -67,14 +86,30 @@ typedef struct ueDb UeCb ueCb[MAX_NUM_UE]; }UeDb; -UeDb ueDb; +typedef struct ipCfg +{ + uint32_t sourceDu; + uint32_t destinationDu; + uint16_t portNumber; +}IpCfg; + +typedef struct phyDb +{ + bool isServer; + IpCfg ipCfgInfo; + UeDb ueDb; +}PhyDb; + +PhyDb phyDb; typedef enum { MSG_TYPE_MSG3, MSG_TYPE_SHORT_BSR, MSG_TYPE_MSG5, - MSG_TYPE_SECURITY_MODE_COMPLETE, + MSG_TYPE_NAS_AUTHENTICATION_COMPLETE, + MSG_TYPE_NAS_SECURITY_MODE_COMPLETE, + MSG_TYPE_RRC_SECURITY_MODE_COMPLETE, MSG_TYPE_REGISTRATION_COMPLETE, MSG_TYPE_RRC_RECONFIG_COMPLETE }MsgType; @@ -93,6 +128,9 @@ uint8_t l1SendUlUserData(uint8_t drbId, uint8_t ueIdx); uint8_t l1SendStatusPdu(); uint16_t l1BuildAndSendSlotIndication(); uint16_t l1BuildAndSendStopInd(); +int inet_pton(int af, const char *sourc, void *dst); +void *establishConnectionWithPeerL1(void *args); +uint16_t l1BuildAndSendRachInd(uint16_t slot, uint16_t sfn, uint8_t raPreambleIdx); /********************************************************************** End of file