Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
Data Structures | Typedefs | Functions
IPv4 And IPv6 Routing Statistics [OPENAPI_ROUTING_STATS]

Data Structures

struct  openEcmpRouteProtocolCount_s
 
struct  openRouteStats_s
 

Typedefs

typedef struct openEcmpRouteProtocolCount_s openEcmpRouteProtocolCount_t
 
typedef struct openRouteStats_s openRouteStats_t
 

Functions

open_error_t openapiGetReportableRouteStats (openapiClientHandle_t *client_handle, uint64_t *ipv4Mask, uint64_t *ipv6Mask)
 Get the IPv4/IPv6 reportable route stats masks. More...
 
open_error_t openapiIpMapDynamicProtoNextGet (openapiClientHandle_t *client_handle, uint32_t *protoId)
 Iterate through the protocols that have been dynamically registered at run time. More...
 
open_error_t openapiIpMapProtoNameGet (openapiClientHandle_t *client_handle, uint32_t protoId, open_buffdesc *protoName)
 Get the name for a given protocol. More...
 
open_error_t openapiIpMapProtoNameLenGet (openapiClientHandle_t *client_handle, uint32_t *len)
 Get the max protocol name length. More...
 
open_error_t openapiIpMapProtoRouteTypeNextGet (openapiClientHandle_t *client_handle, uint32_t protoId, uint32_t *routeType)
 Iterate through the route types with a given protocol ID. More...
 
open_error_t openapiIpMapRouteTypeNameGet (openapiClientHandle_t *client_handle, uint32_t routeType, open_buffdesc *routeTypeName)
 Get the name for a given route type. More...
 
open_error_t openapiIpMapRouteTypeNameLenGet (openapiClientHandle_t *client_handle, uint32_t *len)
 Get the max route type name length. More...
 
open_error_t openapiIpv4EcmpRouteProtocolCountsGet (openapiClientHandle_t *client_handle, open_buffdesc *vrf, open_buffdesc *counts)
 Get a table containing ECMP counts for each IPv4 routing protocol. More...
 
open_error_t openapiIpv4NumRoutingProtocolsGet (openapiClientHandle_t *client_handle, uint32_t *count)
 Get the number of IPv4 routing protocols. More...
 
open_error_t openapiIpv4RouteTableStatsGet (openapiClientHandle_t *client_handle, open_buffdesc *vrfName, OPEN_BOOL_t bestRoutes, openRouteStats_t *routeStats, open_buffdesc *numRoutes, open_buffdesc *ecmpHisto)
 Report IPv4 routing table statistics. More...
 
open_error_t openapiIpv6EcmpRouteProtocolCountsGet (openapiClientHandle_t *client_handle, open_buffdesc *counts)
 Get a table containing ECMP counts for each IPv6 routing protocol. More...
 
open_error_t openapiIpv6NumRoutingProtocolsGet (openapiClientHandle_t *client_handle, uint32_t *count)
 Get the number of IPv6 routing protocols. More...
 
open_error_t openapiIpv6RouteTableStatsGet (openapiClientHandle_t *client_handle, OPEN_BOOL_t bestRoutes, openRouteStats_t *routeStats, open_buffdesc *numRoutes, open_buffdesc *ecmpHisto, open_buffdesc *prefixesNo)
 Report IPv6 routing table statistics. More...
 
open_error_t openapiNumEcmpRoutesGet (openapiClientHandle_t *client_handle, uint32_t *count)
 Get the number of ECMP Routes. More...
 
open_error_t openapiNumIpv6PrefixesGet (openapiClientHandle_t *client_handle, uint32_t *count)
 Get the number of IPv6 prefixes. More...
 

Detailed Description

Function Documentation

open_error_t openapiGetReportableRouteStats ( openapiClientHandle_t client_handle,
uint64_t *  ipv4Mask,
uint64_t *  ipv6Mask 
)

Get the IPv4/IPv6 reportable route stats masks.

Parameters
[in]client_handleOpEN client handle.
[out]ipv4MaskIPv4 mask
[out]ipv6MaskIPv6 mask
Return values
OPEN_E_NONEOn success OPEN_E_FAIL Otherwise OPEN_E_PARAM Bad parameter (see notes)
Note
Each bit in a mask corresponds to a route protocol index defined by the OPEN_RTO6_ROUTE_TYPE_INDICES_t (IPv6) and OPEN_RTO_PROTOCOL_INDICES_t (IPv4) enums. If stats for a protocol are supported by the implementation, the corresponding bit (1 << <proto>) will be set, where <proto> is a value in one of the above enums. For example, the following code tests if MPLS route stats are supported for IPv6:

if (mask & (1 << OPEN_RTO6_MPLS)) { printf("MPLS route stats are supported\n"); } else { printf("MPLS route stats are not suppoted\n"); }

