#include "lwip/mem.h"
#include "lwip/opt.h"
#include "netif/loopif.h"
#include "lwip/tcp.h"
#include "lwip/ip.h"
Include dependency graph for loopif.c:
Go to the source code of this file.
Functions | |
err_t | loopif_output (struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr) |
err_t | loopif_init (struct netif *netif) |
|
Definition at line 70 of file loopif.c. References ERR_OK, loopif_output(), netif::name, and netif::output.
00071 { 00072 netif->name[0] = 'l'; 00073 netif->name[1] = 'o'; 00074 netif->output = loopif_output; 00075 return ERR_OK; 00076 } |
Here is the call graph for this function:
|
Definition at line 45 of file loopif.c. References ERR_MEM, ERR_OK, netif::input, NULL, pbuf_alloc(), PBUF_RAM, PBUF_RAW, and pbuf::tot_len. Referenced by loopif_init().
00047 { 00048 struct pbuf *q, *r; 00049 char *ptr; 00050 00051 #if defined(LWIP_DEBUG) && defined(LWIP_TCPDUMP) 00052 tcpdump(p); 00053 #endif /* LWIP_DEBUG && LWIP_TCPDUMP */ 00054 00055 r = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM); 00056 if(r != NULL) { 00057 ptr = r->payload; 00058 00059 for(q = p; q != NULL; q = q->next) { 00060 memcpy(ptr, q->payload, q->len); 00061 ptr += q->len; 00062 } 00063 netif->input(r, netif); 00064 return ERR_OK; 00065 } 00066 return ERR_MEM; 00067 } |
Here is the call graph for this function: