This document provides a brief description of the DHCP6s OpEN APIs. It provides the following services:
- Get the administrative mode of the IPv6 DHCP-Sever for given VRF.
- Set the administrative mode of the IPv6 DHCP-Sever for given VRF.
- Get the DHCPv6 Server DUID.
- Get the number of pool for a DHCPv6 Server.
- Check if a DHCPv6 pool corresponding to number is valid or not.
- Get the pool name corresponding to a valid pool number.
- Create a DHCPv6 address pool.
- Delete a DHCPv6 address pool.
- Get the first entry in DHCPv6 address pool.
- Get the next entry in DHCPv6 address pool.
- Add a host within a DHCPv6 Server pool.
- Delete the host within a DHCPv6 Server pool.
- Print the host entries within a DHCPv6 Server pool.
- Get the DHCPv6 Server pool type.
- Get the DHCPv6 DNS Domain Names from a pool.
- Add a DHCPv6 DNS Domain Name for a pool.
- Remove a DHCPv6 DNS Domain Name from a pool.
- Add a DHCPv6 host DNS Server for a automatic pool.
- Get DHCPv6 host DNS Servers for a automatic pool.
- Delete a DHCPv6 host DNS Servers for a automatic pool.
- Delete DHCPv6 Server/Relay parameters on a given interface and VRF.
- Set DHCPv6 Relay parameters for an interface.
- Set DHCPv6 Server parameters for an interface.
- Get the DHCPv6 Interface parameters for a given interface.
- Get the next interface with active DHCPv6 configuration.
- Verify the interface has active DHCPv6 configuration.
- Determine if the interface is valid for participation in DHCPv6 components.
- Get the first valid interface for participation in DHCPv6 components.
- Get the next valid interface for participation in DHCPv6 components.
- Print the active bindings from the DHCPv6 server for a given VRF.
- Clear the binding specified by the IPv6 address for the given VRF.
- Clear all the binding entries for a given VRF.
- Get the count of number of bindings in the binding database for a given VRF.
- Get the DHCPv6-Server statistics for a given VRF or interface.
- Clear the DHCPv6-Server statistics for a given interface or VRF.
- Print the DHCPv6 interface relay entries for all interfaces.
- Get the exact DHCPv6 interface relay entry.
- Delete DHCPv6 Relay entry/parameters for an interface.
Example C Application dhcp6s_example
Initialization
In the main function, the sample application initializes the OpEN API RPC service by calling openapiClientRegister() and waits for the RPC service in switchdrvr to start. A Client Handle is returned by openapiClientRegister() which is used while invoking the OpEN APIs. The application then exercises the associated OpEN APIs and logs informational and/or error messages on the console. The example application runs to its completion and exits.
dhcp6s_example
dhcp6s_example.c is a sample application that demonstrates the use of OpEN's DHCP6s APIs. dhcp6s_example is started from the command line and can be used to exercise the various APIs by specifying arguments on the command line.
Sample Output
- Usage: ./dhcp6s_example <test#> <arg1> <arg2> ...
- Test 1: Get the administrative mode of the IPv6 DHCP-Server for given VRF: dhcp6s_example 1 <vrfName>
- Test 2: Set the administrative mode of the IPv6 DHCP-Server for given VRF: dhcp6s_example 2 <vrfName> <mode>
- Test 3: Get the DHCPv6 Server DUID: dhcp6s_example 3
- Test 4: Get the number of pools for a DHCPv6 Server: dhcp6s_example 4
- Test 5: Check if a DHCPv6 pool corresponding to number is valid or not: dhcp6s_example 5 <poolNumber>
- Test 6: Get the pool name corresponding to a valid pool number: dhcp6s_example 6 <poolNumber>
- Test 7: Create a DHCPv6 address pool: dhcp6s_example 7 <poolName>
- Test 8: Delete a DHCPv6 address pool: dhcp6s_example 8 <poolName>
- Test 9: Get the first entry in DHCPv6 address pool: dhcp6s_example 9
- Test 10: Get the next entry in DHCPv6 address pool: dhcp6s_example 10 <poolIndex>
- Test 11: Add a host within a DHCPv6 Server pool: dhcp6s_example 11 <poolName> <hostName> <prefixAddr> <prefixLen> <validLifetime> <preferLifetime>
- Test 12: Delete the host within a DHCPv6 Server pool: dhcp6s_example 12 <poolName> <prefixAddr> <prefixLen>
- Test 13: Print the host entries within a DHCPv6 Server pool: dhcp6s_example 13 <poolName>
- Test 14: Get the DHCPv6 Server pool type: dhcp6s_example 14 <poolName>
- Test 15: Get the DHCPv6 DNS Domain Names from a pool: dhcp6s_example 15 <poolName>
- Test 16: Add a DHCPv6 DNS Domain Name for a pool: dhcp6s_example 16 <poolName> <domainName>
- Test 17: Remove a DHCPv6 DNS Domain Name from a pool: dhcp6s_example 17 <poolName> <domainName>
- Test 18: Add a DHCPv6 host DNS Server for a automatic pool: dhcp6s_example 18 <poolName> <address>
- Test 19: Get DHCPv6 host DNS Servers for a automatic pool: dhcp6s_example 19 <poolName>
- Test 20: Delete a DHCPv6 host DNS Servers for a automatic pool: dhcp6s_example 20 <poolName> <address>
- Test 21: Delete DHCPv6 Server/Relay parameters on a given interface and VRF: dhcp6s_example 21 <ifNum> <vrfName>
- Test 22: Set DHCPv6 Relay parameters for an interface: dhcp6s_example 22 <vrfName> <ifNum> <serverAddr> <serverIfNum> <remoteId>
- Test 23: Set DHCPv6 Server parameters for an interface: dhcp6s_example 23 <ifNum> <poolName> <serverPref> <rapidCommit> <allowUnicast>
- Test 24: Get the DHCPv6 Interface parameters for a given interface: dhcp6s_example 24 <ifNum>
- Test 25: Get the next interface with active DHCPv6 configuration: dhcp6s_example 25 <ifNum>
- Test 26: Verify the interface has active DHCPv6 configuration: dhcp6s_example 26 <ifNum>
- Test 27: Determine if the interface is valid for participation in DHCPv6 components: dhcp6s_example 27 <ifNum>
- Test 28: Get the first valid interface for participation in DHCPv6 components: dhcp6s_example 28
- Test 29: Get the next valid interface for participation in DHCPv6 components: dhcp6s_example 29 <prevIfNum>
- Test 30: Print the active bindings from the DHCPv6 server for a given VRF: dhcp6s_example 30 <vrfName>
- Test 31: Clear the binding specified by the IPv6 address for the given VRF: dhcp6s_example 31 <vrfName> <prefixType> <clientAddr>
- Test 32: Clear all the binding entries for a given VRF: dhcp6s_example 32 <vrfName>
- Test 33: Get the count of number of bindings in the binding database for a given VRF: dhcp6s_example 33 <vrfName>
- Test 34: Get the DHCPv6-Server statistics for a given VRF or interface: dhcp6s_example 34 <ifNum> <vrfName>
- Test 35: Clear the DHCPv6-Server statistics for a given interface or VRF: dhcp6s_example 35 <ifNum> <vrfName>
- Test 36: Print the DHCPv6 interface relay entries for all interfaces: dhcp6s_example 36
- Test 37: Get the exact DHCPv6 interface relay entry: dhcp6s_example 37 <ifNum> <relayAddr>
- Test 38: Delete DHCPv6 Relay entry/parameters for an interface: dhcp6s_example 38 <vrfName> <ifNum> <serverAddr> <serverIfNum> <remoteId>
DHCP6s CLI/API Cross Reference
(Priv-User Mode)##
clear ipv6 dhcp {{interface <u/s/p> statistics} | {statistics [vrf <vrf-name>]}} | openapiDhcp6sStatisticsClear() (Global-config Mode)##
ipv6 dhcp pool <name> | openapiDhcp6sPoolCreate() (Global-config Mode)##
no ipv6 dhcp pool <name> | openapiDhcp6sPoolDelete() (Dhcpv6-Pool_Config)##
dns-server <address1> | openapiDhcp6sPoolDnsServerAdd() (Dhcpv6-Pool_Config)##
no dns-server <address1> | openapiDhcp6sPoolDnsServerRemove() (Priv-User Mode)##
show ipv6 dhcp pool | openapiDhcp6sPoolEntryFirst()
openapiDhcp6sPoolEntryNext()
openapiDhcp6sPoolHostGetNext() (Priv-User Mode)##
show ipv6 dhcp pool | openapiDhcp6sPoolDnsServersGet()
openapiDhcp6sPoolDnsDomainsGet() (Dhcpv6-Pool_Config)##
domain-name <address1> | openapiDhcp6sPoolDnsDomainAdd() (Dhcpv6-Pool_Config)##
no domain-name <address1> | openapiDhcp6sPoolDnsDomainRemove() (Dhcpv6-Pool_Config)##
address prefix <ipv6-prefix> [lifetime {<valid-lifetime> <prefer-lifetime>} | infinite] | openapiDhcp6sPoolHostAdd() (Dhcpv6-Pool_Config)##
no address prefix <ipv6-prefix> | openapiDhcp6sPoolHostRemove() (Interface-Config)##
ipv6 dhcp server [preference <pref-value>] [rapid-commit] | openapiDhcp6sIntfModeServerSet() (Interface-Config)##
no ipv6 dhcp relay | openapiDhcp6sIntfRelayEntryDelete() (Interface-config)##
ipv6 dhcp relay [destination <relay-address>] [vrf <vrf-id>] [interface <relay-intf>] [remote-id <remote-id-string>] | openapiDhcp6sIntfModeRelaySet() (Interface-config)##
no ipv6 dhcp server | openapiDhcp6sIntfModeDelete() (Priv-User Mode)##
show running-config interface <interface> | openapiDhcp6sIntfModeGet() (Priv-User Mode)##
show ipv6 dhcp binding [vrf <vrf-name>] | openapiDhcp6sBindingCountGet()
openapiDhcp6sBindingGetNext() (Priv-User Mode)##
show ipv6 dhcp interface [<interface>] | openapiDhcpv6RelayEntryNextGet() (Priv-User Mode)##
clear ipv6 dhcp binding [vrf <vrf-name>] <ipv6-address> | openapiDhcp6sBindingClear() (Priv-User Mode)##
clear ipv6 dhcp binding [vrf <vrf-name>] | openapiDhcp6sBindingClearAll()