35 |
* |
* |
36 |
*/ |
*/ |
37 |
|
|
38 |
/*-----------------------------------------------------------------------------------*/ |
|
39 |
/* udp.c |
/* udp.c |
40 |
* |
* |
41 |
* The code for the User Datagram Protocol UDP. |
* The code for the User Datagram Protocol UDP. |
42 |
* |
* |
43 |
*/ |
*/ |
44 |
/*-----------------------------------------------------------------------------------*/ |
|
45 |
#include "lwip/opt.h" |
#include "lwip/opt.h" |
46 |
|
|
47 |
#include "lwip/def.h" |
#include "lwip/def.h" |
64 |
|
|
65 |
static struct udp_pcb *pcb_cache = NULL; |
static struct udp_pcb *pcb_cache = NULL; |
66 |
|
|
67 |
/*-----------------------------------------------------------------------------------*/ |
|
68 |
void |
void |
69 |
udp_init(void) |
udp_init(void) |
70 |
{ |
{ |
71 |
udp_pcbs = pcb_cache = NULL; |
udp_pcbs = pcb_cache = NULL; |
72 |
} |
} |
73 |
|
|
74 |
/*-----------------------------------------------------------------------------------*/ |
|
75 |
/* udp_lookup: |
/* udp_lookup: |
76 |
* |
* |
77 |
* An experimental feature that will be changed in future versions. Do |
* An experimental feature that will be changed in future versions. Do |
78 |
* not depend on it yet... |
* not depend on it yet... |
79 |
*/ |
*/ |
80 |
/*-----------------------------------------------------------------------------------*/ |
|
81 |
#ifdef LWIP_DEBUG |
#ifdef LWIP_DEBUG |
82 |
u8_t |
u8_t |
83 |
udp_lookup(struct ip_hdr *iphdr, struct netif *inp) |
udp_lookup(struct ip_hdr *iphdr, struct netif *inp) |
718 |
{ |
{ |
719 |
pcb->flags &= ~UDP_FLAGS_CONNECTED; |
pcb->flags &= ~UDP_FLAGS_CONNECTED; |
720 |
} |
} |
721 |
/*-----------------------------------------------------------------------------------*/ |
|
722 |
void |
void |
723 |
udp_recv(struct udp_pcb *pcb, |
udp_recv(struct udp_pcb *pcb, |
724 |
void (* recv)(void *arg, struct udp_pcb *upcb, struct pbuf *p, |
void (* recv)(void *arg, struct udp_pcb *upcb, struct pbuf *p, |
777 |
|
|
778 |
return pcb; |
return pcb; |
779 |
} |
} |
780 |
/*-----------------------------------------------------------------------------------*/ |
|
781 |
#if UDP_DEBUG |
#if UDP_DEBUG |
782 |
int |
int |
783 |
udp_debug_print(struct udp_hdr *udphdr) |
udp_debug_print(struct udp_hdr *udphdr) |
793 |
return 0; |
return 0; |
794 |
} |
} |
795 |
#endif /* UDP_DEBUG */ |
#endif /* UDP_DEBUG */ |
796 |
/*-----------------------------------------------------------------------------------*/ |
|
797 |
#endif /* LWIP_UDP */ |
#endif /* LWIP_UDP */ |
798 |
|
|
799 |
|
|