A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
arp-header.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2005 INRIA
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18
*/
19
20
#ifndef ARP_HEADER_H
21
#define ARP_HEADER_H
22
23
#include "ns3/address.h"
24
#include "ns3/header.h"
25
#include "ns3/ipv4-address.h"
26
27
#include <string>
28
29
namespace
ns3
30
{
35
class
ArpHeader
:
public
Header
36
{
37
public
:
46
void
SetRequest
(
Address
sourceHardwareAddress,
47
Ipv4Address
sourceProtocolAddress,
48
Address
destinationHardwareAddress,
49
Ipv4Address
destinationProtocolAddress);
58
void
SetReply
(
Address
sourceHardwareAddress,
59
Ipv4Address
sourceProtocolAddress,
60
Address
destinationHardwareAddress,
61
Ipv4Address
destinationProtocolAddress);
62
67
bool
IsRequest
()
const
;
68
73
bool
IsReply
()
const
;
74
79
Address
GetSourceHardwareAddress
()
const
;
80
85
Address
GetDestinationHardwareAddress
()
const
;
86
91
Ipv4Address
GetSourceIpv4Address
()
const
;
92
97
Ipv4Address
GetDestinationIpv4Address
()
const
;
98
103
static
TypeId
GetTypeId
();
104
TypeId
GetInstanceTypeId
()
const override
;
105
void
Print
(std::ostream& os)
const override
;
106
uint32_t
GetSerializedSize
()
const override
;
107
void
Serialize
(
Buffer::Iterator
start
)
const override
;
108
uint32_t
Deserialize
(
Buffer::Iterator
start
)
override
;
109
113
enum
ArpType_e
114
{
115
ARP_TYPE_REQUEST
= 1,
116
ARP_TYPE_REPLY
= 2
117
};
118
119
uint16_t
m_type
;
120
Address
m_macSource
;
121
Address
m_macDest
;
122
Ipv4Address
m_ipv4Source
;
123
Ipv4Address
m_ipv4Dest
;
124
};
125
126
}
// namespace ns3
127
128
#endif
/* ARP_HEADER_H */
ns3::Address
a polymophic address class
Definition:
address.h:101
ns3::ArpHeader
The packet header for an ARP packet.
Definition:
arp-header.h:36
ns3::ArpHeader::m_macSource
Address m_macSource
hardware source address
Definition:
arp-header.h:120
ns3::ArpHeader::Print
void Print(std::ostream &os) const override
Definition:
arp-header.cc:123
ns3::ArpHeader::SetReply
void SetReply(Address sourceHardwareAddress, Ipv4Address sourceProtocolAddress, Address destinationHardwareAddress, Ipv4Address destinationProtocolAddress)
Set the ARP reply parameters.
Definition:
arp-header.cc:49
ns3::ArpHeader::IsReply
bool IsReply() const
Check if the ARP is a reply.
Definition:
arp-header.cc:71
ns3::ArpHeader::IsRequest
bool IsRequest() const
Check if the ARP is a request.
Definition:
arp-header.cc:64
ns3::ArpHeader::GetDestinationHardwareAddress
Address GetDestinationHardwareAddress() const
Returns the destination hardware address.
Definition:
arp-header.cc:85
ns3::ArpHeader::m_type
uint16_t m_type
type of the ICMP (ARP_TYPE_REQUEST)
Definition:
arp-header.h:119
ns3::ArpHeader::ArpType_e
ArpType_e
Enumeration listing the possible ARP types.
Definition:
arp-header.h:114
ns3::ArpHeader::ARP_TYPE_REQUEST
@ ARP_TYPE_REQUEST
Definition:
arp-header.h:115
ns3::ArpHeader::ARP_TYPE_REPLY
@ ARP_TYPE_REPLY
Definition:
arp-header.h:116
ns3::ArpHeader::GetDestinationIpv4Address
Ipv4Address GetDestinationIpv4Address() const
Returns the destination IP address.
Definition:
arp-header.cc:99
ns3::ArpHeader::SetRequest
void SetRequest(Address sourceHardwareAddress, Ipv4Address sourceProtocolAddress, Address destinationHardwareAddress, Ipv4Address destinationProtocolAddress)
Set the ARP request parameters.
Definition:
arp-header.cc:34
ns3::ArpHeader::m_macDest
Address m_macDest
hardware destination address
Definition:
arp-header.h:121
ns3::ArpHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Definition:
arp-header.cc:159
ns3::ArpHeader::m_ipv4Dest
Ipv4Address m_ipv4Dest
IP destination address.
Definition:
arp-header.h:123
ns3::ArpHeader::GetSourceIpv4Address
Ipv4Address GetSourceIpv4Address() const
Returns the source IP address.
Definition:
arp-header.cc:92
ns3::ArpHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition:
arp-header.cc:116
ns3::ArpHeader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
arp-header.cc:106
ns3::ArpHeader::m_ipv4Source
Ipv4Address m_ipv4Source
IP source address.
Definition:
arp-header.h:122
ns3::ArpHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition:
arp-header.cc:145
ns3::ArpHeader::GetSourceHardwareAddress
Address GetSourceHardwareAddress() const
Returns the source hardware address.
Definition:
arp-header.cc:78
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:100
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:44
ns3::Header::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:42
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
two-ray-to-three-gpp-ch-calibration.start
start
Definition:
two-ray-to-three-gpp-ch-calibration.py:520
src
internet
model
arp-header.h
Generated on Sun Mar 3 2024 17:10:58 for ns-3 by
1.9.1