2 * Copyright (c) 2018 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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <vnet/ethernet/ethernet.h>
22 * representation of a pipe interface
24 typedef struct pipe_t_
26 /** the SW if_index of the other end of the pipe */
29 /** Sub-interface config */
30 subint_config_t subint;
34 * Create a new pipe interface
36 * @param is_specified Has the user speficied a desired instance number
37 * @param user_instance The user's desired instnace
38 * @param parent_sw_index OUT the created parent interface
39 * @param pipe_sw_if_index OUT the ends of the pipe
41 extern int vnet_create_pipe_interface (u8 is_specified,
43 u32 * parent_sw_if_index,
44 u32 pipe_sw_if_index[2]);
45 extern int vnet_delete_pipe_interface (u32 parent_sw_if_index);
48 * Get the pipe instnace based on one end
50 extern pipe_t *pipe_get (u32 sw_if_index);
53 * Call back function when walking all the pipes
55 typedef walk_rc_t (*pipe_cb_fn_t) (u32 parent_sw_if_index,
56 u32 pipe_sw_if_index[2],
57 u32 instance, void *ctx);
60 * Walk all the of pipe interfaces
62 extern void pipe_walk (pipe_cb_fn_t fn, void *ctx);
67 * fd.io coding-style-patch-verification: ON
70 * eval: (c-set-style "gnu")