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