mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-13 19:57:05 +08:00
Fix udp_bind to allow rebind for same socket (yesterday's commit broke that) and introduce connection info for UDP pcbs.New function netconn_disconnect, do_disconnect for deatching UDP from a remote addres.Fix #2240
This commit is contained in:
@@ -122,6 +122,7 @@ err_t netconn_bind (struct netconn *conn,
|
||||
err_t netconn_connect (struct netconn *conn,
|
||||
struct ip_addr *addr,
|
||||
u16_t port);
|
||||
err_t netconn_disconnect (struct netconn *conn);
|
||||
err_t netconn_listen (struct netconn *conn);
|
||||
struct netconn * netconn_accept (struct netconn *conn);
|
||||
struct netbuf * netconn_recv (struct netconn *conn);
|
||||
|
||||
@@ -49,6 +49,7 @@ enum api_msg_type {
|
||||
|
||||
API_MSG_BIND,
|
||||
API_MSG_CONNECT,
|
||||
API_MSG_DISCONNECT,
|
||||
|
||||
API_MSG_LISTEN,
|
||||
API_MSG_ACCEPT,
|
||||
|
||||
@@ -56,6 +56,7 @@ struct sockaddr {
|
||||
#define SOCK_STREAM 1
|
||||
#define SOCK_DGRAM 2
|
||||
|
||||
#define AF_UNSPEC 0
|
||||
#define AF_INET 2
|
||||
#define PF_INET AF_INET
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ struct udp_hdr {
|
||||
|
||||
#define UDP_FLAGS_NOCHKSUM 0x01
|
||||
#define UDP_FLAGS_UDPLITE 0x02
|
||||
#define UDP_FLAGS_CONNECTED 0x04
|
||||
|
||||
struct udp_pcb {
|
||||
struct udp_pcb *next;
|
||||
@@ -74,6 +75,7 @@ err_t udp_bind (struct udp_pcb *pcb, struct ip_addr *ipaddr,
|
||||
u16_t port);
|
||||
err_t udp_connect (struct udp_pcb *pcb, struct ip_addr *ipaddr,
|
||||
u16_t port);
|
||||
void udp_disconnect (struct udp_pcb *pcb);
|
||||
void udp_recv (struct udp_pcb *pcb,
|
||||
void (* recv)(void *arg, struct udp_pcb *upcb,
|
||||
struct pbuf *p,
|
||||
|
||||
Reference in New Issue
Block a user