40 #ifndef OPENAPI_BHD_H_INCLUDED
41 #define OPENAPI_BHD_H_INCLUDED
46 #include <netinet/in.h>
50 #define OPEN_BHD_MAX_PACKET_SIZE OPEN_INSTRU_MAX_PACKET_SIZE
53 #define BVIEW_BHD_MAX_SUPPORTED_PORTS OPEN_ASIC_MAX_PORTS
56 #define BVIEW_BHD_MAX_UNITS 1
58 #define BVIEW_BHD_WATERMARK_MIN 100
59 #define BVIEW_BHD_WATERMARK_MAX 10000
61 #define BVIEW_BHD_SAMPLE_PERIODICITY_MIN 1
62 #define BVIEW_BHD_SAMPLE_PERIODICITY_MAX (60*60)
64 #define BVIEW_BHD_SAMPLE_COUNT_MIN 0
65 #define BVIEW_BHD_SAMPLE_COUNT_MAX 30
67 #define BVIEW_BHD_VLAN_MIN 1
68 #define BVIEW_BHD_VLAN_MAX 4094
70 #define BVIEW_BHD_SOURCE_UDP_PORT_MIN 1
71 #define BVIEW_BHD_SOURCE_UDP_PORT_MAX 65535
73 #define BVIEW_BHD_DEST_UDP_PORT_MIN 1
74 #define BVIEW_BHD_DEST_UDP_PORT_MAX 65535
76 #define BVIEW_BHD_SAMP_POOL_SIZE_MIN 1024
77 #define BVIEW_BHD_SAMP_POOL_SIZE_MAX 100000
79 #define OPEN_BHD_MAX_PORT_LIST_STR 256
80 #define OPEN_BHD_MAX_PORT_STR 8
82 #define OPEN_BHD_SFLOW_AGENT_NUM 1
83 #define OPEN_BHD_SFLOW_SESSION 1
89 OPEN_BHD_AGENT_SAMPLING = (1 << 0),
91 OPEN_BHD_SFLOW_SAMPLING = (1 << 1),
92 OPEN_BHD_MAX_SAMPLING_METHOD
94 }OPEN_BHD_PKT_SAMPLING_METHOD_t;
96 #define BVIEW_BHD_DEFAULT_PKT_SAMPLING_METHOD BVIEW_BHD_AGENT_SAMPLING
108 uint32_t sample_periodicity;
110 uint32_t sample_count;
112 } agent_sampling_params;
117 uint32_t encap_vlan_id;
119 struct in_addr encap_dest_ip_addr;
121 uint16_t encap_src_udp_port;
123 uint16_t encap_dest_udp_port;
126 uint32_t mirror_port;
127 char mirror_port_str[OPEN_BHD_MAX_PORT_STR];
131 uint32_t sample_pool_size;
133 } sflow_sampling_params;
142 OPEN_BHD_PKT_SAMPLING_METHOD_t sampling_method;
152 uint8_t black_hole_port_list_str[OPEN_BHD_MAX_PORT_LIST_STR];
164 char portStr[OPEN_BHD_MAX_PORT_STR];
166 bool sflowSamplingEnabled;
168 uint32_t sampled_pkt_count;
170 uint32_t black_holed_pkt_count;
245 int32_t *sampling_capabilities);
open_error_t openapiBhdSflowSamplingStatusGet(openapiClientHandle_t *clientHandle, int32_t asic, int32_t port, open_buffdesc *port_list, OPEN_BHD_PORT_SFLOW_SAMPLING_STATUS_t *status)
BHD feature sflow configuration get function.
open_error_t
OPEN uses these enumerators to indicate the error codes.
open_error_t openapiBhdBlackHoleCancel(openapiClientHandle_t *clientHandle, int32_t asic, int32_t sFlow, open_buffdesc *port_list)
BHD feature, cancel black hole.
open_error_t openapiBhdBlackHoleConfigure(openapiClientHandle_t *clientHandle, int32_t asic, OPEN_BLACK_HOLE_CONFIG_t *config)
BHD feature, configure black hole.
open_error_t openapiBhdAsicCapabilitiesGet(openapiClientHandle_t *clientHandle, int32_t asic, int32_t *sampling_capabilities)
BHD feature, asic sampling capabilities get.
open_error_t openapiBhdPacketCountGet(openapiClientHandle_t *clientHandle, int32_t asic, uint64_t *count)
BHD feature, Black holed packet count get.