Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
openapi_dot1cb.h
Go to the documentation of this file.
1 
9 /**********************************************************************
10 *
11 * Copyright 2019 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_dot1cb.h
28 *
29 * @purpose This code implements the OpEN Dot1cb API
30 *
31 * @component OPEN
32 *
33 * @create 05/29/2019
34 *
35 * @end
36 *
37 *********************************************************************/
38 #ifndef OPENAPI_DOT1CB_H_INCLUDED
39 #define OPENAPI_DOT1CB_H_INCLUDED
40 
41 #include "openapi_common.h"
42 
43 #define OPEN_MAX_DOT1CB_VLANS 16
44 #define OPEN_MAX_DOT1CB_IPV4 512
45 #define OPEN_MAX_DOT1CB_IPV6 512
46 #define OPEN_MIN_DOT1CB_INITIATOR_FLOWS 1
47 #define OPEN_MAX_DOT1CB_INITIATOR_FLOWS 1024
48 #define OPEN_MIN_DOT1CB_TRANSIT_FLOWS 1
49 #define OPEN_MAX_DOT1CB_TRANSIT_FLOWS 1024
50 #define OPEN_MFDB_MAX_MAC_ENTRIES 1024
52 #define OPEN_DOT1CB_IPV4_PREFIX_LEN 32
53 #define OPEN_DOT1CB_IPV6_PREFIX_LEN 128
54 
55 /* 802.1CB flow types */
56 typedef enum
57 {
62 
63 /* 802.1CB global statistics. These counters are aggregated
64  across all VLANs enabled in the 802.1CB mode.
65 */
66 typedef struct
67 {
68  uint64_t arp_to_cpu;
69  uint64_t bcast_to_cpu;
70  uint64_t mcast_to_cpu;
71  uint64_t ucast_dropped;
73 
74 /* 802.1CB statistics on physical ports enabled for R-Tag mode */
75 typedef struct
76 {
77  uint64_t rtag_packets_rx;
79  uint64_t rtag_packets_dups;
80  uint64_t rtag_packets_tx;
82 
83 /*************************************************************************/
102  uint32_t vlanID, OPEN_CONTROL_t *mode);
103 
104 /*************************************************************************/
123  uint32_t vlanID, OPEN_CONTROL_t mode);
124 
125 /*************************************************************************/
144  uint32_t vlanID, OPEN_CONTROL_t *mode);
145 
146 /*************************************************************************/
165  uint32_t vlanID, OPEN_CONTROL_t mode);
166 
167 /*************************************************************************/
192  open_buffdesc *buf, uint32_t vlanID,
193  uint32_t *flowId);
194 
195 /*************************************************************************/
220  open_buffdesc *buf, uint32_t vlanID,
221  OPEN_DOT1CB_FLOW_TYPE_t *flowType);
222 
223 /*************************************************************************/
249  open_buffdesc *buf, uint32_t vlanID,
250  OPEN_DOT1CB_FLOW_TYPE_t flowType, uint32_t flowId);
251 
252 /*************************************************************************/
269  uint32_t ifNum, OPEN_CONTROL_t *mode);
270 
271 /*************************************************************************/
288  uint32_t ifNum, OPEN_CONTROL_t mode);
289 
290 /*************************************************************************/
305 
306 /*************************************************************************/
324 
325 /*************************************************************************/
344  uint32_t ifNum, OPEN_DOT1CB_INTF_STATS_t *stat);
345 
346 /*************************************************************************/
364  uint32_t ifNum, uint32_t *nextIfNum);
365 
366 /*************************************************************************/
389  open_inet_addr_t *srcAddr, uint32_t srcMaskLen,
390  open_inet_addr_t *dstAddr, uint32_t dstMaskLen,
391  OPEN_DOT1CB_FLOW_TYPE_t flowType, uint32_t flowId);
392 
393 /*************************************************************************/
412  open_inet_addr_t *srcAddr, uint32_t srcMaskLen,
413  open_inet_addr_t *dstAddr, uint32_t dstMaskLen);
414 
415 /*************************************************************************/
436  open_inet_addr_t *srcAddr, uint32_t srcMaskLen,
437  open_inet_addr_t *dstAddr, uint32_t dstMaskLen,
438  OPEN_DOT1CB_FLOW_TYPE_t *flowType, uint32_t *flowId);
439 
440 /*************************************************************************/
461  open_inet_addr_t *srcAddr, uint32_t *srcMaskLen,
462  open_inet_addr_t *dstAddr, uint32_t *dstMaskLen,
463  OPEN_DOT1CB_FLOW_TYPE_t *flowType, uint32_t *flowId);
464 
465 /*************************************************************************/
480  uint32_t *value);
481 
482 /*************************************************************************/
497  uint32_t *value);
498 
499 /*************************************************************************/
523  open_in6_addr_t *srcAddr, uint32_t srcMaskLen,
524  open_in6_addr_t *dstAddr, uint32_t dstMaskLen,
525  OPEN_DOT1CB_FLOW_TYPE_t flowType, uint32_t flowId);
526 
527 /*************************************************************************/
547  open_in6_addr_t *srcAddr, uint32_t srcMaskLen,
548  open_in6_addr_t *dstAddr, uint32_t dstMaskLen);
549 
550 /*************************************************************************/
572  open_in6_addr_t *srcAddr, uint32_t srcMaskLen,
573  open_in6_addr_t *dstAddr, uint32_t dstMaskLen,
574  OPEN_DOT1CB_FLOW_TYPE_t *flowType, uint32_t *flowId);
575 
576 /*************************************************************************/
598  open_in6_addr_t *srcAddr, uint32_t *srcMaskLen,
599  open_in6_addr_t *dstAddr, uint32_t *dstMaskLen,
600  OPEN_DOT1CB_FLOW_TYPE_t *flowType, uint32_t *flowId);
601 
602 /*************************************************************************/
618  uint32_t *value);
619 
620 /*************************************************************************/
636  uint32_t *value);
637 
638 /*************************************************************************/
653  uint32_t *value);
654 
655 /*************************************************************************/
670  uint32_t *value);
671 
672 /*************************************************************************/
687  uint32_t *value);
688 
689 /*************************************************************************/
704  uint32_t *value);
705 
706 /*************************************************************************/
723  uint32_t *vid);
724 
725 /*************************************************************************/
744  uint32_t flowId, uint32_t *classifiers,
745  uint32_t *nextTxSequence, uint64_t *txPackets);
746 
747 /*************************************************************************/
766  uint32_t *flowId, uint32_t *classifiers,
767  uint32_t *nextTxSequence, uint64_t *txPackets);
768 
769 /*************************************************************************/
790  uint32_t flowId, uint32_t *classifiers,
791  uint32_t *lastRxSequence, uint64_t *matchingPackets,
792  uint64_t *acceptedPackets, uint64_t *duplicatePackets);
793 
794 /*************************************************************************/
815  uint32_t *flowId, uint32_t *classifiers,
816  uint32_t *lastRxSequence, uint64_t *matchingPackets,
817  uint64_t *acceptedPackets, uint64_t *duplicatePackets);
818 
819 /*************************************************************************/
838  uint32_t flowId, uint32_t *historyWindow,
839  uint32_t *acceptanceWindow, uint32_t *ageTime);
840 
841 /*************************************************************************/
858  uint32_t flowId, uint32_t historyWindow);
859 
860 /*************************************************************************/
877  uint32_t flowId, uint32_t acceptanceWindow);
878 
879 /*************************************************************************/
896  uint32_t flowId, uint32_t ageTime);
897 
898 /*************************************************************************/
913 
914 /*************************************************************************/
930 
931 #endif /* OPENAPI_DOT1CB_H_INCLUDED */
932 
OPEN_DOT1CB_FLOW_TYPE_t
open_error_t openapiDot1cbRtagModeSet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_CONTROL_t mode)
Set the 802.1CB RTAG mode for the specified interface.
uint64_t arp_to_cpu
number of ARP requests and replies sent to CPU
open_error_t openapiFilterFlowTypeIdSet(openapiClientHandle_t *client_handle, open_buffdesc *buf, uint32_t vlanID, OPEN_DOT1CB_FLOW_TYPE_t flowType, uint32_t flowId)
Set the flow type and ID of an existing macfilter.
open_error_t openapiDot1cbIntfStatsGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DOT1CB_INTF_STATS_t *stat)
Get the 802.1CB statistics for the specified interface.
open_error_t openapiDot1cbModeSet(openapiClientHandle_t *client_handle, uint32_t vlanID, OPEN_CONTROL_t mode)
Set the 802.1CB mode for a given VLAN.
uint64_t bcast_to_cpu
number of broadcast packets sent to CPU
open_error_t openapiDot1cbIpv4ClassifierAdd(openapiClientHandle_t *client_handle, open_inet_addr_t *srcAddr, uint32_t srcMaskLen, open_inet_addr_t *dstAddr, uint32_t dstMaskLen, OPEN_DOT1CB_FLOW_TYPE_t flowType, uint32_t flowId)
Add an IPv4 classifier.
open_error_t openapiDot1cbIpv6ClassifierAdd(openapiClientHandle_t *client_handle, open_in6_addr_t *srcAddr, uint32_t srcMaskLen, open_in6_addr_t *dstAddr, uint32_t dstMaskLen, OPEN_DOT1CB_FLOW_TYPE_t flowType, uint32_t flowId)
Add an IPv6 classifier.
open_error_t
OPEN uses these enumerators to indicate the error codes.
open_error_t openapiDot1cbApiTransitFlowAcceptanceWindowSizeSet(openapiClientHandle_t *client_handle, uint32_t flowId, uint32_t acceptanceWindow)
Set the acceptance window size for an 802.1CB transit flow.
open_error_t openapiDot1cbApiInitFlowGet(openapiClientHandle_t *client_handle, uint32_t flowId, uint32_t *classifiers, uint32_t *nextTxSequence, uint64_t *txPackets)
Get the 802.1CB initiator flow and its status/statistics.
open_error_t openapiDot1cbIpv6ClassifierInHardwareGet(openapiClientHandle_t *client_handle, uint32_t *value)
Get the status flag indicating whether IPv6 classifiers are installed in the hardware.
open_error_t openapiDot1cbIpv6ClassifierNextGet(openapiClientHandle_t *client_handle, open_in6_addr_t *srcAddr, uint32_t *srcMaskLen, open_in6_addr_t *dstAddr, uint32_t *dstMaskLen, OPEN_DOT1CB_FLOW_TYPE_t *flowType, uint32_t *flowId)
Get the next IPv6 classifier.
open_error_t openapiDot1cbApiInitFlowNextGet(openapiClientHandle_t *client_handle, uint32_t *flowId, uint32_t *classifiers, uint32_t *nextTxSequence, uint64_t *txPackets)
Get the next 802.1CB initiator flow and its status/statistics.
uint64_t rtag_packets_dups
number of duplicate R-Tagged packets dropped
open_error_t openapiFilterFlowIdGet(openapiClientHandle_t *client_handle, open_buffdesc *buf, uint32_t vlanID, uint32_t *flowId)
Get the configured flow ID.
open_error_t openapiDot1cbGlobalStatsGet(openapiClientHandle_t *client_handle, OPEN_DOT1CB_GLOBAL_STATS_t *stat)
Get the 802.1CB global statistics.
uint64_t rtag_packets_tx
number of transmitted R-Tagged packets
open_error_t openapiDot1cbIpv4ClassifierGet(openapiClientHandle_t *client_handle, open_inet_addr_t *srcAddr, uint32_t srcMaskLen, open_inet_addr_t *dstAddr, uint32_t dstMaskLen, OPEN_DOT1CB_FLOW_TYPE_t *flowType, uint32_t *flowId)
Get an IPv4 classifier.
open_error_t openapiDot1cbIpv6ClassifierCountGet(openapiClientHandle_t *client_handle, uint32_t *value)
Get the number of configured IPv6 classifiers.
open_error_t openapiDot1cbIpv4ClassifierInHardwareGet(openapiClientHandle_t *client_handle, uint32_t *value)
Get the status flag indicating whether IPv4 classifiers are installed in the hardware.
open_error_t openapiDot1cbIpv4ClassifierNextGet(openapiClientHandle_t *client_handle, open_inet_addr_t *srcAddr, uint32_t *srcMaskLen, open_inet_addr_t *dstAddr, uint32_t *dstMaskLen, OPEN_DOT1CB_FLOW_TYPE_t *flowType, uint32_t *flowId)
Get the next IPv4 classifier.
OPEN_CONTROL_t
OPEN uses these enumerators to indicate enable or disable for a given config or status parameter...
open_error_t openapiDot1cbIpv4ClassifierDelete(openapiClientHandle_t *client_handle, open_inet_addr_t *srcAddr, uint32_t srcMaskLen, open_inet_addr_t *dstAddr, uint32_t dstMaskLen)
Delete an IPv4 classifier.
open_error_t openapiDot1cbNumActiveInititatorFlowsGet(openapiClientHandle_t *client_handle, uint32_t *value)
Get the number of initiator flows installed in the hardware.
uint64_t ucast_dropped
number of unicast packets dropped
open_error_t openapiFilterFlowTypeGet(openapiClientHandle_t *client_handle, open_buffdesc *buf, uint32_t vlanID, OPEN_DOT1CB_FLOW_TYPE_t *flowType)
Get the configured flow type.
uint64_t rtag_packets_rx
number of received R-Tagged packets
open_error_t openapiDot1cbApiTransitFlowGet(openapiClientHandle_t *client_handle, uint32_t flowId, uint32_t *classifiers, uint32_t *lastRxSequence, uint64_t *matchingPackets, uint64_t *acceptedPackets, uint64_t *duplicatePackets)
Get the 802.1CB transit flow and its status/statistics.
open_error_t openapiDot1cbForwardArpNdpModeSet(openapiClientHandle_t *client_handle, uint32_t vlanID, OPEN_CONTROL_t mode)
Set the 802.1CB ARP/NDP forwarding mode for a given VLAN.
open_error_t openapiDot1cbModeGet(openapiClientHandle_t *client_handle, uint32_t vlanID, OPEN_CONTROL_t *mode)
Get the 802.1CB mode for a given VLAN.
open_error_t openapiDot1cbForwardArpNdpModeGet(openapiClientHandle_t *client_handle, uint32_t vlanID, OPEN_CONTROL_t *mode)
Get the 802.1CB ARP/NDP forwarding mode for a given VLAN.
open_error_t openapiDot1cbNumActiveTransitFlowsGet(openapiClientHandle_t *client_handle, uint32_t *value)
Get the number of transit flows installed in the hardware.
open_error_t openapiDot1cbSaModeGet(openapiClientHandle_t *client_handle, OPEN_CONTROL_t *mode)
Get the SA-MAC/VLAN flow association mode.
open_error_t openapiDot1cbApiDot1cbEnabledVlanNextGet(openapiClientHandle_t *client_handle, uint32_t *vid)
Get the next 802.1CB enabled VLAN.
open_error_t openapiDot1cbSaModeSet(openapiClientHandle_t *client_handle, OPEN_CONTROL_t mode)
Set the SA-MAC/VLAN flow association mode.
open_error_t openapiDot1cbApiTransitFlowAgeTimeSet(openapiClientHandle_t *client_handle, uint32_t flowId, uint32_t ageTime)
Set the age time for an 802.1CB transit flow.
open_error_t openapiDot1cbApiTransitFlowNextGet(openapiClientHandle_t *client_handle, uint32_t *flowId, uint32_t *classifiers, uint32_t *lastRxSequence, uint64_t *matchingPackets, uint64_t *acceptedPackets, uint64_t *duplicatePackets)
Get the next 802.1CB transit flow and its status/statistics.
open_error_t openapiDot1cbNumMfdbClassifiersGet(openapiClientHandle_t *client_handle, uint32_t *value)
Get the number of MFDB entries associated with flows.
uint64_t rtag_packets_accepted
number of received R-Tagged packets not dropped
uint64_t mcast_to_cpu
number of multicast packets sent to CPU
open_error_t openapiDot1cbIpv6ClassifierGet(openapiClientHandle_t *client_handle, open_in6_addr_t *srcAddr, uint32_t srcMaskLen, open_in6_addr_t *dstAddr, uint32_t dstMaskLen, OPEN_DOT1CB_FLOW_TYPE_t *flowType, uint32_t *flowId)
Get an IPv6 classifier.
open_error_t openapiDot1cbIpv4ClassifierCountGet(openapiClientHandle_t *client_handle, uint32_t *value)
Get the number of configured IPv4 classifiers.
open_error_t openapiDot1cbApiTransitFlowHistoryWindowSizeSet(openapiClientHandle_t *client_handle, uint32_t flowId, uint32_t historyWindow)
Set the history window size for an 802.1CB transit flow.
open_error_t openapiDot1cbApiNumDot1cbVlansGet(openapiClientHandle_t *client_handle, uint32_t *value)
Get the number of 802.1CB enabled VLANs.
open_error_t openapiDot1cbApiTransitFlowConfigGet(openapiClientHandle_t *client_handle, uint32_t flowId, uint32_t *historyWindow, uint32_t *acceptanceWindow, uint32_t *ageTime)
Get the 802.1CB transit flow configuration.
open_error_t openapiDot1cbRtagModeGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_CONTROL_t *mode)
Get the 802.1CB RTAG mode for the specified interface.
open_error_t openapiDot1cbIntfNextGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *nextIfNum)
Get the next valid 802.1CB interface.
open_error_t openapiDot1cbIpv6ClassifierDelete(openapiClientHandle_t *client_handle, open_in6_addr_t *srcAddr, uint32_t srcMaskLen, open_in6_addr_t *dstAddr, uint32_t dstMaskLen)
Delete an IPv6 classifier.
Hash Mode names.
open_error_t openapiDot1cbStatsClear(openapiClientHandle_t *client_handle)
Clear all the 802.1CB statistics.