1/*
2 * Copyright (C) 2013, Broadcom Corporation
3 * All Rights Reserved.
4 *
5 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
6 * the contents of this file may not be disclosed to third parties, copied
7 * or duplicated in any form, in whole or in part, without the prior
8 * written permission of Broadcom Corporation.
9 *
10 * Fundamental constants relating to DHCP Protocol
11 *
12 * $Id: bcmdhcp.h 355047 2012-09-05 07:00:54Z $
13 */
14
15#ifndef _bcmdhcp_h_
16#define _bcmdhcp_h_
17
18/* DHCP params */
19#define DHCP_TYPE_OFFSET	0	/* DHCP type (request|reply) offset */
20#define DHCP_TID_OFFSET		4	/* DHCP transition id offset */
21#define DHCP_FLAGS_OFFSET	10	/* DHCP flags offset */
22#define DHCP_CIADDR_OFFSET	12	/* DHCP client IP address offset */
23#define DHCP_YIADDR_OFFSET	16	/* DHCP your IP address offset */
24#define DHCP_GIADDR_OFFSET	24	/* DHCP relay agent IP address offset */
25#define DHCP_CHADDR_OFFSET	28	/* DHCP client h/w address offset */
26#define DHCP_OPT_OFFSET		236	/* DHCP options offset */
27
28#define DHCP_OPT_MSGTYPE	53	/* DHCP message type */
29#define DHCP_OPT_MSGTYPE_REQ	3
30#define DHCP_OPT_MSGTYPE_ACK	5	/* DHCP message type - ACK */
31
32#define DHCP_OPT_CODE_OFFSET	0	/* Option identifier */
33#define DHCP_OPT_LEN_OFFSET	1	/* Option data length */
34#define DHCP_OPT_DATA_OFFSET	2	/* Option data */
35
36#define DHCP_OPT_CODE_CLIENTID	61	/* Option identifier */
37
38#define DHCP_TYPE_REQUEST	1	/* DHCP request (discover|request) */
39#define DHCP_TYPE_REPLY		2	/* DHCP reply (offset|ack) */
40
41#define DHCP_PORT_SERVER	67	/* DHCP server UDP port */
42#define DHCP_PORT_CLIENT	68	/* DHCP client UDP port */
43
44#define DHCP_FLAG_BCAST	0x8000	/* DHCP broadcast flag */
45
46#define DHCP_FLAGS_LEN	2	/* DHCP flags field length */
47
48#define DHCP6_TYPE_SOLICIT	1	/* DHCP6 solicit */
49#define DHCP6_TYPE_ADVERTISE	2	/* DHCP6 advertise */
50#define DHCP6_TYPE_REQUEST	3	/* DHCP6 request */
51#define DHCP6_TYPE_CONFIRM	4	/* DHCP6 confirm */
52#define DHCP6_TYPE_RENEW	5	/* DHCP6 renew */
53#define DHCP6_TYPE_REBIND	6	/* DHCP6 rebind */
54#define DHCP6_TYPE_REPLY	7	/* DHCP6 reply */
55#define DHCP6_TYPE_RELEASE	8	/* DHCP6 release */
56#define DHCP6_TYPE_DECLINE	9	/* DHCP6 decline */
57#define DHCP6_TYPE_RECONFIGURE	10	/* DHCP6 reconfigure */
58#define DHCP6_TYPE_INFOREQ	11	/* DHCP6 information request */
59#define DHCP6_TYPE_RELAYFWD	12	/* DHCP6 relay forward */
60#define DHCP6_TYPE_RELAYREPLY	13	/* DHCP6 relay reply */
61
62#define DHCP6_TYPE_OFFSET	0	/* DHCP6 type offset */
63
64#define	DHCP6_MSG_OPT_OFFSET	4	/* Offset of options in client server messages */
65#define	DHCP6_RELAY_OPT_OFFSET	34	/* Offset of options in relay messages */
66
67#define	DHCP6_OPT_CODE_OFFSET	0	/* Option identifier */
68#define	DHCP6_OPT_LEN_OFFSET	2	/* Option data length */
69#define	DHCP6_OPT_DATA_OFFSET	4	/* Option data */
70
71#define	DHCP6_OPT_CODE_CLIENTID	1	/* DHCP6 CLIENTID option */
72#define	DHCP6_OPT_CODE_SERVERID	2	/* DHCP6 SERVERID option */
73
74#define DHCP6_PORT_SERVER	547	/* DHCP6 server UDP port */
75#define DHCP6_PORT_CLIENT	546	/* DHCP6 client UDP port */
76
77#endif	/* #ifndef _bcmdhcp_h_ */
78