FD.io VPP  v19.04.4-rc0-5-ge88582fac
Vector Packet Processing
punt.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 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 /**
17  * @file
18  * @brief Definitions for punt infrastructure.
19  */
20 #ifndef included_punt_h
21 #define included_punt_h
22 
23 #include <linux/un.h>
24 #include <stdbool.h>
25 
26 typedef enum
27 {
28 #define punt_error(n,s) PUNT_ERROR_##n,
29 #include <vnet/ip/punt_error.def>
30 #undef punt_error
32 } punt_error_t;
33 
34 
36  u8 protocol, u16 port, bool is_add);
38  bool is_ip4, u8 protocol, u16 port,
39  char *client_pathname);
41  u8 l4_protocol, u16 port);
43 
45 {
46  PUNT_L2 = 0,
49 };
50 
51 /*
52  * Packet descriptor header. Version 1
53  * If this header changes, the version must also change to notify clients.
54  */
55 #define PUNT_PACKETDESC_VERSION 1
56 typedef struct __attribute__ ((packed))
57 {
58  u32 sw_if_index; /* RX or TX interface */
59  enum punt_action_e action;
61 
62 /*
63  * Client registration
64  */
65 typedef struct
66 {
69  struct sockaddr_un caddr;
71 
72 typedef struct punt_thread_data_t_
73 {
74  struct iovec *iovecs;
76 
77 typedef struct
78 {
79  int socket_fd;
80  char sun_path[sizeof (struct sockaddr_un)];
89 } punt_main_t;
90 extern punt_main_t punt_main;
91 
92 typedef struct punt_socket_detail_t_
93 {
97  u8 pathname[108];
99 
101 #endif
102 
103 /*
104  * fd.io coding-style-patch-verification: ON
105  *
106  * Local Variables:
107  * eval: (c-set-style "gnu")
108  * End:
109  */
vlib_node_t * interface_output_node
Definition: punt.h:85
u8 protocol
Definition: punt.h:67
Definition: punt.h:46
u32 * ready_fds
Definition: punt.h:86
u32 clib_file_index
Definition: punt.h:83
int socket_fd
Definition: punt.h:79
unsigned char u8
Definition: types.h:56
punt_thread_data_t * thread_data
Definition: punt.h:88
u16 port
Definition: punt.h:68
struct punt_socket_detail_t_ punt_socket_detail_t
unsigned int u32
Definition: types.h:88
punt_client_t * clients_by_dst_port6
Definition: punt.h:82
struct iovec * iovecs
Definition: punt.h:74
punt_error_t
Definition: punt.h:26
struct punt_thread_data_t_ punt_thread_data_t
unsigned short u16
Definition: types.h:57
clib_error_t * vnet_punt_socket_del(vlib_main_t *vm, bool is_ip4, u8 l4_protocol, u16 port)
Definition: punt.c:678
punt_main_t punt_main
vlib_main_t * vm
Definition: buffer.c:312
u32 sw_if_index
Definition: punt.h:58
clib_error_t * vnet_punt_add_del(vlib_main_t *vm, u8 ipv, u8 protocol, u16 port, bool is_add)
Request IP traffic punt to the local TCP/IP stack.
Definition: punt.c:708
punt_socket_detail_t * punt_socket_entries(u8 ipv)
Definition: punt.c:952
u32 * rx_buffers
Definition: punt.h:87
u8 is_add
Definition: ipsec_gre.api:36
punt_client_t * clients_by_dst_port4
Definition: punt.h:81
struct punt_client_t_ punt_client_t
A client using the punt serivce and its registrations.
punt_action_e
Definition: punt.h:44
bool is_configured
Definition: punt.h:84
char * vnet_punt_get_server_pathname(void)
Definition: punt.c:75
clib_error_t * vnet_punt_socket_add(vlib_main_t *vm, u32 header_version, bool is_ip4, u8 protocol, u16 port, char *client_pathname)
Definition: punt.c:642
u8 protocol
Definition: ipsec.api:96