/* Pass a received packet to tcpip_thread for input processing */
err_t tcpip_input(struct pbuf *p, struct netif *inp)
/* Pass a received packet to tcpip_thread for input processing */
err_t tcpip_input(struct pbuf *p, struct netif *inp)
{
  struct tcpip_msg *msg;
  if (mbox != SYS_MBOX_NULL) {
    msg = memp_malloc(MEMP_TCPIP_MSG_INPKT);
    if (msg == NULL) {
      return ERR_MEM;
    }
    msg->type = TCPIP_MSG_INPKT;
    msg->msg.inp.p = p;
    msg->msg.inp.netif = inp;
    if (sys_mbox_trypost(mbox, msg) != ERR_OK) {
      memp_free(MEMP_TCPIP_MSG_INPKT, msg);
      return ERR_MEM;
    }
    return ERR_OK;
  }
  return ERR_VAL;
}