Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.11.1.2
openapi_ip4dhcpclient.h
Go to the documentation of this file.
1 
9 /**********************************************************************
10 *
11 * Copyright 2023 Broadcom.
12 *
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
16 *
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
24 *
25 ***********************************************************************
26 *
27 * @filename openapi_ip4dhcpclient.h
28 *
29 * @purpose This code implements the OpEN IPv4 DHCP Client API
30 *
31 * @component OPEN
32 *
33 * @create 02/08/2023
34 *
35 * @end
36 *
37 *********************************************************************/
38 #ifndef OPENAPI_IP4DHCPCLIENT_H_INCLUDED
39 #define OPENAPI_IP4DHCPCLIENT_H_INCLUDED
40 
41 #include "openapi_common.h"
42 
43 
45 typedef enum
46 {
47  OPEN_MGMT_SERVICEPORT = 0,
48  OPEN_MGMT_NETWORKPORT,
49  OPEN_MGMT_IPPORT
51 
53 typedef enum
54 {
55  OPEN_DHCPSTATE_INIT = 1,
56  OPEN_DHCPSTATE_SELECTING,
57  OPEN_DHCPSTATE_REQUESTING,
58  OPEN_DHCPSTATE_REQUEST_RECV,
59  OPEN_DHCPSTATE_BOUND,
60  OPEN_DHCPSTATE_RENEWING,
61  OPEN_DHCPSTATE_RENEW_RECV,
62  OPEN_DHCPSTATE_REBINDING,
63  OPEN_DHCPSTATE_REBIND_RECV,
64  OPEN_DHCPSTATE_BOOTP_FALLBACK,
65  OPEN_DHCPSTATE_NOTBOUND,
66  OPEN_DHCPSTATE_FAILED,
67  OPEN_DHCPSTATE_DO_RELEASE,
68  OPEN_DHCPSTATE_INFORM_REQUEST,
69  OPEN_DHCPSTATE_INFORM_ACK_WAIT,
70  OPEN_DHCPSTATE_INFORM_FAILED,
71  OPEN_DHCPSTATE_INFORM_BOUND
72 
73 } OPEN_DHCP_CLIENT_STATE_t;
74 
75 #define OPEN_DHCP_CLIENTID_MAX (128)
76 #define OPEN_DHCP_VENDOR_CLASS_STRING_MAX (128)
78 /*************************************************************************/
92 open_error_t openapiDhcpVendorClassOptionAdminModeGet(openapiClientHandle_t *client_handle, OPEN_CONTROL_t *mode);
93 
94 /*************************************************************************/
112 
113 /*************************************************************************/
128 
129 /*************************************************************************/
145 
146 /*************************************************************************/
162 open_error_t openapiIpDhcpClientDhcpServerIntfIPAddressGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_MGMT_PORT_TYPE_t mgmtPortType, uint32_t *serverAddr);
163 
164 /*************************************************************************/
180 open_error_t openapiIpDhcpClientIntfStateGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_MGMT_PORT_TYPE_t mgmtPortType, OPEN_DHCP_CLIENT_STATE_t *clientState);
181 
182 /*************************************************************************/
198 open_error_t openapiIpDhcpClientTransactionIntfIdGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_MGMT_PORT_TYPE_t mgmtPortType, uint32_t *transId);
199 
200 /*************************************************************************/
218 open_error_t openapiIpDhcpClientLeaseTimeIntfInfoGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_MGMT_PORT_TYPE_t mgmtPortType, uint32_t *leaseTime, uint32_t *renewalTime, uint32_t *rebindTime);
219 
220 /*************************************************************************/
236 open_error_t openapiIpDhcpClientIntfRetryCountGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_MGMT_PORT_TYPE_t mgmtPortType, uint32_t *retryCount);
237 
238 /*************************************************************************/
254 open_error_t openapiIpDhcpClientIdGeneratedGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_MGMT_PORT_TYPE_t mgmtPortType, open_buffdesc *clientId);
255 
256 /*************************************************************************/
279 open_error_t openapiDhcpClientStatsGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *numDiscoverSent, uint32_t *numOfferRecvd, uint32_t *numRequestSent, uint32_t *numAckRecvd, uint32_t *numNackRecvd, uint32_t *numReleaseSent, uint32_t *numInformSent, uint32_t *numRebindSent, uint32_t *numRenewSent);
280 
281 /*************************************************************************/
295 open_error_t openapiDhcpClientStatsClear(openapiClientHandle_t *client_handle, uint32_t ifNum);
296 
297 #endif /* OPENAPI_IP4DHCPCLIENT_H_INCLUDED */
298 
open_error_t openapiIpDhcpClientLeaseTimeIntfInfoGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_MGMT_PORT_TYPE_t mgmtPortType, uint32_t *leaseTime, uint32_t *renewalTime, uint32_t *rebindTime)
Get the lease time information of the DHCP client for specified interface or management port...
open_error_t openapiIpDhcpClientDhcpServerIntfIPAddressGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_MGMT_PORT_TYPE_t mgmtPortType, uint32_t *serverAddr)
Get the DHCP server IP address on a management interface.
open_error_t openapiDhcpVendorClassOptionStringSet(openapiClientHandle_t *client_handle, open_buffdesc *bufd, OPEN_BOOL_t actImmediate)
Set the DHCP Vendor Class Option string.
open_error_t openapiDhcpClientStatsClear(openapiClientHandle_t *client_handle, uint32_t ifNum)
Clear the DHCP Client Statistics on an interface.
open_error_t
OPEN uses these enumerators to indicate the error codes.
OPEN_MGMT_PORT_TYPE_t
< Management port types
open_error_t openapiDhcpVendorClassOptionStringGet(openapiClientHandle_t *client_handle, open_buffdesc *bufd)
Get the DHCP Vendor Class Option string.
open_error_t openapiIpDhcpClientTransactionIntfIdGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_MGMT_PORT_TYPE_t mgmtPortType, uint32_t *transId)
Get the transaction ID of the DHCP client for specified interface or management port.
OPEN_CONTROL_t
OPEN uses these enumerators to indicate enable or disable for a given config or status parameter...
open_error_t openapiDhcpClientStatsGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *numDiscoverSent, uint32_t *numOfferRecvd, uint32_t *numRequestSent, uint32_t *numAckRecvd, uint32_t *numNackRecvd, uint32_t *numReleaseSent, uint32_t *numInformSent, uint32_t *numRebindSent, uint32_t *numRenewSent)
Get the DHCP Client Statistics on an interface.
OPEN_BOOL_t
OPEN uses these enumerators to indicate true or false for a given config or status parameter...
open_error_t openapiDhcpVendorClassOptionAdminModeSet(openapiClientHandle_t *client_handle, OPEN_CONTROL_t mode, OPEN_BOOL_t actImmediate)
Set the DHCP Vendor Option Mode.
open_error_t openapiIpDhcpClientIdGeneratedGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_MGMT_PORT_TYPE_t mgmtPortType, open_buffdesc *clientId)
Get the generated client identifier on the interface.
open_error_t openapiIpDhcpClientIntfRetryCountGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_MGMT_PORT_TYPE_t mgmtPortType, uint32_t *retryCount)
Get the retry count of the DHCP client for specified interface or management port.
open_error_t openapiIpDhcpClientIntfStateGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_MGMT_PORT_TYPE_t mgmtPortType, OPEN_DHCP_CLIENT_STATE_t *clientState)
Get the current state of the DHCP client for specified interface or management port.