A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
sll-header.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2015 Université Pierre et Marie Curie
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: Matthieu Coudron <matthieu.coudron@lip6.fr>
19
*/
20
#ifndef SLL_HEADER_H
21
#define SLL_HEADER_H
22
23
#include "ns3/buffer.h"
24
#include "ns3/header.h"
25
#include <stdint.h>
26
27
namespace
ns3
{
28
64
class
SllHeader
:
public
Header
65
{
66
public
:
67
enum
PacketType
68
{
69
UNICAST_FROM_PEER_TO_ME
= 0,
70
BROADCAST_BY_PEER
= 1,
71
MULTICAST_BY_PEER
= 2,
72
INTERCEPTED_PACKET
= 3,
73
SENT_BY_US
74
};
75
80
static
TypeId
GetTypeId
(
void
);
81
82
SllHeader
();
83
virtual
~SllHeader
();
84
89
uint16_t
GetArpType
()
const
;
90
94
void
SetArpType
(uint16_t arphdType);
95
99
enum
PacketType
GetPacketType
()
const
;
100
104
void
SetPacketType
(
PacketType
type);
105
107
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
109
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
110
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
111
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start
);
112
virtual
void
Print
(std::ostream &os)
const
;
113
114
protected
:
115
// declared in packet order
116
PacketType
m_packetType
;
117
uint16_t
m_arphdType
;
118
uint16_t
m_addressLength
;
119
uint64_t
m_address
;
120
uint16_t
m_protocolType
;
121
};
122
123
}
// namespace ns3
124
125
#endif
/* SLL_HEADER_H */
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:42
ns3::SllHeader::m_protocolType
uint16_t m_protocolType
Definition:
sll-header.h:120
ns3::SllHeader::m_address
uint64_t m_address
Definition:
sll-header.h:119
ns3::SllHeader::m_arphdType
uint16_t m_arphdType
ARP protocol hardware identifier.
Definition:
sll-header.h:117
ns3::SllHeader::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Inherited from ObjectBase.
Definition:
sll-header.cc:58
visualizer.core.start
def start()
Definition:
core.py:1482
ns3::SllHeader::SetPacketType
void SetPacketType(PacketType type)
Definition:
sll-header.cc:83
ns3::SllHeader::UNICAST_FROM_PEER_TO_ME
the packet was specifically sent to us by somebody else
Definition:
sll-header.h:69
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:98
ns3::SllHeader::GetPacketType
enum PacketType GetPacketType() const
Definition:
sll-header.cc:77
ns3::SllHeader::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
sll-header.cc:47
ns3::SllHeader
Protocol header serialization and deserialization.
Definition:
sll-header.h:64
ns3::SllHeader::m_addressLength
uint16_t m_addressLength
Definition:
sll-header.h:118
ns3::SllHeader::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)
Definition:
sll-header.cc:113
ns3::SllHeader::m_packetType
PacketType m_packetType
Definition:
sll-header.h:116
ns3::SllHeader::INTERCEPTED_PACKET
packet was sent to somebody else by somebody else
Definition:
sll-header.h:72
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::SllHeader::SetArpType
void SetArpType(uint16_t arphdType)
Definition:
sll-header.cc:70
ns3::SllHeader::GetArpType
uint16_t GetArpType() const
Definition:
sll-header.cc:64
ns3::SllHeader::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Inherited from Header.
Definition:
sll-header.cc:96
ns3::SllHeader::Serialize
virtual void Serialize(Buffer::Iterator start) const
Definition:
sll-header.cc:102
ns3::SllHeader::SllHeader
SllHeader()
Definition:
sll-header.cc:30
ns3::SllHeader::Print
virtual void Print(std::ostream &os) const
Definition:
sll-header.cc:90
ns3::SllHeader::~SllHeader
virtual ~SllHeader()
Definition:
sll-header.cc:40
ns3::SllHeader::MULTICAST_BY_PEER
packet was multicast, but not broadcast, by somebody else
Definition:
sll-header.h:71
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
ns3::SllHeader::PacketType
PacketType
Definition:
sll-header.h:67
ns3::SllHeader::SENT_BY_US
the packet was sent by us
Definition:
sll-header.h:73
ns3::SllHeader::BROADCAST_BY_PEER
packet was broadcast by somebody else
Definition:
sll-header.h:70
src
network
utils
sll-header.h
Generated on Thu Mar 24 2016 00:46:51 for ns-3 by
1.8.9.1