1 #ifndef included_vnet_dhcp4_packet_h
2 #define included_vnet_dhcp4_packet_h
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:
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #include <vnet/ip/ip4_packet.h>
23 u8 opcode; /* 1 = request, 2 = reply */
24 u8 hardware_type; /* 1 = ethernet */
25 u8 hardware_address_length;
27 u32 transaction_identifier;
30 #define DHCP_FLAG_BROADCAST (1<<15)
31 ip4_address_t client_ip_address;
32 ip4_address_t your_ip_address; /* use this one */
33 ip4_address_t server_ip_address;
34 ip4_address_t gateway_ip_address; /* use option 3, not this one */
35 u8 client_hardware_address[16];
37 u8 boot_filename[128];
38 ip4_address_t magic_cookie;
49 } __attribute__((packed)) dhcp_option_t;
52 DHCP_PACKET_DISCOVER=1,
58 typedef enum dhcp_packet_option_t_
60 DHCP_PACKET_OPTION_MSG_TYPE = 53,
61 } dhcp_packet_option_t;
63 /* charming antique: 99.130.83.99 is the dhcp magic cookie */
64 #define DHCP_MAGIC (clib_host_to_net_u32(0x63825363))
66 #endif /* included_vnet_dhcp4_packet_h */