Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
Data Structures | Macros | Enumerations | Functions
DHCP Client Configuration And Status [OPENAPI_DHCP_CLIENT]

Data Structures

struct  open_bootp_dhcp_t
 
struct  open_dhcp_option125_t
 
struct  open_dhcp_vendor_specific_option_t
 
struct  open_dhcp_vendor_sub_opt_t
 
struct  open_tlv_option_t
 

Macros

#define OPEN_BOOTP_FILE_LEN   128
 
#define OPEN_BOOTP_SNAME_LEN   64
 
#define OPEN_DHCP_BOOTP_VEND_OPTIONS_LEN   64
 
#define OPEN_DHCP_OPT125_VENDOR_NUMBER_MAX   3
 
#define OPEN_DHCP_VENDOR_SPECIFIC_SUBOPTIONS_NUM   3
 
#define OPEN_DNS_NAME_SERVER_ENTRIES   8
 
#define OPEN_HOSTNAME_MAX_LEN   64
 
#define OPEN_SNTP_MAX_SERVER_ENTRIES   12
 
#define OPENAPI_DNS_HOST_NAME_LEN_MAX   255
 

Enumerations

enum  open_bootp_dhcp_offered_options_e {
  OPEN_BOOTP_DHCP_IP_ADDR = 1, OPEN_BOOTP_DHCP_NETMASK = 2, OPEN_BOOTP_DHCP_GATEWAY = 4, OPEN_BOOTP_DHCP_SIADDR = 8,
  OPEN_BOOTP_DHCP_BOOTFILE = 16, OPEN_BOOTP_DHCP_SNAME = 32, OPEN_BOOTP_DHCP_OPTION_TFTP_SVR_ADDR = 64, OPEN_BOOTP_DHCP_OPTION_DNS_SVR_ADDR = 128,
  OPEN_BOOTP_DHCP_OPTION_BOOTFILE = 256, OPEN_BOOTP_DHCP_OPTION_TFTP_SVR_NAME = 512, OPEN_BOOTP_DHCP_OPTION_VENDOR_SPECIFIC = 1024, OPEN_BOOTP_DHCP_OPTION_VENDOR_IDENT = 2048,
  OPEN_BOOTP_DHCP_OPTION_HOSTNAME = 4096, OPEN_BOOTP_DHCP_OPTION_DEF_DOMAIN_NAME = 8192, OPEN_BOOTP_DHCP_OPTION_NTP_SVR_ADDR = 16384, OPEN_BOOTP_DHCP_OPTION_SYSLOG_SVR_ADDR = 32768
}
 

Functions

open_error_t openapiDhcpClientDhcpServerIPAddrGet (openapiClientHandle_t *client_handle, uint32_t intIfNum, open_inet_addr_t *serverAddr)
 Get the DHCP Server IP Address on an interface. More...
 
open_error_t openapiDhcpClientIPAddrGet (openapiClientHandle_t *client_handle, uint32_t intIfNum, open_inet_addr_t *clientAddr)
 Get the DHCP Client IP Address on an interface. More...
 
open_error_t openapiDhcpClientNetMaskGet (openapiClientHandle_t *client_handle, uint32_t intIfNum, open_inet_addr_t *netmask)
 Get the DHCP Client subnet mask on an interface. More...
 
open_error_t openapiDhcpClientOptionsGet (openapiClientHandle_t *client_handle, open_bootp_dhcp_t *networkParams)
 Get the DHCP Options returned by the DHCP Server. More...
 

Detailed Description

Function Documentation

open_error_t openapiDhcpClientDhcpServerIPAddrGet ( openapiClientHandle_t client_handle,
uint32_t  intIfNum,
open_inet_addr_t serverAddr 
)

Get the DHCP Server IP Address on an interface.

Parameters
[in]client_handleClient handle from registration API
[in]intIfNumInternal interface number of the entry
[out]serverAddrDHCP server IPv4 address
Return values
OPEN_E_NONEif successfully
OPEN_E_FAILif get operation has failed
OPEN_E_PARAMif invalid parameter is supplied

OpEN API Version: 1.8

Examples:
dhcp_client_example.c.
open_error_t openapiDhcpClientIPAddrGet ( openapiClientHandle_t client_handle,
uint32_t  intIfNum,
open_inet_addr_t clientAddr 
)

Get the DHCP Client IP Address on an interface.

Parameters
[in]client_handleClient handle from registration API
[in]intIfNumInternal interface number of the entry
[out]clientAddrDHCP client IPv4 address
Return values
OPEN_E_NONEif successfully
OPEN_E_FAILif get operation has failed
OPEN_E_PARAMif invalid parameter is supplied

OpEN API Version: 1.8

Examples:
dhcp_client_example.c.
open_error_t openapiDhcpClientNetMaskGet ( openapiClientHandle_t client_handle,
uint32_t  intIfNum,
open_inet_addr_t netmask 
)

Get the DHCP Client subnet mask on an interface.

Parameters
[in]client_handleClient handle from registration API
[in]intIfNumInternal interface number of the entry
[out]netmaskNetwork mask
Return values
OPEN_E_NONEif successfully
OPEN_E_FAILif get operation has failed
OPEN_E_PARAMif invalid parameter is supplied

OpEN API Version: 1.8

Examples:
dhcp_client_example.c.
open_error_t openapiDhcpClientOptionsGet ( openapiClientHandle_t client_handle,
open_bootp_dhcp_t networkParams 
)

Get the DHCP Options returned by the DHCP Server.

Parameters
[out]networkParamsDHCP Parameters
Return values
OPEN_E_NONEif found
OPEN_E_FAILif not found
OPEN_E_PARAMif invalid parameter is supplied
Note
This API returns the DHCP Options in the following priority
  1. Service Port (if included in the build)
  2. Routing/Host Interface (if Routing package is included in the build)
  3. Network Port (if included in the build)

OpEN API Version: 1.8

Examples:
dhcp_client_example.c.