Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.13.1.2
openapi_iphelper.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_iphelper.h
28 *
29 * @purpose This code implements the OpEN IP-HELPER API
30 *
31 * @component OPEN
32 *
33 * @create 02/28/2023
34 *
35 * @end
36 *
37 *********************************************************************/
38 #ifndef OPENAPI_IPHELPER_H_INCLUDED
39 #define OPENAPI_IPHELPER_H_INCLUDED
40 
41 #include "openapi_common.h"
42 
43 
44 typedef struct OPEN_IPHELPER_STATS_s
45 {
48 
52 
55 
58 
61 
64 
66  uint32_t tooManyHops;
67 
69  uint32_t tooEarly;
70 
72  uint32_t spoofedGiaddr;
73 
75  uint32_t ttlExpired;
76 
78  uint32_t matchDiscardEntry;
79 
81 
83 typedef enum
84 {
85  OPEN_RELAY_INTF_DISABLE = 0,
86  OPEN_RELAY_INTF_ENABLE,
87  OPEN_RELAY_INTF_NOT_CONFIGURED
88 } OPEN_DHCP_RELAY_INTF_VALUE_t;
89 
90 
91 /*************************************************************************/
106 open_error_t openapiBootpDhcpRelayMaxHopCountGet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t *maxHopCount);
107 
108 /*************************************************************************/
123 open_error_t openapiBootpDhcpRelayMaxHopCountSet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t maxHopCount);
124 
125 /*************************************************************************/
140 open_error_t openapiBootpDhcpRelayMinWaitTimeGet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t *minWaitTime);
141 
142 /*************************************************************************/
157 open_error_t openapiBootpDhcpRelayMinWaitTimeSet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t minWaitTime);
158 
159 /*************************************************************************/
175 
176 /*************************************************************************/
192 
193 /*************************************************************************/
209 
210 /*************************************************************************/
226 
227 /*************************************************************************/
243 
244 /*************************************************************************/
260 
261 /*************************************************************************/
277 
278 /*************************************************************************/
294 
295 /*************************************************************************/
311 
312 /*************************************************************************/
327 open_error_t openapiBootpDhcpRelayIntfServerOverrideGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DHCP_RELAY_INTF_VALUE_t *mode);
328 
329 /*************************************************************************/
344 open_error_t openapiBootpDhcpRelayIntfServerOverrideSet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DHCP_RELAY_INTF_VALUE_t mode);
345 
346 /*************************************************************************/
362 
363 /*************************************************************************/
379 
380 /*************************************************************************/
395 
396 /*************************************************************************/
411 open_error_t openapiBootpDhcpRelayIntfSourceInterfaceGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *srcIfNum);
412 
413 /*************************************************************************/
428 open_error_t openapiBootpDhcpRelayIntfSourceInterfaceSet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t srcIfNum);
429 
430 /*************************************************************************/
445 
446 /*************************************************************************/
461 
462 /*************************************************************************/
477 open_error_t openapiBootpDhcpRelayrtrCIDOptionModeGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DHCP_RELAY_INTF_VALUE_t *mode);
478 
479 /*************************************************************************/
494 open_error_t openapiBootpDhcpRelayrtrCIDOptionModeSet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DHCP_RELAY_INTF_VALUE_t mode);
495 
496 /*************************************************************************/
511 open_error_t openapiBootpDhcpRelayrtrCIDOptionCheckModeGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DHCP_RELAY_INTF_VALUE_t *mode);
512 
513 /*************************************************************************/
528 open_error_t openapiBootpDhcpRelayrtrCIDOptionCheckModeSet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DHCP_RELAY_INTF_VALUE_t mode);
529 
530 /*************************************************************************/
545 
546 /*************************************************************************/
568 open_error_t openapiIhIpHelperAddressFirst(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t *intIfNum,
569  uint16_t *udpPort, uint32_t *serverAddr, OPEN_BOOL_t *discard,
570  OPEN_BOOL_t *isServerVrfSet, open_buffdesc *serverVrfName, uint32_t *hitCount);
571 
572 /*************************************************************************/
594 open_error_t openapiIhIpHelperAddressNext(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t *intIfNum,
595  uint16_t *udpPort, uint32_t *serverAddr, OPEN_BOOL_t *discard,
596  OPEN_BOOL_t *isServerVrfSet, open_buffdesc *serverVrfName, uint32_t *hitCount);
597 
598 #endif /* OPENAPI_IPHELPER_H_INCLUDED */
599 
open_error_t openapiBootpDhcpRelayMinWaitTimeSet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t minWaitTime)
Set the Minimum Wait time for DHCP relay agent for the given VRF.
open_error_t openapiBootpDhcpRelayrtrCIDOptionModeSet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DHCP_RELAY_INTF_VALUE_t mode)
Set the Relay Agent Circuit ID Option mode for the given interface.
open_error_t openapiBootpDhcpRelayMinWaitTimeGet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t *minWaitTime)
Get the Minimum Wait time configured for DHCP relay agent for the given VRF.
open_error_t openapiIpHelperAddressesRemove(openapiClientHandle_t *client_handle, uint32_t ifNum)
Remove all IP helper addresses configured on an interface.
open_error_t openapiBootpDhcpRelayCIDOptionCheckModeGet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, OPEN_CONTROL_t *mode)
Get the Relay Agent global option check mode for the given VRF.
open_error_t openapiBootpDhcpRelayCircuitIdOptionModeSet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, OPEN_CONTROL_t mode)
Set the Relay Agent Circuit ID option mode for the given VRF.
open_error_t openapiIpHelperStatisticsClear(openapiClientHandle_t *client_handle, open_buffdesc *vrfName)
Clear IP helper statistics for the given VRF.
open_error_t openapiBootpDhcpRelayCIDOptionCheckModeSet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, OPEN_CONTROL_t mode)
Set the Relay Agent global option check mode for the given VRF.
uint32_t dhcpServerMsgsRelayed
Number of UDP client messages received.
open_error_t
OPEN uses these enumerators to indicate the error codes.
open_error_t openapiBootpDhcpRelayIntfSourceInterfaceGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *srcIfNum)
Get the interface level Source interface for DHCP relay agent.
open_error_t openapiIhIpHelperAddressNext(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t *intIfNum, uint16_t *udpPort, uint32_t *serverAddr, OPEN_BOOL_t *discard, OPEN_BOOL_t *isServerVrfSet, open_buffdesc *serverVrfName, uint32_t *hitCount)
Get the next relay entry along with the server's VRF name config.
open_error_t openapiBootpDhcpRelayMaxHopCountGet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t *maxHopCount)
Get the Maximum Hop count configured for DHCP relay agent for the given VRF.
open_error_t openapiBootpDhcpRelayrtrCIDOptionModeGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DHCP_RELAY_INTF_VALUE_t *mode)
Get the Relay Agent Circuit ID Option mode for the given interface.
open_error_t openapiBootpDhcpRelaySourceInterfaceSet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t ifNum)
Set the global Source interface of DHCP relay agent for the given VRF.
open_error_t openapiBootpDhcpRelayServerOverrideModeSet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, OPEN_BOOL_t mode)
Set the Relay Agent global Server Override mode for the given VRF.
open_error_t openapiBootpDhcpRelayIntfServerOverrideSet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DHCP_RELAY_INTF_VALUE_t mode)
Set the Relay Agent Server Override mode for the given interface.
struct OPEN_IPHELPER_STATS_s OPEN_IPHELPER_STATS_t
Relay interface mode values.
open_error_t openapiBootpDhcpRelayrtrCIDOptionCheckModeSet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DHCP_RELAY_INTF_VALUE_t mode)
Set the Relay Agent Circuit ID option check mode for the given interface.
open_error_t openapiBootpDhcpRelayMaxHopCountSet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t maxHopCount)
Set the Maximum Hop count for DHCP relay agent for the given VRF.
open_error_t openapiIhIpHelperAddressFirst(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t *intIfNum, uint16_t *udpPort, uint32_t *serverAddr, OPEN_BOOL_t *discard, OPEN_BOOL_t *isServerVrfSet, open_buffdesc *serverVrfName, uint32_t *hitCount)
Get the first relay entry along with the server's VRF name config.
uint32_t ttlExpired
Number of times server lookup matched a discard entry.
OPEN_CONTROL_t
OPEN uses these enumerators to indicate enable or disable for a given config or status parameter...
uint32_t dhcpClientMsgsReceived
< Number of valid DHCP client messages received
uint32_t udpClientMsgsRelayed
DHCP client message arrived with hops > max allowed.
OPEN_BOOL_t
OPEN uses these enumerators to indicate true or false for a given config or status parameter...
uint32_t spoofedGiaddr
Number of packets intercepted whose TTL is <= 1.
open_error_t openapiBootpDhcpRelaySourceInterfaceClear(openapiClientHandle_t *client_handle, open_buffdesc *vrfName)
Clear the global Source interface of DHCP relay agent for the given VRF.
uint32_t udpClientMsgsReceived
Number of UDP client messages relayed.
open_error_t openapiBootpDhcpRelaySourceInterfaceGet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, uint32_t *ifNum)
Get the global Source interface of DHCP relay agent for the given VRF.
uint32_t tooEarly
Received DHCP client message with giaddr already set to our own address.
uint32_t dhcpServerMsgsReceived
Number of DHCP server messages relayed to client.
open_error_t openapiBootpDhcpRelayIntfSourceInterfaceSet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t srcIfNum)
Set the interface level Source interface for DHCP relay agent.
open_error_t openapiBootpDhcpRelayServerOverrideModeGet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, OPEN_BOOL_t *mode)
Get the Relay Agent global Server Override mode for the given VRF.
open_error_t openapiIpHelperStatisticsGet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, OPEN_IPHELPER_STATS_t *ihStats)
Get the IP Helper statistics for the given VRF.
open_error_t openapiIpHelperAdminModeSet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, OPEN_CONTROL_t mode)
Set the administrative mode of IP-Helper for the given VRF.
open_error_t openapiBootpDhcpRelayrtrCIDOptionCheckModeGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DHCP_RELAY_INTF_VALUE_t *mode)
Get the Relay Agent Circuit ID option check mode for the given interface.
open_error_t openapiBootpDhcpRelayCircuitIdOptionModeGet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, OPEN_CONTROL_t *mode)
Get the Relay Agent Circuit ID option mode for the given VRF.
uint32_t dhcpClientMsgsRelayed
Number of messages received from a DHCP server.
open_error_t openapiBootpDhcpRelayIntfSourceInterfaceClear(openapiClientHandle_t *client_handle, uint32_t ifNum)
Clear the interface level Source interface for DHCP relay agent.
open_error_t openapiIpHelperAdminModeGet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, OPEN_CONTROL_t *mode)
Get the administrative mode of IP-Helper for the given VRF.
uint32_t tooManyHops
DHCP client message arrived with secs field lower than min allowed.
open_error_t openapiBootpDhcpRelayIntfServerOverrideGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DHCP_RELAY_INTF_VALUE_t *mode)
Get the Relay Agent Server Override mode for the given interface.