Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015 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 | #include <vnet/l2/l2_xcrw.h> |
| 16 | |
Chris Luke | 16bcf7d | 2016-09-01 14:31:46 -0400 | [diff] [blame] | 17 | /** |
| 18 | * @file |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 19 | * General L2 / L3 cross-connect, used to set up |
| 20 | * "L2 interface <--> your-favorite-tunnel-encap" tunnels. |
| 21 | * |
| 22 | * We set up a typical L2 cross-connect or (future) bridge |
| 23 | * to hook L2 interface(s) up to the L3 stack in arbitrary ways. |
| 24 | * |
| 25 | * Each l2_xcrw adjacency specifies 3 things: |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 26 | * |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 27 | * 1. The next graph node (presumably in the L3 stack) to |
| 28 | * process the (L2 -> L3) packet |
| 29 | * |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 30 | * 2. A new value for vnet_buffer(b)->sw_if_index[VLIB_TX] |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 31 | * (i.e. a lookup FIB index), |
| 32 | * |
| 33 | * 3. A rewrite string to apply. |
| 34 | * |
| 35 | * Example: to cross-connect an L2 interface or (future) bridge |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 36 | * to an mpls-o-gre tunnel, set up the L2 rewrite string as shown in |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 37 | * mpls_gre_rewrite, and use "mpls-post-rewrite" to fix the |
| 38 | * GRE IP header checksum and length fields. |
| 39 | */ |
| 40 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 41 | typedef struct |
| 42 | { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 43 | u32 next_index; |
| 44 | u32 tx_fib_index; |
| 45 | } l2_xcrw_trace_t; |
| 46 | |
| 47 | /* packet trace format function */ |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 48 | static u8 * |
| 49 | format_l2_xcrw_trace (u8 * s, va_list * args) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 50 | { |
| 51 | CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *); |
| 52 | CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *); |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 53 | l2_xcrw_trace_t *t = va_arg (*args, l2_xcrw_trace_t *); |
| 54 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 55 | s = format (s, "L2_XCRW: next index %d tx_fib_index %d", |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 56 | t->next_index, t->tx_fib_index); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 57 | return s; |
| 58 | } |
| 59 | |
| 60 | l2_xcrw_main_t l2_xcrw_main; |
| 61 | |
| 62 | static vlib_node_registration_t l2_xcrw_node; |
| 63 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 64 | static char *l2_xcrw_error_strings[] = { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 65 | #define _(sym,string) string, |
| 66 | foreach_l2_xcrw_error |
| 67 | #undef _ |
| 68 | }; |
| 69 | |
| 70 | static uword |
| 71 | l2_xcrw_node_fn (vlib_main_t * vm, |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 72 | vlib_node_runtime_t * node, vlib_frame_t * frame) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 73 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 74 | u32 n_left_from, *from, *to_next; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 75 | l2_xcrw_next_t next_index; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 76 | l2_xcrw_main_t *xcm = &l2_xcrw_main; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 77 | vlib_node_t *n = vlib_get_node (vm, l2_xcrw_node.index); |
| 78 | u32 node_counter_base_index = n->error_heap_index; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 79 | vlib_error_main_t *em = &vm->error_main; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 80 | |
| 81 | from = vlib_frame_vector_args (frame); |
| 82 | n_left_from = frame->n_vectors; |
| 83 | next_index = node->cached_next_index; |
| 84 | |
| 85 | while (n_left_from > 0) |
| 86 | { |
| 87 | u32 n_left_to_next; |
| 88 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 89 | vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 90 | |
| 91 | while (n_left_from >= 4 && n_left_to_next >= 2) |
| 92 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 93 | u32 bi0, bi1; |
| 94 | vlib_buffer_t *b0, *b1; |
| 95 | u32 next0, next1; |
| 96 | u32 sw_if_index0, sw_if_index1; |
| 97 | l2_xcrw_adjacency_t *adj0, *adj1; |
| 98 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 99 | /* Prefetch next iteration. */ |
| 100 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 101 | vlib_buffer_t *p2, *p3; |
| 102 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 103 | p2 = vlib_get_buffer (vm, from[2]); |
| 104 | p3 = vlib_get_buffer (vm, from[3]); |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 105 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 106 | vlib_prefetch_buffer_header (p2, LOAD); |
| 107 | vlib_prefetch_buffer_header (p3, LOAD); |
| 108 | |
| 109 | CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, STORE); |
| 110 | CLIB_PREFETCH (p3->data, CLIB_CACHE_LINE_BYTES, STORE); |
| 111 | } |
| 112 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 113 | /* speculatively enqueue b0 and b1 to the current next frame */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 114 | to_next[0] = bi0 = from[0]; |
| 115 | to_next[1] = bi1 = from[1]; |
| 116 | from += 2; |
| 117 | to_next += 2; |
| 118 | n_left_from -= 2; |
| 119 | n_left_to_next -= 2; |
| 120 | |
| 121 | b0 = vlib_get_buffer (vm, bi0); |
| 122 | b1 = vlib_get_buffer (vm, bi1); |
| 123 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 124 | sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX]; |
| 125 | sw_if_index1 = vnet_buffer (b1)->sw_if_index[VLIB_RX]; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 126 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 127 | adj0 = vec_elt_at_index (xcm->adj_by_sw_if_index, sw_if_index0); |
| 128 | adj1 = vec_elt_at_index (xcm->adj_by_sw_if_index, sw_if_index1); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 129 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 130 | next0 = adj0->rewrite_header.next_index; |
| 131 | vnet_buffer (b0)->sw_if_index[VLIB_TX] = |
| 132 | adj0->rewrite_header.sw_if_index; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 133 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 134 | next1 = adj1->rewrite_header.next_index; |
| 135 | vnet_buffer (b1)->sw_if_index[VLIB_TX] = |
| 136 | adj1->rewrite_header.sw_if_index; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 137 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 138 | em->counters[node_counter_base_index + next1]++; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 139 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 140 | if (PREDICT_TRUE (next0 > 0)) |
| 141 | { |
| 142 | u8 *h0 = vlib_buffer_get_current (b0); |
| 143 | vnet_rewrite_one_header (adj0[0], h0, |
| 144 | adj0->rewrite_header.data_bytes); |
| 145 | vlib_buffer_advance (b0, -adj0->rewrite_header.data_bytes); |
| 146 | em->counters[node_counter_base_index + L2_XCRW_ERROR_FWD]++; |
| 147 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 148 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 149 | if (PREDICT_TRUE (next1 > 0)) |
| 150 | { |
| 151 | u8 *h1 = vlib_buffer_get_current (b1); |
| 152 | vnet_rewrite_one_header (adj1[0], h1, |
| 153 | adj1->rewrite_header.data_bytes); |
| 154 | vlib_buffer_advance (b1, -adj1->rewrite_header.data_bytes); |
| 155 | em->counters[node_counter_base_index + L2_XCRW_ERROR_FWD]++; |
| 156 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 157 | |
| 158 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 159 | if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE))) |
| 160 | { |
| 161 | if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE) |
| 162 | && (b0->flags & VLIB_BUFFER_IS_TRACED))) |
| 163 | { |
| 164 | l2_xcrw_trace_t *t = |
| 165 | vlib_add_trace (vm, node, b0, sizeof (*t)); |
| 166 | t->next_index = next0; |
| 167 | t->tx_fib_index = adj0->rewrite_header.sw_if_index; |
| 168 | } |
| 169 | if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE) |
| 170 | && (b1->flags & VLIB_BUFFER_IS_TRACED))) |
| 171 | { |
| 172 | l2_xcrw_trace_t *t = |
| 173 | vlib_add_trace (vm, node, b1, sizeof (*t)); |
| 174 | t->next_index = next1; |
| 175 | t->tx_fib_index = adj1->rewrite_header.sw_if_index; |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | /* verify speculative enqueues, maybe switch current next frame */ |
| 180 | vlib_validate_buffer_enqueue_x2 (vm, node, next_index, |
| 181 | to_next, n_left_to_next, |
| 182 | bi0, bi1, next0, next1); |
| 183 | } |
| 184 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 185 | while (n_left_from > 0 && n_left_to_next > 0) |
| 186 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 187 | u32 bi0; |
| 188 | vlib_buffer_t *b0; |
| 189 | u32 next0; |
| 190 | u32 sw_if_index0; |
| 191 | l2_xcrw_adjacency_t *adj0; |
| 192 | |
| 193 | /* speculatively enqueue b0 to the current next frame */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 194 | bi0 = from[0]; |
| 195 | to_next[0] = bi0; |
| 196 | from += 1; |
| 197 | to_next += 1; |
| 198 | n_left_from -= 1; |
| 199 | n_left_to_next -= 1; |
| 200 | |
| 201 | b0 = vlib_get_buffer (vm, bi0); |
| 202 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 203 | sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX]; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 204 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 205 | adj0 = vec_elt_at_index (xcm->adj_by_sw_if_index, sw_if_index0); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 206 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 207 | next0 = adj0->rewrite_header.next_index; |
| 208 | vnet_buffer (b0)->sw_if_index[VLIB_TX] = |
| 209 | adj0->rewrite_header.sw_if_index; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 210 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 211 | if (PREDICT_TRUE (next0 > 0)) |
| 212 | { |
| 213 | u8 *h0 = vlib_buffer_get_current (b0); |
| 214 | vnet_rewrite_one_header (adj0[0], h0, |
| 215 | adj0->rewrite_header.data_bytes); |
| 216 | vlib_buffer_advance (b0, -adj0->rewrite_header.data_bytes); |
| 217 | em->counters[node_counter_base_index + L2_XCRW_ERROR_FWD]++; |
| 218 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 219 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 220 | if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE) |
| 221 | && (b0->flags & VLIB_BUFFER_IS_TRACED))) |
| 222 | { |
| 223 | l2_xcrw_trace_t *t = vlib_add_trace (vm, node, b0, sizeof (*t)); |
| 224 | t->next_index = next0; |
| 225 | t->tx_fib_index = adj0->rewrite_header.sw_if_index; |
| 226 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 227 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 228 | /* verify speculative enqueue, maybe switch current next frame */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 229 | vlib_validate_buffer_enqueue_x1 (vm, node, next_index, |
| 230 | to_next, n_left_to_next, |
| 231 | bi0, next0); |
| 232 | } |
| 233 | |
| 234 | vlib_put_next_frame (vm, node, next_index, n_left_to_next); |
| 235 | } |
| 236 | |
| 237 | return frame->n_vectors; |
| 238 | } |
| 239 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 240 | /* *INDENT-OFF* */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 241 | VLIB_REGISTER_NODE (l2_xcrw_node, static) = { |
| 242 | .function = l2_xcrw_node_fn, |
| 243 | .name = "l2-xcrw", |
| 244 | .vector_size = sizeof (u32), |
| 245 | .format_trace = format_l2_xcrw_trace, |
| 246 | .type = VLIB_NODE_TYPE_INTERNAL, |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 247 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 248 | .n_errors = ARRAY_LEN(l2_xcrw_error_strings), |
| 249 | .error_strings = l2_xcrw_error_strings, |
| 250 | |
| 251 | .n_next_nodes = L2_XCRW_N_NEXT, |
| 252 | |
| 253 | /* edit / add dispositions here */ |
| 254 | .next_nodes = { |
| 255 | [L2_XCRW_NEXT_DROP] = "error-drop", |
| 256 | }, |
| 257 | }; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 258 | /* *INDENT-ON* */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 259 | |
Damjan Marion | 1c80e83 | 2016-05-11 23:07:18 +0200 | [diff] [blame] | 260 | VLIB_NODE_FUNCTION_MULTIARCH (l2_xcrw_node, l2_xcrw_node_fn) |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 261 | clib_error_t *l2_xcrw_init (vlib_main_t * vm) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 262 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 263 | l2_xcrw_main_t *mp = &l2_xcrw_main; |
| 264 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 265 | mp->vlib_main = vm; |
| 266 | mp->vnet_main = &vnet_main; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 267 | mp->tunnel_index_by_l2_sw_if_index = hash_create (0, sizeof (uword)); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 268 | |
| 269 | return 0; |
| 270 | } |
| 271 | |
| 272 | VLIB_INIT_FUNCTION (l2_xcrw_init); |
| 273 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 274 | static uword |
| 275 | dummy_interface_tx (vlib_main_t * vm, |
| 276 | vlib_node_runtime_t * node, vlib_frame_t * frame) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 277 | { |
| 278 | clib_warning ("you shouldn't be here, leaking buffers..."); |
| 279 | return frame->n_vectors; |
| 280 | } |
| 281 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 282 | static u8 * |
| 283 | format_xcrw_name (u8 * s, va_list * args) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 284 | { |
| 285 | u32 dev_instance = va_arg (*args, u32); |
| 286 | return format (s, "xcrw%d", dev_instance); |
| 287 | } |
| 288 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 289 | /* *INDENT-OFF* */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 290 | VNET_DEVICE_CLASS (xcrw_device_class,static) = { |
| 291 | .name = "Xcrw", |
| 292 | .format_device_name = format_xcrw_name, |
| 293 | .tx_function = dummy_interface_tx, |
| 294 | }; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 295 | /* *INDENT-ON* */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 296 | |
| 297 | /* Create a sham tunnel interface and return its sw_if_index */ |
| 298 | static u32 |
| 299 | create_xcrw_interface (vlib_main_t * vm) |
| 300 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 301 | vnet_main_t *vnm = vnet_get_main (); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 302 | static u32 instance; |
| 303 | u8 address[6]; |
| 304 | u32 hw_if_index; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 305 | vnet_hw_interface_t *hi; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 306 | u32 sw_if_index; |
| 307 | |
| 308 | /* mac address doesn't really matter */ |
| 309 | memset (address, 0, sizeof (address)); |
| 310 | address[2] = 0x12; |
| 311 | |
| 312 | /* can returns error iff phy != 0 */ |
| 313 | (void) ethernet_register_interface |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 314 | (vnm, xcrw_device_class.index, instance++, address, &hw_if_index, |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 315 | /* flag change */ 0); |
| 316 | |
| 317 | hi = vnet_get_hw_interface (vnm, hw_if_index); |
| 318 | sw_if_index = hi->sw_if_index; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 319 | vnet_sw_interface_set_flags (vnm, sw_if_index, |
| 320 | VNET_SW_INTERFACE_FLAG_ADMIN_UP); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 321 | |
| 322 | /* Output to the sham tunnel invokes the encap node */ |
| 323 | hi->output_node_index = l2_xcrw_node.index; |
| 324 | |
| 325 | return sw_if_index; |
| 326 | } |
| 327 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 328 | int |
| 329 | vnet_configure_l2_xcrw (vlib_main_t * vm, vnet_main_t * vnm, |
| 330 | u32 l2_sw_if_index, u32 tx_fib_index, |
| 331 | u8 * rewrite, u32 next_node_index, int is_add) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 332 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 333 | l2_xcrw_main_t *xcm = &l2_xcrw_main; |
| 334 | l2_xcrw_adjacency_t *a; |
| 335 | l2_xcrw_tunnel_t *t; |
| 336 | uword *p; |
| 337 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 338 | if (is_add) |
| 339 | { |
| 340 | |
| 341 | pool_get (xcm->tunnels, t); |
| 342 | |
| 343 | /* No interface allocated? Do it. Otherwise, set admin up */ |
| 344 | if (t->tunnel_sw_if_index == 0) |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 345 | t->tunnel_sw_if_index = create_xcrw_interface (vm); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 346 | else |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 347 | vnet_sw_interface_set_flags (vnm, t->tunnel_sw_if_index, |
| 348 | VNET_SW_INTERFACE_FLAG_ADMIN_UP); |
| 349 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 350 | t->l2_sw_if_index = l2_sw_if_index; |
| 351 | |
| 352 | vec_validate (xcm->adj_by_sw_if_index, t->l2_sw_if_index); |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 353 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 354 | a = vec_elt_at_index (xcm->adj_by_sw_if_index, t->l2_sw_if_index); |
| 355 | memset (a, 0, sizeof (*a)); |
| 356 | |
| 357 | a->rewrite_header.sw_if_index = tx_fib_index; |
| 358 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 359 | /* |
| 360 | * Add or find a dynamic disposition for the successor node, |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 361 | * e.g. so we can ship pkts to mpls_post_rewrite... |
| 362 | */ |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 363 | a->rewrite_header.next_index = |
| 364 | vlib_node_add_next (vm, l2_xcrw_node.index, next_node_index); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 365 | |
| 366 | if (vec_len (rewrite)) |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 367 | vnet_rewrite_set_data (a[0], rewrite, vec_len (rewrite)); |
| 368 | |
| 369 | set_int_l2_mode (vm, vnm, MODE_L2_XC, t->l2_sw_if_index, 0, 0, 0, |
| 370 | t->tunnel_sw_if_index); |
| 371 | hash_set (xcm->tunnel_index_by_l2_sw_if_index, |
| 372 | t->l2_sw_if_index, t - xcm->tunnels); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 373 | return 0; |
| 374 | } |
| 375 | else |
| 376 | { |
| 377 | p = hash_get (xcm->tunnel_index_by_l2_sw_if_index, l2_sw_if_index); |
| 378 | if (p == 0) |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 379 | return VNET_API_ERROR_INVALID_SW_IF_INDEX; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 380 | |
| 381 | t = pool_elt_at_index (xcm->tunnels, p[0]); |
| 382 | |
| 383 | a = vec_elt_at_index (xcm->adj_by_sw_if_index, t->l2_sw_if_index); |
| 384 | /* Reset adj to drop traffic */ |
| 385 | memset (a, 0, sizeof (*a)); |
| 386 | |
| 387 | set_int_l2_mode (vm, vnm, MODE_L3, t->l2_sw_if_index, 0, 0, 0, 0); |
| 388 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 389 | vnet_sw_interface_set_flags (vnm, t->tunnel_sw_if_index, 0 /* down */ ); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 390 | |
| 391 | hash_unset (xcm->tunnel_index_by_l2_sw_if_index, l2_sw_if_index); |
| 392 | pool_put (xcm->tunnels, t); |
| 393 | } |
| 394 | return 0; |
| 395 | } |
| 396 | |
| 397 | |
| 398 | static clib_error_t * |
| 399 | set_l2_xcrw_command_fn (vlib_main_t * vm, |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 400 | unformat_input_t * input, vlib_cli_command_t * cmd) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 401 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 402 | unformat_input_t _line_input, *line_input = &_line_input; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 403 | int is_add = 1; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 404 | int is_ipv6 = 0; /* for fib id -> fib index mapping */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 405 | u32 tx_fib_id = ~0; |
| 406 | u32 tx_fib_index = ~0; |
| 407 | u32 next_node_index = ~0; |
| 408 | u32 l2_sw_if_index; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 409 | u8 *rw = 0; |
| 410 | vnet_main_t *vnm = vnet_get_main (); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 411 | int rv; |
Billy McFall | a9a20e7 | 2017-02-15 11:39:12 -0500 | [diff] [blame^] | 412 | clib_error_t *error = NULL; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 413 | |
| 414 | |
| 415 | if (!unformat_user (input, unformat_line_input, line_input)) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 416 | return 0; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 417 | |
| 418 | if (!unformat (line_input, "%U", |
| 419 | unformat_vnet_sw_interface, vnm, &l2_sw_if_index)) |
Billy McFall | a9a20e7 | 2017-02-15 11:39:12 -0500 | [diff] [blame^] | 420 | { |
| 421 | error = clib_error_return (0, "unknown input '%U'", |
| 422 | format_unformat_error, line_input); |
| 423 | goto done; |
| 424 | } |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 425 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 426 | while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) |
| 427 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 428 | if (unformat (line_input, "next %U", |
| 429 | unformat_vlib_node, vm, &next_node_index)) |
| 430 | ; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 431 | else if (unformat (line_input, "tx-fib-id %d", &tx_fib_id)) |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 432 | ; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 433 | else if (unformat (line_input, "del")) |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 434 | is_add = 0; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 435 | else if (unformat (line_input, "ipv6")) |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 436 | is_ipv6 = 1; |
| 437 | else if (unformat (line_input, "rw %U", unformat_hex_string, &rw)); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 438 | else |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 439 | break; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 440 | } |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 441 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 442 | if (next_node_index == ~0) |
Billy McFall | a9a20e7 | 2017-02-15 11:39:12 -0500 | [diff] [blame^] | 443 | { |
| 444 | error = clib_error_return (0, "next node not specified"); |
| 445 | goto done; |
| 446 | } |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 447 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 448 | if (tx_fib_id != ~0) |
| 449 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 450 | uword *p; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 451 | |
| 452 | if (is_ipv6) |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 453 | p = hash_get (ip6_main.fib_index_by_table_id, tx_fib_id); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 454 | else |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 455 | p = hash_get (ip4_main.fib_index_by_table_id, tx_fib_id); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 456 | |
| 457 | if (p == 0) |
Billy McFall | a9a20e7 | 2017-02-15 11:39:12 -0500 | [diff] [blame^] | 458 | { |
| 459 | error = |
| 460 | clib_error_return (0, "nonexistent tx_fib_id %d", tx_fib_id); |
| 461 | goto done; |
| 462 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 463 | |
| 464 | tx_fib_index = p[0]; |
| 465 | } |
| 466 | |
| 467 | rv = vnet_configure_l2_xcrw (vm, vnm, l2_sw_if_index, tx_fib_index, |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 468 | rw, next_node_index, is_add); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 469 | |
| 470 | switch (rv) |
| 471 | { |
| 472 | |
| 473 | case 0: |
| 474 | break; |
| 475 | |
| 476 | case VNET_API_ERROR_INVALID_SW_IF_INDEX: |
Billy McFall | a9a20e7 | 2017-02-15 11:39:12 -0500 | [diff] [blame^] | 477 | error = clib_error_return (0, "%U not cross-connected", |
| 478 | format_vnet_sw_if_index_name, |
| 479 | vnm, l2_sw_if_index); |
| 480 | goto done; |
| 481 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 482 | default: |
Billy McFall | a9a20e7 | 2017-02-15 11:39:12 -0500 | [diff] [blame^] | 483 | error = clib_error_return (0, "vnet_configure_l2_xcrw returned %d", rv); |
| 484 | goto done; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 485 | } |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 486 | |
Billy McFall | a9a20e7 | 2017-02-15 11:39:12 -0500 | [diff] [blame^] | 487 | done: |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 488 | vec_free (rw); |
Billy McFall | a9a20e7 | 2017-02-15 11:39:12 -0500 | [diff] [blame^] | 489 | unformat_free (line_input); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 490 | |
Billy McFall | a9a20e7 | 2017-02-15 11:39:12 -0500 | [diff] [blame^] | 491 | return error; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 492 | } |
| 493 | |
Billy McFall | 22aa3e9 | 2016-09-09 08:46:40 -0400 | [diff] [blame] | 494 | /*? |
| 495 | * Add or delete a Layer 2 to Layer 3 rewrite cross-connect. This is |
| 496 | * used to hook Layer 2 interface(s) up to the Layer 3 stack in |
| 497 | * arbitrary ways. For example, cross-connect an L2 interface or |
| 498 | * (future) bridge to an mpls-o-gre tunnel. Set up the L2 rewrite |
| 499 | * string as shown in mpls_gre_rewrite, and use \"mpls-post-rewrite\" |
| 500 | * to fix the GRE IP header checksum and length fields. |
| 501 | * |
| 502 | * @cliexpar |
| 503 | * @todo This is incomplete. This needs a detailed description and a |
| 504 | * practical example. |
| 505 | ?*/ |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 506 | /* *INDENT-OFF* */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 507 | VLIB_CLI_COMMAND (set_l2_xcrw_command, static) = { |
| 508 | .path = "set interface l2 xcrw", |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 509 | .short_help = |
Billy McFall | 22aa3e9 | 2016-09-09 08:46:40 -0400 | [diff] [blame] | 510 | "set interface l2 xcrw <interface> next <node-name>\n" |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 511 | " [del] [tx-fib-id <id>] [ipv6] rw <hex-bytes>", |
| 512 | .function = set_l2_xcrw_command_fn, |
| 513 | }; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 514 | /* *INDENT-ON* */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 515 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 516 | static u8 * |
| 517 | format_l2xcrw (u8 * s, va_list * args) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 518 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 519 | vnet_main_t *vnm = va_arg (*args, vnet_main_t *); |
| 520 | l2_xcrw_tunnel_t *t = va_arg (*args, l2_xcrw_tunnel_t *); |
| 521 | l2_xcrw_main_t *xcm = &l2_xcrw_main; |
| 522 | vlib_main_t *vm = vlib_get_main (); |
| 523 | l2_xcrw_adjacency_t *a; |
| 524 | u8 *rewrite_string; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 525 | |
| 526 | if (t == 0) |
| 527 | { |
| 528 | s = format (s, "%-25s%s", "L2 interface", "Tunnel Details"); |
| 529 | return s; |
| 530 | } |
| 531 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 532 | s = format (s, "%-25U %U ", |
| 533 | format_vnet_sw_if_index_name, vnm, t->l2_sw_if_index, |
| 534 | format_vnet_sw_if_index_name, vnm, t->tunnel_sw_if_index); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 535 | |
| 536 | a = vec_elt_at_index (xcm->adj_by_sw_if_index, t->l2_sw_if_index); |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 537 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 538 | s = format (s, "next %U ", |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 539 | format_vlib_next_node_name, vm, l2_xcrw_node.index, |
| 540 | a->rewrite_header.next_index); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 541 | |
| 542 | if (a->rewrite_header.sw_if_index != ~0) |
| 543 | s = format (s, "tx fib index %d ", a->rewrite_header.sw_if_index); |
| 544 | |
| 545 | if (a->rewrite_header.data_bytes) |
| 546 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 547 | rewrite_string = (u8 *) (a + 1); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 548 | rewrite_string -= a->rewrite_header.data_bytes; |
| 549 | s = format (s, "rewrite data: %U ", |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 550 | format_hex_bytes, rewrite_string, |
| 551 | a->rewrite_header.data_bytes); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 552 | } |
| 553 | |
| 554 | s = format (s, "\n"); |
| 555 | |
| 556 | return s; |
| 557 | } |
| 558 | |
| 559 | |
| 560 | static clib_error_t * |
| 561 | show_l2xcrw_command_fn (vlib_main_t * vm, |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 562 | unformat_input_t * input, vlib_cli_command_t * cmd) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 563 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 564 | vnet_main_t *vnm = vnet_get_main (); |
| 565 | l2_xcrw_main_t *xcm = &l2_xcrw_main; |
| 566 | l2_xcrw_tunnel_t *t; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 567 | |
| 568 | if (pool_elts (xcm->tunnels) == 0) |
| 569 | { |
| 570 | vlib_cli_output (vm, "No L2 / L3 rewrite cross-connects configured"); |
| 571 | return 0; |
| 572 | } |
| 573 | |
| 574 | vlib_cli_output (vm, "%U", format_l2xcrw, 0, 0); |
| 575 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 576 | /* *INDENT-OFF* */ |
| 577 | pool_foreach (t, xcm->tunnels, |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 578 | ({ |
| 579 | vlib_cli_output (vm, "%U", format_l2xcrw, vnm, t); |
| 580 | })); |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 581 | /* *INDENT-ON* */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 582 | |
| 583 | return 0; |
| 584 | } |
| 585 | |
Billy McFall | 22aa3e9 | 2016-09-09 08:46:40 -0400 | [diff] [blame] | 586 | /*? |
| 587 | * Display a Layer 2 to Layer 3 rewrite cross-connect. This is used to |
| 588 | * hook Layer 2 interface(s) up to the Layer 3 stack in arbitrary ways. |
| 589 | * |
| 590 | * @todo This is incomplete. This needs a detailed description and a |
| 591 | * practical example. |
| 592 | ?*/ |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 593 | /* *INDENT-OFF* */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 594 | VLIB_CLI_COMMAND (show_l2xcrw_command, static) = { |
| 595 | .path = "show l2xcrw", |
Billy McFall | 22aa3e9 | 2016-09-09 08:46:40 -0400 | [diff] [blame] | 596 | .short_help = "show l2xcrw", |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 597 | .function = show_l2xcrw_command_fn, |
| 598 | }; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 599 | /* *INDENT-ON* */ |
| 600 | |
| 601 | /* |
| 602 | * fd.io coding-style-patch-verification: ON |
| 603 | * |
| 604 | * Local Variables: |
| 605 | * eval: (c-set-style "gnu") |
| 606 | * End: |
| 607 | */ |