blob: 16286824ef21c43fe9366c3a01febdc476b52869 [file] [log] [blame]
Florin Corasb040f982020-10-20 14:59:43 -07001/*
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
58typedef 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
65typedef enum
66{
67#define _(n,f) UDP6_DST_PORT_##f = n,
68 foreach_udp6_dst_port
69#undef _
70} udp6_dst_port_t;
71
72void udp_register_dst_port (vlib_main_t * vm,
73 udp_dst_port_t dst_port,
74 u32 node_index, u8 is_ip4);
75void udp_unregister_dst_port (vlib_main_t * vm,
76 udp_dst_port_t dst_port, u8 is_ip4);
77u8 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 */