+}
+
+/*******************************************************************
+ *
+ * @brief function reads the recevied information send by peer PHY
+ *
+ * @details
+ *
+ * Function : receiveMsgFromPeerL1
+ *
+ * Functionality: This function reads the recevied information
+ * and prints at console
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+void receiveMsgFromPeerL1()
+{
+ while(true)
+ {
+ char buffer[1024] = {0};
+
+ if(read(socket_fd, buffer, 1024)>0)
+ {
+ DU_LOG("\n");
+ DU_LOG("%s\n",buffer);
+ if (strncmp("HANDOVER_IN_PROGRESS", buffer, 19) == 0)
+ {
+ DU_LOG("\nINFO --> PHY_STUB : Communication completed in between the source and destination PHY\n");
+ //TODO: Trigger for other handover process in target PHY
+ }
+ }
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief function build the message which need to send to target PHY
+ *
+ * @details
+ *
+ * Function : sendMsg
+ *
+ * Functionality: function build the message which need to send
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+void sendMsg()
+{
+ char *msgToDestinationPhy = "HANDOVER_IN_PROGRESS";
+
+ send(socket_fd, msgToDestinationPhy , strlen(msgToDestinationPhy) , 0 );
+}
+
+/*******************************************************************
+ *
+ * @brief This function handles the server functionalities like
+ * binding socket, listen and accept
+ *
+ * @details
+ *
+ * Function : startL1AsServer
+ *
+ * Functionality: This function handles the server functionalities like
+ * binding socket, listen and accept
+ *
+ * @params[in] struct sockaddr_in serverPhy, struct sockaddr_in
+ * clientPhy
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+int8_t startL1AsServer(struct sockaddr_in serverPhy, struct sockaddr_in clientPhy)
+{
+ int addrlen= sizeof(struct sockaddr_in);
+
+ if (bind(socket_fd, (struct sockaddr *)&serverPhy, sizeof(struct sockaddr_in))<0)
+ {
+ DU_LOG("\nERROR --> PHY_STUB : bind failed");
+ return RFAILED;
+ }
+ if (listen(socket_fd, 3) < 0)
+ {
+ DU_LOG("\nERROR --> PHY_STUB : listen failed");
+ return RFAILED;
+ }
+ while(true)
+ {
+ if ((socket_fd = accept(socket_fd, (struct sockaddr *)&clientPhy,
+ (socklen_t*)&addrlen))<0)
+ {
+ DU_LOG("\nINFO --> PHY_STUB : Server is waiting");
+ }
+ else
+ {
+ DU_LOG("\nINFO --> PHY_STUB : Server Connected");
+ break;
+ }
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief this function includes all the functionalities of client side
+ * like binding the client side socket and connecting to the server
+ *
+ * @details
+ *
+ * Function : startL1AsClient
+ *
+ * Functionality: this function includes all the functionalities of client
+ * side like binding the client side socket and connecting to the server
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+int8_t startL1AsClient(struct sockaddr_in serverPhy, struct sockaddr_in destinationPhy)
+{
+ if (bind(socket_fd, (struct sockaddr *)&serverPhy, sizeof(struct sockaddr_in ))<0)
+ {
+ DU_LOG("\nERROR --> PHY_STUB : bind failed");
+ return RFAILED;
+ }
+
+ while(true)
+ {
+ if (connect(socket_fd, (struct sockaddr *)&destinationPhy, sizeof(struct sockaddr_in)) < 0)
+ {
+ DU_LOG("\nERROR --> PHY_STUB : Connection Failed");
+ }
+ else
+ {
+ DU_LOG("\nINFO --> PHY_STUB : Client connected to sever");
+ break;
+ }
+ }
+ return ROK;