47#include "lwip/ip_addr.h"
56static struct raw_pcb *raw_pcbs;
78 struct raw_pcb *pcb, *prev;
85 iphdr = (
struct ip_hdr *)
p->payload;
92 while ((eaten == 0) && (pcb !=
NULL)) {
93 if ((pcb->protocol ==
proto) &&
96#if IP_SOF_BROADCAST_RECV
102 if (pcb->recv !=
NULL) {
111 prev->
next = pcb->next;
112 pcb->next = raw_pcbs;
142raw_bind(
struct raw_pcb *pcb,
ip_addr_t *ipaddr)
162raw_connect(
struct raw_pcb *pcb,
ip_addr_t *ipaddr)
183raw_recv(
struct raw_pcb *pcb, raw_recv_fn
recv,
void *recv_arg)
187 pcb->recv_arg = recv_arg;
221 if (
p->tot_len != 0) {
226 LWIP_DEBUGF(
RAW_DEBUG, (
"raw_sendto: added header pbuf %p before given pbuf %p\n", (
void *)
q, (
void *)
p));
231 LWIP_ASSERT(
"Can't restore header we just removed!", 0);
263 src_ip = &(pcb->local_ip);
286raw_send(
struct raw_pcb *pcb,
struct pbuf *
p)
288 return raw_sendto(pcb,
p, &pcb->remote_ip);
300raw_remove(
struct raw_pcb *pcb)
302 struct raw_pcb *pcb2;
304 if (raw_pcbs == pcb) {
306 raw_pcbs = raw_pcbs->next;
309 for(pcb2 = raw_pcbs; pcb2 !=
NULL; pcb2 = pcb2->
next) {
311 if (pcb2->next !=
NULL && pcb2->
next == pcb) {
313 pcb2->next = pcb->next;
341 memset(pcb, 0,
sizeof(
struct raw_pcb));
342 pcb->protocol =
proto;
344 pcb->
next = raw_pcbs;
#define LWIP_UNUSED_ARG(x)
INT WSAAPI recv(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags)
#define ip_get_option(pcb, opt)
#define ip_current_src_addr()
#define LWIP_DBG_LEVEL_SERIOUS
#define LWIP_DEBUGF(debug, message)
#define LWIP_DBG_LEVEL_WARNING
#define LWIP_ASSERT(message, assertion)
GLdouble GLdouble GLdouble GLdouble q
#define ip_addr_cmp(addr1, addr2)
#define ip_addr_isany(addr1)
#define ip4_addr1_16(ipaddr)
#define ip4_addr2_16(ipaddr)
#define ip_addr_set(dest, src)
typedefPACK_STRUCT_END struct ip_addr ip_addr_t
#define ip_addr_isbroadcast(ipaddr, netif)
#define ip4_addr3_16(ipaddr)
#define ip4_addr4_16(ipaddr)
err_t ip_output_if(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest, u8_t ttl, u8_t tos, u8_t proto, struct netif *netif)
ip_addr_t current_iphdr_dest
struct netif * ip_route(ip_addr_t *dest)
void * memp_malloc(memp_t type)
void memp_free(memp_t type, void *mem)
#define NETIF_SET_HWADDRHINT(netif, hint)
u8_t pbuf_header(struct pbuf *p, s16_t header_size_increment)
void pbuf_chain(struct pbuf *h, struct pbuf *t)
struct pbuf * pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
u8_t pbuf_free(struct pbuf *p)