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