aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/dhcp/dhcp4_packet.h
diff options
context:
space:
mode:
authorEyal Bari <ebari@cisco.com>2018-11-05 13:29:25 +0200
committerJohn Lo <loj@cisco.com>2018-11-20 02:52:39 +0000
commitd3d424180fcd98561d656d5c2189e9e59ef2b2b9 (patch)
treea9288e7e960b97072de833fb3453303c1d242198 /src/vnet/dhcp/dhcp4_packet.h
parentc7b03fe8f3fd2753d97ffdf8e7ebd85e2c527085 (diff)
dhcp4:(VPP-1483) linearize chained packets before handling
dhcp packets might (when flooded) arrive in chains of cloned buffers Change-Id: Ifddecd656b6a5d6ba8cd94184f5c021684e35548 Signed-off-by: Eyal Bari <ebari@cisco.com>
Diffstat (limited to 'src/vnet/dhcp/dhcp4_packet.h')
-rw-r--r--src/vnet/dhcp/dhcp4_packet.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/vnet/dhcp/dhcp4_packet.h b/src/vnet/dhcp/dhcp4_packet.h
index 9fbeb02fb2b..3076dd9529d 100644
--- a/src/vnet/dhcp/dhcp4_packet.h
+++ b/src/vnet/dhcp/dhcp4_packet.h
@@ -21,6 +21,17 @@
typedef struct
{
+ u8 option;
+ u8 length;
+ union
+ {
+ u8 data[0];
+ u32 data_as_u32[0];
+ };
+} __attribute__ ((packed)) dhcp_option_t;
+
+typedef struct
+{
u8 opcode; /* 1 = request, 2 = reply */
u8 hardware_type; /* 1 = ethernet */
u8 hardware_address_length;
@@ -37,20 +48,9 @@ typedef struct
u8 server_name[64];
u8 boot_filename[128];
ip4_address_t magic_cookie;
- u8 options[0];
+ dhcp_option_t options[0];
} dhcp_header_t;
-typedef struct
-{
- u8 option;
- u8 length;
- union
- {
- u8 data[0];
- u32 data_as_u32[0];
- };
-} __attribute__ ((packed)) dhcp_option_t;
-
typedef enum
{
DHCP_PACKET_DISCOVER = 1,
@@ -63,6 +63,7 @@ typedef enum
typedef enum dhcp_packet_option_t_
{
DHCP_PACKET_OPTION_MSG_TYPE = 53,
+ DHCP_PACKET_OPTION_END = 0xff,
} dhcp_packet_option_t;
/* charming antique: 99.130.83.99 is the dhcp magic cookie */