A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
internet
model
arp-header.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2005 INRIA
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
*/
20
21
#ifndef ARP_HEADER_H
22
#define ARP_HEADER_H
23
24
#include "ns3/header.h"
25
#include "ns3/address.h"
26
#include "ns3/ipv4-address.h"
27
#include <string>
28
29
namespace
ns3
{
34
class
ArpHeader
:
public
Header
35
{
36
public
:
44
void
SetRequest
(
Address
sourceHardwareAddress,
45
Ipv4Address
sourceProtocolAddress,
46
Address
destinationHardwareAddress,
47
Ipv4Address
destinationProtocolAddress);
55
void
SetReply
(
Address
sourceHardwareAddress,
56
Ipv4Address
sourceProtocolAddress,
57
Address
destinationHardwareAddress,
58
Ipv4Address
destinationProtocolAddress);
59
64
bool
IsRequest
(
void
)
const
;
65
70
bool
IsReply
(
void
)
const
;
71
76
Address
GetSourceHardwareAddress
(
void
)
const
;
77
82
Address
GetDestinationHardwareAddress
(
void
)
const
;
83
88
Ipv4Address
GetSourceIpv4Address
(
void
)
const
;
89
94
Ipv4Address
GetDestinationIpv4Address
(
void
)
const
;
95
100
static
TypeId
GetTypeId
(
void
);
101
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
102
virtual
void
Print
(std::ostream &os)
const
;
103
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
104
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
105
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start
);
106
110
enum
ArpType_e
{
111
ARP_TYPE_REQUEST
= 1,
112
ARP_TYPE_REPLY
= 2
113
};
114
uint16_t
m_type
;
115
Address
m_macSource
;
116
Address
m_macDest
;
117
Ipv4Address
m_ipv4Source
;
118
Ipv4Address
m_ipv4Dest
;
119
};
120
121
}
// namespace ns3
122
123
#endif
/* ARP_HEADER_H */
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:42
ns3::ArpHeader::SetReply
void SetReply(Address sourceHardwareAddress, Ipv4Address sourceProtocolAddress, Address destinationHardwareAddress, Ipv4Address destinationProtocolAddress)
Set the ARP reply parameters.
Definition:
arp-header.cc:46
ns3::ArpHeader::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
arp-header.cc:97
ns3::ArpHeader::m_macSource
Address m_macSource
hardware source address
Definition:
arp-header.h:115
ns3::ArpHeader::ARP_TYPE_REQUEST
Definition:
arp-header.h:111
ns3::ArpHeader::ARP_TYPE_REPLY
Definition:
arp-header.h:112
ns3::ArpHeader::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Definition:
arp-header.cc:136
ns3::ArpHeader::GetDestinationIpv4Address
Ipv4Address GetDestinationIpv4Address(void) const
Returns the destination IP address.
Definition:
arp-header.cc:89
visualizer.core.start
def start()
Definition:
core.py:1844
ns3::ArpHeader::SetRequest
void SetRequest(Address sourceHardwareAddress, Ipv4Address sourceProtocolAddress, Address destinationHardwareAddress, Ipv4Address destinationProtocolAddress)
Set the ARP request parameters.
Definition:
arp-header.cc:33
ns3::ArpHeader
The packet header for an ARP packet.
Definition:
arp-header.h:34
ns3::ArpHeader::GetDestinationHardwareAddress
Address GetDestinationHardwareAddress(void) const
Returns the destination hardware address.
Definition:
arp-header.cc:77
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:98
ns3::Address
a polymophic address class
Definition:
address.h:90
ns3::ArpHeader::GetSourceHardwareAddress
Address GetSourceHardwareAddress(void) const
Returns the source hardware address.
Definition:
arp-header.cc:71
ns3::ArpHeader::GetSourceIpv4Address
Ipv4Address GetSourceIpv4Address(void) const
Returns the source IP address.
Definition:
arp-header.cc:83
ns3::ArpHeader::m_ipv4Source
Ipv4Address m_ipv4Source
IP source address.
Definition:
arp-header.h:117
ns3::ArpHeader::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)
Definition:
arp-header.cc:169
ns3::ArpHeader::IsRequest
bool IsRequest(void) const
Check if the ARP is a request.
Definition:
arp-header.cc:59
ns3::ArpHeader::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition:
arp-header.cc:107
ns3::ArpHeader::Print
virtual void Print(std::ostream &os) const
Definition:
arp-header.cc:113
ns3::ArpHeader::m_macDest
Address m_macDest
hardware destination address
Definition:
arp-header.h:116
ns3::ArpHeader::m_ipv4Dest
Ipv4Address m_ipv4Dest
IP destination address.
Definition:
arp-header.h:118
ns3::ArpHeader::IsReply
bool IsReply(void) const
Check if the ARP is a reply.
Definition:
arp-header.cc:65
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::ArpHeader::Serialize
virtual void Serialize(Buffer::Iterator start) const
Definition:
arp-header.cc:149
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:40
ns3::ArpHeader::m_type
uint16_t m_type
type of the ICMP (ARP_TYPE_REQUEST)
Definition:
arp-header.h:114
ns3::ArpHeader::ArpType_e
ArpType_e
Enumeration listing the possible ARP types.
Definition:
arp-header.h:110
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
Generated on Wed Nov 7 2018 10:01:53 for ns-3 by
1.8.14