/* Processing an incoming message on the Event port. */ static void eventRecv(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_addr *addr, u16_t port) { NetPath *netPath = (NetPath *)arg; /* prevent warnings about unused arguments */ (void)pcb; (void)addr; (void)port; /* Place the incoming message on the Event Port QUEUE. */ if(!netQPut(&netPath->eventQ, p)) PERROR("Event Queue Full!\n"); }
/** * @brief Processing an incoming message on the General port. * @param arg the user argument * @param pcb the tcp_pcb that has received the data * @param p the packet buffer * @param addr the addres of sender * @param port the port number of sender * @retval None */ static void netRecvGeneralCallback(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_addr *addr, u16_t port) { NetPath *netPath = (NetPath *)arg; /* Place the incoming message on the Event Port QUEUE. */ if (!netQPut(&netPath->generalQ, p)) { pbuf_free(p); p = NULL; ERROR("netRecvGeneralCallback: queue full\n"); return; } }
/* Process an incoming message on the General port. */ static void netRecvGeneralCallback(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_addr *addr, u16_t port) { NetPath *netPath = (NetPath *) arg; /* Place the incoming message on the Event Port QUEUE. */ if (!netQPut(&netPath->generalQ, p)) { pbuf_free(p); ERROR("netRecvGeneralCallback: queue full\n"); return; } /* Alert the PTP thread there is now something to do. */ ptpd_alert(); }