OpenVPN
dhcp.c File Reference
#include "syshead.h"
#include "dhcp.h"
#include "socket_util.h"
#include "error.h"
#include "memdbg.h"
Include dependency graph for dhcp.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static int get_dhcp_message_type (const struct dhcp *dhcp, const int optlen)
static in_addr_t do_extract (struct dhcp *dhcp, int optlen)
in_addr_t dhcp_extract_router_msg (struct buffer *ipbuf)
static void write_dhcp_u8 (struct buffer *buf, const uint8_t type, const uint8_t data, bool *error)
static void write_dhcp_u32_array (struct buffer *buf, const uint8_t type, const uint32_t *data, const unsigned int len, bool *error)
static void write_dhcp_str (struct buffer *buf, const uint8_t type, const char *str, bool *error)
static void write_dhcp_search_str (struct buffer *buf, const uint8_t type, const char *const *str_array, int array_len, bool *error)
bool build_dhcp_options_string (struct buffer *buf, const struct tuntap_options *o)

Function Documentation

◆ build_dhcp_options_string()

◆ dhcp_extract_router_msg()

◆ do_extract()

in_addr_t do_extract ( struct dhcp * dhcp,
int optlen )
static

Definition at line 76 of file dhcp.c.

References DHCP_END, DHCP_PAD, and DHCP_ROUTER.

Referenced by dhcp_extract_router_msg().

◆ get_dhcp_message_type()

int get_dhcp_message_type ( const struct dhcp * dhcp,
const int optlen )
static

Definition at line 36 of file dhcp.c.

References DHCP_END, DHCP_MSG_TYPE, and DHCP_PAD.

Referenced by dhcp_extract_router_msg().

◆ write_dhcp_search_str()

void write_dhcp_search_str ( struct buffer * buf,
const uint8_t type,
const char *const * str_array,
int array_len,
bool * error )
static

Definition at line 269 of file dhcp.c.

References buf_safe(), buf_write(), buf_write_u8(), M_WARN, and msg.

Referenced by build_dhcp_options_string(), and test_write_dhcp_search_str().

◆ write_dhcp_str()

void write_dhcp_str ( struct buffer * buf,
const uint8_t type,
const char * str,
bool * error )
static

Definition at line 240 of file dhcp.c.

References buf_safe(), buf_write(), buf_write_u8(), M_WARN, and msg.

Referenced by build_dhcp_options_string().

◆ write_dhcp_u32_array()

void write_dhcp_u32_array ( struct buffer * buf,
const uint8_t type,
const uint32_t * data,
const unsigned int len,
bool * error )
static

Definition at line 211 of file dhcp.c.

References buf_safe(), buf_write_u32(), buf_write_u8(), M_WARN, and msg.

Referenced by build_dhcp_options_string().

◆ write_dhcp_u8()

void write_dhcp_u8 ( struct buffer * buf,
const uint8_t type,
const uint8_t data,
bool * error )
static

Definition at line 197 of file dhcp.c.

References buf_safe(), buf_write_u8(), M_WARN, and msg.

Referenced by build_dhcp_options_string().