• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Fundamental constants relating to UDP Protocol
3  *
4  * Copyright (C) 1999-2017, Broadcom Corporation
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 of
16  * the license of that module.  An independent module is a module which is not
17  * 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
36 
37 /* This marks the start of a packed structure section. */
38 #include <packed_section_start.h>
39 
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