56#define UDP_FLAGS_NOCHKSUM 0x01U
57#define UDP_FLAGS_UDPLITE 0x02U
58#define UDP_FLAGS_CONNECTED 0x04U
59#define UDP_FLAGS_MULTICAST_LOOP 0x08U
77typedef void (*udp_recv_fn)(
void *arg,
struct udp_pcb *pcb,
struct pbuf *p,
78 const ip_addr_t *addr, u16_t port);
91 u16_t local_port, remote_port;
93#if LWIP_MULTICAST_TX_OPTIONS
106 u16_t chksum_len_rx, chksum_len_tx;
115extern struct udp_pcb *udp_pcbs;
119struct udp_pcb * udp_new (
void);
120struct udp_pcb * udp_new_ip_type(u8_t type);
121void udp_remove (
struct udp_pcb *pcb);
122err_t udp_bind (
struct udp_pcb *pcb,
const ip_addr_t *ipaddr,
124void udp_bind_netif (
struct udp_pcb *pcb,
const struct netif*
netif);
125err_t udp_connect (
struct udp_pcb *pcb,
const ip_addr_t *ipaddr,
127void udp_disconnect (
struct udp_pcb *pcb);
128void udp_recv (
struct udp_pcb *pcb, udp_recv_fn recv,
130err_t udp_sendto_if (
struct udp_pcb *pcb,
struct pbuf *p,
131 const ip_addr_t *dst_ip, u16_t dst_port,
133err_t udp_sendto_if_src(
struct udp_pcb *pcb,
struct pbuf *p,
134 const ip_addr_t *dst_ip, u16_t dst_port,
135 struct netif *
netif,
const ip_addr_t *src_ip);
136err_t udp_sendto (
struct udp_pcb *pcb,
struct pbuf *p,
137 const ip_addr_t *dst_ip, u16_t dst_port);
138err_t udp_send (
struct udp_pcb *pcb,
struct pbuf *p);
140#if LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP
141err_t udp_sendto_if_chksum(
struct udp_pcb *pcb,
struct pbuf *p,
142 const ip_addr_t *dst_ip, u16_t dst_port,
145err_t udp_sendto_chksum(
struct udp_pcb *pcb,
struct pbuf *p,
146 const ip_addr_t *dst_ip, u16_t dst_port,
147 u8_t have_chksum, u16_t chksum);
148err_t udp_send_chksum(
struct udp_pcb *pcb,
struct pbuf *p,
149 u8_t have_chksum, u16_t chksum);
150err_t udp_sendto_if_src_chksum(
struct udp_pcb *pcb,
struct pbuf *p,
151 const ip_addr_t *dst_ip, u16_t dst_port,
struct netif *
netif,
152 u8_t have_chksum, u16_t chksum,
const ip_addr_t *src_ip);
155#define udp_flags(pcb) ((pcb)->flags)
156#define udp_setflags(pcb, f) ((pcb)->flags = (f))
158#define udp_set_flags(pcb, set_flags) do { (pcb)->flags = (u8_t)((pcb)->flags | (set_flags)); } while(0)
159#define udp_clear_flags(pcb, clr_flags) do { (pcb)->flags = (u8_t)((pcb)->flags & (u8_t)(~(clr_flags) & 0xff)); } while(0)
160#define udp_is_flag_set(pcb, flag) (((pcb)->flags & (flag)) != 0)
163void udp_input (
struct pbuf *p,
struct netif *inp);
168#define udp_new_ip6() udp_new_ip_type(IPADDR_TYPE_V6)
170#if LWIP_MULTICAST_TX_OPTIONS
172#define udp_set_multicast_netif_addr(pcb, ip4addr) ip4_addr_copy((pcb)->mcast_ip4, *(ip4addr))
173#define udp_get_multicast_netif_addr(pcb) (&(pcb)->mcast_ip4)
175#define udp_set_multicast_netif_index(pcb, idx) ((pcb)->mcast_ifindex = (idx))
176#define udp_get_multicast_netif_index(pcb) ((pcb)->mcast_ifindex)
177#define udp_set_multicast_ttl(pcb, value) ((pcb)->mcast_ttl = (value))
178#define udp_get_multicast_ttl(pcb) ((pcb)->mcast_ttl)
182void udp_debug_print(
struct udp_hdr *udphdr);
184#define udp_debug_print(udphdr)
187void udp_netif_ip_addr_changed(
const ip_addr_t* old_addr,
const ip_addr_t* new_addr);
s8_t err_t
Definition: err.h:96
#define IP_PCB
Definition: ip.h:76