STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
raw.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without modification,
6  * are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  * 3. The name of the author may not be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
19  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
21  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
24  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
25  * OF SUCH DAMAGE.
26  *
27  * This file is part of the lwIP TCP/IP stack.
28  *
29  * Author: Adam Dunkels <adam@sics.se>
30  *
31  */
32 #ifndef LWIP_HDR_RAW_H
33 #define LWIP_HDR_RAW_H
34 
35 #include "lwip/opt.h"
36 
37 #if LWIP_RAW /* don't build if not configured for use in lwipopts.h */
38 
39 #include "lwip/pbuf.h"
40 #include "lwip/def.h"
41 #include "lwip/ip.h"
42 #include "lwip/ip_addr.h"
43 #include "lwip/ip6_addr.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 struct raw_pcb;
50 
61 typedef u8_t (*raw_recv_fn)(void *arg, struct raw_pcb *pcb, struct pbuf *p,
62  const ip_addr_t *addr);
63 
64 struct raw_pcb {
65  /* Common members of all PCB types */
66  IP_PCB;
67 
68  struct raw_pcb *next;
69 
70  u8_t protocol;
71 
73  raw_recv_fn recv;
74  /* user-supplied argument for the recv callback */
75  void *recv_arg;
76 #if LWIP_IPV6
77  /* fields for handling checksum computations as per RFC3542. */
78  u16_t chksum_offset;
79  u8_t chksum_reqd;
80 #endif
81 };
82 
83 /* The following functions is the application layer interface to the
84  RAW code. */
85 struct raw_pcb * raw_new (u8_t proto);
86 void raw_remove (struct raw_pcb *pcb);
87 err_t raw_bind (struct raw_pcb *pcb, const ip_addr_t *ipaddr);
88 err_t raw_connect (struct raw_pcb *pcb, const ip_addr_t *ipaddr);
89 
90 err_t raw_sendto (struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *ipaddr);
91 err_t raw_send (struct raw_pcb *pcb, struct pbuf *p);
92 
93 void raw_recv (struct raw_pcb *pcb, raw_recv_fn recv, void *recv_arg);
94 
95 #if LWIP_IPV6
96 struct raw_pcb * raw_new_ip6 (u8_t proto);
97 #endif /* LWIP_IPV6 */
98 
99 /* The following functions are the lower layer interface to RAW. */
100 u8_t raw_input (struct pbuf *p, struct netif *inp);
101 #define raw_init() /* Compatibility define, no init needed. */
102 
103 #ifdef __cplusplus
104 }
105 #endif
106 
107 #endif /* LWIP_RAW */
108 
109 #endif /* LWIP_HDR_RAW_H */
110 
#define IP_PCB
Definition: ip.h:96
Definition: pbuf.h:108
s8_t err_t
Definition: err.h:47
Definition: netif.h:182
unsigned char u8_t
Definition: cc.h:38
ip6_addr_t ip_addr_t
Definition: ip_addr.h:194
unsigned short u16_t
Definition: cc.h:40