28 #ifndef INCLUDE_PACKET_TRACE_H
29 #define INCLUDE_PACKET_TRACE_H
36 #include "broadview.h"
39 #include "port_utils.h"
41 #define BVIEW_PT_MAX_PACKET_SIZE 1558
44 #define BVIEW_PT_MAX_WC 3
45 #define BVIEW_PT_MIN_PROTOCOL 0
46 #define BVIEW_PT_MAX_PROTOCOL 144
48 #define BVIEW_PT_MIN_SRC_PORT 0
49 #define BVIEW_PT_MAX_SRC_PORT 65535
51 #define BVIEW_PT_MIN_DST_PORT 0
52 #define BVIEW_PT_MAX_DST_PORT 65535
54 #define BVIEW_PT_MIN_PACKET_LIMIT 1
55 #define BVIEW_PT_MAX_PACKET_LIMIT 10
62 unsigned char data[BVIEW_PT_MAX_PACKET_SIZE];
68 typedef enum _pt_drop_reason_type_
70 BVIEW_PT_VLAN_XLATE_MISS_DROP,
72 BVIEW_PT_PROTOCOL_PKT_DROP,
74 BVIEW_PT_SRC_ROUTE_DROP,
75 BVIEW_PT_L2_SRC_DISCARD_DROP,
76 BVIEW_PT_L2SRC_STATIC_MOVE_DROP,
77 BVIEW_PT_L2DST_DISCARD_DROP,
78 BVIEW_PT_CFI_OR_L3DISABLE_DROP,
79 BVIEW_PT_HIGIG_MH_TYPE1_DROP,
80 BVIEW_PT_DISC_STAGE_DROP,
81 BVIEW_PT_SW1_INVALID_VLAN_DROP,
82 BVIEW_PT_HIGIG_HDR_ERROR_DROP,
83 BVIEW_PT_LAG_FAILOVER_DROP,
86 BVIEW_PT_VLAN_CC_OR_PBT_DROP,
87 BVIEW_PT_CLASS_BASED_SM_DROP,
88 BVIEW_PT_MPLS_STAGE_DROP,
89 BVIEW_PT_TIME_SYNC_PKT_DROP,
90 BVIEW_PT_MY_STATION_DROP,
91 BVIEW_PT_BAD_UDP_CHECKSUM_DROP,
92 BVIEW_PT_NIV_FORWARDING_DROP,
93 BVIEW_PT_NIV_RPF_CHECK_FAIL_DROP,
94 BVIEW_PT_PVLAN_VP_EFILTER_DROP,
95 BVIEW_PT_TRILL_HEADER_VERSION_NONZERO_DROP,
96 BVIEW_PT_TRILL_ADJACENCY_CHECK_FAIL_DROP,
97 BVIEW_PT_TRILL_RBRIDGE_LOOKUP_MISS_DROP,
98 BVIEW_PT_TRILL_UC_HDR_MC_MACDA_DROP,
99 BVIEW_PT_TRILL_SLOWPATH_DROP,
100 BVIEW_PT_CORE_IS_IS_PKT_DROP,
101 BVIEW_PT_TRILL_RPF_CHECK_FAIL_DROP,
102 BVIEW_PT_TRILL_PKT_WITH_SNAP_ENCAP_DROP,
103 BVIEW_PT_TRILL_ING_RBRIDGE_EQ_EGR_RBRIDGE_DROP,
104 BVIEW_PT_TRILL_HOPCOUNT_CHECK_FAIL_DROP,
105 BVIEW_PT_BFD_TERMINATED_DROP,
106 BVIEW_PT_L3DST_DISCARD_DROP,
107 BVIEW_PT_TUNNEL_DECAP_ECN_DROP,
108 BVIEW_PT_L3_PKT_RESOURCE_DROP,
109 BVIEW_PT_IPV4_HEADER_ERROR_DROP,
110 BVIEW_PT_L3_IPV6_PKT_RESOURCE_DROP,
111 BVIEW_PT_IPV6_HEADER_ERROR_DROP,
112 BVIEW_PT_INGRESS_PORT_FWD_STATE_DROP,
113 BVIEW_PT_FIELD_PROCESSOR_DROP,
114 BVIEW_PT_MULTICAST_DROP,
115 BVIEW_PT_BITMAP_ZERO_DROP,
116 BVIEW_PT_POLICY_DROP,
117 BVIEW_PT_DOS_L4_HEADER_ERROR_DROP,
118 BVIEW_PT_MTU_ERROR_DROP,
119 BVIEW_PT_RECV_TUNNELED_PKT_ERROR_DROP,
120 BVIEW_PT_VLAN_ERROR_DROP,
121 BVIEW_PT_HIGIG_HEADER_ERROR_DROP,
122 BVIEW_PT_MC_IPMC_INDEX_ERROR_DROP,
123 BVIEW_PT_PARITY_ERROR_DROP,
124 BVIEW_PT_REVERSE_RPF_ERROR_DROP,
125 BVIEW_PT_DST_DISCARD_BIT_ERROR_DROP,
126 BVIEW_PT_ECMP_CALCULATION_ERROR_DROP,
127 BVIEW_PT_MPLS_SEQ_NUM_ERROR_DROP,
128 BVIEW_PT_FIELD_PROCESSOR_REDIRECT_ERROR_DROP,
129 BVIEW_PT_INVALID_L2MC_ENTRY_DROP,
130 BVIEW_PT_NEXTHOP_ZERO_DROP,
132 BVIEW_PT_MAX_DROP_REASON
133 } BVIEW_PT_DROP_REASON_TYPE_t;
141 } data[BVIEW_PT_MAX_DROP_REASON][BVIEW_ASIC_MAX_PORTS];
149 BVIEW_PT_DROP_REASON_TYPE_t dropReason;
155 typedef BVIEW_STATUS(*BVIEW_PT_TRIGGER_CALLBACK_t) (
int asic,
162 BVIEW_MASK_BASE_UNIT value[BVIEW_MASK_SIZE(BVIEW_PT_MAX_DROP_REASON)];
171 BVIEW_PORT_MASK_t pbmp;
173 bool sendDropedPacket;
186 typedef enum _bview_pt_hashing_info_mask_
188 BVIEW_PT_NO_HASHING_RESOLUTION = 1<<0,
190 BVIEW_PT_ECMP_1_RESOLUTION = 1<<1,
192 BVIEW_PT_ECMP_2_RESOLUTION = 1<<2,
194 BVIEW_PT_TRUNK_RESOLUTION = 1<<3,
196 BVIEW_PT_FABRIC_TRUNK_RESOLUTION = 1<<4,
198 BVIEW_PT_DGPP_RESOLUTION = 1 <<5
199 } BVIEW_PT_HASHING_INFO_MASK_t;
202 #define BVIEW_MAX_TRUNK_MEMBERS 8
207 int trunk_members[BVIEW_MAX_TRUNK_MEMBERS];
209 int fabric_trunk_member;
210 int fabric_trunk_members[BVIEW_MAX_TRUNK_MEMBERS];
213 #define BVIEW_ECMP_MAX_MEMBERS 8
229 #define PKT_TRACE_ECMP_1_INDEX 0
230 #define PKT_TRACE_ECMP_2_INDEX 1
231 #define BVIEW_ECMP_MAX_LEVEL 2
237 BVIEW_PT_HASHING_INFO_MASK_t flags;
244 typedef enum _pt_resolution_type_t
246 BVIEW_PT_RESOLUTIONUNKOWN = 0,
247 BVIEW_PT_RESOLUTIONCONTROLPKT = 1,
248 BVIEW_PT_RESOLUTIONOAMPKT = 2,
249 BVIEW_PT_RESOLUTIONBFDPKT = 3,
250 BVIEW_PT_RESOLUTIONBPDUPKT = 4,
251 BVIEW_PT_RESOLUTION1588PKT = 6,
252 BVIEW_PT_RESOLUTIONKNOWNL2UCPKT = 8,
253 BVIEW_PT_RESOLUTIONUNKNOWNL2UCPKT = 9,
254 BVIEW_PT_RESOLUTIONKNOWNL2MCPKT = 10,
255 BVIEW_PT_RESOLUTIONUNKNOWNL2MCPKT = 11,
256 BVIEW_PT_RESOLUTIONL2BCPKT = 12,
257 BVIEW_PT_RESOLUTIONKNOWNL3UCPKT = 16,
258 BVIEW_PT_RESOLUTIONUNKNOWNL3UCPKT = 17,
259 BVIEW_PT_RESOLUTIONKNOWNIPMCPKT = 18,
260 BVIEW_PT_RESOLUTIONUNKNOWNIPMCPKT = 19,
261 BVIEW_PT_RESOLUTIONKNOWNMPLSL2PKT = 24,
262 BVIEW_PT_RESOLUTIONUNKNOWNMPLSPKT = 25,
263 BVIEW_PT_RESOLUTIONKNOWNMPLSL3PKT = 26,
264 BVIEW_PT_RESOLUTIONKNOWNMPLSPKT = 28,
265 BVIEW_PT_RESOLUTIONKNOWNMIMPKT = 32,
266 BVIEW_PT_RESOLUTIONUNKNOWNMIMPKT = 33,
267 BVIEW_PT_RESOLUTIONKNOWNTRILLPKT = 40,
268 BVIEW_PT_RESOLUTIONUNKNOWNTRILLPKT = 41,
269 BVIEW_PT_RESOLUTIONKNOWNNIVPKT = 48,
270 BVIEW_PT_RESOLUTIONUNKNOWNNIVPKT = 49,
271 BVIEW_PT_RESOLUTIONKNOWNL2GREPKT = 50,
272 BVIEW_PT_RESOLUTIONKNOWNVXLANPKT = 51,
273 BVIEW_PT_RESOLUTIONCOUNT = 52
274 } BVIEW_PT_RESOULTION_t;
277 typedef enum _pt_lookup_result_type_
279 BVIEW_PT_LOOKUPINVALID = 0,
280 BVIEW_PT_LOOKUPFIRSTVLANTRANSLATIONHIT = 1,
281 BVIEW_PT_LOOKUPSECONDVLANTRANSLATIONHIT = 2,
282 BVIEW_PT_LOOKUPFORWARDINGVLANVALID = 3,
283 BVIEW_PT_LOOKUPL2SRCHIT = 6,
284 BVIEW_PT_LOOKUPL2SRCSTATIC = 7,
285 BVIEW_PT_LOOKUPL2DSTHIT = 8,
286 BVIEW_PT_LOOKUPL2CACHEHIT = 9,
287 BVIEW_PT_LOOKUPL3SRCHOSTHIT = 10,
288 BVIEW_PT_LOOKUPL3DESTHOSTHIT = 11,
289 BVIEW_PT_LOOKUPL3DESTROUTEHIT = 12,
290 BVIEW_PT_LOOKUPL2SRCMISS = 13,
291 BVIEW_PT_LOOKUPDOSATTACK = 14,
292 BVIEW_PT_LOOKUPIPTUNNELHIT = 15,
293 BVIEW_PT_LOOKUPMPLSLABEL1HIT = 16,
294 BVIEW_PT_LOOKUPMPLSLABEL2HIT = 17,
295 BVIEW_PT_LOOKUPMPLSTERMINATED = 18,
296 BVIEW_PT_LOOKUPMYSTATIONHIT = 19,
297 BVIEW_PT_LOOKUPCOUNT = 20
298 } BVIEW_PT_LOOKUP_RESULT_TYPE_t;
304 BVIEW_MASK_BASE_UNIT value[BVIEW_MASK_SIZE(BVIEW_PT_LOOKUPCOUNT)];
308 typedef enum _stp_state_
314 } BVIEW_PT_STP_STATE_t;
326 BVIEW_PT_RESOULTION_t packetResolution;
330 BVIEW_PT_STP_STATE_t stpState;
332 BVIEW_PORT_MASK_t destPortMask;
337 typedef enum _pt_config_tuple_mask_ {
338 PT_CONFIG_TUPLE_SRC_IP = (1 << 0),
339 PT_CONFIG_TUPLE_DST_IP = (1 << 1),
340 PT_CONFIG_TUPLE_PROTOCOL = (1 << 2),
341 PT_CONFIG_TUPLE_SRC_PORT = (1 << 3),
342 PT_CONFIG_TUPLE_DST_PORT = (1 << 4)
343 }PT_CONFIG_TUPLE_MASK_t;
350 unsigned int protocol;
351 unsigned int src_port;
352 unsigned int dst_port;
353 unsigned int tuple_mask;