bfd_sdk_msg.h (7722B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 6 * * 7 * File: bfd_sdk_msg.h 8 */ 9 10 #ifndef BFD_SDK_MSG_H_ 11 #define BFD_SDK_MSG_H_ 12 13 14 /* 15 * BFD Initialization control message 16 */ 17 typedef struct bfd_sdk_msg_ctrl_init_s { 18 uint32 num_sessions; /* Max number of BFD sessions */ 19 uint32 encap_size; /* Total encapsulation table size */ 20 uint32 num_auth_sha1_keys; /* Max number of sha1 auth keys */ 21 uint32 num_auth_sp_keys; /* Max number of simple pwd auth keys */ 22 uint32 rx_channel; /* Local RX DMA channel (0..3) */ 23 uint32 config_flags; /* Flags representing various config 24 properties on SDK side */ 25 uint32 dip_based_lookup_enable; /* DIP address to de-multiplex BFD session 26 for zero Your-discriminator packets */ 27 } bfd_sdk_msg_ctrl_init_t; 28 29 /* 30 * BFD Statistics control messages (Request/Reply) 31 */ 32 33 typedef struct bfd_sdk_msg_ctrl_stat_reply_s { 34 uint32 sess_id; /* BFD session (endpoint) id */ 35 uint32 packets_in; /* Total packets in */ 36 uint32 packets_out; /* Total packets out */ 37 uint32 packets_drop; /* Total packets drop */ 38 uint32 packets_auth_drop; /* Packets drop due to authentication failure */ 39 40 /* 64bit statistics */ 41 uint32 packets_in_hi; 42 uint32 packets_out_hi; 43 uint32 packets_drop_hi; 44 uint32 packets_auth_drop_hi; 45 uint32 packets_echo_reply; /*Total number of echo reply packets processed*/ 46 uint32 packets_echo_reply_hi; 47 } bfd_sdk_msg_ctrl_stat_reply_t; 48 49 typedef struct bfd_sdk_msg_ctrl_stat_req_s { 50 uint32 sess_id; /* BFD session (endpoint) id */ 51 uint32 options; /* clear / 64bit get options */ 52 } bfd_sdk_msg_ctrl_stat_req_t; 53 54 typedef struct bfd_sdk_version_exchange_msg_s { 55 uint32 version; /* BFD SDK or appl version */ 56 }bfd_sdk_version_exchange_msg_t; 57 58 /* 59 * BFD Session Set control message 60 */ 61 typedef struct bfd_sdk_msg_ctrl_sess_set_s { 62 uint32 sess_id; 63 uint32 flags; 64 uint8 passive; 65 uint8 local_demand; 66 uint8 local_diag; 67 uint8 local_detect_mult; 68 uint32 local_discriminator; 69 uint32 remote_discriminator; 70 uint32 local_min_tx; 71 uint32 local_min_rx; 72 uint32 local_min_echo_rx; 73 uint8 auth_type; 74 uint32 auth_key; 75 uint32 xmt_auth_seq; 76 uint8 encap_type; /* Raw, UDP-IPv4/IPv6, used for UDP checksum */ 77 uint32 encap_length; /* BFD encapsulation length */ 78 uint8 encap_data[SHR_BFD_MAX_ENCAP_LENGTH]; /* Encapsulation data */ 79 uint16 lkey_etype; /* Lookup key Ether Type */ 80 uint16 lkey_offset; /* Lookup key offset */ 81 uint16 lkey_length; /* Lookup key length */ 82 uint32 mep_id_length; /* MPLS-TP CV Source MEP-ID TLV length */ 83 uint8 mep_id[_SHR_BFD_ENDPOINT_MAX_MEP_ID_LENGTH]; /* MPLS-TP CV 84 Source MEP-ID */ 85 uint8 mpls_label[SHR_BFD_MPLS_LABEL_LENGTH]; /* Incoming inner MPLS 86 label packet format */ 87 uint32 tx_port; 88 uint32 tx_cos; 89 uint32 tx_pri; 90 uint32 tx_qnum; 91 uint8 local_echo; 92 uint32 remote_mep_id_length; 93 uint8 remote_mep_id[_SHR_BFD_ENDPOINT_MAX_MEP_ID_LENGTH]; /* MPLS-TP CV 94 Remote MEP-ID */ 95 uint16 rx_pkt_vlan_id; /* RX packet vlan id */ 96 } bfd_sdk_msg_ctrl_sess_set_t; 97 98 /* 99 * BFD Session Get control message 100 */ 101 typedef struct bfd_sdk_msg_ctrl_sess_get_s { 102 uint32 sess_id; 103 uint8 enable; 104 uint8 passive; 105 uint8 poll; 106 uint8 local_demand; 107 uint8 remote_demand; 108 uint8 local_diag; 109 uint8 remote_diag; 110 uint8 local_sess_state; 111 uint8 remote_sess_state; 112 uint8 local_detect_mult; 113 uint8 remote_detect_mult; 114 uint32 local_discriminator; 115 uint32 remote_discriminator; 116 uint32 local_min_tx; 117 uint32 remote_min_tx; 118 uint32 local_min_rx; 119 uint32 remote_min_rx; 120 uint32 local_min_echo_rx; 121 uint32 remote_min_echo_rx; 122 uint8 auth_type; 123 uint32 auth_key; 124 uint32 xmt_auth_seq; 125 uint32 rcv_auth_seq; 126 uint8 encap_type; /* Raw, UDP-IPv4/IPv6, used for UDP checksum */ 127 uint32 encap_length; /* BFD encapsulation length */ 128 uint8 encap_data[SHR_BFD_MAX_ENCAP_LENGTH]; /* Encapsulation data */ 129 uint16 lkey_etype; /* Lookup key Ether Type */ 130 uint16 lkey_offset; /* Lookup key offset */ 131 uint16 lkey_length; /* Lookup key length */ 132 uint32 mep_id_length; /* MPLS-TP CV Source MEP-ID TLV length */ 133 uint8 mep_id[_SHR_BFD_ENDPOINT_MAX_MEP_ID_LENGTH]; /* MPLS-TP CV 134 Source MEP-ID */ 135 uint8 mpls_label[SHR_BFD_MPLS_LABEL_LENGTH]; /* Incoming inner MPLS 136 label packet format */ 137 uint32 tx_port; 138 uint32 tx_cos; 139 uint32 tx_pri; 140 uint32 tx_qnum; 141 uint8 local_echo; 142 uint32 remote_mep_id_length; 143 uint8 remote_mep_id[_SHR_BFD_ENDPOINT_MAX_MEP_ID_LENGTH]; /* MPLS-TP CV 144 Remote MEP-ID */ 145 uint32 mis_conn_mep_id_length; 146 uint8 mis_conn_mep_id[_SHR_BFD_ENDPOINT_MAX_MEP_ID_LENGTH]; /* MPLS-TP CV 147 Mis connectivity MEP-ID */ 148 uint16 rx_pkt_vlan_id; /* RX packet vlan id */ 149 } bfd_sdk_msg_ctrl_sess_get_t; 150 151 /* 152 * BFD discard stat get control message 153 */ 154 typedef struct bfd_sdk_msg_ctrl_discard_stat_get_s { 155 uint32 bfd_ver_err; 156 uint32 bfd_len_err; 157 uint32 bfd_detect_mult; 158 uint32 bfd_my_disc; 159 uint32 bfd_p_f_bit; 160 uint32 bfd_m_bit; 161 uint32 bfd_auth_type_mismatch; 162 uint32 bfd_auth_simple_err; 163 uint32 bfd_auth_m_sha1_err; 164 uint32 bfd_sess_mismatch; 165 } bfd_sdk_msg_ctrl_discard_stat_get_t; 166 167 168 #if defined(BCM_TOMAHAWK_SUPPORT) 169 typedef struct bfd_sdk_msg_port_txqueue_map_s { 170 short max_num_port; 171 short tx_queue[SOC_MAX_NUM_PORTS+1]; 172 } bfd_sdk_msg_port_txqueue_map_t; 173 174 #endif 175 176 typedef struct bfd_sdk_msg_ctrl_trace_log_enable_s { 177 uint32 addr_hi; 178 uint32 addr_lo; 179 } bfd_sdk_msg_ctrl_trace_log_enable_t; 180 181 #if defined(BCM_TRIDENT3_SUPPORT) 182 183 #define MAX_MATCH_ID_FIELDS 17 184 185 typedef struct bfd_sdk_msg_match_id_field_info_s { 186 uint32 offset; 187 uint32 width; 188 uint32 value; 189 } bfd_sdk_msg_match_id_field_info_t; 190 191 typedef struct bfd_sdk_msg_match_id_map_s { 192 uint32 match_id_types; 193 uint32 match_id_length; 194 bfd_sdk_msg_match_id_field_info_t match_id_fields[MAX_MATCH_ID_FIELDS]; 195 } bfd_sdk_msg_match_id_map_t; 196 197 #endif 198 199 /* 200 * BFD control messages 201 */ 202 typedef union bfd_sdk_msg_ctrl_s { 203 bfd_sdk_msg_ctrl_init_t init; 204 bfd_sdk_msg_ctrl_sess_set_t sess_set; 205 bfd_sdk_msg_ctrl_sess_get_t sess_get; 206 shr_bfd_msg_ctrl_auth_sp_t auth_sp; 207 shr_bfd_msg_ctrl_auth_sha1_t auth_sha1; 208 bfd_sdk_msg_ctrl_stat_req_t stat_req; 209 bfd_sdk_msg_ctrl_stat_reply_t stat_reply; 210 bfd_sdk_version_exchange_msg_t msg; 211 bfd_sdk_msg_ctrl_discard_stat_get_t discard_stat; 212 #if defined(BCM_TOMAHAWK_SUPPORT) 213 bfd_sdk_msg_port_txqueue_map_t port_queue_map; 214 #endif 215 bfd_sdk_msg_ctrl_trace_log_enable_t trace_enable; 216 #if defined(BCM_TRIDENT3_SUPPORT) 217 bfd_sdk_msg_match_id_map_t match_id_map; 218 #endif 219 } bfd_sdk_msg_ctrl_t; 220 221 #endif /* BFD_SDK_MSG_H_ */ 222