Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015-2016 Cisco and/or its affiliates. |
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | * you may not use this file except in compliance with the License. |
| 5 | * You may obtain a copy of the License at: |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software |
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | * See the License for the specific language governing permissions and |
| 13 | * limitations under the License. |
| 14 | */ |
| 15 | |
| 16 | /** \brief Configure BFD feature |
| 17 | @param client_index - opaque cookie to identify the sender |
| 18 | @param context - sender context, to match reply w/ request |
| 19 | @param slow_timer - slow timer (seconds) |
| 20 | @param min_tx - desired min tx interval |
| 21 | @param min_rx - desired min rx interval |
| 22 | @param detect_mult - desired detection multiplier |
| 23 | */ |
| 24 | define bfd_set_config { |
| 25 | u32 client_index; |
| 26 | u32 context; |
| 27 | u32 slow_timer; |
| 28 | u32 min_tx; |
| 29 | u32 min_rx; |
| 30 | u8 detect_mult; |
| 31 | }; |
| 32 | |
| 33 | /** \brief Configure BFD feature response |
| 34 | @param context - sender context, to match reply w/ request |
| 35 | @param retval - return code for the request |
| 36 | */ |
| 37 | define bfd_set_config_reply { |
| 38 | u32 context; |
| 39 | i32 retval; |
| 40 | }; |
| 41 | |
| 42 | /** \brief Get BFD configuration |
| 43 | */ |
| 44 | define bfd_get_config { |
| 45 | u32 client_index; |
| 46 | u32 context; |
| 47 | }; |
| 48 | |
| 49 | /** \brief Get BFD configuration response |
| 50 | @param context - sender context, to match reply w/ request |
| 51 | @param retval - return code for the request |
| 52 | @param slow_timer - slow timer (seconds) |
| 53 | @param min_tx - desired min tx interval |
| 54 | @param min_rx - desired min rx interval |
| 55 | @param detect_mult - desired detection multiplier |
| 56 | */ |
| 57 | define bfd_get_config_reply { |
| 58 | u32 client_index; |
| 59 | u32 context; |
| 60 | u32 slow_timer; |
| 61 | u32 min_tx; |
| 62 | u32 min_rx; |
| 63 | u8 detect_mult; |
| 64 | }; |
| 65 | |
| 66 | /** \brief Add UDP BFD session on interface |
| 67 | @param client_index - opaque cookie to identify the sender |
| 68 | @param context - sender context, to match reply w/ request |
| 69 | @param sw_if_index - sw index of the interface |
| 70 | @param desired_min_tx - desired min transmit interval (microseconds) |
| 71 | @param required_min_rx - required min receive interval (microseconds) |
| 72 | @param detect_mult - detect multiplier (# of packets missed between connection goes down) |
| 73 | @param local_addr - local address |
| 74 | @param peer_addr - peer address |
| 75 | @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4 |
| 76 | */ |
| 77 | define bfd_udp_add { |
| 78 | u32 client_index; |
| 79 | u32 context; |
| 80 | u32 sw_if_index; |
| 81 | u32 desired_min_tx; |
| 82 | u32 required_min_rx; |
| 83 | u8 local_addr[16]; |
| 84 | u8 peer_addr[16]; |
| 85 | u8 is_ipv6; |
| 86 | u8 detect_mult; |
| 87 | }; |
| 88 | |
| 89 | /** \brief Add UDP BFD session response |
| 90 | @param context - sender context, to match reply w/ request |
| 91 | @param retval - return code for the request |
| 92 | @param bs_index - index of the session created |
| 93 | */ |
| 94 | define bfd_udp_add_reply { |
| 95 | u32 context; |
| 96 | i32 retval; |
| 97 | u32 bs_index; |
| 98 | }; |
| 99 | |
| 100 | /** \brief Delete UDP BFD session on interface |
| 101 | @param client_index - opaque cookie to identify the sender |
| 102 | @param context - sender context, to match reply w/ request |
| 103 | @param sw_if_index - sw index of the interface |
| 104 | @param local_addr - local address |
| 105 | @param peer_addr - peer address |
| 106 | @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4 |
| 107 | */ |
| 108 | define bfd_udp_del { |
| 109 | u32 client_index; |
| 110 | u32 context; |
| 111 | u32 sw_if_index; |
| 112 | u8 local_addr[16]; |
| 113 | u8 peer_addr[16]; |
| 114 | u8 is_ipv6; |
| 115 | }; |
| 116 | |
| 117 | /** \brief Delete UDP BFD session response |
| 118 | @param context - sender context, to match reply w/ request |
| 119 | @param retval - return code for the request |
| 120 | */ |
| 121 | define bfd_udp_del_reply { |
| 122 | u32 context; |
| 123 | i32 retval; |
| 124 | }; |
| 125 | |
| 126 | /** \brief Get all BFD sessions |
| 127 | @param client_index - opaque cookie to identify the sender |
| 128 | @param context - sender context, to match reply w/ request |
| 129 | */ |
| 130 | define bfd_udp_session_dump { |
| 131 | u32 client_index; |
| 132 | u32 context; |
| 133 | }; |
| 134 | |
| 135 | /** \brief BFD session details structure |
| 136 | @param context - sender context, to match reply w/ request |
| 137 | @param bs_index - index of the session |
| 138 | @param sw_if_index - sw index of the interface |
| 139 | @param local_addr - local address |
| 140 | @param peer_addr - peer address |
| 141 | @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4 |
| 142 | @param state - session state |
| 143 | */ |
| 144 | define bfd_udp_session_details { |
| 145 | u32 context; |
| 146 | u32 bs_index; |
| 147 | u32 sw_if_index; |
| 148 | u8 local_addr[16]; |
| 149 | u8 peer_addr[16]; |
| 150 | u8 is_ipv6; |
| 151 | u8 state; |
| 152 | }; |
| 153 | |
| 154 | /** \brief Set flags of BFD session |
| 155 | @param client_index - opaque cookie to identify the sender |
| 156 | @param context - sender context, to match reply w/ request |
| 157 | @param bs_index - index of the bfd session to set flags on |
| 158 | @param admin_up_down - set the admin state, 1 = up, 0 = down |
| 159 | */ |
| 160 | define bfd_session_set_flags { |
| 161 | u32 client_index; |
| 162 | u32 context; |
| 163 | u32 bs_index; |
| 164 | u8 admin_up_down; |
| 165 | }; |
| 166 | |
| 167 | /** \brief Reply to bfd_session_set_flags |
| 168 | @param context - sender context which was passed in the request |
| 169 | @param retval - return code of the set flags request |
| 170 | */ |
| 171 | define bfd_session_set_flags_reply |
| 172 | { |
| 173 | u32 context; |
| 174 | i32 retval; |
| 175 | }; |
| 176 | |
| 177 | /** \brief Register for BFD events |
| 178 | @param client_index - opaque cookie to identify the sender |
| 179 | @param context - sender context, to match reply w/ request |
| 180 | @param enable_disable - 1 => register for events, 0 => cancel registration |
| 181 | @param pid - sender's pid |
| 182 | */ |
| 183 | define want_bfd_events |
| 184 | { |
| 185 | u32 client_index; |
| 186 | u32 context; |
| 187 | u32 enable_disable; |
| 188 | u32 pid; |
| 189 | }; |
| 190 | |
| 191 | /** \brief Reply for BFD events registration |
| 192 | @param context - returned sender context, to match reply w/ request |
| 193 | @param retval - return code |
| 194 | */ |
| 195 | define want_bfd_events_reply |
| 196 | { |
| 197 | u32 context; |
| 198 | i32 retval; |
| 199 | }; |
| 200 | |
| 201 | /* |
| 202 | * Local Variables: |
| 203 | * eval: (c-set-style "gnu") |
| 204 | * End: |
| 205 | */ |