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