Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
openapi_routing_stats.h
Go to the documentation of this file.
1 
9 /*********************************************************************
10 *
11 * Copyright 2016-2018 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_routing_stats.h
28 *
29 * @purpose IPv4 and IPv6 routing statistics.
30 *
31 * @component OPEN
32 *
33 * @create 12/15/2016
34 *
35 * @end
36 *
37 **********************************************************************/
38 #ifndef OPENAPI_ROUTING_STATS_H_INCLUDED
39 #define OPENAPI_ROUTING_STATS_H_INCLUDED
40 
41 #include <stdio.h>
42 #include <stddef.h>
43 #include <sys/un.h>
44 
45 #include "openapi_common.h"
46 #include "openapi_ip_route_table.h"
47 
48 /* Data structure holds results returned by both openapiIpv4RouteTableStatsGet() and openapiIpv6RouteTableStatsGet() */
49 
50 typedef struct openRouteStats_s
51 {
52  uint64_t mask; /*<< defines which stats are reported in numRoutes */
53 
54  uint32_t bestRoutes; /*<< Number of routes installed in the forwarding table */
55  uint32_t bestRoutesHigh; /*<< Number of routes installed in the forwarding table, high */
56 
57  uint32_t altRoutes; /*<< Number of routes in RTO not selected as a best route */
58 
59  uint32_t leakedRoutes; /*<< Number of routes leaked into RTO from other VR. */
60  OPEN_BOOL_t leakedRoutesValid; /*<< If OPEN_FALSE, leakedRoutes not reportable */
61 
62  uint32_t mplsRoutes; /*<< Number of MPLS routes */
63  OPEN_BOOL_t mplsRoutesValid; /*<< If OPEN_FALSE, mplsRoutes not reportable */
64 
65  uint32_t rfc5549Routes; /*<< RFC5549 routes - IPv4 routes with IPv6 nexthop */
66  OPEN_BOOL_t rfc5549RoutesValid; /*<< If OPEN_FALSE, rfc5549Routes not reportable */
67 
68  uint32_t rejectRoutes; /*<< Number of reject routes */
69  OPEN_BOOL_t rejectRoutesValid; /*<< If OPEN_FALSE, rejectRoutes not reportable */
70 
71  uint32_t adds; /*<< Number of route adds */
72  uint32_t mods; /*<< Number of route mods */
73  uint32_t dels; /*<< Number of route deletes */
74 
75  uint32_t invalidAdds; /*<< route is invalid */
76  uint32_t unresAdds; /*<< No next hops resolve to local subnet */
77  uint32_t failedAdds; /*<< resource limitation */
78 
79  uint32_t activeLocals; /*<< Number of local routes */
80 
81  uint32_t resvLocals; /*<< Number of local routes not currently installed but for which RTO has reserved space */
82 
83  uint32_t nextHops; /*<< Number of unique next hops currently used among all routes. */
84  uint32_t nextHopsHigh; /*<< Next hops high water */
85 
86  uint32_t ecmpRoutes; /*<< Current number of ECMP routes. Does not count truncated routes. */
87 
88  uint32_t nextHopGroups; /*<< Current number of ECMP groups. May exceed what hardware can install. */
89  uint32_t nhGroupsHigh; /*<< Next hop ECMP groups high water */
90 
91  uint32_t ecmpGroups; /*<< Number of ECMP groups. An ECMP group is a next hop group with more than 1 next hop. */
92  uint32_t ecmpGroupsHigh; /*<< ECMP group high water */
93 
94  uint32_t ecmpTruncs; /*<< Number of current best routes that failed to be installed in the forwarding table, most likely because the ECMP group table is full. */
95 
96  uint32_t ecmpRetries; /*<< Number of attempts to reinstall ECMP routes in hardware */
97 
98  uint32_t hwFailureRoutes; /*<< Number of routes failed to add into hardware */
99 
100  uint32_t kernelFailedAdds; /*<< Number of kernel routes failed to add */
102 
103 /* Data structure holds results returned by both openapiIpv4EcmpRouteProtocolCountsGet() and openapiIpv6EcmpRouteProtocolCountsGet() */
104 
106 {
107  uint32_t protocol; /*<< @ref OPEN_RTO_PROTOCOL_INDICES_t or @ref OPEN_RTO6_ROUTE_TYPE_INDICES_t depending on ipv4 flag, below*/
108  OPEN_AF_t family; /*<< OPEN_AF_INET or OPEN_AF_INET6 */
109  uint32_t numEcmpRoutes; /*<< Number of ECMP routes */
111 
112 /*****************************************************************/
129 open_error_t openapiNumEcmpRoutesGet(openapiClientHandle_t *client_handle, uint32_t *count);
130 
131 /*****************************************************************/
155 
156 /*****************************************************************/
180 
181 /*****************************************************************/
198 open_error_t openapiNumIpv6PrefixesGet(openapiClientHandle_t *client_handle, uint32_t *count);
199 
200 /*****************************************************************/
219 
220 /*****************************************************************/
239 
240 /*****************************************************************/
262 open_error_t openapiIpv4RouteTableStatsGet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, OPEN_BOOL_t bestRoutes, openRouteStats_t *routeStats, open_buffdesc *numRoutes, open_buffdesc *ecmpHisto);
263 
264 /*****************************************************************/
284 open_error_t openapiIpv6RouteTableStatsGet(openapiClientHandle_t *client_handle, OPEN_BOOL_t bestRoutes, openRouteStats_t *routeStats, open_buffdesc *numRoutes, open_buffdesc *ecmpHisto, open_buffdesc *prefixesNo);
285 
286 /*****************************************************************/
304 open_error_t openapiIpMapProtoRouteTypeNextGet(openapiClientHandle_t *client_handle, uint32_t protoId, uint32_t *routeType);
305 
306 /*****************************************************************/
323 open_error_t openapiIpMapDynamicProtoNextGet(openapiClientHandle_t *client_handle, uint32_t *protoId);
324 
325 /*****************************************************************/
341 open_error_t openapiIpMapProtoNameGet(openapiClientHandle_t *client_handle, uint32_t protoId, open_buffdesc *protoName);
342 
343 /*****************************************************************/
356 open_error_t openapiIpMapProtoNameLenGet(openapiClientHandle_t *client_handle, uint32_t *len);
357 
358 /*****************************************************************/
374 open_error_t openapiIpMapRouteTypeNameGet(openapiClientHandle_t *client_handle, uint32_t routeType, open_buffdesc *routeTypeName);
375 
376 /*****************************************************************/
390 
391 /*****************************************************************/
431 open_error_t openapiGetReportableRouteStats(openapiClientHandle_t *client_handle, uint64_t *ipv4Mask, uint64_t *ipv6Mask);
432 
433 #endif /* OPENAPI_ROUTING_STATS_H_INCLUDED */
434 
open_error_t openapiIpv4NumRoutingProtocolsGet(openapiClientHandle_t *client_handle, uint32_t *count)
Get the number of IPv4 routing protocols.
open_error_t openapiIpMapRouteTypeNameGet(openapiClientHandle_t *client_handle, uint32_t routeType, open_buffdesc *routeTypeName)
Get the name for a given route type.
open_error_t openapiNumEcmpRoutesGet(openapiClientHandle_t *client_handle, uint32_t *count)
Get the number of ECMP Routes.
open_error_t openapiIpv6EcmpRouteProtocolCountsGet(openapiClientHandle_t *client_handle, open_buffdesc *counts)
Get a table containing ECMP counts for each IPv6 routing protocol.
open_error_t openapiNumIpv6PrefixesGet(openapiClientHandle_t *client_handle, uint32_t *count)
Get the number of IPv6 prefixes.
open_error_t openapiIpMapRouteTypeNameLenGet(openapiClientHandle_t *client_handle, uint32_t *len)
Get the max route type name length.
open_error_t openapiIpMapDynamicProtoNextGet(openapiClientHandle_t *client_handle, uint32_t *protoId)
Iterate through the protocols that have been dynamically registered at run time.
open_error_t
OPEN uses these enumerators to indicate the error codes.
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.
OPEN_AF_t
OPEN uses these enumerators to indicate address family, IPV4 or IPV6.
open_error_t openapiIpv6NumRoutingProtocolsGet(openapiClientHandle_t *client_handle, uint32_t *count)
Get the number of IPv6 routing protocols.
open_error_t openapiIpMapProtoNameLenGet(openapiClientHandle_t *client_handle, uint32_t *len)
Get the max protocol name length.
OPEN_BOOL_t
OPEN uses these enumerators to indicate true or false for a given config or status parameter...
open_error_t openapiIpMapProtoNameGet(openapiClientHandle_t *client_handle, uint32_t protoId, open_buffdesc *protoName)
Get the name for a given protocol.
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.
open_error_t openapiIpMapProtoRouteTypeNextGet(openapiClientHandle_t *client_handle, uint32_t protoId, uint32_t *routeType)
Iterate through the route types with a given protocol ID.
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.
open_error_t openapiGetReportableRouteStats(openapiClientHandle_t *client_handle, uint64_t *ipv4Mask, uint64_t *ipv6Mask)
Get the IPv4/IPv6 reportable route stats masks.