EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
Functions
dhcp_config_utils.h File Reference

Functions that help work with DHCP Configuration structures. More...

#include <stdbool.h>
#include "./dhcp_config.h"
Include dependency graph for dhcp_config_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool get_config_dhcpinfo (const char *info, config_dhcpinfo_t *el)
 Creates a config_dhcpinfo_t from a string. More...
 

Detailed Description

Functions that help work with DHCP Configuration structures.

Author
Alois Klink
Date
2023

Function Documentation

◆ get_config_dhcpinfo()

bool get_config_dhcpinfo ( const char *  info,
config_dhcpinfo_t el 
)

Creates a config_dhcpinfo_t from a string.

Parameters
[in]info- The string to parse. The format of this string is a comma-separated value line of: <vlanid>,<ip_addr_low>,<ip_addr_upp>,<subnet_mask>,<lease_time>

vlanid must be a decimal integer.

All other parameters are passed as a dhcp-range option to dnsmasq, see man dnsmasq(8).

For example: 0,10.0.0.2,10.0.0.254,255.255.255.0,24h.

Parameters
[out]el- The parsed dhcp info.
Return values
trueOn success.
falseOn failure.