1/*
2 * Copyright (c) 1982, 1986, 1993
3 *	The Regents of the University of California.  All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 *    notice, this list of conditions and the following disclaimer in the
12 *    documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 *    must display the following acknowledgement:
15 *	This product includes software developed by the University of
16 *	California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 *    may be used to endorse or promote products derived from this software
19 *    without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 *	@(#)udp.h	8.1 (Berkeley) 6/10/93
34 */
35
36/*
37 * Udp protocol header.
38 * Per RFC 768, September, 1981.
39 */
40struct udphdr {
41	nd_uint16_t	uh_sport;		/* source port */
42	nd_uint16_t	uh_dport;		/* destination port */
43	nd_uint16_t	uh_ulen;		/* udp length */
44	nd_uint16_t	uh_sum;			/* udp checksum */
45};
46
47#ifndef NAMESERVER_PORT
48#define NAMESERVER_PORT			53
49#endif
50#ifndef BOOTPS_PORT
51#define BOOTPS_PORT			67	/* RFC951 */
52#endif
53#ifndef BOOTPC_PORT
54#define BOOTPC_PORT			68	/* RFC951 */
55#endif
56#ifndef TFTP_PORT
57#define TFTP_PORT			69	/*XXX*/
58#endif
59#ifndef KERBEROS_PORT
60#define KERBEROS_PORT			88	/*XXX*/
61#endif
62#ifndef SUNRPC_PORT
63#define SUNRPC_PORT			111	/*XXX*/
64#endif
65#ifndef NTP_PORT
66#define NTP_PORT			123	/*XXX*/
67#endif
68#ifndef NETBIOS_NS_PORT
69#define NETBIOS_NS_PORT			137	/* RFC 1001, RFC 1002 */
70#endif
71#ifndef NETBIOS_DGRAM_PORT
72#define NETBIOS_DGRAM_PORT		138	/* RFC 1001, RFC 1002 */
73#endif
74#ifndef SNMP_PORT
75#define SNMP_PORT			161	/*XXX*/
76#endif
77#ifndef SNMPTRAP_PORT
78#define SNMPTRAP_PORT			162	/*XXX*/
79#endif
80#ifndef PTP_EVENT_PORT
81#define PTP_EVENT_PORT			319 /* IANA */
82#endif
83#ifndef PTP_GENERAL_PORT
84#define PTP_GENERAL_PORT	        320 /* IANA */
85#endif
86#ifndef CISCO_AUTORP_PORT
87#define CISCO_AUTORP_PORT		496	/*XXX*/
88#endif
89#ifndef ISAKMP_PORT
90#define ISAKMP_PORT			500	/*XXX*/
91#endif
92#ifndef SYSLOG_PORT
93#define SYSLOG_PORT			514	/* rfc3164 */
94#endif
95#ifndef RIP_PORT
96#define RIP_PORT			520	/*XXX*/
97#endif
98#ifndef RIPNG_PORT
99#define RIPNG_PORT			521	/* RFC 2080 */
100#endif
101#ifndef TIMED_PORT
102#define TIMED_PORT			525	/*XXX*/
103#endif
104#ifndef DHCP6_SERV_PORT
105#define DHCP6_SERV_PORT			546	/*XXX*/
106#endif
107#ifndef DHCP6_CLI_PORT
108#define DHCP6_CLI_PORT			547	/*XXX*/
109#endif
110#ifndef LDP_PORT
111#define LDP_PORT			646
112#endif
113#ifndef AQDV_PORT
114#define AODV_PORT			654	/*XXX*/
115#endif
116#ifndef OLSR_PORT
117#define OLSR_PORT			698	/* rfc3626 */
118#endif
119#ifndef LMP_PORT
120#define LMP_PORT			701	/* rfc4204 */
121#endif
122#ifndef KERBEROS_SEC_PORT
123#define KERBEROS_SEC_PORT		750	/*XXX - Kerberos v4 */
124#endif
125#ifndef LWRES_PORT
126#define LWRES_PORT			921	/*XXX*/
127#endif
128#ifndef VQP_PORT
129#define VQP_PORT			1589	/*XXX*/
130#endif
131#ifndef RADIUS_PORT
132#define RADIUS_PORT			1645	/*XXX*/
133#endif
134#ifndef RADIUS_ACCOUNTING_PORT
135#define RADIUS_ACCOUNTING_PORT		1646
136#endif
137#ifndef RADIUS_CISCO_COA_PORT
138#define RADIUS_CISCO_COA_PORT		1700
139#endif
140#ifndef L2TP_PORT
141#define L2TP_PORT			1701	/*XXX*/
142#endif
143#ifndef RADIUS_NEW_PORT
144#define RADIUS_NEW_PORT			1812	/*XXX*/
145#endif
146#ifndef RADIUS_NEW_ACCOUNTING_PORT
147#define RADIUS_NEW_ACCOUNTING_PORT	1813
148#endif
149#ifndef HSRP_PORT
150#define HSRP_PORT			1985	/*XXX*/
151#endif
152#ifndef ZEPHYR_SRV_PORT
153#define ZEPHYR_SRV_PORT			2103	/*XXX*/
154#endif
155#ifndef ZEPHYR_CLI_PORT
156#define ZEPHYR_CLT_PORT			2104	/*XXX*/
157#endif
158#ifndef VAT_PORT
159#define VAT_PORT			3456	/*XXX*/
160#endif
161#ifndef MPLS_LSP_PING_PORT
162#define MPLS_LSP_PING_PORT		3503	/* draft-ietf-mpls-lsp-ping-02.txt */
163#endif
164#ifndef BCM_LI_PORT
165#define BCM_LI_PORT			49152   /* SDK default */
166#endif
167#ifndef BFD_CONTROL_PORT
168#define BFD_CONTROL_PORT		3784	/* RFC 5881 */
169#endif
170#ifndef BFD_ECHO_PORT
171#define BFD_ECHO_PORT			3785	/* RFC 5881 */
172#endif
173#ifndef RADIUS_COA_PORT
174#define RADIUS_COA_PORT			3799	/* RFC 5176 */
175#endif
176#ifndef LISP_CONTROL_PORT
177#define LISP_CONTROL_PORT		4342	/* RFC 6830 */
178#endif
179#ifndef ISAKMP_PORT_NATT
180#define ISAKMP_PORT_NATT		4500	/* rfc3948 */
181#endif
182#ifndef WB_PORT
183#define WB_PORT				4567
184#endif
185#ifndef BFD_MULTIHOP_PORT
186#define BFD_MULTIHOP_PORT		4784	/* RFC 5883 */
187#endif
188#ifndef VXLAN_PORT
189#define VXLAN_PORT			4789	/* RFC 7348 */
190#endif
191#ifndef VXLAN_GPE_PORT
192#define VXLAN_GPE_PORT			4790	/* draft-ietf-nvo3-vxlan-gpe-01 */
193#endif
194#ifndef SIP_PORT
195#define SIP_PORT			5060
196#endif
197#ifndef MULTICASTDNS_PORT
198#define MULTICASTDNS_PORT		5353	/* RFC 6762 */
199#endif
200#ifndef AHCP_PORT
201#define AHCP_PORT			5359	/* draft-chroboczek-ahcp-00 */
202#endif
203#ifndef GENEVE_PORT
204#define GENEVE_PORT			6081	/* draft-gross-geneve-02 */
205#endif
206#ifndef SFLOW_PORT
207#define SFLOW_PORT			6343	/* https://sflow.org/developers/specifications.php */
208#endif
209#ifndef MPLS_PORT
210#define MPLS_PORT			6635	/* RFC 7510 */
211#endif
212#ifndef BABEL_PORT
213#define BABEL_PORT			6696	/* RFC 6126 errata */
214#endif
215#ifndef BABEL_PORT_OLD
216#define BABEL_PORT_OLD			6697	/* RFC 6126 */
217#endif
218#ifndef BFD_LAG_PORT
219#define BFD_LAG_PORT			6784	/* RFC 7310 */
220#endif
221#ifndef RX_PORT_LOW
222#define RX_PORT_LOW			7000	/*XXX*/
223#endif
224#ifndef RX_PORT_HIGH
225#define RX_PORT_HIGH			7009	/*XXX*/
226#endif
227#ifndef ISAKMP_PORT_USER1
228#define ISAKMP_PORT_USER1		7500	/*XXX - nonstandard*/
229#endif
230#ifndef HNCP_PORT
231#define HNCP_PORT			8231	/* RFC 7788 */
232#endif
233#ifndef OTV_PORT
234#define OTV_PORT			8472	/* draft-hasmit-otv-04 */
235#endif
236#ifndef ISAKMP_PORT_USER2
237#define ISAKMP_PORT_USER2		8500	/*XXX - nonstandard*/
238#endif
239#ifndef LWAPP_DATA_PORT
240#define LWAPP_DATA_PORT			12222	/* RFC 5412 */
241#endif
242#ifndef LWAPP_CONTROL_PORT
243#define LWAPP_CONTROL_PORT		12223	/* RFC 5412 */
244#endif
245#ifndef ZEP_PORT
246#define ZEP_PORT			17754	/* XXX */
247#endif
248#ifndef SOMEIP_PORT
249#define SOMEIP_PORT			30490	/* https://www.autosar.org/standards/foundation */
250#endif
251