1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun * Fundamental constants relating to DHCP Protocol 3*4882a593Smuzhiyun * 4*4882a593Smuzhiyun * Portions of this code are copyright (c) 2021 Cypress Semiconductor Corporation 5*4882a593Smuzhiyun * 6*4882a593Smuzhiyun * Copyright (C) 1999-2017, Broadcom Corporation 7*4882a593Smuzhiyun * 8*4882a593Smuzhiyun * Unless you and Broadcom execute a separate written software license 9*4882a593Smuzhiyun * agreement governing use of this software, this software is licensed to you 10*4882a593Smuzhiyun * under the terms of the GNU General Public License version 2 (the "GPL"), 11*4882a593Smuzhiyun * available at http://www.broadcom.com/licenses/GPLv2.php, with the 12*4882a593Smuzhiyun * following added to such license: 13*4882a593Smuzhiyun * 14*4882a593Smuzhiyun * As a special exception, the copyright holders of this software give you 15*4882a593Smuzhiyun * permission to link this software with independent modules, and to copy and 16*4882a593Smuzhiyun * distribute the resulting executable under terms of your choice, provided that 17*4882a593Smuzhiyun * you also meet, for each linked independent module, the terms and conditions of 18*4882a593Smuzhiyun * the license of that module. An independent module is a module which is not 19*4882a593Smuzhiyun * derived from this software. The special exception does not apply to any 20*4882a593Smuzhiyun * modifications of the software. 21*4882a593Smuzhiyun * 22*4882a593Smuzhiyun * Notwithstanding the above, under no circumstances may you combine this 23*4882a593Smuzhiyun * software in any way with any other Broadcom software provided under a license 24*4882a593Smuzhiyun * other than the GPL, without Broadcom's express prior written consent. 25*4882a593Smuzhiyun * 26*4882a593Smuzhiyun * 27*4882a593Smuzhiyun * <<Broadcom-WL-IPTag/Open:>> 28*4882a593Smuzhiyun * 29*4882a593Smuzhiyun * $Id$ 30*4882a593Smuzhiyun */ 31*4882a593Smuzhiyun 32*4882a593Smuzhiyun #ifndef _bcmdhcp_h_ 33*4882a593Smuzhiyun #define _bcmdhcp_h_ 34*4882a593Smuzhiyun 35*4882a593Smuzhiyun /* DHCP params */ 36*4882a593Smuzhiyun #define DHCP_TYPE_OFFSET 0 /* DHCP type (request|reply) offset */ 37*4882a593Smuzhiyun #define DHCP_TID_OFFSET 4 /* DHCP transition id offset */ 38*4882a593Smuzhiyun #define DHCP_FLAGS_OFFSET 10 /* DHCP flags offset */ 39*4882a593Smuzhiyun #define DHCP_CIADDR_OFFSET 12 /* DHCP client IP address offset */ 40*4882a593Smuzhiyun #define DHCP_YIADDR_OFFSET 16 /* DHCP your IP address offset */ 41*4882a593Smuzhiyun #define DHCP_GIADDR_OFFSET 24 /* DHCP relay agent IP address offset */ 42*4882a593Smuzhiyun #define DHCP_CHADDR_OFFSET 28 /* DHCP client h/w address offset */ 43*4882a593Smuzhiyun #define DHCP_OPT_OFFSET 236 /* DHCP options offset */ 44*4882a593Smuzhiyun 45*4882a593Smuzhiyun #define DHCP_OPT_MSGTYPE 53 /* DHCP message type */ 46*4882a593Smuzhiyun #define DHCP_OPT_MSGTYPE_REQ 3 47*4882a593Smuzhiyun #define DHCP_OPT_MSGTYPE_ACK 5 /* DHCP message type - ACK */ 48*4882a593Smuzhiyun 49*4882a593Smuzhiyun #define DHCP_OPT_CODE_OFFSET 0 /* Option identifier */ 50*4882a593Smuzhiyun #define DHCP_OPT_LEN_OFFSET 1 /* Option data length */ 51*4882a593Smuzhiyun #define DHCP_OPT_DATA_OFFSET 2 /* Option data */ 52*4882a593Smuzhiyun 53*4882a593Smuzhiyun #define DHCP_OPT_CODE_CLIENTID 61 /* Option identifier */ 54*4882a593Smuzhiyun 55*4882a593Smuzhiyun #define DHCP_TYPE_REQUEST 1 /* DHCP request (discover|request) */ 56*4882a593Smuzhiyun #define DHCP_TYPE_REPLY 2 /* DHCP reply (offset|ack) */ 57*4882a593Smuzhiyun 58*4882a593Smuzhiyun #define DHCP_PORT_SERVER 67 /* DHCP server UDP port */ 59*4882a593Smuzhiyun #define DHCP_PORT_CLIENT 68 /* DHCP client UDP port */ 60*4882a593Smuzhiyun 61*4882a593Smuzhiyun #define DHCP_FLAG_BCAST 0x8000 /* DHCP broadcast flag */ 62*4882a593Smuzhiyun 63*4882a593Smuzhiyun #define DHCP_FLAGS_LEN 2 /* DHCP flags field length */ 64*4882a593Smuzhiyun 65*4882a593Smuzhiyun #define DHCP6_TYPE_SOLICIT 1 /* DHCP6 solicit */ 66*4882a593Smuzhiyun #define DHCP6_TYPE_ADVERTISE 2 /* DHCP6 advertise */ 67*4882a593Smuzhiyun #define DHCP6_TYPE_REQUEST 3 /* DHCP6 request */ 68*4882a593Smuzhiyun #define DHCP6_TYPE_CONFIRM 4 /* DHCP6 confirm */ 69*4882a593Smuzhiyun #define DHCP6_TYPE_RENEW 5 /* DHCP6 renew */ 70*4882a593Smuzhiyun #define DHCP6_TYPE_REBIND 6 /* DHCP6 rebind */ 71*4882a593Smuzhiyun #define DHCP6_TYPE_REPLY 7 /* DHCP6 reply */ 72*4882a593Smuzhiyun #define DHCP6_TYPE_RELEASE 8 /* DHCP6 release */ 73*4882a593Smuzhiyun #define DHCP6_TYPE_DECLINE 9 /* DHCP6 decline */ 74*4882a593Smuzhiyun #define DHCP6_TYPE_RECONFIGURE 10 /* DHCP6 reconfigure */ 75*4882a593Smuzhiyun #define DHCP6_TYPE_INFOREQ 11 /* DHCP6 information request */ 76*4882a593Smuzhiyun #define DHCP6_TYPE_RELAYFWD 12 /* DHCP6 relay forward */ 77*4882a593Smuzhiyun #define DHCP6_TYPE_RELAYREPLY 13 /* DHCP6 relay reply */ 78*4882a593Smuzhiyun 79*4882a593Smuzhiyun #define DHCP6_TYPE_OFFSET 0 /* DHCP6 type offset */ 80*4882a593Smuzhiyun 81*4882a593Smuzhiyun #define DHCP6_MSG_OPT_OFFSET 4 /* Offset of options in client server messages */ 82*4882a593Smuzhiyun #define DHCP6_RELAY_OPT_OFFSET 34 /* Offset of options in relay messages */ 83*4882a593Smuzhiyun 84*4882a593Smuzhiyun #define DHCP6_OPT_CODE_OFFSET 0 /* Option identifier */ 85*4882a593Smuzhiyun #define DHCP6_OPT_LEN_OFFSET 2 /* Option data length */ 86*4882a593Smuzhiyun #define DHCP6_OPT_DATA_OFFSET 4 /* Option data */ 87*4882a593Smuzhiyun 88*4882a593Smuzhiyun #define DHCP6_OPT_CODE_CLIENTID 1 /* DHCP6 CLIENTID option */ 89*4882a593Smuzhiyun #define DHCP6_OPT_CODE_SERVERID 2 /* DHCP6 SERVERID option */ 90*4882a593Smuzhiyun 91*4882a593Smuzhiyun #define DHCP6_PORT_SERVER 547 /* DHCP6 server UDP port */ 92*4882a593Smuzhiyun #define DHCP6_PORT_CLIENT 546 /* DHCP6 client UDP port */ 93*4882a593Smuzhiyun 94*4882a593Smuzhiyun #endif /* #ifndef _bcmdhcp_h_ */ 95