FD.io VPP  v19.08-27-gf4dcae4
Vector Packet Processing
dhcp4_packet.h
Go to the documentation of this file.
1 #ifndef included_vnet_dhcp4_packet_h
2 #define included_vnet_dhcp4_packet_h
3 
4 /*
5  * DHCP packet format
6  *
7  * Copyright (c) 2013 Cisco and/or its affiliates.
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at:
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 #include <vnet/ip/ip4_packet.h>
21 
22 typedef struct
23 {
26  union
27  {
28  u8 data[0];
29  u32 data_as_u32[0];
30  };
31 } __attribute__ ((packed)) dhcp_option_t;
32 
33 typedef struct
34 {
35  u8 opcode; /* 1 = request, 2 = reply */
36  u8 hardware_type; /* 1 = ethernet */
42 #define DHCP_FLAG_BROADCAST (1<<15)
44  ip4_address_t your_ip_address; /* use this one */
46  ip4_address_t gateway_ip_address; /* use option 3, not this one */
47  u8 client_hardware_address[16];
48  u8 server_name[64];
49  u8 boot_filename[128];
51  dhcp_option_t options[0];
53 
54 typedef enum
55 {
62 
64 {
68 
69 /* charming antique: 99.130.83.99 is the dhcp magic cookie */
70 #define DHCP_MAGIC (clib_host_to_net_u32(0x63825363))
71 
72 #endif /* included_vnet_dhcp4_packet_h */
73 
74 /*
75  * fd.io coding-style-patch-verification: ON
76  *
77  * Local Variables:
78  * eval: (c-set-style "gnu")
79  * End:
80  */
u8 data[128]
Definition: ipsec.api:249
ip4_address_t server_ip_address
Definition: dhcp4_packet.h:45
unsigned char u8
Definition: types.h:56
enum dhcp_packet_option_t_ dhcp_packet_option_t
unsigned int u32
Definition: types.h:88
unsigned short u16
Definition: types.h:57
ip4_address_t client_ip_address
Definition: dhcp4_packet.h:43
ip4_address_t gateway_ip_address
Definition: dhcp4_packet.h:46
u32 transaction_identifier
Definition: dhcp4_packet.h:39
u8 hardware_address_length
Definition: dhcp4_packet.h:37
ip4_address_t magic_cookie
Definition: dhcp4_packet.h:50
dhcp_packet_option_t_
Definition: dhcp4_packet.h:63
dhcp_packet_type_t
Definition: dhcp4_packet.h:54
ip4_address_t your_ip_address
Definition: dhcp4_packet.h:44