FD.io VPP  v19.04-6-g6f05f72
Vector Packet Processing
pipe.h
Go to the documentation of this file.
1 /*
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:
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 #ifndef __PIPE_H__
17 #define __PIPE_H__
18 
19 #include <vnet/ethernet/ethernet.h>
20 
21 /**
22  * represenation of a pipe interface
23  */
24 typedef struct pipe_t_
25 {
26  /** the SW if_index of the other end of the pipe */
28 
29  /** Sub-interface config */
31 } pipe_t;
32 
33 /**
34  * Create a new pipe interface
35  *
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
40  */
41 extern int vnet_create_pipe_interface (u8 is_specified,
42  u32 user_instance,
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);
46 
47 /**
48  * Get the pipe instnace based on one end
49  */
50 extern pipe_t *pipe_get (u32 sw_if_index);
51 
52 /**
53  * Call back function when walking all the pipes
54  */
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);
58 
59 /**
60  * Walk all the of pipe interfaces
61  */
62 extern void pipe_walk (pipe_cb_fn_t fn, void *ctx);
63 
64 #endif
65 
66 /*
67  * fd.io coding-style-patch-verification: ON
68  *
69  * Local Variables:
70  * eval: (c-set-style "gnu")
71  * End:
72  */
int vnet_delete_pipe_interface(u32 parent_sw_if_index)
Definition: pipe.c:708
pipe_t * pipe_get(u32 sw_if_index)
Get the pipe instnace based on one end.
Definition: pipe.c:95
int vnet_create_pipe_interface(u8 is_specified, u32 user_instance, u32 *parent_sw_if_index, u32 pipe_sw_if_index[2])
Create a new pipe interface.
Definition: pipe.c:531
void pipe_walk(pipe_cb_fn_t fn, void *ctx)
Walk all the of pipe interfaces.
Definition: pipe.c:649
struct pipe_t_ pipe_t
represenation of a pipe interface
unsigned char u8
Definition: types.h:56
walk_rc_t(* pipe_cb_fn_t)(u32 parent_sw_if_index, u32 pipe_sw_if_index[2], u32 instance, void *ctx)
Call back function when walking all the pipes.
Definition: pipe.h:55
enum walk_rc_t_ walk_rc_t
Walk return code.
represenation of a pipe interface
Definition: pipe.h:24
unsigned int u32
Definition: types.h:88
long ctx[MAX_CONNS]
Definition: main.c:144
u32 sw_if_index
the SW if_index of the other end of the pipe
Definition: pipe.h:27
subint_config_t subint
Sub-interface config.
Definition: pipe.h:30