lwip/core/raw.c
/**
 * Create a RAW PCB.
 *
 * @return The RAW PCB which was created. NULL if the PCB data structure
 * could not be allocated.
 *
 * @param proto the protocol number of the IPs payload (e.g. IP_PROTO_ICMP)
 *
 * @see raw_remove()
 */
Create a RAW PCB.
@return The RAW PCB which was created. NULL if the PCB data structure
could not be allocated.

@param proto the protocol number of the IPs payload


Create a RAW PCB . @return The RAW PCB which was created . NULL if the PCB data structure could not be allocated . @param proto the protocol number of the IPs payload
struct raw_pcb *
raw_new(u16_t proto) {
  struct raw_pcb *pcb;
  LWIP_DEBUGF(RAW_DEBUG | DBG_TRACE | 3, ("raw_new\n"));
  pcb = memp_malloc(MEMP_RAW_PCB);
  if (pcb != NULL) {
    memset(pcb, 0, sizeof(struct raw_pcb));
    pcb->protocol = proto;
    pcb->ttl = RAW_TTL;
    pcb->next = raw_pcbs;
    raw_pcbs = pcb;
  }
  return pcb;
}
struct raw_pcb * raw_new ( u16_t proto ) { struct raw_pcb * pcb ; LWIP_DEBUGF ( RAW_DEBUG | DBG_TRACE | 3 , ( " \n " ) ) ; pcb = memp_malloc ( MEMP_RAW_PCB ) ; if ( pcb != NULL ) { memset ( pcb , 0 , sizeof ( struct raw_pcb ) ) ; pcb -> protocol = proto ; pcb -> ttl = RAW_TTL ; pcb -> next = raw_pcbs ; raw_pcbs = pcb ; } return pcb ; }
Create a RAW PCB.
Create a RAW PCB .
/* could allocate RAW PCB? */ /* initialize PCB to all zeroes */