# udp.h File Reference

`#include "net/arch.h"`
`#include "net/pbuf.h"`
`#include "net/ipv4/inet.h"`
`#include "net/ipv4/ip.h"`
`#include "net/err.h"`

Go to the source code of this file.

## Data Structures
struct | udp_hdr
struct | udp_pcb
## Defines
#define | UDP_HLEN 8
#define | UDP_FLAGS_NOCHKSUM 0x01
#define | UDP_FLAGS_UDPLITE 0x02
#define | udp_flags(pcb) ((pcb)->flags)
#define | udp_setflags(pcb, f) ((pcb)->flags = (f))
## Functions
udp_pcb * | udp_new (void)
void | udp_remove (struct udp_pcb *pcb)
err_t | udp_bind (struct udp_pcb *pcb, struct ip_addr *ipaddr, uInt16 port)
err_t | udp_connect (struct udp_pcb *pcb, struct ip_addr *ipaddr, uInt16 port)
void | udp_recv (struct udp_pcb *pcb, void(*recv)(void *arg, struct udp_pcb *upcb, struct pbuf *p, struct ip_addr *addr, uInt16 port), void *recv_arg)
err_t | udp_send (struct udp_pcb *pcb, struct pbuf *p)
uInt8 | udp_lookup (struct ip_hdr *iphdr, struct netif *inp)
void | udp_input (struct pbuf *p, struct netif *inp)
void | udp_init (void)
## Variables
udp_hdr | PACK_STRUCT_STRUCT

## Define Documentation

#define udp_flags | ( | pcb |  | ) | ((pcb)->flags)

#define UDP_FLAGS_NOCHKSUM 0x01

#define UDP_FLAGS_UDPLITE 0x02

#define UDP_HLEN 8

#define udp_setflags | ( | pcb,
|  | f |  | ) | ((pcb)->flags = (f))

## Function Documentation

err_t udp_bind | ( | struct udp_pcb * | pcb,
|  | struct ip_addr * | ipaddr,
|  | uInt16 | port
| ) |

err_t udp_connect | ( | struct udp_pcb * | pcb,
|  | struct ip_addr * | ipaddr,
|  | uInt16 | port
| ) |

void udp_init | ( | void |  | ) |

void udp_input | ( | struct pbuf * | p,
|  | struct netif * | inp
| ) |

uInt8 udp_lookup | ( | struct ip_hdr * | iphdr,
|  | struct netif * | inp
| ) |

struct udp_pcb* udp_new | ( | void |  | ) |

void udp_recv | ( | struct udp_pcb * | pcb,
|  | void(* | recv)(void *arg, struct udp_pcb *upcb, struct pbuf *p, struct ip_addr *addr, uInt16 port),
|  | void * | recv_arg
| ) |

void udp_remove | ( | struct udp_pcb * | pcb | ) |

err_t udp_send | ( | struct udp_pcb * | pcb,
|  | struct pbuf * | p
| ) |

## Variable Documentation

struct udp_hdr PACK_STRUCT_STRUCT