Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.11.1.2
openapi_dot1cb.h
Go to the documentation of this file.
1 
9 /**********************************************************************
10 *
11 * Copyright 2019-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_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 /*************************************************************************/
190  open_buffdesc *macAddr, uint32_t vlanID,
191  uint32_t *flowId);
192 
193 /*************************************************************************/
216  open_buffdesc *macAddr, uint32_t vlanID,
217  OPEN_DOT1CB_FLOW_TYPE_t *flowType);
218 
219 /*************************************************************************/
243  open_buffdesc *macAddr, uint32_t vlanID,
244  OPEN_DOT1CB_FLOW_TYPE_t flowType, uint32_t flowId);
245 
246 /*************************************************************************/
263  uint32_t ifNum, OPEN_CONTROL_t *mode);
264 
265 /*************************************************************************/
282  uint32_t ifNum, OPEN_CONTROL_t mode);
283 
284 /*************************************************************************/
299 
300 /*************************************************************************/
318 
319 /*************************************************************************/
338  uint32_t ifNum, OPEN_DOT1CB_INTF_STATS_t *stat);
339 
340 /*************************************************************************/
358  uint32_t ifNum, uint32_t *nextIfNum);
359 
360 /*************************************************************************/
383  open_inet_addr_t *srcAddr, uint32_t srcMaskLen,
384  open_inet_addr_t *dstAddr, uint32_t dstMaskLen,
385  OPEN_DOT1CB_FLOW_TYPE_t flowType, uint32_t flowId);
386 
387 /*************************************************************************/
406  open_inet_addr_t *srcAddr, uint32_t srcMaskLen,
407  open_inet_addr_t *dstAddr, uint32_t dstMaskLen);
408 
409 /*************************************************************************/
430  open_inet_addr_t *srcAddr, uint32_t srcMaskLen,
431  open_inet_addr_t *dstAddr, uint32_t dstMaskLen,
432  OPEN_DOT1CB_FLOW_TYPE_t *flowType, uint32_t *flowId);
433 
434 /*************************************************************************/
455  open_inet_addr_t *srcAddr, uint32_t *srcMaskLen,
456  open_inet_addr_t *dstAddr, uint32_t *dstMaskLen,
457  OPEN_DOT1CB_FLOW_TYPE_t *flowType, uint32_t *flowId);
458 
459 /*************************************************************************/
474  uint32_t *value);
475 
476 /*************************************************************************/
491  uint32_t *value);
492 
493 /*************************************************************************/
517  open_in6_addr_t *srcAddr, uint32_t srcMaskLen,
518  open_in6_addr_t *dstAddr, uint32_t dstMaskLen,
519  OPEN_DOT1CB_FLOW_TYPE_t flowType, uint32_t flowId);
520 
521 /*************************************************************************/
541  open_in6_addr_t *srcAddr, uint32_t srcMaskLen,
542  open_in6_addr_t *dstAddr, uint32_t dstMaskLen);
543 
544 /*************************************************************************/
566  open_in6_addr_t *srcAddr, uint32_t srcMaskLen,
567  open_in6_addr_t *dstAddr, uint32_t dstMaskLen,
568  OPEN_DOT1CB_FLOW_TYPE_t *flowType, uint32_t *flowId);
569 
570 /*************************************************************************/
592  open_in6_addr_t *srcAddr, uint32_t *srcMaskLen,
593  open_in6_addr_t *dstAddr, uint32_t *dstMaskLen,
594  OPEN_DOT1CB_FLOW_TYPE_t *flowType, uint32_t *flowId);
595 
596 /*************************************************************************/
612  uint32_t *value);
613 
614 /*************************************************************************/
630  uint32_t *value);
631 
632 /*************************************************************************/
647  uint32_t *value);
648 
649 /*************************************************************************/
664  uint32_t *value);
665 
666 /*************************************************************************/
681  uint32_t *value);
682 
683 /*************************************************************************/
698  uint32_t *value);
699 
700 /*************************************************************************/
717  uint32_t *vid);
718 
719 /*************************************************************************/
738  uint32_t flowId, uint32_t *classifiers,
739  uint32_t *nextTxSequence, uint64_t *txPackets);
740 
741 /*************************************************************************/
760  uint32_t *flowId, uint32_t *classifiers,
761  uint32_t *nextTxSequence, uint64_t *txPackets);
762 
763 /*************************************************************************/
784  uint32_t flowId, uint32_t *classifiers,
785  uint32_t *lastRxSequence, uint64_t *matchingPackets,
786  uint64_t *acceptedPackets, uint64_t *duplicatePackets);
787 
788 /*************************************************************************/
809  uint32_t *flowId, uint32_t *classifiers,
810  uint32_t *lastRxSequence, uint64_t *matchingPackets,
811  uint64_t *acceptedPackets, uint64_t *duplicatePackets);
812 
813 /*************************************************************************/
832  uint32_t flowId, uint32_t *historyWindow,
833  uint32_t *acceptanceWindow, uint32_t *ageTime);
834 
835 /*************************************************************************/
852  uint32_t flowId, uint32_t historyWindow);
853 
854 /*************************************************************************/
871  uint32_t flowId, uint32_t acceptanceWindow);
872 
873 /*************************************************************************/
890  uint32_t flowId, uint32_t ageTime);
891 
892 /*************************************************************************/
907 
908 /*************************************************************************/
924 
925 #endif /* OPENAPI_DOT1CB_H_INCLUDED */
926 
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 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.
open_error_t openapiFilterFlowTypeGet(openapiClientHandle_t *client_handle, open_buffdesc *macAddr, uint32_t vlanID, OPEN_DOT1CB_FLOW_TYPE_t *flowType)
Get the configured flow type.
uint64_t rtag_packets_dups
number of duplicate R-Tagged packets dropped
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_error_t openapiFilterFlowTypeIdSet(openapiClientHandle_t *client_handle, open_buffdesc *macAddr, uint32_t vlanID, OPEN_DOT1CB_FLOW_TYPE_t flowType, uint32_t flowId)
Set the flow type and ID of an existing macfilter.
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
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 openapiFilterFlowIdGet(openapiClientHandle_t *client_handle, open_buffdesc *macAddr, uint32_t vlanID, uint32_t *flowId)
Get the configured flow ID.
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.