1 /* 2 * Fundamental constants relating to UDP Protocol 3 * 4 * Copyright (C) 1999-2019, Broadcom. 5 * 6 * Unless you and Broadcom execute a separate written software license 7 * agreement governing use of this software, this software is licensed to you 8 * under the terms of the GNU General Public License version 2 (the "GPL"), 9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the 10 * following added to such license: 11 * 12 * As a special exception, the copyright holders of this software give you 13 * permission to link this software with independent modules, and to copy and 14 * distribute the resulting executable under terms of your choice, provided that 15 * you also meet, for each linked independent module, the terms and conditions 16 * of the license of that module. An independent module is a module which is 17 * not derived from this software. The special exception does not apply to any 18 * modifications of the software. 19 * 20 * Notwithstanding the above, under no circumstances may you combine this 21 * software in any way with any other Broadcom software provided under a license 22 * other than the GPL, without Broadcom's express prior written consent. 23 * 24 * 25 * <<Broadcom-WL-IPTag/Open:>> 26 * 27 * $Id: bcmudp.h 700076 2017-05-17 14:42:22Z $ 28 */ 29 30 #ifndef _bcmudp_h_ 31 #define _bcmudp_h_ 32 33 #ifndef _TYPEDEFS_H_ 34 #include <typedefs.h> 35 #endif // endif 36 37 /* This marks the start of a packed structure section. */ 38 #include <packed_section_start.h> 39 40 /* UDP header */ 41 #define UDP_DEST_PORT_OFFSET 2 /* UDP dest port offset */ 42 #define UDP_LEN_OFFSET 4 /* UDP length offset */ 43 #define UDP_CHKSUM_OFFSET 6 /* UDP body checksum offset */ 44 45 #define UDP_HDR_LEN 8 /* UDP header length */ 46 #define UDP_PORT_LEN 2 /* UDP port length */ 47 48 /* These fields are stored in network order */ 49 BWL_PRE_PACKED_STRUCT struct bcmudp_hdr { 50 uint16 src_port; /* Source Port Address */ 51 uint16 dst_port; /* Destination Port Address */ 52 uint16 len; /* Number of bytes in datagram including header */ 53 uint16 chksum; /* entire datagram checksum with pseudoheader */ 54 } BWL_POST_PACKED_STRUCT; 55 56 /* This marks the end of a packed structure section. */ 57 #include <packed_section_end.h> 58 59 #endif /* #ifndef _bcmudp_h_ */ 60