• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Fundamental constants relating to DHCP 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: bcmdhcp.h 700076 2017-05-17 14:42:22Z $
29  */
30 
31 #ifndef _bcmdhcp_h_
32 #define _bcmdhcp_h_
33 
34 /* DHCP params */
35 #define DHCP_TYPE_OFFSET	0	/* DHCP type (request|reply) offset */
36 #define DHCP_TID_OFFSET		4	/* DHCP transition id offset */
37 #define DHCP_FLAGS_OFFSET	10	/* DHCP flags offset */
38 #define DHCP_CIADDR_OFFSET	12	/* DHCP client IP address offset */
39 #define DHCP_YIADDR_OFFSET	16	/* DHCP your IP address offset */
40 #define DHCP_GIADDR_OFFSET	24	/* DHCP relay agent IP address offset */
41 #define DHCP_CHADDR_OFFSET	28	/* DHCP client h/w address offset */
42 #define DHCP_OPT_OFFSET		236	/* DHCP options offset */
43 
44 #define DHCP_OPT_MSGTYPE	53	/* DHCP message type */
45 #define DHCP_OPT_MSGTYPE_REQ	3
46 #define DHCP_OPT_MSGTYPE_ACK	5	/* DHCP message type - ACK */
47 
48 #define DHCP_OPT_CODE_OFFSET	0	/* Option identifier */
49 #define DHCP_OPT_LEN_OFFSET	1	/* Option data length */
50 #define DHCP_OPT_DATA_OFFSET	2	/* Option data */
51 
52 #define DHCP_OPT_CODE_CLIENTID	61	/* Option identifier */
53 
54 #define DHCP_TYPE_REQUEST	1	/* DHCP request (discover|request) */
55 #define DHCP_TYPE_REPLY		2	/* DHCP reply (offset|ack) */
56 
57 #define DHCP_PORT_SERVER	67	/* DHCP server UDP port */
58 #define DHCP_PORT_CLIENT	68	/* DHCP client UDP port */
59 
60 #define DHCP_FLAG_BCAST	0x8000	/* DHCP broadcast flag */
61 
62 #define DHCP_FLAGS_LEN	2	/* DHCP flags field length */
63 
64 #define DHCP6_TYPE_SOLICIT	1	/* DHCP6 solicit */
65 #define DHCP6_TYPE_ADVERTISE	2	/* DHCP6 advertise */
66 #define DHCP6_TYPE_REQUEST	3	/* DHCP6 request */
67 #define DHCP6_TYPE_CONFIRM	4	/* DHCP6 confirm */
68 #define DHCP6_TYPE_RENEW	5	/* DHCP6 renew */
69 #define DHCP6_TYPE_REBIND	6	/* DHCP6 rebind */
70 #define DHCP6_TYPE_REPLY	7	/* DHCP6 reply */
71 #define DHCP6_TYPE_RELEASE	8	/* DHCP6 release */
72 #define DHCP6_TYPE_DECLINE	9	/* DHCP6 decline */
73 #define DHCP6_TYPE_RECONFIGURE	10	/* DHCP6 reconfigure */
74 #define DHCP6_TYPE_INFOREQ	11	/* DHCP6 information request */
75 #define DHCP6_TYPE_RELAYFWD	12	/* DHCP6 relay forward */
76 #define DHCP6_TYPE_RELAYREPLY	13	/* DHCP6 relay reply */
77 
78 #define DHCP6_TYPE_OFFSET	0	/* DHCP6 type offset */
79 
80 #define	DHCP6_MSG_OPT_OFFSET	4	/* Offset of options in client server messages */
81 #define	DHCP6_RELAY_OPT_OFFSET	34	/* Offset of options in relay messages */
82 
83 #define	DHCP6_OPT_CODE_OFFSET	0	/* Option identifier */
84 #define	DHCP6_OPT_LEN_OFFSET	2	/* Option data length */
85 #define	DHCP6_OPT_DATA_OFFSET	4	/* Option data */
86 
87 #define	DHCP6_OPT_CODE_CLIENTID	1	/* DHCP6 CLIENTID option */
88 #define	DHCP6_OPT_CODE_SERVERID	2	/* DHCP6 SERVERID option */
89 
90 #define DHCP6_PORT_SERVER	547	/* DHCP6 server UDP port */
91 #define DHCP6_PORT_CLIENT	546	/* DHCP6 client UDP port */
92 
93 #endif	/* #ifndef _bcmdhcp_h_ */
94