uhcp.h File Reference

UHCP header. More...

Detailed Description

UHCP header.

Author
Kaspar Schleiser kaspa.nosp@m.r@sc.nosp@m.hleis.nosp@m.er.d.nosp@m.e

Definition in file uhcp.h.

#include <stdint.h>
#include <stddef.h>
#include <arpa/inet.h>
+ Include dependency graph for uhcp.h:

Go to the source code of this file.

Data Structures

struct  uhcp_hdr_t
 UHCP packet header struct. More...
 
struct  uhcp_req_t
 struct for request packets More...
 
struct  uhcp_push_t
 struct for push packets More...
 

Macros

#define UHCP_MAGIC   (0x55484350) /* "UHCP" in hex */
 UHCP magic number.
 
#define UHCP_VER   (0)
 UHCP version of this header.
 
#define UHCP_PORT   (12345U)
 UHCP port number.
 
#define UHCP_PORT_STR   "12345"
 UHCP port number (as string for e.g., getaddrinfo() service arg.
 

Typedefs

typedef unsigned uhcp_iface_t
 typedef for interface handle
 

Enumerations

enum  uhcp_type_t { UHCP_REQ, UHCP_PUSH }
 Enum containing possible UHCP packet types. More...
 

Functions

void uhcp_handle_udp (uint8_t *buf, size_t len, uint8_t *src, uint16_t port, uhcp_iface_t iface)
 handle incoming UDP packet More...
 
void uhcp_handle_req (uhcp_req_t *req, uint8_t *src, uint16_t port, uhcp_iface_t iface)
 handle incoming UHCP request packet More...
 
void uhcp_handle_push (uhcp_push_t *req, uint8_t *src, uint16_t port, uhcp_iface_t iface)
 handle incoming UHCP push packet More...
 
void uhcp_handle_prefix (uint8_t *prefix, uint8_t prefix_len, uint16_t lifetime, uint8_t *src, uhcp_iface_t iface)
 handle incoming prefix (as parsed from push packet) More...
 
static void uhcp_hdr_set (uhcp_hdr_t *hdr, uhcp_type_t type)
 function to set constant values in UHCP header
 
int udp_sendto (uint8_t *buf, size_t len, uint8_t *dst, uint16_t dst_port, uhcp_iface_t dst_iface)
 UDP send function used by UHCP client / server. More...