FD.io VPP  v19.08.3-2-gbabecb413
Vector Packet Processing
nsim.h
Go to the documentation of this file.
1 
2 /*
3  * nsim.h - skeleton vpp engine plug-in header file
4  *
5  * Copyright (c) <current-year> <your-organization>
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at:
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #ifndef __included_nsim_h__
19 #define __included_nsim_h__
20 
21 #include <vnet/vnet.h>
22 #include <vnet/ip/ip.h>
23 #include <vnet/ethernet/ethernet.h>
24 
25 #include <vppinfra/hash.h>
26 #include <vppinfra/error.h>
27 
28 typedef struct
29 {
35  u32 pad; /* pad to 32-bytes */
37 
38 typedef struct
39 {
46 } nsim_wheel_t;
47 
48 typedef struct
49 {
50  /* API message ID base */
52 
53  /* Two interfaces, cross-connected with delay */
54  u32 sw_if_index0, sw_if_index1;
55  u32 output_next_index0, output_next_index1;
56 
57  /* N interfaces, using the output feature */
59 
60  /* Random seed for loss-rate simulation */
62 
63  /* Per-thread scheduler wheels */
65 
66  /* Config parameters */
72 
74 
75  /* Wheels are configured */
77 
78  /* convenience */
81 } nsim_main_t;
82 
83 extern nsim_main_t nsim_main;
84 
87 
88 #endif /* __included_nsim_h__ */
89 
90 /*
91  * fd.io coding-style-patch-verification: ON
92  *
93  * Local Variables:
94  * eval: (c-set-style "gnu")
95  * End:
96  */
u32 * output_next_index_by_sw_if_index
Definition: nsim.h:58
f64 packet_size
Definition: nsim.h:69
u8 pad[3]
log2 (size of the packing page block)
Definition: bihash_doc.h:61
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
Definition: cache.h:60
u16 msg_id_base
Definition: nsim.h:51
unsigned long u64
Definition: types.h:89
Definition: nsim.h:28
u32 pad
Definition: nsim.h:35
double f64
Definition: types.h:142
u32 cursize
Definition: nsim.h:41
u32 tx_sw_if_index
Definition: nsim.h:32
vnet_main_t * vnet_main
Definition: nsim.h:80
int is_configured
Definition: nsim.h:76
unsigned int u32
Definition: types.h:88
vlib_node_registration_t nsim_node
(constructor) VLIB_REGISTER_NODE (nsim_node)
Definition: node.c:51
u64 mmap_size
Definition: nsim.h:73
unsigned short u16
Definition: types.h:57
u32 tail
Definition: nsim.h:43
u32 sw_if_index1
Definition: nsim.h:54
vlib_node_registration_t nsim_input_node
(constructor) VLIB_REGISTER_NODE (nsim_input_node)
Definition: nsim_input.c:168
nsim_wheel_entry_t * entries
Definition: nsim.h:44
u32 head
Definition: nsim.h:42
vlib_main_t * vlib_main
Definition: nsim.h:79
nsim_wheel_t ** wheel_by_thread
Definition: nsim.h:64
u32 poll_main_thread
Definition: nsim.h:71
struct _vlib_node_registration vlib_node_registration_t
u32 seed
Definition: nsim.h:61
f64 bandwidth
Definition: nsim.h:68
f64 tx_time
Definition: nsim.h:30
u32 buffer_index
Definition: nsim.h:34
nsim_main_t nsim_main
Definition: nsim.c:59
f64 delay
Definition: nsim.h:67
u32 output_next_index
Definition: nsim.h:33
f64 drop_fraction
Definition: nsim.h:70
u32 wheel_size
Definition: nsim.h:40
u32 output_next_index1
Definition: nsim.h:55
u32 rx_sw_if_index
Definition: nsim.h:31