From b040f98a88954ccf2e63fd7b2676865a2dbe0078 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Tue, 20 Oct 2020 14:59:43 -0700 Subject: misc: minimize dependencies on udp.h Type: improvement Signed-off-by: Florin Coras Change-Id: Id13f33843b230a1d169560742c4f7b2dc17d8718 --- src/vnet/udp/udp_local.h | 87 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 src/vnet/udp/udp_local.h (limited to 'src/vnet/udp/udp_local.h') diff --git a/src/vnet/udp/udp_local.h b/src/vnet/udp/udp_local.h new file mode 100644 index 00000000000..16286824ef2 --- /dev/null +++ b/src/vnet/udp/udp_local.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2020 Cisco and/or its affiliates. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SRC_VNET_UDP_UDP_LOCAL_H_ +#define SRC_VNET_UDP_UDP_LOCAL_H_ + +#include + +#define foreach_udp4_dst_port \ +_ (53, dns) \ +_ (67, dhcp_to_server) \ +_ (68, dhcp_to_client) \ +_ (500, ikev2) \ +_ (2152, GTPU) \ +_ (3784, bfd4) \ +_ (3785, bfd_echo4) \ +_ (4341, lisp_gpe) \ +_ (4342, lisp_cp) \ +_ (4500, ipsec) \ +_ (4739, ipfix) \ +_ (4789, vxlan) \ +_ (4789, vxlan6) \ +_ (48879, vxlan_gbp) \ +_ (4790, VXLAN_GPE) \ +_ (6633, vpath_3) \ +_ (6081, geneve) \ +_ (53053, dns_reply) + + +#define foreach_udp6_dst_port \ +_ (53, dns6) \ +_ (547, dhcpv6_to_server) \ +_ (546, dhcpv6_to_client) \ +_ (2152, GTPU6) \ +_ (3784, bfd6) \ +_ (3785, bfd_echo6) \ +_ (4341, lisp_gpe6) \ +_ (4342, lisp_cp6) \ +_ (48879, vxlan6_gbp) \ +_ (4790, VXLAN6_GPE) \ +_ (6633, vpath6_3) \ +_ (6081, geneve6) \ +_ (8138, BIER) \ +_ (53053, dns_reply6) + +typedef enum +{ +#define _(n,f) UDP_DST_PORT_##f = n, + foreach_udp4_dst_port foreach_udp6_dst_port +#undef _ +} udp_dst_port_t; + +typedef enum +{ +#define _(n,f) UDP6_DST_PORT_##f = n, + foreach_udp6_dst_port +#undef _ +} udp6_dst_port_t; + +void udp_register_dst_port (vlib_main_t * vm, + udp_dst_port_t dst_port, + u32 node_index, u8 is_ip4); +void udp_unregister_dst_port (vlib_main_t * vm, + udp_dst_port_t dst_port, u8 is_ip4); +u8 udp_is_valid_dst_port (udp_dst_port_t dst_port, u8 is_ip4); + +#endif /* SRC_VNET_UDP_UDP_LOCAL_H_ */ + +/* + * fd.io coding-style-patch-verification: ON + * + * Local Variables: + * eval: (c-set-style "gnu") + * End: + */ -- cgit 1.2.3-korg