FD.io VPP
v17.01.1-3-gc6833f8
Vector Packet Processing
Main Page
Related Pages
Data Structures
Source
Files
Symbols
packet.h
Go to the documentation of this file.
1
#ifndef included_vnet_dhcp_packet_h
2
#define included_vnet_dhcp_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
u8
opcode
;
/* 1 = request, 2 = reply */
24
u8
hardware_type
;
/* 1 = ethernet */
25
u8
hardware_address_length
;
26
u8
hops
;
27
u32
transaction_identifier
;
28
u16
seconds
;
29
u16
flags
;
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];
36
u8
server_name[64];
37
u8
boot_filename[128];
38
ip4_address_t
magic_cookie
;
39
u8
options[0];
40
}
dhcp_header_t
;
41
42
typedef
struct
{
43
u8
option
;
44
u8
length
;
45
union
{
46
u8
data[0];
47
u32
data_as_u32[0];
48
};
49
} __attribute__((packed))
dhcp_option_t
;
50
51
typedef enum {
52
DHCP_PACKET_DISCOVER
=1,
53
DHCP_PACKET_OFFER
,
54
DHCP_PACKET_REQUEST
,
55
DHCP_PACKET_ACK
=5,
56
}
dhcp_packet_type_t
;
57
58
/* charming antique: 99.130.83.99 is the dhcp magic cookie */
59
#define DHCP_MAGIC (clib_host_to_net_u32(0x63825363))
60
61
#endif
/* included_vnet_dhcp_packet_h */
dhcp_header_t::opcode
u8 opcode
Definition:
packet.h:23
dhcp_packet_type_t
dhcp_packet_type_t
Definition:
packet.h:51
dhcp_option_t::length
u8 length
Definition:
packet.h:44
dhcp_option_t::option
u8 option
Definition:
packet.h:43
dhcp_header_t::seconds
u16 seconds
Definition:
packet.h:28
dhcp_header_t
Definition:
packet.h:22
dhcp_header_t::server_ip_address
ip4_address_t server_ip_address
Definition:
packet.h:33
ip4_address_t
Definition:
ip4_packet.h:49
ip4_packet.h
dhcp_header_t::hops
u8 hops
Definition:
packet.h:26
dhcp_header_t::client_ip_address
ip4_address_t client_ip_address
Definition:
packet.h:31
DHCP_PACKET_REQUEST
Definition:
packet.h:54
u32
unsigned int u32
Definition:
types.h:88
dhcp_header_t::flags
u16 flags
Definition:
packet.h:29
dhcp_header_t::gateway_ip_address
ip4_address_t gateway_ip_address
Definition:
packet.h:34
dhcp_header_t::transaction_identifier
u32 transaction_identifier
Definition:
packet.h:27
dhcp_header_t::hardware_address_length
u8 hardware_address_length
Definition:
packet.h:25
u16
unsigned short u16
Definition:
types.h:57
dhcp_header_t::magic_cookie
ip4_address_t magic_cookie
Definition:
packet.h:38
DHCP_PACKET_DISCOVER
Definition:
packet.h:52
u8
unsigned char u8
Definition:
types.h:56
DHCP_PACKET_ACK
Definition:
packet.h:55
DHCP_PACKET_OFFER
Definition:
packet.h:53
dhcp_option_t
Definition:
packet.h:42
dhcp_header_t::hardware_type
u8 hardware_type
Definition:
packet.h:24
dhcp_header_t::your_ip_address
ip4_address_t your_ip_address
Definition:
packet.h:32
vnet
vnet
dhcp
packet.h
Generated on Mon May 15 2017 22:01:57 for FD.io VPP by
1.8.11