Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.11.1.2
openapi_ipsla.h
Go to the documentation of this file.
1 
9 /**********************************************************************
10 *
11 * Copyright 2022-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_ipsla.h
28 *
29 * @purpose This code implements the OpEN IPSLA API
30 *
31 * @component OPEN
32 *
33 * @create 12/27/2022
34 *
35 * @end
36 *
37 *********************************************************************/
38 #ifndef OPENAPI_IPSLA_H_INCLUDED
39 #define OPENAPI_IPSLA_H_INCLUDED
40 
41 #include "openapi_common.h"
42 #include "openapi_routing_config.h"
43 
44 
45 /*** Data structures for Configuration data of IP-SLA-Table ***/
46 
49 {
50  OPEN_IPSLA_OPERATION_TYPE_NONE = 0,
51  OPEN_IPSLA_OPERATION_TYPE_ICMP_ECHO = 1
53 
57 typedef struct openIpSlaIcmpEchoCfg_s
58 {
60  uint32_t srcIntIfNum;
61  uint32_t frequency;
62  uint32_t threshold;
63  uint32_t timeout;
66 
68 typedef struct openIpSlaCfg_s
69 {
71  uint32_t ipSlaId;
74  union
75  {
76  openIpSlaIcmpEchoCfg_t ipSlaEchoCfgParams;
77  } u;
79 
81 typedef enum openIpSlaTrackTypes_s
82 {
83  OPEN_IPSLA_TRACKING_TYPE_REACHABILITY = 0,
84  OPEN_IPSLA_TRACKING_TYPE_STATE = 1
86 
88 typedef struct openIpSlaOperData_s
89 {
90  uint32_t ipSlaId;
91  uint32_t family;
92  uint32_t ipSlaVrfId;
97  uint32_t probeReturnCode;
98  uint32_t lastProbeRTTvalue;
99  uint32_t numSuccesses;
100  uint32_t numFailures;
104 
106 typedef struct openIpSlaTrackCfg_s
107 {
109  uint32_t trackId;
110  uint32_t trackedIpSlaId;
112  uint32_t delayUp;
113  uint32_t delayDown;
115 
117 typedef enum openTrackRC_s
118 {
119  OPEN_IPSLA_TRACK_RC_UNKNOWN = 0,
120  OPEN_IPSLA_TRACK_RC_OK = 1,
121  OPEN_IPSLA_TRACK_RC_TIMEOUT = 2,
122  OPEN_IPSLA_TRACK_RC_OVERTHRESHOLD = 3,
123 } openTrackRC_t;
124 
127 {
128  uint32_t trackId; /*Track object number. Range {1-128}*/
129  uint32_t family; /*IP address family type of associated IPSLA operation (OPEN_AF_INET or OPEN_AF_INET6)*/
130  OPEN_BOOL_t isTrackEntryActive; /*{OPEN_TRUE, OPEN_FALSE}. [Default: OPEN_FALSE]**If IpSlaId associated but IpSlaId not created/defined then also OPEN_FALSE.*/
131  OPEN_BOOL_t trackingStatus; /*{OPEN_TRUE, OPEN_FALSE}. [Default: OPEN_TRUE]*/
132  OPEN_BOOL_t prevTrackingStatus; /*{OPEN_TRUE, OPEN_FALSE}. [Default: OPEN_TRUE]. Store the previous TrackStatus value for delayTimerCheck*/
133  OPEN_BOOL_t ignoreDelayConfig; /*{OPEN_TRUE, OPEN_FALSE}. [Default: OPEN_FALSE]. Flag to indicate whether to ignore delay config or not*/
134  uint32_t delayStartTime; /*Time in seconds since the last reachability status change update arrived with
135  different value. If not value is zero. It is reset to zero when delay up or
136  delay down timer expiry happens and Reachability Status is changed. */
137  uint32_t lastStatusChangeUpdateTime; /*Time in seconds since the last reachability status change*/
138  uint32_t numStatusChangeUpdates; /*Count of Status Change Updates received since TrackEntryActive. [Default: 0]*/
139  uint32_t latestOperationReturnCode; /*ReturnCode when the last TrackingStatus was changed.{Unknown, OK, Timeout, overThreshold} [Default: Unknown]*/
140 
142 
143 
144 /*************************************************************************/
158 open_error_t openapiIpSlaIpSlaIdCreate(openapiClientHandle_t *client_handle, uint32_t ipSlaId);
159 
160 /*************************************************************************/
174 open_error_t openapiIpSlaIpSlaIdDelete(openapiClientHandle_t *client_handle, uint32_t ipSlaId);
175 
176 /*************************************************************************/
191 open_error_t openapiIpSlaIpSlaSchedule(openapiClientHandle_t *client_handle, uint32_t ipSlaId, OPEN_BOOL_t toSchedule);
192 
193 /*************************************************************************/
208 open_error_t openapiIpSlaIpSlaIdNodeCfgInfoGet(openapiClientHandle_t *client_handle, uint32_t ipSlaId, openIpSlaCfg_t *ipSlaCfgInfo);
209 
210 /*************************************************************************/
225 open_error_t openapiIpSlaIpSlaIdNodeOperInfoGet(openapiClientHandle_t *client_handle,uint32_t ipSlaId, openIpSlaOperData_t *ipSlaOperInfo);
226 
227 /*************************************************************************/
242 open_error_t openapiIpSlaIpSlaIdCfgNodeFirstGet(openapiClientHandle_t *client_handle, OPEN_BOOL_t isShowRunningCfg, uint32_t *ipSlaId);
243 
244 /*************************************************************************/
260 open_error_t openapiIpSlaIpSlaIdCfgNodeNextGet(openapiClientHandle_t *client_handle, uint32_t ipSlaId, OPEN_BOOL_t isShowRunningCfg, uint32_t *nextIpSlaId);
261 
262 /*************************************************************************/
277 open_error_t openapiIpSlaIpSlaIdOperStatusGet(openapiClientHandle_t *client_handle, uint32_t ipSlaId, OPEN_BOOL_t *isIpSlaEntryActive);
278 
279 /*************************************************************************/
294 open_error_t openapiIpSlaTrackIdTrackingStateGet(openapiClientHandle_t *client_handle, uint32_t trackId, OPEN_BOOL_t *isTrackStatusUp);
295 
296 /*************************************************************************/
311 open_error_t openapiIpSlaTrackIdNodeCfgInfoGet(openapiClientHandle_t *client_handle, uint32_t trackId, openIpSlaTrackCfg_t *trackCfgInfo);
312 
313 /*************************************************************************/
329 
330 /*************************************************************************/
345 
346 /*************************************************************************/
361 open_error_t openapiIpSlaTrackIdCfgNodeNextGet(openapiClientHandle_t *client_handle, uint32_t trackId, uint32_t *nextTrackId);
362 
363 /*************************************************************************/
379 open_error_t openapiIpSlaTrackIdCreate(openapiClientHandle_t *client_handle, uint32_t trackId, uint32_t ipSlaId, openIpSlaTrackTypes_t trackingType);
380 
381 /*************************************************************************/
395 open_error_t openapiIpSlaTrackIdDelete(openapiClientHandle_t *client_handle, uint32_t trackId);
396 
397 /*************************************************************************/
412 open_error_t openapiIpSlaSetTrackOjectsDelayUpTime(openapiClientHandle_t *client_handle, uint32_t trackId, uint32_t upDelayTime);
413 
414 /*************************************************************************/
429 open_error_t openapiIpSlaSetTrackOjectsDelayDownTime(openapiClientHandle_t *client_handle, uint32_t trackId, uint32_t downDelayTime);
430 
431 /*************************************************************************/
447 open_error_t openapiIpSlaIpSlaProbesIcmpEchoTypeSet(openapiClientHandle_t *client_handle, uint32_t ipSlaId, open_inet_addr_t destIpAddress, uint32_t srcIntIfNum);
448 
449 /*************************************************************************/
464 open_error_t openapiIpSlaSetIpSlaProbesFrequency(openapiClientHandle_t *client_handle, uint32_t ipSlaId, uint32_t frequency);
465 
466 /*************************************************************************/
481 open_error_t openapiIpSlaSetIpSlaProbesTimeout(openapiClientHandle_t *client_handle, uint32_t ipSlaId, uint32_t timeout);
482 
483 /*************************************************************************/
498 open_error_t openapiIpSlaSetIpSlaProbesThreshold(openapiClientHandle_t *client_handle, uint32_t ipSlaId, uint32_t threshold);
499 
500 /*************************************************************************/
515 open_error_t openapiIpSlaSetIpSlaProbesVrfName(openapiClientHandle_t *client_handle, uint32_t ipSlaId, open_buffdesc *vrfName);
516 
517 /*************************************************************************/
532 
533 
534 #endif /* OPENAPI_IPSLA_H_INCLUDED */
535 
OPEN_BOOL_t inUse
L7_TRUE if this entry contains a Track object config info.
uint32_t delayDown
Time to delay notification of Down event.
uint32_t srcIntIfNum
Optional.
Definition: openapi_ipsla.h:60
open_error_t openapiIpSlaIpSlaIdNodeCfgInfoGet(openapiClientHandle_t *client_handle, uint32_t ipSlaId, openIpSlaCfg_t *ipSlaCfgInfo)
Get the config information of the given IP SLA number.
open_error_t openapiIpSlaIpSlaIdCfgNodeNextGet(openapiClientHandle_t *client_handle, uint32_t ipSlaId, OPEN_BOOL_t isShowRunningCfg, uint32_t *nextIpSlaId)
To get the ipSla id of the next IPSLA probe operational entry from the IPSLA Table.
open_error_t openapiIpSlaSetIpSlaProbesFrequency(openapiClientHandle_t *client_handle, uint32_t ipSlaId, uint32_t frequency)
Set the given IP SLA Operation's ICMP-ECHO Frequency value.
open_error_t openapiIpSlaSetIpSlaProbesVrfName(openapiClientHandle_t *client_handle, uint32_t ipSlaId, open_buffdesc *vrfName)
Set the given IP SLA Operation's ICMP-ECHO VRF Name value.
enum openTrackRC_s openTrackRC_t
Data structure for Operational data of Track-Table Element.
openIpSlaOperTypes_s
< IPSLA operation types
Definition: openapi_ipsla.h:48
uint32_t numFailures
Count of Failed Probes (Return Code is not 'OK').
uint32_t delayUp
Time to delay notification of Up event.
open_error_t openapiIpSlaIpSlaIdNodeOperInfoGet(openapiClientHandle_t *client_handle, uint32_t ipSlaId, openIpSlaOperData_t *ipSlaOperInfo)
Get the operational info of the given IP SLA number.
#define OPEN_VRF_MAX_NAME_LEN
largest allowable VRF name
open_error_t
OPEN uses these enumerators to indicate the error codes.
openIpSlaOperTypes_t ipSlaType
{OPEN_IPSLA_OPER_TYPE_NONE, OPEN_IPSLA_OPER_TYPE_ICMP_ECHO} [default: OPEN_IPSLA_OPER_TYPE_NONE] ...
Definition: openapi_ipsla.h:72
uint32_t family
IP address family type of associated IPSLA operation (OPEN_AF_INET or OPEN_AF_INET6).
Definition: openapi_ipsla.h:91
open_error_t openapiIpSlaIpSlaProbesIcmpEchoTypeSet(openapiClientHandle_t *client_handle, uint32_t ipSlaId, open_inet_addr_t destIpAddress, uint32_t srcIntIfNum)
Set the given IP SLA Operation's ICMP-ECHO Type params.
open_error_t openapiIpSlaSetIpSlaProbesThreshold(openapiClientHandle_t *client_handle, uint32_t ipSlaId, uint32_t threshold)
Set the given IP SLA Operation's ICMP-ECHO Threshold value.
open_error_t openapiIpSlaSetTrackOjectsDelayDownTime(openapiClientHandle_t *client_handle, uint32_t trackId, uint32_t downDelayTime)
Set the given Track object's Down delay time value.
uint32_t latestOperationStartUpTime
Up time since lastest probe start time.
open_error_t openapiIpSlaTrackIdNodeOperInfoGet(openapiClientHandle_t *client_handle, uint32_t trackId, openIpSlaTrackOperData_t *trackOperInfo)
Get the operational info of the given track number.
uint32_t ipSlaId
IP SLA operation number Range {1-128}.
Definition: openapi_ipsla.h:90
OPEN_BOOL_t isSrcIntfV4RoutingEnabled
OPEN_TRUE if IPv4 routing is enabled on the interface.
Definition: openapi_ipsla.h:94
OPEN_BOOL_t isSrcIntfV6RoutingEnabled
OPEN_TRUE if IPv6 routing is enabled on the interface.
Definition: openapi_ipsla.h:95
enum openIpSlaTrackTypes_s openIpSlaTrackTypes_t
Data structure for Operational Data of IP-SLA-Table Element.
open_error_t openapiIpSlaIpSlaIdCfgNodeFirstGet(openapiClientHandle_t *client_handle, OPEN_BOOL_t isShowRunningCfg, uint32_t *ipSlaId)
To get the IPSLA ID of the first IPSLA probe operational.
open_error_t openapiIpSlaTrackIdCfgNodeFirstGet(openapiClientHandle_t *client_handle, uint32_t *trackId)
To get the track Id of the first track object's operational entry from the Track Table.
open_error_t openapiIpSlaTrackIdCfgNodeNextGet(openapiClientHandle_t *client_handle, uint32_t trackId, uint32_t *nextTrackId)
To get the track Id of the next track object's operational entry from the TrackTable.
struct openIpSlaCfg_s openIpSlaCfg_t
IPSLA Tracking types.
struct openIpSlaIcmpEchoCfg_s openIpSlaIcmpEchoCfg_t
IP SLA Config Entry Structure.
OPEN_BOOL_t isScheduled
{OPEN_TRUE, OPEN_FALSE} [Default: OPEN_FALSE]
Definition: openapi_ipsla.h:73
uint32_t probeReturnCode
{OK, Timeout, overThreshold} [Default: OK]
Definition: openapi_ipsla.h:97
uint32_t trackedIpSlaId
Tracked IP SLA operation number.
open_error_t openapiIpSlaIpSlaSchedule(openapiClientHandle_t *client_handle, uint32_t ipSlaId, OPEN_BOOL_t toSchedule)
Schedule an IP SLA operation to start or stop probing.
struct openIpSlaTrackCfg_s openIpSlaTrackCfg_t
IPSLA Tracking return codes.
uint32_t frequency
1-3600 seconds [Default: 60sec]
Definition: openapi_ipsla.h:61
OPEN_BOOL_t
OPEN uses these enumerators to indicate true or false for a given config or status parameter...
open_inet_addr_t destIpAddr
By default when un-configured this contains L7_AF_NONE family type and zero address.
Definition: openapi_ipsla.h:59
enum openIpSlaOperTypes_s openIpSlaOperTypes_t
< IPSLA operation types
uint32_t timeout
0-300000 millisec [Default: 5000millisec]
Definition: openapi_ipsla.h:63
uint32_t ipSlaVrfId
VRF-ID of the VRF to which the IPSLA ID is associated.
Definition: openapi_ipsla.h:92
uint32_t ipSlaId
IP SLA operation number Range {1-128}.
Definition: openapi_ipsla.h:71
open_error_t openapiIpSlaTrackIdCreate(openapiClientHandle_t *client_handle, uint32_t trackId, uint32_t ipSlaId, openIpSlaTrackTypes_t trackingType)
Create a Track object for the given track number.
open_error_t openapiIpSlaIpSlaIdOperStatusGet(openapiClientHandle_t *client_handle, uint32_t ipSlaId, OPEN_BOOL_t *isIpSlaEntryActive)
Get the operational status of the given IP SLA number.
open_error_t openapiIpSlaIpSlaIdDelete(openapiClientHandle_t *client_handle, uint32_t ipSlaId)
Delete an IP SLA operation for the given IP SLA number.
OPEN_BOOL_t inUse
OPEN_TRUE if this entry contains an IP-SLA Probe config info.
Definition: openapi_ipsla.h:70
OPEN_BOOL_t overThresholdsOccurred
{OPEN_TRUE, OPEN_FALSE}.
uint32_t threshold
0-60000 millisec [Default: 5000millisec]
Definition: openapi_ipsla.h:62
open_error_t openapiIpSlaSetTrackOjectsDelayUpTime(openapiClientHandle_t *client_handle, uint32_t trackId, uint32_t upDelayTime)
Set the given Track object's Up delay time value.
open_inet_addr_t srcIpAddr
SrcIP to be used for Probes in case SrcIntf configured for this IPSLA operation.
Definition: openapi_ipsla.h:96
struct openIpSlaOperData_s openIpSlaOperData_t
IPSLA Track object configuration.
char vrfName[OPEN_VRF_MAX_NAME_LEN+1]
Optional.
Definition: openapi_ipsla.h:64
OPEN_BOOL_t isIpSlaEntryActive
OPEN_TRUE,OPEN_FALSE}.
Definition: openapi_ipsla.h:93
uint32_t lastProbeRTTvalue
in millisecs [Default: 0 ms]
Definition: openapi_ipsla.h:98
open_error_t openapiIpSlaSetIpSlaProbesTimeout(openapiClientHandle_t *client_handle, uint32_t ipSlaId, uint32_t timeout)
Set the given IP SLA Operation's ICMP-ECHO Timeout value.
uint32_t trackId
Track object number.
openIpSlaTrackTypes_t trackingType
{reachability,state} [Default: reachability]
open_error_t openapiIpSlaTrackIdNodeCfgInfoGet(openapiClientHandle_t *client_handle, uint32_t trackId, openIpSlaTrackCfg_t *trackCfgInfo)
Get the config information of the given track number.
uint32_t numSuccesses
Count of Successful Probes (Return Code is 'OK').
Definition: openapi_ipsla.h:99
open_error_t openapiIpSlaTrackIdTrackingStateGet(openapiClientHandle_t *client_handle, uint32_t trackId, OPEN_BOOL_t *isTrackStatusUp)
Get the tracking status of the given Track number.
open_error_t openapiIpSlaIpSlaIdCreate(openapiClientHandle_t *client_handle, uint32_t ipSlaId)
Create an IP SLA operation for the given IP SLA number.
open_error_t openapiIpSlaIpSlaStatisticsClear(openapiClientHandle_t *client_handle, uint32_t ipSlaId)
Clear IP SLA statistical information for given IP SLA operation or all IP SLAs.
open_error_t openapiIpSlaTrackIdDelete(openapiClientHandle_t *client_handle, uint32_t trackId)
Delete the Track object for the given track number.