OpenNSL API Guide and Reference Manual
switch.h
Go to the documentation of this file.
1 
4 /*****************************************************************************
5  *
6  * (C) Copyright Broadcom Corporation 2013-2016
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  *
11  * You may obtain a copy of the License at
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  ***************************************************************************/
24 #ifndef __OPENNSL_SWITCH_H__
25 #define __OPENNSL_SWITCH_H__
26 
27 #include <opennsl/types.h>
28 #include <opennsl/port.h>
29 #include <opennsl/error.h>
30 #include <opennsl/stg.h>
31 #include <shared/switch.h>
32 #include <shared/bitop.h>
33 
136 /* __doxy_func_body_end__ */
137 
138 #define OPENNSL_SWITCH_STABLE_APPLICATION (_SHR_SWITCH_STABLE_APPLICATION)
139 #ifndef OPENNSL_HIDE_DISPATCHABLE
140 
141 /***************************************************************************/
160 extern int opennsl_switch_control_get(
161  int unit,
163  int *arg) LIB_DLL_EXPORTED ;
164 
165 /***************************************************************************/
184 extern int opennsl_switch_control_set(
185  int unit,
187  int arg) LIB_DLL_EXPORTED ;
188 
189 /***************************************************************************/
210  int unit,
213  int *arg) LIB_DLL_EXPORTED ;
214 
215 /***************************************************************************/
236  int unit,
239  int arg) LIB_DLL_EXPORTED ;
240 
241 #endif /* OPENNSL_HIDE_DISPATCHABLE */
242 
245 
246 #ifndef OPENNSL_HIDE_DISPATCHABLE
247 
248 /***************************************************************************/
266  int unit,
267  int temperature_max,
268  opennsl_switch_temperature_monitor_t *temperature_array,
269  int *temperature_count) LIB_DLL_EXPORTED ;
270 
271 #endif /* OPENNSL_HIDE_DISPATCHABLE */
272 
273 #define OPENNSL_SWITCH_PKT_INFO_SRC_GPORT (1 << 0)
275 #define OPENNSL_SWITCH_PKT_INFO_VLAN (1 << 1)
277 #define OPENNSL_SWITCH_PKT_INFO_ETHERTYPE (1 << 2)
278 #define OPENNSL_SWITCH_PKT_INFO_SRC_MAC (1 << 3)
280 #define OPENNSL_SWITCH_PKT_INFO_DST_MAC (1 << 4)
282 #define OPENNSL_SWITCH_PKT_INFO_SRC_IP (1 << 5)
284 #define OPENNSL_SWITCH_PKT_INFO_DST_IP (1 << 6)
286 #define OPENNSL_SWITCH_PKT_INFO_SRC_IPV6 (1 << 7)
288 #define OPENNSL_SWITCH_PKT_INFO_DST_IPV6 (1 << 8)
290 #define OPENNSL_SWITCH_PKT_INFO_PROTOCOL (1 << 9)
292 #define OPENNSL_SWITCH_PKT_INFO_SRC_L4_PORT (1 << 10)
294 #define OPENNSL_SWITCH_PKT_INFO_DST_L4_PORT (1 << 11)
296 #define OPENNSL_SWITCH_PKT_INFO_HASH_TRUNK (1 << 12)
298 #define OPENNSL_SWITCH_PKT_INFO_HASH_MULTIPATH (1 << 13)
300 #define OPENNSL_SWITCH_PKT_INFO_HASH_UDP_SOURCE_PORT (1 << 14)
302 #define OPENNSL_SWITCH_PKT_INFO_HASH_LBID (1 << 15)
303 #define OPENNSL_SWITCH_PKT_INFO_HASH_OVERLAY (1 << 16)
307 typedef enum opennsl_switch_pkt_hash_info_fwd_reason_e {
314 /* __doxy_func_body_end__ */
315 
342 /* __doxy_func_body_end__ */
343 
344 /***************************************************************************/
361 
362 #ifndef OPENNSL_HIDE_DISPATCHABLE
363 
364 /***************************************************************************/
384  int unit,
385  opennsl_switch_pkt_info_t *pkt_info,
386  opennsl_gport_t *dst_gport,
387  opennsl_if_t *dst_intf) LIB_DLL_EXPORTED ;
388 
389 #endif /* OPENNSL_HIDE_DISPATCHABLE */
390 
392  int unit,
393  opennsl_switch_event_t event,
394  uint32 arg1,
395  uint32 arg2,
396  uint32 arg3,
397  void *userdata);
398 
399 #ifndef OPENNSL_HIDE_DISPATCHABLE
400 
401 /***************************************************************************/
426  int unit,
428  void *userdata) LIB_DLL_EXPORTED ;
429 
430 /***************************************************************************/
455  int unit,
457  void *userdata) LIB_DLL_EXPORTED ;
458 
459 #endif /* OPENNSL_HIDE_DISPATCHABLE */
460 
461 #define OPENNSL_HASH_CONTROL_MULTIPATH_L4PORTS 0x0001
462 #define OPENNSL_HASH_CONTROL_MULTIPATH_DIP 0x0002
464 #define OPENNSL_HASH_CONTROL_TRUNK_UC_SRCPORT 0x0008
465 #define OPENNSL_HASH_CONTROL_TRUNK_NUC_DST 0x0010
467 #define OPENNSL_HASH_CONTROL_TRUNK_NUC_SRC 0x0020
469 #define OPENNSL_HASH_CONTROL_ECMP_ENHANCE 0x0080
471 #define OPENNSL_HASH_CONTROL_TRUNK_NUC_ENHANCE 0x0100
474 #define OPENNSL_HASH_FIELD_CONFIG_CRC16XOR8 0x00000001
476 #define OPENNSL_HASH_FIELD_CONFIG_XOR16 0x00000006
477 #define OPENNSL_HASH_FIELD_CONFIG_CRC16CCITT 0x00000007
479 #define OPENNSL_HASH_FIELD_CONFIG_CRC32LO 0x00000008
480 #define OPENNSL_HASH_FIELD_CONFIG_CRC32HI 0x00000009
482 #define OPENNSL_HASH_FIELD_DSTL4 0x00000020
483 #define OPENNSL_HASH_FIELD_SRCL4 0x00000040
484 #define OPENNSL_HASH_FIELD_VLAN 0x00000080
485 #define OPENNSL_HASH_FIELD_IP4DST_LO 0x00000100
487 #define OPENNSL_HASH_FIELD_IP4DST_HI 0x00000200
489 #define OPENNSL_HASH_FIELD_IP4SRC_LO 0x00000400
491 #define OPENNSL_HASH_FIELD_IP4SRC_HI 0x00000800
493 #define OPENNSL_HASH_FIELD_IP6DST_LO 0x00001000
495 #define OPENNSL_HASH_FIELD_IP6DST_HI 0x00002000
497 #define OPENNSL_HASH_FIELD_IP6SRC_LO 0x00004000
499 #define OPENNSL_HASH_FIELD_IP6SRC_HI 0x00008000
501 #define OPENNSL_HASH_FIELD_MACDA_LO 0x00040000
503 #define OPENNSL_HASH_FIELD_MACDA_MI 0x00080000
505 #define OPENNSL_HASH_FIELD_MACDA_HI 0x00100000
507 #define OPENNSL_HASH_FIELD_MACSA_LO 0x00200000
509 #define OPENNSL_HASH_FIELD_MACSA_MI 0x00400000
511 #define OPENNSL_HASH_FIELD_MACSA_HI 0x00800000
513 #define OPENNSL_COLOR_PRIORITY 0
514 #define OPENNSL_COLOR_OUTER_CFI 1
515 typedef enum opennsl_switch_object_e {
574 /* __doxy_func_body_end__ */
575 
576 #ifndef OPENNSL_HIDE_DISPATCHABLE
577 
578 /***************************************************************************/
593  int unit,
594  int object_size,
595  opennsl_switch_object_t *object_array,
596  int *entries) LIB_DLL_EXPORTED ;
597 
598 #endif /* OPENNSL_HIDE_DISPATCHABLE */
599 
604 /* __doxy_func_body_end__ */
605 
611 /* __doxy_func_body_end__ */
612 
613 #define OPENNSL_SWITCH_PKT_TRACE_ECMP_1 0x0001
615 #define OPENNSL_SWITCH_PKT_TRACE_ECMP_2 0x0002
617 #define OPENNSL_SWITCH_PKT_TRACE_TRUNK 0x0004
619 #define OPENNSL_SWITCH_PKT_TRACE_FABRIC_TRUNK 0x0008
622 typedef struct opennsl_switch_pkt_trace_hashing_info_s {
623  uint32 flags;
631  opennsl_gport_t trunk_member;
634  opennsl_gport_t fabric_trunk_member;
637 /* __doxy_func_body_end__ */
638 
639 #define OPENNSL_SWITCH_PKT_TRACE_RAW_DATA_MAX 112
642 typedef struct opennsl_switch_pkt_trace_info_s {
646  uint32 dest_pipe_num;
652 /* __doxy_func_body_end__ */
653 
654 #ifndef OPENNSL_HIDE_DISPATCHABLE
655 
656 /***************************************************************************/
682  int unit,
683  uint32 options,
684  uint8 port,
685  int len,
686  uint8 *data,
688 
689 #endif /* OPENNSL_HIDE_DISPATCHABLE */
690 
691 #include <opennsl/switchX.h>
692 #endif /* __OPENNSL_SWITCH_H__ */
693