A field in openRouteStats_t named mask holds the same mask when stats are reported by openapiIpv4RouteTableStatsGet and openapiIpv6RouteTableStatsGet. However, this function can be used to get the masks without querying for statistics.

Passing either ipv4Mask or ipv6Mask as NULL will cause that mask to not be retrieved. Passing both as NULL will result in a OPEN_E_PARAM return.

OpEN API Version: 1.14

open_error_t openapiIpMapDynamicProtoNextGet ( openapiClientHandle_t client_handle,
uint32_t *  protoId 
)

Iterate through the protocols that have been dynamically registered at run time.

Parameters
[in]client_handleOpEN client handle.
[in,out]protoIdProtocol ID. Set to 0 on input to get the first value. Set to previous value on input to get the next value.
Return values
OPEN_E_NONEIf a protocol ID is returned OPEN_E_FAIL If no more dynamic protocols OPEN_E_PARAM Bad parameter

OpEN API Version: 1.14

open_error_t openapiIpMapProtoNameGet ( openapiClientHandle_t client_handle,
uint32_t  protoId,
open_buffdesc protoName 
)

Get the name for a given protocol.

Parameters
[in]client_handleOpEN client handle.
[in]protoIdA protocol ID
[out]protoNameProtocol name. Size must be at least the value obtained by calling openapiIpMapProtoNameLenGet() in bytes.
Return values
OPEN_E_NONEIf protocol name found OPEN_E_PARAM Invalid parameter. OPEN_E_FAIL Otherwise

OpEN API Version: 1.14

open_error_t openapiIpMapProtoNameLenGet ( openapiClientHandle_t client_handle,
uint32_t *  len 
)

Get the max protocol name length.

Parameters
[in]client_handleOpEN client handle.
[out]lenMax len for a protocol name.
Return values
OPEN_E_NONEOn success OPEN_E_PARAM Bad argument OPEN_E_FAIL Otherwise

OpEN API Version: 1.14

open_error_t openapiIpMapProtoRouteTypeNextGet ( openapiClientHandle_t client_handle,
uint32_t  protoId,
uint32_t *  routeType 
)

Iterate through the route types with a given protocol ID.

Parameters
[in]client_handleOpEN client handle.
[in]protoIdprotocol ID
[in,out]routeTyperoute type. Set to 0 on input to get the first value. Set to previous value on input to get the next value.
Return values
OPEN_E_NONEIf a route type returned OPEN_E_NOT_FOUND If there is no protocol with the given protocol ID OPEN_E_FAIL If no more route types for this protocol OPEN_E_PARAM Bad parameter

OpEN API Version: 1.14

open_error_t openapiIpMapRouteTypeNameGet ( openapiClientHandle_t client_handle,
uint32_t  routeType,
open_buffdesc routeTypeName 
)

Get the name for a given route type.

Parameters
[in]client_handleOpEN client handle.
[in]routeTypeA route type
[out]routeTypeNameRoute type name. Size must be at least the value obtained by calling openapiIpMapRouteTypeNameLenGet() in bytes.
Return values
OPEN_E_NONEIf route type name found OPEN_E_PARAM Invalid parameter. OPEN_E_FAIL Otherwise

OpEN API Version: 1.14

open_error_t openapiIpMapRouteTypeNameLenGet ( openapiClientHandle_t client_handle,
uint32_t *  len 
)

Get the max route type name length.

Parameters
[in]client_handleOpEN client handle.
[out]lenMax length for a route type name.
Return values
OPEN_E_NONEOn success OPEN_E_PARAM Bad argument OPEN_E_FAIL Otherwise

OpEN API Version: 1.14

open_error_t openapiIpv4EcmpRouteProtocolCountsGet ( openapiClientHandle_t client_handle,
open_buffdesc vrf,
open_buffdesc counts 
)

Get a table containing ECMP counts for each IPv4 routing protocol.

Parameters
[in]client_handleOpEN client handle
[in]vrfVRF name. Use "" for default.
[out]countsNumber of ECMP routes returned as a vector of openEcmpRouteProtocolCount_t. Use openapiIpv4NumRoutingProtocolsGet() to determine the number of elements to allocate in this buffer. On return, the size field of the buffdesc will contain the number of bytes consumed by the elements that were returned.
Return values
OPEN_E_NONESuccess.
OPEN_E_PARAMInvalid argument.
OPEN_E_FAILFailure occurred.
OPEN_E_INTERNALInternal error occurred.

OpEN API Version: 1.15

open_error_t openapiIpv4NumRoutingProtocolsGet ( openapiClientHandle_t client_handle,
uint32_t *  count 
)

Get the number of IPv4 routing protocols.

