FD.io VPP  v20.09-rc2-28-g3c5414029
Vector Packet Processing
wireguard.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Doc.ai 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 #include <vnet/vnet.h>
17 #include <vnet/plugin/plugin.h>
18 #include <vnet/ipip/ipip.h>
19 #include <vpp/app/version.h>
20 #include <vnet/udp/udp.h>
21 
24 #include <wireguard/wireguard_if.h>
25 #include <wireguard/wireguard.h>
26 
28 
29 static clib_error_t *
31 {
32  wg_main_t *wmp = &wg_main;
33 
34  wmp->vlib_main = vm;
35 
37  wmp->out_fq_index =
39 
41 
44 
46 
47  return (NULL);
48 }
49 
51 
52 /* *INDENT-OFF* */
53 
54 VNET_FEATURE_INIT (wg_output_tun, static) =
55 {
56  .arc_name = "ip4-output",
57  .node_name = "wg-output-tun",
58 };
59 
61 {
62  .version = VPP_BUILD_VER,
63  .description = "Wireguard Protocol",
64 };
65 /* *INDENT-ON* */
66 
67 /*
68  * fd.io coding-style-patch-verification: ON
69  *
70  * Local Variables:
71  * eval: (c-set-style "gnu")
72  * End:
73  */
wg_per_thread_data_t * per_thread_data
Definition: wireguard.h:43
u32 vlib_frame_queue_main_init(u32 node_index, u32 frame_queue_nelts)
Definition: threads.c:1873
vlib_main_t * vm
Definition: in2out_ed.c:1582
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
Definition: vec.h:520
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:173
static clib_error_t * wg_init(vlib_main_t *vm)
Definition: wireguard.c:30
vlib_node_registration_t wg_input_node
(constructor) VLIB_REGISTER_NODE (wg_input_node)
vlib_node_registration_t wg_output_tun_node
(constructor) VLIB_REGISTER_NODE (wg_output_tun_node)
u32 out_fq_index
Definition: wireguard.h:41
void wg_timer_wheel_init()
wg_main_t wg_main
Definition: wireguard.c:27
VLIB_PLUGIN_REGISTER()
VNET_FEATURE_INIT(wg_output_tun, static)
vlib_main_t * vlib_main
Definition: wireguard.h:34
static vlib_thread_main_t * vlib_get_thread_main()
Definition: global_funcs.h:32
#define CLIB_CACHE_LINE_BYTES
Definition: cache.h:59
u32 in_fq_index
Definition: wireguard.h:40