17#include <boost/shared_ptr.hpp>
60 Pkt4(uint8_t msg_type, uint32_t transid);
69 Pkt4(
const uint8_t* data,
size_t len);
114 const uint32_t transid);
130 std::string
toText()
const;
249 static const char*
getName(
const uint8_t type);
271 void setSname(
const uint8_t* sname,
size_t sname_len);
287 setFile(
const uint8_t* file,
size_t file_len);
300 void setHWAddr(uint8_t htype, uint8_t hlen,
301 const std::vector<uint8_t>& mac_addr);
356 const std::vector<uint8_t>& mac_addr);
422 virtual void setHWAddrMember(
const uint8_t htype,
const uint8_t hlen,
423 const std::vector<uint8_t>& mac_addr,
Defines elements for storing the names of client classes.
The IOAddress class represents an IP addresses (version agnostic)
Represents DHCPv4 packet.
virtual void addOption(const OptionPtr &opt)
Add an option.
std::string toText() const
Returns text representation of the packet.
void setCiaddr(const isc::asiolink::IOAddress &ciaddr)
Sets ciaddr field.
virtual void unpack()
Parses on-wire form of DHCPv4 packet.
const isc::asiolink::IOAddress & getSiaddr() const
Returns siaddr field.
const isc::asiolink::IOAddress & getYiaddr() const
Returns yiaddr field.
uint8_t getHops() const
Returns hops field.
std::list< uint16_t > deferred_options_
virtual HWAddrPtr getMACFromSrcLinkLocalAddr()
No-op.
HWAddrPtr hwaddr_
link-layer address and hardware information represents 3 fields: htype (hardware type,...
void setHops(uint8_t hops)
Sets hops field.
const char * getName() const
Returns name of the DHCP message.
HWAddrPtr local_hwaddr_
local HW address (dst if receiving packet, src if sending packet)
void setSecs(uint16_t secs)
Sets secs field.
static const size_t MAX_CHADDR_LEN
length of the CHADDR field in DHCPv4 message
void setLocalHWAddr(const uint8_t htype, const uint8_t hlen, const std::vector< uint8_t > &mac_addr)
Sets local HW address.
std::string getHWAddrLabel() const
Returns text representation of the hardware address.
virtual HWAddrPtr getMACFromDUID()
No-op.
uint8_t DHCPTypeToBootpType(uint8_t dhcpType)
converts DHCP message type to BOOTP op type
const isc::asiolink::IOAddress & getGiaddr() const
Returns giaddr field.
std::string getLabel() const
Returns text representation of the primary packet identifiers.
virtual void pack()
Prepares on-wire format of DHCPv4 packet.
isc::asiolink::IOAddress giaddr_
giaddr field (32 bits): Gateway IP address
uint8_t file_[MAX_FILE_LEN]
file field (128 bytes)
const isc::asiolink::IOAddress & getCiaddr() const
Returns ciaddr field.
uint8_t op_
message operation code
uint16_t getSecs() const
Returns secs field.
uint8_t hops_
Number of relay agents traversed.
const OptionBuffer getFile() const
Returns file field.
const OptionBuffer getSname() const
Returns sname field.
std::list< uint16_t > & getDeferredOptions()
Returns a reference to option codes which unpacking will be deferred.
HWAddrPtr getHWAddr() const
returns hardware address information
virtual HWAddrPtr getMACFromDocsisCMTS()
No-op.
void setSname(const uint8_t *sname, size_t sname_len)
Sets sname field.
Pkt4(uint8_t msg_type, uint32_t transid)
Constructor, used in replying to a message.
uint8_t getHlen() const
Returns hlen field.
void setYiaddr(const isc::asiolink::IOAddress &yiaddr)
Sets yiaddr field.
static const size_t DHCPV4_PKT_HDR_LEN
specifies DHCPv4 packet header length (fixed part)
bool isRelayed() const
Checks if a DHCPv4 message has been relayed.
void setFile(const uint8_t *file, size_t file_len)
Sets file field.
static const size_t MAX_SNAME_LEN
length of the SNAME field in DHCPv4 message
static std::string makeLabel(const HWAddrPtr &hwaddr, const ClientIdPtr &client_id, const uint32_t transid)
Returns text representation of the given packet identifiers.
void setSiaddr(const isc::asiolink::IOAddress &siaddr)
Sets siaddr field.
uint8_t getType() const
Returns DHCP message type (e.g.
uint16_t getFlags() const
Returns flags field.
void setType(uint8_t type)
Sets DHCP message type (e.g.
HWAddrPtr getLocalHWAddr() const
Returns local HW address.
isc::asiolink::IOAddress siaddr_
siaddr field (32 bits): next server IP address in boot process(e.g.TFTP)
size_t len()
Returns the size of the required buffer to build the packet.
uint16_t secs_
elapsed (number of seconds since beginning of transmission)
isc::asiolink::IOAddress ciaddr_
ciaddr field (32 bits): Client's IP address
static const uint16_t FLAG_BROADCAST_MASK
Mask for the value of flags field in the DHCPv4 message to check whether client requested broadcast r...
isc::asiolink::IOAddress yiaddr_
yiaddr field (32 bits): Client's IP address ("your"), set by server
uint8_t sname_[MAX_SNAME_LEN]
sname field (64 bytes)
virtual HWAddrPtr getMACFromDocsisModem()
No-op.
virtual HWAddrPtr getMACFromRemoteIdRelayOption()
No-op.
virtual bool isDhcp4o6() const
Checks if a DHCPv4 message has been transported over DHCPv6.
uint8_t getOp() const
Returns op field.
void setHWAddr(uint8_t htype, uint8_t hlen, const std::vector< uint8_t > &mac_addr)
Sets hardware address.
uint8_t getHtype() const
Returns htype field.
void setFlags(uint16_t flags)
Sets flags field.
virtual HWAddrPtr getMACFromIPv6RelayOpt()
No-op.
static const size_t MAX_FILE_LEN
length of the FILE field in DHCPv4 message
void setGiaddr(const isc::asiolink::IOAddress &giaddr)
Sets giaddr field.
Base class for classes representing DHCP messages.
boost::shared_ptr< Pkt4 > Pkt4Ptr
A pointer to Pkt4 object.
boost::shared_ptr< HWAddr > HWAddrPtr
Shared pointer to a hardware address structure.
boost::shared_ptr< ClientId > ClientIdPtr
Shared pointer to a Client ID.
std::vector< uint8_t > OptionBuffer
buffer types used in DHCP code.
boost::shared_ptr< Option > OptionPtr
Defines the logger used by the top-level component of kea-lfc.