|
OpenNSL API Guide and Reference Manual
|
#include <opennsl/types.h>#include <opennsl/port.h>#include <opennsl/error.h>#include <opennsl/stg.h>#include <shared/switch.h>#include <shared/bitop.h>#include <opennsl/switchX.h>Go to the source code of this file.
Data Structures | |
| struct | opennsl_switch_pkt_info_s |
| Switch packet info structure. More... | |
| struct | opennsl_switch_pkt_trace_hashing_info_s |
| packet hashing resolution information More... | |
| struct | opennsl_switch_pkt_trace_info_s |
| packet trace ingress process data More... | |
| struct | opennsl_switch_pkt_trace_lookup_result_s |
| lookup result set bit map More... | |
Macros | |
| #define | OPENNSL_COLOR_OUTER_CFI 1 |
| SPVLAN CFI->COLOR mapping. | |
| #define | OPENNSL_COLOR_PRIORITY 0 |
| Priority->COLOR mapping. | |
| #define | OPENNSL_HASH_CONTROL_ECMP_ENHANCE 0x0080 |
| Use enhanced ECMP hashing. | |
| #define | OPENNSL_HASH_CONTROL_MULTIPATH_DIP 0x0002 |
| Use destination IP address. | |
| #define | OPENNSL_HASH_CONTROL_MULTIPATH_L4PORTS 0x0001 |
| Use TCP/UDP ports. | |
| #define | OPENNSL_HASH_CONTROL_TRUNK_NUC_DST 0x0010 |
| Use destination MAC or IP address. | |
| #define | OPENNSL_HASH_CONTROL_TRUNK_NUC_ENHANCE 0x0100 |
| Use enhanced non-unicast trunk hashing. | |
| #define | OPENNSL_HASH_CONTROL_TRUNK_NUC_SRC 0x0020 |
| Use source MAC or IP address. | |
| #define | OPENNSL_HASH_CONTROL_TRUNK_UC_SRCPORT 0x0008 |
| Use source port. | |
| #define | OPENNSL_HASH_FIELD_CONFIG_CRC16CCITT 0x00000007 |
| 16-bit CRC using CCITT polynomial. | |
| #define | OPENNSL_HASH_FIELD_CONFIG_CRC16XOR8 0x00000001 |
| 8-bit CRC16 + 8-bit XOR8. | |
| #define | OPENNSL_HASH_FIELD_CONFIG_CRC32HI 0x00000009 |
| Higher 16-bit of CRC32. | |
| #define | OPENNSL_HASH_FIELD_CONFIG_CRC32LO 0x00000008 |
| Lower 16-bit of CRC32. | |
| #define | OPENNSL_HASH_FIELD_CONFIG_XOR16 0x00000006 |
| 16-bit XOR. | |
| #define | OPENNSL_HASH_FIELD_DSTL4 0x00000020 |
| Destination L4 port. | |
| #define | OPENNSL_HASH_FIELD_IP4DST_HI 0x00000200 |
| IPv4 destination address upper 16 bits. | |
| #define | OPENNSL_HASH_FIELD_IP4DST_LO 0x00000100 |
| IPv4 destination address lower 16 bits. | |
| #define | OPENNSL_HASH_FIELD_IP4SRC_HI 0x00000800 |
| IPv4 source address upper 16 bits. | |
| #define | OPENNSL_HASH_FIELD_IP4SRC_LO 0x00000400 |
| IPv4 source address lower 16 bits. | |
| #define | OPENNSL_HASH_FIELD_IP6DST_HI 0x00002000 |
| IPv6 collapsed destination address upper 16 bits. | |
| #define | OPENNSL_HASH_FIELD_IP6DST_LO 0x00001000 |
| IPv6 collapsed destination address lower 16 bits. | |
| #define | OPENNSL_HASH_FIELD_IP6SRC_HI 0x00008000 |
| IPv6 collapsed source address upper 16 bits. | |
| #define | OPENNSL_HASH_FIELD_IP6SRC_LO 0x00004000 |
| IPv6 collapsed source address lower 16 bits. | |
| #define | OPENNSL_HASH_FIELD_MACDA_HI 0x00100000 |
| MAC destination address upper 16 bits. | |
| #define | OPENNSL_HASH_FIELD_MACDA_LO 0x00040000 |
| MAC destination address lower 16 bits. | |
| #define | OPENNSL_HASH_FIELD_MACDA_MI 0x00080000 |
| MAC destination address middle 16 bits. | |
| #define | OPENNSL_HASH_FIELD_MACSA_HI 0x00800000 |
| MAC source address upper 16 bits. | |
| #define | OPENNSL_HASH_FIELD_MACSA_LO 0x00200000 |
| MAC source address lower 16 bits. | |
| #define | OPENNSL_HASH_FIELD_MACSA_MI 0x00400000 |
| MAC source address middle 16 bits. | |
| #define | OPENNSL_HASH_FIELD_SRCL4 0x00000040 |
| Source L4 port. | |
| #define | OPENNSL_HASH_FIELD_VLAN 0x00000080 |
| VLAN ID. | |
| #define | OPENNSL_SWITCH_PKT_INFO_DST_IP (1 << 6) |
| Destination IPv4 address field valid. | |
| #define | OPENNSL_SWITCH_PKT_INFO_DST_IPV6 (1 << 8) |
| Destination IPv6 address field valid. | |
| #define | OPENNSL_SWITCH_PKT_INFO_DST_L4_PORT (1 << 11) |
| Destination L4 port field valid. | |
| #define | OPENNSL_SWITCH_PKT_INFO_DST_MAC (1 << 4) |
| Destination MAC address field valid. | |
| #define | OPENNSL_SWITCH_PKT_INFO_ETHERTYPE (1 << 2) |
| Ethertype field valid. | |
| #define | OPENNSL_SWITCH_PKT_INFO_HASH_LBID (1 << 15) |
| Retrieve LBID. | |
| #define | OPENNSL_SWITCH_PKT_INFO_HASH_MULTIPATH (1 << 13) |
| Retrieve ECMP hash result. | |
| #define | OPENNSL_SWITCH_PKT_INFO_HASH_OVERLAY (1 << 16) |
| Retrieve ECMP hash result for overlay layer. | |
| #define | OPENNSL_SWITCH_PKT_INFO_HASH_TRUNK (1 << 12) |
| Retrieve trunk hash result. | |
| #define | OPENNSL_SWITCH_PKT_INFO_HASH_UDP_SOURCE_PORT (1 << 14) |
| Retrieve Entropy Value of VXLan packet. | |
| #define | OPENNSL_SWITCH_PKT_INFO_PROTOCOL (1 << 9) |
| IP protocol field valid. | |
| #define | OPENNSL_SWITCH_PKT_INFO_SRC_GPORT (1 << 0) |
| Source gport (module, port) field valid. | |
| #define | OPENNSL_SWITCH_PKT_INFO_SRC_IP (1 << 5) |
| Source IPv4 address field valid. | |
| #define | OPENNSL_SWITCH_PKT_INFO_SRC_IPV6 (1 << 7) |
| Source IPv6 address field valid. | |
| #define | OPENNSL_SWITCH_PKT_INFO_SRC_L4_PORT (1 << 10) |
| Source L4 port field valid. | |
| #define | OPENNSL_SWITCH_PKT_INFO_SRC_MAC (1 << 3) |
| Source MAC address field valid. | |
| #define | OPENNSL_SWITCH_PKT_INFO_VLAN (1 << 1) |
| VLAN identifier field valid. | |
| #define | OPENNSL_SWITCH_PKT_TRACE_ECMP_1 0x0001 |
| level 1 ecmp hashing resolution done | |
| #define | OPENNSL_SWITCH_PKT_TRACE_ECMP_2 0x0002 |
| level 2 ecmp hashing resolution done | |
| #define | OPENNSL_SWITCH_PKT_TRACE_FABRIC_TRUNK 0x0008 |
| hg trunk hashing resolution done | |
| #define | OPENNSL_SWITCH_PKT_TRACE_RAW_DATA_MAX 112 |
| max bytes of pkt_trace_info.raw_data | |
| #define | OPENNSL_SWITCH_PKT_TRACE_TRUNK 0x0004 |
| trunk hashing resolution done | |
| #define | OPENNSL_SWITCH_STABLE_APPLICATION (_SHR_SWITCH_STABLE_APPLICATION) |
Functions | |
| int | opennsl_switch_control_get (int unit, opennsl_switch_control_t type, int *arg) LIB_DLL_EXPORTED |
| Configure port-specific and device-wide operating modes. | |
| int | opennsl_switch_control_port_get (int unit, opennsl_port_t port, opennsl_switch_control_t type, int *arg) LIB_DLL_EXPORTED |
| Configure port-specific and device-wide operating modes. | |
| int | opennsl_switch_control_port_set (int unit, opennsl_port_t port, opennsl_switch_control_t type, int arg) LIB_DLL_EXPORTED |
| Configure port-specific and device-wide operating modes. | |
| int | opennsl_switch_control_set (int unit, opennsl_switch_control_t type, int arg) LIB_DLL_EXPORTED |
| Configure port-specific and device-wide operating modes. | |
| int | opennsl_switch_event_register (int unit, opennsl_switch_event_cb_t cb, void *userdata) LIB_DLL_EXPORTED |
| Registers/Unregisters a callback function for switch critical events. | |
| int | opennsl_switch_event_unregister (int unit, opennsl_switch_event_cb_t cb, void *userdata) LIB_DLL_EXPORTED |
| Registers/Unregisters a callback function for switch critical events. | |
| int | opennsl_switch_object_count_multi_get (int unit, int object_size, opennsl_switch_object_t *object_array, int *entries) LIB_DLL_EXPORTED |
| Retrieving the statistics on the number of API objects. | |
| int | opennsl_switch_pkt_info_hash_get (int unit, opennsl_switch_pkt_info_t *pkt_info, opennsl_gport_t *dst_gport, opennsl_if_t *dst_intf) LIB_DLL_EXPORTED |
| Gets the hash result for the specified link aggregation method using provided packet parameters and device configuration. | |
| void | opennsl_switch_pkt_info_t_init (opennsl_switch_pkt_info_t *pkt_info) LIB_DLL_EXPORTED |
| Initialize a opennsl_switch_pkt_info_t structure. | |
| int | opennsl_switch_pkt_trace_info_get (int unit, uint32 options, uint8 port, int len, uint8 *data, opennsl_switch_pkt_trace_info_t *pkt_trace_info) LIB_DLL_EXPORTED |
| Generate a visibility trace packet and then read the result of the packets ingress processing information. | |
| int | opennsl_switch_temperature_monitor_get (int unit, int temperature_max, opennsl_switch_temperature_monitor_t *temperature_array, int *temperature_count) LIB_DLL_EXPORTED |
| There are temperature monitors embedded in the various points of some switch chips for the purpose of monitoring the health of the chip. | |