udp.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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. * Udp protocol header.
  37. * Per RFC 768, September, 1981.
  38. */
  39. struct udphdr {
  40. uint16_t uh_sport; /* source port */
  41. uint16_t uh_dport; /* destination port */
  42. uint16_t uh_ulen; /* udp length */
  43. uint16_t uh_sum; /* udp checksum */
  44. };
  45. #ifndef NAMESERVER_PORT
  46. #define NAMESERVER_PORT 53
  47. #endif
  48. #ifndef TACACS_DB_PORT
  49. #define TACACS_DB_PORT 65 /*XXX*/
  50. #endif
  51. #ifndef ORACLE_SQLNET_PORT
  52. #define ORACLE_SQLNET_PORT 66 /*XXX*/
  53. #endif
  54. #ifndef BOOTPS_PORT
  55. #define BOOTPS_PORT 67 /* RFC951 */
  56. #endif
  57. #ifndef BOOTPC_PORT
  58. #define BOOTPC_PORT 68 /* RFC951 */
  59. #endif
  60. #ifndef TFTP_PORT
  61. #define TFTP_PORT 69 /*XXX*/
  62. #endif
  63. #ifndef KERBEROS_PORT
  64. #define KERBEROS_PORT 88 /*XXX*/
  65. #endif
  66. #ifndef SUNRPC_PORT
  67. #define SUNRPC_PORT 111 /*XXX*/
  68. #endif
  69. #ifndef NTP_PORT
  70. #define NTP_PORT 123 /*XXX*/
  71. #endif
  72. #ifndef NETBIOS_NS_PORT
  73. #define NETBIOS_NS_PORT 137 /* RFC 1001, RFC 1002 */
  74. #endif
  75. #ifndef NETBIOS_DGRAM_PORT
  76. #define NETBIOS_DGRAM_PORT 138 /* RFC 1001, RFC 1002 */
  77. #endif
  78. #ifndef NETBIOS_SSN_PORT
  79. #define NETBIOS_SSN_PORT 139 /* RFC 1001, RFC 1002 */
  80. #endif
  81. #ifndef SNMP_PORT
  82. #define SNMP_PORT 161 /*XXX*/
  83. #endif
  84. #ifndef SNMPTRAP_PORT
  85. #define SNMPTRAP_PORT 162 /*XXX*/
  86. #endif
  87. #ifndef BGP_PORT
  88. #define BGP_PORT 179 /*XXX*/
  89. #endif
  90. #ifndef APPLETALK_RTMP_PORT
  91. #define APPLETALK_RTMP_PORT 201 /*XXX*/
  92. #endif
  93. #ifndef APPLETALK_NB_PORT
  94. #define APPLETALK_NB_PORT 202 /*XXX*/
  95. #endif
  96. #ifndef APPLETALK_ECHO
  97. #define APPLETALK_ECHO 204 /*XXX*/
  98. #endif
  99. #ifndef APPLETALK_ZONE_INFO_PORT
  100. #define APPLETALK_ZONE_INFO_PORT 206 /*XXX*/
  101. #endif
  102. #ifndef LDAP_PORT
  103. #define LDAP_PORT 389 /*XXX*/
  104. #endif
  105. #ifndef HTTPS_PORT
  106. #define HTTPS_PORT 443 /*XXX*/
  107. #endif
  108. #ifndef MICROSOFT_DS_PORT
  109. #define MICROSOFT_DS_PORT 445 /*XXX*/
  110. #endif
  111. #ifndef KERBEROS5_PASSWD_PORT
  112. #define KERBEROS5_PASSWD_PORT 464 /* PER IANA */
  113. #endif
  114. #ifndef CISCO_AUTORP_PORT
  115. #define CISCO_AUTORP_PORT 496 /*XXX*/
  116. #endif
  117. #ifndef ISAKMP_PORT
  118. #define ISAKMP_PORT 500 /*XXX*/
  119. #endif
  120. #ifndef SYSLOG_PORT
  121. #define SYSLOG_PORT 514 /* rfc3164 */
  122. #endif
  123. #ifndef RIP_PORT
  124. #define RIP_PORT 520 /*XXX*/
  125. #endif
  126. #ifndef RIPNG_PORT
  127. #define RIPNG_PORT 521 /* RFC 2080 */
  128. #endif
  129. #ifndef TIMED_PORT
  130. #define TIMED_PORT 525 /*XXX*/
  131. #endif
  132. #ifndef KERBEROS_LOGIN_PORT
  133. #define KERBEROS_LOGIN_PORT 543 /*XXX*/
  134. #endif
  135. #ifndef KERBEROS_SHELL_PORT
  136. #define KERBEROS_SHELL_PORT 544 /*XXX*/
  137. #endif
  138. #ifndef DHCP6_SERV_PORT
  139. #define DHCP6_SERV_PORT 546 /*XXX*/
  140. #endif
  141. #ifndef DHCP6_CLI_PORT
  142. #define DHCP6_CLI_PORT 547 /*XXX*/
  143. #endif
  144. #ifndef LDAPS_PORT
  145. #define LDAPS_PORT 636 /*XXX - LDAP over TLS/SSL */
  146. #endif
  147. #ifndef LDP_PORT
  148. #define LDP_PORT 646
  149. #endif
  150. #ifndef DHCP_FAILOVER_PORT
  151. #define DHCP_FAILOVER_PORT 647 /*XXX*/
  152. #endif
  153. #ifndef AQDV_PORT
  154. #define AODV_PORT 654 /*XXX*/
  155. #endif
  156. #ifndef OLSR_PORT
  157. #define OLSR_PORT 698 /* rfc3626 */
  158. #endif
  159. #ifndef LMP_PORT
  160. #define LMP_PORT 701 /* rfc4204 */
  161. #endif
  162. #ifndef CISCO_TDP_PORT
  163. #define CISCO_TDP_PORT 711 /*XXX*/
  164. #endif
  165. #ifndef KERBEROS_ADM_PORT
  166. #define KERBEROS_ADM_PORT 749 /*XXX - Kerberos v5 */
  167. #endif
  168. #ifndef KERBEROS_SEC_PORT
  169. #define KERBEROS_SEC_PORT 750 /*XXX - Kerberos v4 */
  170. #endif
  171. #ifndef RSYNC_PORT
  172. #define RSYNC_PORT 873 /*XXX*/
  173. #endif
  174. #ifndef LWRES_PORT
  175. #define LWRES_PORT 921 /*XXX*/
  176. #endif
  177. #ifndef OPENSSL_PORT
  178. #define OPENSSL_PORT 1194 /*XXX*/
  179. #endif
  180. #ifndef LOTUS_NOTES_PORT
  181. #define LOTUS_NOTES_PORT 1352 /*XXX*/
  182. #endif
  183. #ifndef MS_SQL_SERVER_PORT
  184. #define MS_SQL_SERVER_PORT 1433 /*XXX*/
  185. #endif
  186. #ifndef MS_SQL_SERVER_MONITOR
  187. #define MS_SQL_SERVER_MONITOR 1434 /*XXX*/
  188. #endif
  189. #ifndef INGRESLOCK_PORT
  190. #define INGRESLOCK_PORT 1524 /*XXX*/
  191. #endif
  192. #ifndef VQP_PORT
  193. #define VQP_PORT 1589 /*XXX*/
  194. #endif
  195. #ifndef RADIUS_PORT
  196. #define RADIUS_PORT 1645 /*XXX*/
  197. #endif
  198. #ifndef RADIUS_ACCOUNTING_PORT
  199. #define RADIUS_ACCOUNTING_PORT 1646
  200. #endif
  201. #ifndef RADIUS_CISCO_COA_PORT
  202. #define RADIUS_CISCO_COA_PORT 1700
  203. #endif
  204. #ifndef L2TP_PORT
  205. #define L2TP_PORT 1701 /*XXX*/
  206. #endif
  207. #ifndef RADIUS_NEW_PORT
  208. #define RADIUS_NEW_PORT 1812 /*XXX*/
  209. #endif
  210. #ifndef RADIUS_NEW_ACCOUNTING_PORT
  211. #define RADIUS_NEW_ACCOUNTING_PORT 1813
  212. #endif
  213. #ifndef HSRP_PORT
  214. #define HSRP_PORT 1985 /*XXX*/
  215. #endif
  216. #ifndef NFS_DAEMON_PORT
  217. #define NFS_DAEMON_PORT 2049 /*XXX*/
  218. #endif
  219. #ifndef ZEPHYR_SRV_PORT
  220. #define ZEPHYR_SRV_PORT 2103 /*XXX*/
  221. #endif
  222. #ifndef ZEPHYR_CLI_PORT
  223. #define ZEPHYR_CLT_PORT 2104 /*XXX*/
  224. #endif
  225. #ifndef MYSQL_PORT
  226. #define MYSQL_PORT 3306 /*XXX*/
  227. #endif
  228. #ifndef MS_RDP_PORT
  229. #define MS_RDP_PORT 3389 /*XXX*/
  230. #endif
  231. #ifndef VAT_PORT
  232. #define VAT_PORT 3456 /*XXX*/
  233. #endif
  234. #ifndef MPLS_LSP_PING_PORT
  235. #define MPLS_LSP_PING_PORT 3503 /* draft-ietf-mpls-lsp-ping-02.txt */
  236. #endif
  237. #ifndef SUBVERSION_PORT
  238. #define SUBVERSION_PORT 3690 /*XXX*/
  239. #endif
  240. #ifndef BFD_CONTROL_PORT
  241. #define BFD_CONTROL_PORT 3784 /* RFC 5881 */
  242. #endif
  243. #ifndef BFD_ECHO_PORT
  244. #define BFD_ECHO_PORT 3785 /* RFC 5881 */
  245. #endif
  246. #ifndef RADIUS_COA_PORT
  247. #define RADIUS_COA_PORT 3799 /* RFC 5176 */
  248. #endif
  249. #ifndef NFS_LOCK_DAEMON_PORT
  250. #define NFS_LOCK_DAEMON_PORT 4045 /*XXX*/
  251. #endif
  252. #ifndef LISP_CONTROL_PORT
  253. #define LISP_CONTROL_PORT 4342 /* RFC 6830 */
  254. #endif
  255. #ifndef ISAKMP_PORT_NATT
  256. #define ISAKMP_PORT_NATT 4500 /* rfc3948 */
  257. #endif
  258. #ifndef WB_PORT
  259. #define WB_PORT 4567
  260. #endif
  261. #ifndef VXLAN_PORT
  262. #define VXLAN_PORT 4789 /* RFC 7348 */
  263. #endif
  264. #ifndef VXLAN_GPE_PORT
  265. #define VXLAN_GPE_PORT 4790 /* draft-ietf-nvo3-vxlan-gpe-01 */
  266. #endif
  267. #ifndef SIP_DS_PORT
  268. #define SIP_DS_PORT 5059 /*XXX*/
  269. #endif
  270. #ifndef SIP_PORT
  271. #define SIP_PORT 5060
  272. #endif
  273. #ifndef MULTICASTDNS_PORT
  274. #define MULTICASTDNS_PORT 5353 /* RFC 6762 */
  275. #endif
  276. #ifndef AHCP_PORT
  277. #define AHCP_PORT 5359 /* draft-chroboczek-ahcp-00 */
  278. #endif
  279. #ifndef GENEVE_PORT
  280. #define GENEVE_PORT 6081 /* draft-gross-geneve-02 */
  281. #endif
  282. #ifndef SFLOW_PORT
  283. #define SFLOW_PORT 6343 /* http://www.sflow.org/developers/specifications.php */
  284. #endif
  285. #ifndef BABEL_PORT
  286. #define BABEL_PORT 6696 /* RFC 6126 errata */
  287. #endif
  288. #ifndef BABEL_PORT_OLD
  289. #define BABEL_PORT_OLD 6697 /* RFC 6126 */
  290. #endif
  291. #ifndef RX_PORT_LOW
  292. #define RX_PORT_LOW 7000 /*XXX*/
  293. #endif
  294. #ifndef RX_PORT_HIGH
  295. #define RX_PORT_HIGH 7009 /*XXX*/
  296. #endif
  297. #ifndef ISAKMP_PORT_USER1
  298. #define ISAKMP_PORT_USER1 7500 /*XXX - nonstandard*/
  299. #endif
  300. #ifndef HNCP_PORT
  301. #define HNCP_PORT 8231 /* RFC 7788 */
  302. #endif
  303. #ifndef OTV_PORT
  304. #define OTV_PORT 8472 /* draft-hasmit-otv-04 */
  305. #endif
  306. #ifndef ISAKMP_PORT_USER2
  307. #define ISAKMP_PORT_USER2 8500 /*XXX - nonstandard*/
  308. #endif
  309. #ifndef LWAPP_DATA_PORT
  310. #define LWAPP_DATA_PORT 12222 /* RFC 5412 */
  311. #endif
  312. #ifndef LWAPP_CONTROL_PORT
  313. #define LWAPP_CONTROL_PORT 12223 /* RFC 5412 */
  314. #endif