A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
ipv6-header.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2007-2008 Louis Pasteur University
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: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
19
*/
20
21
#ifndef IPV6_HEADER_H
22
#define IPV6_HEADER_H
23
24
#include "ns3/header.h"
25
#include "ns3/ipv6-address.h"
26
#include "ns3/deprecated.h"
27
28
namespace
ns3
{
29
35
class
Ipv6Header
:
public
Header
36
{
37
public
:
46
enum
DscpType
47
{
48
DscpDefault
= 0x00,
49
50
// Prefixed with "DSCP" to avoid name clash (bug 1723)
51
DSCP_CS1
= 0x08,
// octal 010
52
DSCP_AF11
= 0x0A,
// octal 012
53
DSCP_AF12
= 0x0C,
// octal 014
54
DSCP_AF13
= 0x0E,
// octal 016
55
56
DSCP_CS2
= 0x10,
// octal 020
57
DSCP_AF21
= 0x12,
// octal 022
58
DSCP_AF22
= 0x14,
// octal 024
59
DSCP_AF23
= 0x16,
// octal 026
60
61
DSCP_CS3
= 0x18,
// octal 030
62
DSCP_AF31
= 0x1A,
// octal 032
63
DSCP_AF32
= 0x1C,
// octal 034
64
DSCP_AF33
= 0x1E,
// octal 036
65
66
DSCP_CS4
= 0x20,
// octal 040
67
DSCP_AF41
= 0x22,
// octal 042
68
DSCP_AF42
= 0x24,
// octal 044
69
DSCP_AF43
= 0x26,
// octal 046
70
71
DSCP_CS5
= 0x28,
// octal 050
72
DSCP_EF
= 0x2E,
// octal 056
73
74
DSCP_CS6
= 0x30,
// octal 060
75
DSCP_CS7
= 0x38
// octal 070
76
77
};
78
83
enum
NextHeader_e
84
{
85
IPV6_EXT_HOP_BY_HOP
= 0,
86
IPV6_IPV4
= 4,
87
IPV6_TCP
= 6,
88
IPV6_UDP
= 17,
89
IPV6_IPV6
= 41,
90
IPV6_EXT_ROUTING
= 43,
91
IPV6_EXT_FRAGMENTATION
= 44,
92
IPV6_EXT_CONFIDENTIALITY
= 50,
93
IPV6_EXT_AUTHENTIFICATION
= 51,
94
IPV6_ICMPV6
= 58,
95
IPV6_EXT_END
= 59,
96
IPV6_EXT_DESTINATION
= 60,
97
IPV6_SCTP
= 135,
98
IPV6_EXT_MOBILITY
= 135,
99
IPV6_UDP_LITE
= 136,
100
};
101
106
static
TypeId
GetTypeId
(
void
);
107
112
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
113
117
Ipv6Header
(
void
);
118
123
void
SetTrafficClass
(uint8_t traffic);
124
129
uint8_t
GetTrafficClass
(
void
)
const
;
130
135
void
SetDscp
(
DscpType
dscp);
136
140
DscpType
GetDscp
(
void
)
const
;
141
146
std::string
DscpTypeToString
(
DscpType
dscp)
const
;
147
152
enum
EcnType
153
{
154
// Prefixed with "ECN" to avoid name clash
155
ECN_NotECT
= 0x00,
156
ECN_ECT1
= 0x01,
157
ECN_ECT0
= 0x02,
158
ECN_CE
= 0x03
159
};
160
165
void
SetEcn
(
EcnType
ecn);
166
170
EcnType
GetEcn
(
void
)
const
;
171
176
std::string
EcnTypeToString
(
EcnType
ecn)
const
;
177
182
void
SetFlowLabel
(uint32_t flow);
183
188
uint32_t
GetFlowLabel
(
void
)
const
;
189
194
void
SetPayloadLength
(uint16_t len);
195
200
uint16_t
GetPayloadLength
(
void
)
const
;
201
206
void
SetNextHeader
(uint8_t next);
207
212
uint8_t
GetNextHeader
(
void
)
const
;
213
218
void
SetHopLimit
(uint8_t limit);
219
224
uint8_t
GetHopLimit
(
void
)
const
;
225
230
void
SetSource
(
Ipv6Address
src);
231
237
NS_DEPRECATED_3_35
238
void
SetSourceAddress
(
Ipv6Address
src);
239
244
Ipv6Address
GetSource
(
void
)
const
;
245
251
NS_DEPRECATED_3_35
252
Ipv6Address
GetSourceAddress
(
void
)
const
;
253
258
void
SetDestination
(
Ipv6Address
dst);
259
265
NS_DEPRECATED_3_35
266
void
SetDestinationAddress
(
Ipv6Address
dst);
267
272
Ipv6Address
GetDestination
(
void
)
const
;
273
279
NS_DEPRECATED_3_35
280
Ipv6Address
GetDestinationAddress
(
void
)
const
;
281
286
virtual
void
Print
(std::ostream& os)
const
;
287
292
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
293
298
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
299
305
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start
);
306
307
private
:
311
uint32_t
m_trafficClass
: 8;
312
317
uint32_t
m_flowLabel
: 20;
318
322
uint16_t
m_payloadLength
;
323
327
uint8_t
m_nextHeader
;
328
332
uint8_t
m_hopLimit
;
333
337
Ipv6Address
m_sourceAddress
;
338
342
Ipv6Address
m_destinationAddress
;
343
};
344
345
}
/* namespace ns3 */
346
347
#endif
/* IPV6_HEADER_H */
348
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:99
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:43
ns3::Header::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
ns3::Ipv6Address
Describes an IPv6 address.
Definition:
ipv6-address.h:50
ns3::Ipv6Header
Packet header for IPv6.
Definition:
ipv6-header.h:36
ns3::Ipv6Header::SetDestination
void SetDestination(Ipv6Address dst)
Set the "Destination address" field.
Definition:
ipv6-header.cc:115
ns3::Ipv6Header::GetSourceAddress
NS_DEPRECATED_3_35 Ipv6Address GetSourceAddress(void) const
Get the "Source address" field.
Definition:
ipv6-header.cc:110
ns3::Ipv6Header::GetHopLimit
uint8_t GetHopLimit(void) const
Get the "Hop limit" field (TTL).
Definition:
ipv6-header.cc:90
ns3::Ipv6Header::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
Definition:
ipv6-header.cc:145
ns3::Ipv6Header::Print
virtual void Print(std::ostream &os) const
Print some information about the packet.
Definition:
ipv6-header.cc:150
ns3::Ipv6Header::SetEcn
void SetEcn(EcnType ecn)
Set ECN field bits.
Definition:
ipv6-header.cc:215
ns3::Ipv6Header::NextHeader_e
NextHeader_e
IPv6 next-header value.
Definition:
ipv6-header.h:84
ns3::Ipv6Header::IPV6_EXT_END
@ IPV6_EXT_END
Definition:
ipv6-header.h:95
ns3::Ipv6Header::IPV6_IPV6
@ IPV6_IPV6
Definition:
ipv6-header.h:89
ns3::Ipv6Header::IPV6_SCTP
@ IPV6_SCTP
Definition:
ipv6-header.h:97
ns3::Ipv6Header::IPV6_EXT_ROUTING
@ IPV6_EXT_ROUTING
Definition:
ipv6-header.h:90
ns3::Ipv6Header::IPV6_EXT_FRAGMENTATION
@ IPV6_EXT_FRAGMENTATION
Definition:
ipv6-header.h:91
ns3::Ipv6Header::IPV6_ICMPV6
@ IPV6_ICMPV6
Definition:
ipv6-header.h:94
ns3::Ipv6Header::IPV6_EXT_CONFIDENTIALITY
@ IPV6_EXT_CONFIDENTIALITY
Definition:
ipv6-header.h:92
ns3::Ipv6Header::IPV6_EXT_AUTHENTIFICATION
@ IPV6_EXT_AUTHENTIFICATION
Definition:
ipv6-header.h:93
ns3::Ipv6Header::IPV6_EXT_HOP_BY_HOP
@ IPV6_EXT_HOP_BY_HOP
Definition:
ipv6-header.h:85
ns3::Ipv6Header::IPV6_UDP_LITE
@ IPV6_UDP_LITE
Definition:
ipv6-header.h:99
ns3::Ipv6Header::IPV6_IPV4
@ IPV6_IPV4
Definition:
ipv6-header.h:86
ns3::Ipv6Header::IPV6_EXT_DESTINATION
@ IPV6_EXT_DESTINATION
Definition:
ipv6-header.h:96
ns3::Ipv6Header::IPV6_EXT_MOBILITY
@ IPV6_EXT_MOBILITY
Definition:
ipv6-header.h:98
ns3::Ipv6Header::IPV6_TCP
@ IPV6_TCP
Definition:
ipv6-header.h:87
ns3::Ipv6Header::IPV6_UDP
@ IPV6_UDP
Definition:
ipv6-header.h:88
ns3::Ipv6Header::GetSource
Ipv6Address GetSource(void) const
Get the "Source address" field.
Definition:
ipv6-header.cc:105
ns3::Ipv6Header::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
Definition:
ipv6-header.cc:163
ns3::Ipv6Header::GetDscp
DscpType GetDscp(void) const
Definition:
ipv6-header.cc:222
ns3::Ipv6Header::GetTypeId
static TypeId GetTypeId(void)
Get the type identifier.
Definition:
ipv6-header.cc:135
ns3::Ipv6Header::m_destinationAddress
Ipv6Address m_destinationAddress
The destination address.
Definition:
ipv6-header.h:342
ns3::Ipv6Header::SetSource
void SetSource(Ipv6Address src)
Set the "Source address" field.
Definition:
ipv6-header.cc:95
ns3::Ipv6Header::GetNextHeader
uint8_t GetNextHeader(void) const
Get the next header.
Definition:
ipv6-header.cc:80
ns3::Ipv6Header::SetHopLimit
void SetHopLimit(uint8_t limit)
Set the "Hop limit" field (TTL).
Definition:
ipv6-header.cc:85
ns3::Ipv6Header::m_flowLabel
uint32_t m_flowLabel
The flow label.
Definition:
ipv6-header.h:317
ns3::Ipv6Header::SetPayloadLength
void SetPayloadLength(uint16_t len)
Set the "Payload length" field.
Definition:
ipv6-header.cc:65
ns3::Ipv6Header::GetDestinationAddress
NS_DEPRECATED_3_35 Ipv6Address GetDestinationAddress(void) const
Get the "Destination address" field.
Definition:
ipv6-header.cc:130
ns3::Ipv6Header::Ipv6Header
Ipv6Header(void)
Constructor.
Definition:
ipv6-header.cc:34
ns3::Ipv6Header::GetTrafficClass
uint8_t GetTrafficClass(void) const
Get the "Traffic class" field.
Definition:
ipv6-header.cc:50
ns3::Ipv6Header::GetPayloadLength
uint16_t GetPayloadLength(void) const
Get the "Payload length" field.
Definition:
ipv6-header.cc:70
ns3::Ipv6Header::SetFlowLabel
void SetFlowLabel(uint32_t flow)
Set the "Flow label" field.
Definition:
ipv6-header.cc:55
ns3::Ipv6Header::m_sourceAddress
Ipv6Address m_sourceAddress
The source address.
Definition:
ipv6-header.h:337
ns3::Ipv6Header::EcnType
EcnType
ECN field bits.
Definition:
ipv6-header.h:153
ns3::Ipv6Header::ECN_NotECT
@ ECN_NotECT
Definition:
ipv6-header.h:155
ns3::Ipv6Header::ECN_ECT1
@ ECN_ECT1
Definition:
ipv6-header.h:156
ns3::Ipv6Header::ECN_ECT0
@ ECN_ECT0
Definition:
ipv6-header.h:157
ns3::Ipv6Header::ECN_CE
@ ECN_CE
Definition:
ipv6-header.h:158
ns3::Ipv6Header::m_payloadLength
uint16_t m_payloadLength
The payload length.
Definition:
ipv6-header.h:322
ns3::Ipv6Header::m_nextHeader
uint8_t m_nextHeader
The Next header number.
Definition:
ipv6-header.h:327
ns3::Ipv6Header::SetSourceAddress
NS_DEPRECATED_3_35 void SetSourceAddress(Ipv6Address src)
Set the "Source address" field.
Definition:
ipv6-header.cc:100
ns3::Ipv6Header::DscpTypeToString
std::string DscpTypeToString(DscpType dscp) const
Definition:
ipv6-header.cc:229
ns3::Ipv6Header::EcnTypeToString
std::string EcnTypeToString(EcnType ecn) const
Definition:
ipv6-header.cc:289
ns3::Ipv6Header::Serialize
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
Definition:
ipv6-header.cc:168
ns3::Ipv6Header::SetTrafficClass
void SetTrafficClass(uint8_t traffic)
Set the "Traffic class" field.
Definition:
ipv6-header.cc:45
ns3::Ipv6Header::SetDscp
void SetDscp(DscpType dscp)
Set DSCP Field.
Definition:
ipv6-header.cc:208
ns3::Ipv6Header::GetFlowLabel
uint32_t GetFlowLabel(void) const
Get the "Flow label" field.
Definition:
ipv6-header.cc:60
ns3::Ipv6Header::GetDestination
Ipv6Address GetDestination(void) const
Get the "Destination address" field.
Definition:
ipv6-header.cc:125
ns3::Ipv6Header::SetNextHeader
void SetNextHeader(uint8_t next)
Set the "Next header" field.
Definition:
ipv6-header.cc:75
ns3::Ipv6Header::m_trafficClass
uint32_t m_trafficClass
The traffic class.
Definition:
ipv6-header.h:311
ns3::Ipv6Header::GetEcn
EcnType GetEcn(void) const
Definition:
ipv6-header.cc:282
ns3::Ipv6Header::SetDestinationAddress
NS_DEPRECATED_3_35 void SetDestinationAddress(Ipv6Address dst)
Set the "Destination address" field.
Definition:
ipv6-header.cc:120
ns3::Ipv6Header::m_hopLimit
uint8_t m_hopLimit
The Hop limit value.
Definition:
ipv6-header.h:332
ns3::Ipv6Header::DscpType
DscpType
DiffServ Code Points Code Points defined in Assured Forwarding (AF) RFC 2597 Expedited Forwarding (EF...
Definition:
ipv6-header.h:47
ns3::Ipv6Header::DSCP_AF43
@ DSCP_AF43
Definition:
ipv6-header.h:69
ns3::Ipv6Header::DSCP_AF23
@ DSCP_AF23
Definition:
ipv6-header.h:59
ns3::Ipv6Header::DSCP_AF32
@ DSCP_AF32
Definition:
ipv6-header.h:63
ns3::Ipv6Header::DSCP_AF21
@ DSCP_AF21
Definition:
ipv6-header.h:57
ns3::Ipv6Header::DSCP_AF11
@ DSCP_AF11
Definition:
ipv6-header.h:52
ns3::Ipv6Header::DscpDefault
@ DscpDefault
Definition:
ipv6-header.h:48
ns3::Ipv6Header::DSCP_AF13
@ DSCP_AF13
Definition:
ipv6-header.h:54
ns3::Ipv6Header::DSCP_CS2
@ DSCP_CS2
Definition:
ipv6-header.h:56
ns3::Ipv6Header::DSCP_CS7
@ DSCP_CS7
Definition:
ipv6-header.h:75
ns3::Ipv6Header::DSCP_CS3
@ DSCP_CS3
Definition:
ipv6-header.h:61
ns3::Ipv6Header::DSCP_CS6
@ DSCP_CS6
Definition:
ipv6-header.h:74
ns3::Ipv6Header::DSCP_CS1
@ DSCP_CS1
Definition:
ipv6-header.h:51
ns3::Ipv6Header::DSCP_AF41
@ DSCP_AF41
Definition:
ipv6-header.h:67
ns3::Ipv6Header::DSCP_AF42
@ DSCP_AF42
Definition:
ipv6-header.h:68
ns3::Ipv6Header::DSCP_EF
@ DSCP_EF
Definition:
ipv6-header.h:72
ns3::Ipv6Header::DSCP_AF22
@ DSCP_AF22
Definition:
ipv6-header.h:58
ns3::Ipv6Header::DSCP_AF33
@ DSCP_AF33
Definition:
ipv6-header.h:64
ns3::Ipv6Header::DSCP_AF12
@ DSCP_AF12
Definition:
ipv6-header.h:53
ns3::Ipv6Header::DSCP_CS5
@ DSCP_CS5
Definition:
ipv6-header.h:71
ns3::Ipv6Header::DSCP_AF31
@ DSCP_AF31
Definition:
ipv6-header.h:62
ns3::Ipv6Header::DSCP_CS4
@ DSCP_CS4
Definition:
ipv6-header.h:66
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
NS_DEPRECATED_3_35
#define NS_DEPRECATED_3_35
Tag for things deprecated in version ns-3.35.
Definition:
deprecated.h:81
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
visualizer.core.start
def start()
Definition:
core.py:1853
src
internet
model
ipv6-header.h
Generated on Tue Feb 6 2024 19:21:19 for ns-3 by
1.9.1