misc: minimize dependencies on udp.h
[vpp.git] / src / vnet / udp / udp_local.h
1 /*
2  * Copyright (c) 2020 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 SRC_VNET_UDP_UDP_LOCAL_H_
17 #define SRC_VNET_UDP_UDP_LOCAL_H_
18
19 #include <vnet/vnet.h>
20
21 #define foreach_udp4_dst_port                   \
22 _ (53, dns)                                     \
23 _ (67, dhcp_to_server)                          \
24 _ (68, dhcp_to_client)                          \
25 _ (500, ikev2)                                  \
26 _ (2152, GTPU)                                  \
27 _ (3784, bfd4)                                  \
28 _ (3785, bfd_echo4)                             \
29 _ (4341, lisp_gpe)                              \
30 _ (4342, lisp_cp)                               \
31 _ (4500, ipsec)                                 \
32 _ (4739, ipfix)                                 \
33 _ (4789, vxlan)                                 \
34 _ (4789, vxlan6)                                \
35 _ (48879, vxlan_gbp)                            \
36 _ (4790, VXLAN_GPE)                             \
37 _ (6633, vpath_3)                               \
38 _ (6081, geneve)                                \
39 _ (53053, dns_reply)
40
41
42 #define foreach_udp6_dst_port                   \
43 _ (53, dns6)                                    \
44 _ (547, dhcpv6_to_server)                       \
45 _ (546, dhcpv6_to_client)                       \
46 _ (2152, GTPU6)                                 \
47 _ (3784, bfd6)                                  \
48 _ (3785, bfd_echo6)                             \
49 _ (4341, lisp_gpe6)                             \
50 _ (4342, lisp_cp6)                              \
51 _ (48879, vxlan6_gbp)                           \
52 _ (4790, VXLAN6_GPE)                            \
53 _ (6633, vpath6_3)                              \
54 _ (6081, geneve6)                               \
55 _ (8138, BIER)                                  \
56 _ (53053, dns_reply6)
57
58 typedef enum
59 {
60 #define _(n,f) UDP_DST_PORT_##f = n,
61   foreach_udp4_dst_port foreach_udp6_dst_port
62 #undef _
63 } udp_dst_port_t;
64
65 typedef enum
66 {
67 #define _(n,f) UDP6_DST_PORT_##f = n,
68   foreach_udp6_dst_port
69 #undef _
70 } udp6_dst_port_t;
71
72 void udp_register_dst_port (vlib_main_t * vm,
73                             udp_dst_port_t dst_port,
74                             u32 node_index, u8 is_ip4);
75 void udp_unregister_dst_port (vlib_main_t * vm,
76                               udp_dst_port_t dst_port, u8 is_ip4);
77 u8 udp_is_valid_dst_port (udp_dst_port_t dst_port, u8 is_ip4);
78
79 #endif /* SRC_VNET_UDP_UDP_LOCAL_H_ */
80
81 /*
82  * fd.io coding-style-patch-verification: ON
83  *
84  * Local Variables:
85  * eval: (c-set-style "gnu")
86  * End:
87  */