bcmdhcp.h 4.0 KB

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