75#define UDP_FLAGS_NOCHKSUM 0x01U
76#define UDP_FLAGS_UDPLITE 0x02U
77#define UDP_FLAGS_CONNECTED 0x04U
78#define UDP_FLAGS_MULTICAST_LOOP 0x08U
96typedef void (*udp_recv_fn)(
void *arg,
struct udp_pcb *pcb,
struct pbuf *p,
97 const ip_addr_t *addr, u16_t port);
106 struct udp_pcb *next;
110 u16_t local_port, remote_port;
112#if LWIP_MULTICAST_TX_OPTIONS
114 ip_addr_t multicast_ip;
121 u16_t chksum_len_rx, chksum_len_tx;
130extern struct udp_pcb *udp_pcbs;
134struct udp_pcb * udp_new (
void);
135struct udp_pcb * udp_new_ip_type(u8_t type);
136void udp_remove (
struct udp_pcb *pcb);
137err_t udp_bind (
struct udp_pcb *pcb,
const ip_addr_t *ipaddr,
139err_t udp_connect (
struct udp_pcb *pcb,
const ip_addr_t *ipaddr,
141void udp_disconnect (
struct udp_pcb *pcb);
142void udp_recv (
struct udp_pcb *pcb, udp_recv_fn recv,
144err_t udp_sendto_if (
struct udp_pcb *pcb,
struct pbuf *p,
145 const ip_addr_t *dst_ip, u16_t dst_port,
147err_t udp_sendto_if_src(
struct udp_pcb *pcb,
struct pbuf *p,
148 const ip_addr_t *dst_ip, u16_t dst_port,
149 struct netif *
netif,
const ip_addr_t *src_ip);
150err_t udp_sendto (
struct udp_pcb *pcb,
struct pbuf *p,
151 const ip_addr_t *dst_ip, u16_t dst_port);
152err_t udp_send (
struct udp_pcb *pcb,
struct pbuf *p);
154#if LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP
155err_t udp_sendto_if_chksum(
struct udp_pcb *pcb,
struct pbuf *p,
156 const ip_addr_t *dst_ip, u16_t dst_port,
159err_t udp_sendto_chksum(
struct udp_pcb *pcb,
struct pbuf *p,
160 const ip_addr_t *dst_ip, u16_t dst_port,
161 u8_t have_chksum, u16_t chksum);
162err_t udp_send_chksum(
struct udp_pcb *pcb,
struct pbuf *p,
163 u8_t have_chksum, u16_t chksum);
164err_t udp_sendto_if_src_chksum(
struct udp_pcb *pcb,
struct pbuf *p,
165 const ip_addr_t *dst_ip, u16_t dst_port,
struct netif *
netif,
166 u8_t have_chksum, u16_t chksum,
const ip_addr_t *src_ip);
169#define udp_flags(pcb) ((pcb)->flags)
170#define udp_setflags(pcb, f) ((pcb)->flags = (f))
173void udp_input (
struct pbuf *p,
struct netif *inp);
178#define udp_new_ip6() udp_new_ip_type(IPADDR_TYPE_V6)
180#if LWIP_MULTICAST_TX_OPTIONS
181#define udp_set_multicast_netif_addr(pcb, ip4addr) ip_addr_copy_from_ip4((pcb)->multicast_ip, *(ip4addr))
182#define udp_get_multicast_netif_addr(pcb) ip_2_ip4(&(pcb)->multicast_ip)
183#define udp_set_multicast_ttl(pcb, value) do { (pcb)->mcast_ttl = value; } while(0)
184#define udp_get_multicast_ttl(pcb) ((pcb)->mcast_ttl)
188void udp_debug_print(
struct udp_hdr *udphdr);
190#define udp_debug_print(udphdr)
193void udp_netif_ip_addr_changed(
const ip_addr_t* old_addr,
const ip_addr_t* new_addr);