58 static struct raw_pcb *raw_pcbs;
78 raw_input(
struct pbuf *p,
struct netif *inp)
80 struct raw_pcb *pcb, *prev;
91 struct ip6_hdr *ip6hdr = (
struct ip6_hdr *)p->
payload;
92 proto = IP6H_NEXTH(ip6hdr);
100 proto = IPH_PROTO((
struct ip_hdr *)p->
payload);
108 while ((eaten == 0) && (pcb !=
NULL)) {
112 #if IP_SOF_BROADCAST_RECV 120 if (pcb->recv !=
NULL) {
121 #ifndef LWIP_NOASSERT 122 void* old_payload = p->
payload;
133 prev->next = pcb->next;
134 pcb->next = raw_pcbs;
139 LWIP_ASSERT(
"raw pcb recv callback altered pbuf payload pointer without eating packet",
168 raw_bind(
struct raw_pcb *pcb,
const ip_addr_t *ipaddr)
191 raw_connect(
struct raw_pcb *pcb,
const ip_addr_t *ipaddr)
214 raw_recv(
struct raw_pcb *pcb, raw_recv_fn recv,
void *recv_arg)
218 pcb->recv_arg = recv_arg;
234 raw_sendto(
struct raw_pcb *pcb,
struct pbuf *p,
const ip_addr_t *ipaddr)
250 #if LWIP_IPV4 && LWIP_IPV6 272 LWIP_DEBUGF(
RAW_DEBUG, (
"raw_sendto: added header pbuf %p before given pbuf %p\n", (
void *)q, (
void *)p));
277 LWIP_ASSERT(
"Can't restore header we just removed!", 0);
282 netif = ip_route(
PCB_ISIPV6(pcb), &pcb->local_ip, dst_ip);
310 src_ip = ip_netif_get_local_ip(
PCB_ISIPV6(pcb), netif, dst_ip);
312 if (src_ip ==
NULL) {
321 src_ip = &pcb->local_ip;
329 LWIP_ASSERT(
"Checksum must fit into first pbuf", p->
len >= (pcb->chksum_offset + 2));
335 err = ip_output_if(
PCB_ISIPV6(pcb), q, src_ip, dst_ip, pcb->ttl, pcb->tos, pcb->protocol, netif);
354 raw_send(
struct raw_pcb *pcb,
struct pbuf *p)
356 return raw_sendto(pcb, p, &pcb->remote_ip);
368 raw_remove(
struct raw_pcb *pcb)
370 struct raw_pcb *pcb2;
372 if (raw_pcbs == pcb) {
374 raw_pcbs = raw_pcbs->next;
377 for (pcb2 = raw_pcbs; pcb2 !=
NULL; pcb2 = pcb2->next) {
379 if (pcb2->next !=
NULL && pcb2->next == pcb) {
381 pcb2->next = pcb->next;
410 memset(pcb, 0,
sizeof(
struct raw_pcb));
411 pcb->protocol = proto;
413 pcb->next = raw_pcbs;
432 raw_new_ip6(
u8_t proto)
435 pcb = raw_new(proto);
#define ip_current_netif()
#define LWIP_DBG_LEVEL_SERIOUS
#define ip_addr_isany(ipaddr)
#define LWIP_DBG_LEVEL_WARNING
u8_t pbuf_header(struct pbuf *p, s16_t header_size_increment)
#define SMEMCPY(dst, src, len)
#define ip_addr_isbroadcast(addr, netif)
void memp_free(memp_t type, void *mem)
struct pbuf * pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
#define ip_current_dest_addr()
#define IP_ADDR_PCB_VERSION_MATCH(addr, pcb)
u8_t pbuf_free(struct pbuf *p)
void pbuf_chain(struct pbuf *h, struct pbuf *t)
#define NETIF_SET_HWADDRHINT(netif, hint)
#define ip_addr_cmp(addr1, addr2)
#define LWIP_ASSERT(message, assertion)
#define ip_addr_debug_print(debug, ipaddr)
#define ip_current_src_addr()
#define IP_PCB_IPVER_INPUT_MATCH(pcb)
#define IP_HDR_GET_VERSION(ptr)
void * memp_malloc(memp_t type)
#define LWIP_DEBUGF(debug, message)
#define LWIP_UNUSED_ARG(x)
#define ip_get_option(pcb, opt)
#define ip_addr_set_ipaddr(dest, src)