Parameters
[in]client_handleOpEN client handle
[out]countNumber of IPv4 routing protocols.
Return values
OPEN_E_NONESuccess.
OPEN_E_PARAMInvalid argument.
OPEN_E_FAILFailure occurred.
Note
Use this function to determine the number of uint32_t sized elements to allocate for the numroutes argument to openapiIpv4RouteTableStatsGet and the counts argument to openapiIpv4EcmpRouteProtocolCountsGet.

OpEN API Version: 1.14

open_error_t openapiIpv4RouteTableStatsGet ( openapiClientHandle_t client_handle,
open_buffdesc vrfName,
OPEN_BOOL_t  bestRoutes,
openRouteStats_t routeStats,
open_buffdesc numRoutes,
open_buffdesc ecmpHisto 
)

Report IPv4 routing table statistics.

Parameters
[in]client_handleOpEN client handle.
[in]vrfNameVRF Name
[in]bestRoutesWhether to report statistics for just best routes or for all routes. Set to OPEN_TRUE to only get best routes and OPEN_FALSE to get all routes.
[out]routeStatsA place to put the stats.
[out]numRoutesContains number of routes for each supported routing protocol.
[out]ecmpHistoContains ECMP next hop histogram.
Return values
OPEN_E_NONESuccess.
OPEN_E_PARAMInvalid argument.
OPEN_E_FAILFailure occurred.

OpEN API Version: 1.14

open_error_t openapiIpv6EcmpRouteProtocolCountsGet ( openapiClientHandle_t client_handle,
open_buffdesc counts 
)

Get a table containing ECMP counts for each IPv6 routing protocol.

Parameters
[in]client_handleOpEN client handle.
[out]countsNumber of ECMP routes returned as a vector of openEcmpRouteProtocolCount_t. Use openapiIpv6NumRoutingProtocolsGet() to determine the number of elements to allocate in this buffer. On return, the size field of the buffdesc will contain the size in bytes consumed by the number of elements that were returned.
Return values
OPEN_E_NONESuccess.
OPEN_E_PARAMInvalid argument.
OPEN_E_FAILFailure occurred.
OPEN_E_UNAVAILFailure occurred.
OPEN_E_INTERNALInternal error occurred.

OpEN API Version: 1.15

open_error_t openapiIpv6NumRoutingProtocolsGet ( openapiClientHandle_t client_handle,
uint32_t *  count 
)

Get the number of IPv6 routing protocols.

Parameters
[in]client_handleOpEN client handle
[out]countNumber of IPv6 routing protocols.
Return values
OPEN_E_NONESuccess.
OPEN_E_PARAMInvalid argument.
OPEN_E_FAILFailure occurred.
Note
Use this function to determine the number of uint32_t sized elements to allocate for the numroutes argument to openapiIpv6RouteTableStatsGet and the counts argument to openapiIpv6EcmpRouteProtocolCountsGet.

OpEN API Version: 1.14

open_error_t openapiIpv6RouteTableStatsGet ( openapiClientHandle_t client_handle,
OPEN_BOOL_t  bestRoutes,
openRouteStats_t routeStats,
open_buffdesc numRoutes,
open_buffdesc ecmpHisto,
open_buffdesc prefixesNo 
)

Report IPv6 routing table statistics.

Parameters
[in]client_handleOpEN client handle.
[in]vrfNameVRF Name
[in]bestRoutesWhether to report statistics for just best routes or for all routes
[out]routeStatsA place to put the stats.
[out]numRoutesContains number of routes for each supported routing protocol.
[out]ecmpHistoContains ECMP next hop histogram.
[out]prefixesNoContains vector of prefix numbers.
Return values
OPEN_E_NONESuccess.
OPEN_E_PARAMInvalid argument.
OPEN_E_FAILFailure occurred.

OpEN API Version: 1.14

open_error_t openapiNumEcmpRoutesGet ( openapiClientHandle_t client_handle,
uint32_t *  count 
)

Get the number of ECMP Routes.

Parameters
[in]client_handleOpEN client handle
[out]countNumber of ECMP routes.
Return values
OPEN_E_NONESuccess.
OPEN_E_PARAMInvalid argument.
OPEN_E_FAILFailure occurred.
Note
Use this function to determine the number of uint32_t sized elements to allocate for the ecmpHist argument to openapiIpv4RouteTableStatsGet or openapiIpv6RouteTableStatsGet.

OpEN API Version: 1.14

open_error_t openapiNumIpv6PrefixesGet ( openapiClientHandle_t client_handle,
uint32_t *  count 
)

Get the number of IPv6 prefixes.

Parameters
[in]client_handleOpEN client handle
[out]countNumber of IPv6 prefixes.
Return values
OPEN_E_NONESuccess.
OPEN_E_PARAMInvalid argument.
OPEN_E_FAILFailure occurred.
Note
Use this function to determine the number of uint32_t sized elements to allocate for the prefixesNo argument to openapiIpv6RouteTableStatsGet.

OpEN API Version: 1.14