Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.12.0.1
openapi_dhcp6s.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_dhcp6s.h
28 *
29 * @purpose This code implements the OpEN DHCPv6 API
30 *
31 * @component OPEN
32 *
33 * @create 07/26/2023
34 *
35 * @end
36 *
37 *********************************************************************/
38 #ifndef OPENAPI_DHCP6S_H_INCLUDED
39 #define OPENAPI_DHCP6S_H_INCLUDED
40 
41 #include "openapi_common.h"
42 
43 
44 #define OPEN_DHCP6S_DNS_DOMAIN_MAX 8
45 #define OPEN_DHCP6S_DOMAIN_NAME_MINLEN 1
46 #define OPEN_DHCP6S_DOMAIN_NAME_MAXLEN 253
47 #define OPEN_DHCP6S_DNS_SERVER_MAX 8
48 #define OPEN_DHCP6S_MAX_POOL_NUMBER 256
49 
51 typedef struct
52 {
53  uint8_t dns_domains[OPEN_DHCP6S_DNS_DOMAIN_MAX][OPEN_DHCP6S_DOMAIN_NAME_MAXLEN];
55 
57 typedef struct
58 {
59  open_in6_addr_t dns_servers[OPEN_DHCP6S_DNS_SERVER_MAX];
61 
63 typedef enum {
64  OPEN_DHCP6_PREFIX_IAPD = 0,
65  OPEN_DHCP6_PREFIX_IANA,
66  OPEN_DHCP6_PREFIX_IATA
67 } OPEN_DHCP6_PREFIX_TYPE_t;
68 
70 typedef enum {
71  OPEN_DHCP6_MODE_NONE = 0,
72  OPEN_DHCP6_MODE_SERVER,
73  OPEN_DHCP6_MODE_CLIENT,
74  OPEN_DHCP6_MODE_RELAY
75 } OPEN_DHCP6_MODE_t;
76 
78 #define OPEN_DHCP6S_INACTIVE_POOL 0
79 #define OPEN_DHCP6S_DYNAMIC_POOL 1
80 #define OPEN_DHCP6S_MANUAL_POOL 2
81 #define OPEN_DHCP6S_NOT_READY_POOL 3
83 #define OPEN_DHCP6S_POOL_NAME_MINLEN 1
84 #define OPEN_DHCP6S_POOL_NAME_MAXLEN 32
85 #define OPEN_DHCP6S_HOST_NAME_MAXLEN 32
86 
87 #define OPEN_DHCP6S_MAX_DUID_STR_LEN 389
88 #define OPEN_DHCP6S_RELAYOPT_REMOTEID_MAXLEN 64
89 
90 #define OPEN_IH_INTF_ANY 0
91 
93 typedef struct openDhcp6sStatData_s
94 {
97  uint32_t numOfDhcpsRequestReceived;
98  uint32_t numOfDhcpsConfirmReceived;
99  uint32_t numOfDhcpsRenewReceived;
100  uint32_t numOfDhcpsRebindReceived;
101  uint32_t numOfDhcpsReleaseReceived;
102  uint32_t numOfDhcpsDeclineReceived;
103  uint32_t numOfDhcpsInformReceived;
104  uint32_t numOfDhcpsRelayReplyReceived;
105  uint32_t numOfDhcpsRelayForwReceived;
108  uint32_t numOfDhcpsAdvertiseSent;
109  uint32_t numOfDhcpsReplySent;
110  uint32_t numOfDhcpsReconfigureSent;
111  uint32_t numOfDhcpsRelayReplySent;
112  uint32_t numOfDhcpsRelayForwSent;
113 
114  uint32_t numOfMalformedMessages;
115  uint32_t numOfDhcpPacketsDiscarded;
116  uint32_t totalPacketsSent;
118 
119 /*************************************************************************/
135 
136 /*************************************************************************/
152 
153 /*************************************************************************/
168 
169 /*************************************************************************/
183 open_error_t openapiDhcp6sPoolNumGet(openapiClientHandle_t *client_handle, uint32_t *poolsCount);
184 
185 /*************************************************************************/
199 open_error_t openapiDhcp6sPoolValidate(openapiClientHandle_t *client_handle, uint32_t poolNumber);
200 
201 /*************************************************************************/
216 open_error_t openapiDhcp6sNumberToPoolNameGet(openapiClientHandle_t *client_handle, uint32_t poolNumber, open_buffdesc *poolName);
217 
218 /*************************************************************************/
233 
234 /*************************************************************************/
249 
250 /*************************************************************************/
265 open_error_t openapiDhcp6sPoolEntryFirst(openapiClientHandle_t *client_handle, open_buffdesc *poolName, uint32_t *poolIndex);
266 
267 /*************************************************************************/
282 open_error_t openapiDhcp6sPoolEntryNext(openapiClientHandle_t *client_handle, open_buffdesc *poolName, uint32_t *poolIndex);
283 
284 /*************************************************************************/
304  open_inet_addr_t *prefixAddr, uint16_t prefixLen, uint32_t validLifetime, uint32_t preferLifetime);
305 
306 /*************************************************************************/
322 open_error_t openapiDhcp6sPoolHostRemove(openapiClientHandle_t *client_handle, open_buffdesc *poolName, open_inet_addr_t *prefixAddr, uint16_t prefixLen);
323 
324 /*************************************************************************/
345 open_error_t openapiDhcp6sPoolHostGetNext(openapiClientHandle_t *client_handle, open_buffdesc *poolName, open_buffdesc *duidStr, open_buffdesc *hostName, uint32_t *iaid,
346  open_inet_addr_t *prefixAddr, uint16_t *prefixLen, uint32_t *validLifetime, uint32_t *preferLifetime);
347 
348 /*************************************************************************/
365 open_error_t openapiDhcp6sPoolTypeGet(openapiClientHandle_t *client_handle, open_buffdesc *poolName, uint32_t *poolType);
366 
367 /*************************************************************************/
383 
384 /*************************************************************************/
400 
401 /*************************************************************************/
417 
418 /*************************************************************************/
434 
435 /*************************************************************************/
451 
452 /*************************************************************************/
468 
469 /*************************************************************************/
484 open_error_t openapiDhcp6sIntfModeDelete(openapiClientHandle_t *client_handle, uint32_t ifNum, open_buffdesc *vrfName);
485 
486 /*************************************************************************/
504 open_error_t openapiDhcp6sIntfModeRelaySet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t ifNum, open_inet_addr_t *serverAddr, uint32_t serverIfNum, open_buffdesc *remoteId);
505 
506 /*************************************************************************/
524 open_error_t openapiDhcp6sIntfRelayEntryDelete(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t ifNum, open_inet_addr_t *serverAddr, uint32_t serverIfNum, open_buffdesc *remoteId);
525 
526 /*************************************************************************/
544 open_error_t openapiDhcp6sIntfModeServerSet(openapiClientHandle_t *client_handle, uint32_t ifNum, open_buffdesc *poolName, uint32_t serverPref, OPEN_BOOL_t rapidCommit, OPEN_BOOL_t allowUnicast);
545 
546 /*************************************************************************/
571 open_error_t openapiDhcp6sIntfModeGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DHCP6_MODE_t *mode, open_buffdesc *pPoolName, uint32_t *serverPref,
572  open_inet_addr_t *relayAddr, uint32_t *relayIfNum, open_buffdesc *remoteId, OPEN_BOOL_t *rapidCommit, OPEN_BOOL_t *allowUnicast,
573  open_buffdesc *localVrfName, open_buffdesc *relayDestVrfName, uint32_t *pdClientIntIfNum);
574 
575 /*************************************************************************/
590 open_error_t openapiDhcp6sIntfGetNext(openapiClientHandle_t *client_handle, uint32_t *ifNum);
591 
592 /*************************************************************************/
606 open_error_t openapiDhcp6sIntfValidate(openapiClientHandle_t *client_handle, uint32_t ifNum);
607 
608 /*************************************************************************/
623 open_error_t openapiDhcp6MapIntfIsValid(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_BOOL_t *isValidFlag);
624 
625 /*************************************************************************/
640 
641 /*************************************************************************/
656 open_error_t openapiDhcp6MapIntfValidNextGet(openapiClientHandle_t *client_handle, uint32_t prevIfNum, uint32_t *ifNum);
657 
658 /*************************************************************************/
683 open_error_t openapiDhcp6sBindingGetNext(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, open_buffdesc *duid, uint32_t *iaid, open_inet_addr_t *prefixAddr,
684  uint16_t *prefixLen, uint32_t *prefixType, open_inet_addr_t *clientAddr, uint32_t *clientIntfNum, uint32_t *expiration,
685  uint32_t *validLifetime, uint32_t *preferLifetime);
686 
687 /*************************************************************************/
703 open_error_t openapiDhcp6sBindingClear(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, OPEN_DHCP6_PREFIX_TYPE_t prefixType, open_inet_addr_t *clientAddr);
704 
705 /*************************************************************************/
720 
721 /*************************************************************************/
736 open_error_t openapiDhcp6sBindingCountGet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t *count);
737 
738 /*************************************************************************/
754 open_error_t openapiDhcp6sStatisticsGet(openapiClientHandle_t *client_handle, uint32_t ifNum, open_buffdesc *vrfName, openDhcp6sStatData_t *dhcp6Stats);
755 
756 /*************************************************************************/
771 open_error_t openapiDhcp6sStatisticsClear(openapiClientHandle_t *client_handle, uint32_t ifNum, open_buffdesc *vrfName);
772 
773 /*************************************************************************/
795 open_error_t openapiDhcpv6RelayEntryNextGet(openapiClientHandle_t *client_handle, uint32_t ifNum, open_inet_addr_t *relayAddr, uint32_t *relayIfNum, open_buffdesc *vrfName,
796  uint32_t *nextIfNum, open_inet_addr_t *nextRelayAddr, uint32_t *nextRelayIfNum, open_buffdesc *nextVrfName);
797 
798 /*************************************************************************/
814 open_error_t openapiDhcpv6RelayEntryGet(openapiClientHandle_t *client_handle, uint32_t ifNum, open_in6_addr_t *relayAddr, uint32_t *relayIfNum);
815 
816 
817 #endif /* OPENAPI_DHCP6S_H_INCLUDED */
818 
open_error_t openapiDhcp6sBindingClearAll(openapiClientHandle_t *client_handle, open_buffdesc *vrfName)
Clear all the binding entries for a given VRF.
open_error_t openapiDhcp6sBindingGetNext(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, open_buffdesc *duid, uint32_t *iaid, open_inet_addr_t *prefixAddr, uint16_t *prefixLen, uint32_t *prefixType, open_inet_addr_t *clientAddr, uint32_t *clientIntfNum, uint32_t *expiration, uint32_t *validLifetime, uint32_t *preferLifetime)
Get next active binding from the DHCPv6 server for a given VRF.
open_error_t openapiDhcp6sBindingClear(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, OPEN_DHCP6_PREFIX_TYPE_t prefixType, open_inet_addr_t *clientAddr)
Clear the binding specified by the IPv6 address for the given VRF.
open_error_t openapiDhcp6sIntfModeRelaySet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t ifNum, open_inet_addr_t *serverAddr, uint32_t serverIfNum, open_buffdesc *remoteId)
Set DHCPv6 Relay parameters for an interface.
open_error_t openapiDhcp6sStatisticsGet(openapiClientHandle_t *client_handle, uint32_t ifNum, open_buffdesc *vrfName, openDhcp6sStatData_t *dhcp6Stats)
Get the DHCPv6-Server statistics for a given VRF or interface.
uint32_t totalPacketsReceived
Type of packets sent to client.
open_error_t openapiDhcp6sPoolValidate(openapiClientHandle_t *client_handle, uint32_t poolNumber)
Check if a DHCPv6 pool corresponding to number is valid or not.
open_error_t openapiDhcp6sIntfModeGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DHCP6_MODE_t *mode, open_buffdesc *pPoolName, uint32_t *serverPref, open_inet_addr_t *relayAddr, uint32_t *relayIfNum, open_buffdesc *remoteId, OPEN_BOOL_t *rapidCommit, OPEN_BOOL_t *allowUnicast, open_buffdesc *localVrfName, open_buffdesc *relayDestVrfName, uint32_t *pdClientIntIfNum)
Get the DHCPv6 Interface parameters for a given interface.
open_error_t
OPEN uses these enumerators to indicate the error codes.
open_error_t openapiDhcp6sIntfGetNext(openapiClientHandle_t *client_handle, uint32_t *ifNum)
Get the next interface with active DHCPv6 configuration.
uint32_t numOfDhcpsSolicitReceived
< Type of packets received from client
open_error_t openapiDhcp6sIntfValidate(openapiClientHandle_t *client_handle, uint32_t ifNum)
Verify the interface has active DHCPv6 configuration.
open_error_t openapiDhcp6sPoolEntryFirst(openapiClientHandle_t *client_handle, open_buffdesc *poolName, uint32_t *poolIndex)
Get the first entry in DHCPv6 address pool.
open_error_t openapiDhcp6MapIntfValidNextGet(openapiClientHandle_t *client_handle, uint32_t prevIfNum, uint32_t *ifNum)
Get the next valid interface for participation in DHCPv6 components.
open_error_t openapiDhcp6sIntfRelayEntryDelete(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t ifNum, open_inet_addr_t *serverAddr, uint32_t serverIfNum, open_buffdesc *remoteId)
Delete DHCPv6 Relay entry/parameters for a given interface.
open_error_t openapiDhcp6sPoolNumGet(openapiClientHandle_t *client_handle, uint32_t *poolsCount)
Get the number of pool for a DHCPv6 Server.
open_error_t openapiDhcp6sAdminModeGet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, OPEN_CONTROL_t *mode)
Get the administrative mode of the IPv6 DHCP-Sever for given VRF.
open_error_t openapiDhcp6sAdminModeSet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, OPEN_CONTROL_t mode)
Set the administrative mode of the IPv6 DHCP-Sever for given VRF.
open_error_t openapiDhcp6sStatisticsClear(openapiClientHandle_t *client_handle, uint32_t ifNum, open_buffdesc *vrfName)
Clear the DHCPv6-Server statistics for a given interface or VRF.
open_error_t openapiDhcp6sPoolDnsServerRemove(openapiClientHandle_t *client_handle, open_buffdesc *poolName, open_inet_addr_t *pAddr)
Delete a DHCPv6 host DNS Servers for a automatic pool.
open_error_t openapiDhcp6MapIntfValidFirstGet(openapiClientHandle_t *client_handle, uint32_t *ifNum)
Get the first valid interface for participation in DHCPv6 components.
open_error_t openapiDhcp6sPoolTypeGet(openapiClientHandle_t *client_handle, open_buffdesc *poolName, uint32_t *poolType)
Get the DHCPv6 Server pool type.
open_error_t openapiDhcp6sPoolDnsServersGet(openapiClientHandle_t *client_handle, open_buffdesc *poolName, openDnsServerTable_t *dnsServers)
Get DHCPv6 host DNS Servers for a automatic pool.
open_error_t openapiDhcp6sPoolDelete(openapiClientHandle_t *client_handle, open_buffdesc *poolName)
Delete a DHCPv6 address pool.
open_error_t openapiDhcp6sIntfModeServerSet(openapiClientHandle_t *client_handle, uint32_t ifNum, open_buffdesc *poolName, uint32_t serverPref, OPEN_BOOL_t rapidCommit, OPEN_BOOL_t allowUnicast)
Set DHCPv6 Server parameters for an interface.
OPEN_CONTROL_t
OPEN uses these enumerators to indicate enable or disable for a given config or status parameter...
OPEN_BOOL_t
OPEN uses these enumerators to indicate true or false for a given config or status parameter...
open_error_t openapiDhcp6sPoolHostRemove(openapiClientHandle_t *client_handle, open_buffdesc *poolName, open_inet_addr_t *prefixAddr, uint16_t prefixLen)
Delete the host within a DHCPv6 Server pool.
open_error_t openapiDhcp6sBindingCountGet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t *count)
Get the count of number of bindings in the binding database for a given VRF.
open_error_t openapiDhcp6sPoolDnsServerAdd(openapiClientHandle_t *client_handle, open_buffdesc *poolName, open_inet_addr_t *pAddr)
Add a DHCPv6 host DNS Server for a automatic pool.
open_error_t openapiDhcp6sNumberToPoolNameGet(openapiClientHandle_t *client_handle, uint32_t poolNumber, open_buffdesc *poolName)
Get the pool name corresponding to a valid pool number.
open_error_t openapiDhcp6sPoolHostGetNext(openapiClientHandle_t *client_handle, open_buffdesc *poolName, open_buffdesc *duidStr, open_buffdesc *hostName, uint32_t *iaid, open_inet_addr_t *prefixAddr, uint16_t *prefixLen, uint32_t *validLifetime, uint32_t *preferLifetime)
Get next host within a DHCPv6 Server pool.
open_error_t openapiDhcp6sServerDuidGet(openapiClientHandle_t *client_handle, open_buffdesc *duid)
Get the DHCPv6 Server DUID.
open_error_t openapiDhcp6sPoolCreate(openapiClientHandle_t *client_handle, open_buffdesc *poolName)
Create a DHCPv6 address pool.
open_error_t openapiDhcp6MapIntfIsValid(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_BOOL_t *isValidFlag)
Determine if the interface is valid for participation in DHCPv6 components.
open_error_t openapiDhcp6sPoolDnsDomainAdd(openapiClientHandle_t *client_handle, open_buffdesc *poolName, open_buffdesc *domainName)
Add a DHCPv6 DNS Domain Name for a pool.
open_error_t openapiDhcpv6RelayEntryNextGet(openapiClientHandle_t *client_handle, uint32_t ifNum, open_inet_addr_t *relayAddr, uint32_t *relayIfNum, open_buffdesc *vrfName, uint32_t *nextIfNum, open_inet_addr_t *nextRelayAddr, uint32_t *nextRelayIfNum, open_buffdesc *nextVrfName)
Get the next DHCPv6 interface relay parameters for an interface.
open_error_t openapiDhcp6sPoolDnsDomainsGet(openapiClientHandle_t *client_handle, open_buffdesc *poolName, openDnsDomainTable_t *dnsDomainNames)
Get the DHCPv6 DNS Domain Names from a pool.
open_error_t openapiDhcp6sIntfModeDelete(openapiClientHandle_t *client_handle, uint32_t ifNum, open_buffdesc *vrfName)
Delete DHCPv6 Server/Relay parameters on a given interface and VRF.
open_error_t openapiDhcp6sPoolDnsDomainRemove(openapiClientHandle_t *client_handle, open_buffdesc *poolName, open_buffdesc *domainName)
Remove a DHCPv6 DNS Domain Name from a pool.
open_error_t openapiDhcpv6RelayEntryGet(openapiClientHandle_t *client_handle, uint32_t ifNum, open_in6_addr_t *relayAddr, uint32_t *relayIfNum)
Get the exact DHCPv6 interface relay entry.
open_error_t openapiDhcp6sPoolHostAdd(openapiClientHandle_t *client_handle, open_buffdesc *poolName, open_buffdesc *hostName, open_inet_addr_t *prefixAddr, uint16_t prefixLen, uint32_t validLifetime, uint32_t preferLifetime)
Add a host within a DHCPv6 Server pool.
Hash Mode names.
open_error_t openapiDhcp6sPoolEntryNext(openapiClientHandle_t *client_handle, open_buffdesc *poolName, uint32_t *poolIndex)
Get the next entry in DHCPv6 address pool.