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