OpenVPN 3 Core Library
Loading...
Searching...
No Matches
dhcp.hpp
Go to the documentation of this file.
1// OpenVPN -- An application to securely tunnel IP networks
2// over a single port, with support for SSL/TLS-based
3// session authentication and key exchange,
4// packet encryption, packet authentication, and
5// packet compression.
6//
7// Copyright (C) 2012- OpenVPN Inc.
8//
9// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10//
11
12#ifndef OPENVPN_IP_DHCP_H
13#define OPENVPN_IP_DHCP_H
14
15#include <openvpn/ip/eth.hpp>
16#include <openvpn/ip/ip4.hpp>
17#include <openvpn/ip/udp.hpp>
18
19#pragma pack(push)
20#pragma pack(1)
21
22namespace openvpn {
23struct DHCP
24{
25 enum
26 {
27 /* DHCP Option types */
32 DHCP_MSG_TYPE = 53 /* message type (u8) */,
33 DHCP_END = 255,
34
35 /* DHCP Messages types */
44
45 /* DHCP UDP port numbers */
48
49 /* DHCP message op */
52 };
53
54 std::uint8_t op; /* message op */
55 std::uint8_t htype; /* hardware address type (e.g. '1' = 10Mb Ethernet) */
56 std::uint8_t hlen; /* hardware address length (e.g. '6' for 10Mb Ethernet) */
57 std::uint8_t hops; /* client sets to 0, may be used by relay agents */
58 std::uint32_t xid; /* transaction ID, chosen by client */
59 std::uint16_t secs; /* seconds since request process began, set by client */
60 std::uint16_t flags;
61 std::uint32_t ciaddr; /* client IP address, client sets if known */
62 std::uint32_t yiaddr; /* 'your' IP address -- server's response to client */
63 std::uint32_t siaddr; /* server IP address */
64 std::uint32_t giaddr; /* relay agent IP address */
65 std::uint8_t chaddr[16]; /* client hardware address */
66 std::uint8_t sname[64]; /* optional server host name */
67 std::uint8_t file[128]; /* boot file name */
68 std::uint32_t magic; /* must be 0x63825363 (network order) */
69};
70
79} // namespace openvpn
80
81#pragma pack(pop)
82
83#endif
std::uint8_t options[]
Definition dhcp.hpp:77
IPv4Header ip
Definition dhcp.hpp:74
EthHeader eth
Definition dhcp.hpp:73
UDPHeader udp
Definition dhcp.hpp:75
std::uint16_t secs
Definition dhcp.hpp:59
std::uint8_t sname[64]
Definition dhcp.hpp:66
std::uint32_t ciaddr
Definition dhcp.hpp:61
std::uint8_t htype
Definition dhcp.hpp:55
std::uint8_t file[128]
Definition dhcp.hpp:67
std::uint8_t chaddr[16]
Definition dhcp.hpp:65
std::uint32_t yiaddr
Definition dhcp.hpp:62
std::uint32_t magic
Definition dhcp.hpp:68
std::uint32_t siaddr
Definition dhcp.hpp:63
std::uint32_t giaddr
Definition dhcp.hpp:64
std::uint16_t flags
Definition dhcp.hpp:60
@ DHCP_MSG_TYPE
Definition dhcp.hpp:32
std::uint8_t hops
Definition dhcp.hpp:57
std::uint8_t hlen
Definition dhcp.hpp:56
std::uint8_t op
Definition dhcp.hpp:54
std::uint32_t xid
Definition dhcp.hpp:58