Go to the documentation of this file.
42 #define UHCP_MAGIC (0x55484350)
48 #define UHCP_PORT (12345U)
51 #define UHCP_PORT_STR "12345"
62 typedef struct __attribute__((packed)) {
73 typedef struct __attribute__((packed)) {
83 typedef struct __attribute__((packed)) {
Definitions for internet operations.
void uhcp_handle_udp(uint8_t *buf, size_t len, uint8_t *src, uint16_t port, uhcp_iface_t iface)
handle incoming UDP packet
uint8_t prefix_len
contains the prefix length of assigned prefix
unsigned uhcp_iface_t
typedef for interface handle
#define UHCP_MAGIC
UHCP magic number.
void uhcp_handle_req(uhcp_req_t *req, uint8_t *src, uint16_t port, uhcp_iface_t iface)
handle incoming UHCP request packet
static void uhcp_hdr_set(uhcp_hdr_t *hdr, uhcp_type_t type)
function to set constant values in UHCP header
UHCP packet header struct.
uhcp_hdr_t hdr
member holding parent type
uhcp_type_t
Enum containing possible UHCP packet types.
#define UHCP_VER
UHCP version of this header.
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)
@ UHCP_REQ
packet is a request packet
uint8_t prefix_len
contains the requested prefix length
static uint32_t htonl(uint32_t v)
Convert from host byte order to network byte order, 32 bit.
uint8_t ver_type
four bits version number, four bits packet type (see uchp_type_t)
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.
@ UHCP_PUSH
packet is a push / answer packet
uint32_t uhcp_magic
always contains UHCP in hex
uhcp_hdr_t hdr
member holding parent type
void uhcp_handle_push(uhcp_push_t *req, uint8_t *src, uint16_t port, uhcp_iface_t iface)
handle incoming UHCP push packet
struct for request packets