lwip/core/raw.c
/**
 * Determine if in incoming IP packet is covered by a RAW pcb and
 * and process it if possible
 *
 * Given an incoming IP datagram (as a chain of pbufs) this function
 * finds a corresponding RAW PCB and
 *
 * @param pbuf pbuf to be demultiplexed to a RAW PCB.
 * @param netif network interface on which the datagram was received.
 * @return 0 if packet is not eated (pbuf needs to be freed then)
 *         or 1 if the packet has been eaten (pbuf needs not to be freed
 *         then)
 *
 */
Determine if in incoming IP packet is covered by a RAW pcb and
and process it if possible

Given an incoming IP datagram (as a chain of pbufs) this function
finds a corresponding RAW PCB and

@param pbuf pbuf to be demultiplexed to a RAW PCB.
@param netif network interface on which the datagram was received.
@return 0 if packet is not eated (pbuf needs to be freed then)
or 1 if the packet has been eaten (pbuf needs not to be freed
then)
Determine if in incoming IP packet is covered by a RAW pcb and and process it if possible Given an incoming IP datagram ( as a chain of pbufs ) this function finds a corresponding RAW PCB and @param pbuf pbuf to be demultiplexed to a RAW PCB . @param netif network interface on which the datagram was received . @return 0 if packet is not eated ( pbuf needs to be freed then ) or 1 if the packet has been eaten ( pbuf needs not to be freed then )
int
raw_input(struct pbuf *p, struct netif *inp)
{
  struct raw_pcb *pcb;
  struct ip_hdr *iphdr;
  int proto;
  int rc = 0;
  iphdr = p->payload;
  proto = IPH_PROTO(iphdr);
  for(pcb = raw_pcbs; pcb != NULL; pcb = pcb->next) {
    if (pcb->protocol == proto) {
      if (pcb->recv) {
        if (!pcb->recv(pcb->recv_arg, pcb, p, &(iphdr->src)))
          return 0;
      }
      pbuf_free(p);
      rc = 1;
      break;
    }
  }
  return rc;
}
int raw_input ( struct pbuf * p , struct netif * inp ) { struct raw_pcb * pcb ; struct ip_hdr * iphdr ; int proto ; int rc = 0 ; iphdr = p -> payload ; proto = IPH_PROTO ( iphdr ) ; for ( pcb = raw_pcbs ; pcb != NULL ; pcb = pcb -> next ) { if ( pcb -> protocol == proto ) { if ( pcb -> recv ) { if ( ! pcb -> recv ( pcb -> recv_arg , pcb , p , & ( iphdr -> src ) ) ) return 0 ; } pbuf_free ( p ) ; rc = 1 ; break ; } } return rc ; }
Determine if in incoming IP packet is covered by a RAW pcb and
 and process it if possible
Determine if in incoming IP packet is covered by a RAW pcb and and process it if possible