[Epic-ID: ODUHIGH-405][Task-ID: ODUHIGH-437] Establishing communication between Sourc...
[o-du/l2.git] / src / phy_stub / phy_stub.h
index 4d78c49..669eb3e 100644 (file)
 *******************************************************************************/
 #include <unistd.h>
 
+/* 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
 #define MAX_SFN_VALUE    1023
 #define NR_PCI            1
 #define SLOT_DELAY       3
+#define NUM_DRB_TO_PUMP_DATA  3
+#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
+
+bool     slotIndicationStarted;
+uint16_t sfnValue;
+uint16_t slotValue;
+
+/*Mapping between LCG ID and BSR Idx*/
+typedef struct lcgBufferSize
+{
+   uint8_t lcgId;   /*LCG ID for which BSR will be requested*/
+   /*BufferStatus Index. This is as per Spec 38.321, BSR will be reported as Index 
+    * Refer table Table 6.1.3.1-1:Short_BSR and Table 6.1.3.1-2:Long_BSR*/
+   uint8_t bsIdx;
+}LcgBufferSize;
+
+/* UE specific information */
+typedef struct ueCb
+{
+   uint8_t  ueId;
+   uint16_t crnti;
+   bool     rachIndSent;
+   bool     msg3Sent;
+   bool     msg5ShortBsrSent;
+   bool     msg5Sent;
+   bool     dlDedMsg;
+   bool     msgSecurityModeComp;
+   bool           msgRrcReconfiguration;
+   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 */
+typedef struct ueDb
+{
+   uint8_t   numActvUe;
+   UeCb      ueCb[MAX_NUM_UE];
+}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;
 
-uint16_t sfnValue = 0;
-uint16_t slotValue = 0;
-bool     rachIndSent = false;
-bool     msg3Sent = false;
-bool     msg5ShortBsrSent = false;
-bool     msg5Sent = false;
-bool     dlDedMsg = false;
-bool     msgSecurityModeComp =  false;
-bool    msgRrcReconfiguration  =  false;
-bool    msgRegistrationComp    = false;
 typedef enum
 {
    MSG_TYPE_MSG3,
@@ -54,7 +111,14 @@ void fillMsgHeader ARGS((fapi_msg_t *hdr, uint16_t msgType, uint16_t msgLen));
 #endif
 void procPhyMessages(uint16_t msgType, uint32_t msgSize, void *msg);
 void l1StartConsoleHandler();
-
+void l1HdlSlotIndicaion(bool);
+void GenerateTicks();
+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);
 /**********************************************************************
          End of file
 **********************************************************************/