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
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
ipv6-packet-info-tag.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2010 Hajime Tazaki
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
* Authors: Hajime Tazaki <tazaki@sfc.wide.ad.jp>
19
*/
20
21
#ifndef IPV6_PACKET_INFO_TAG_H
22
#define IPV6_PACKET_INFO_TAG_H
23
24
#include "ns3/tag.h"
25
#include "ns3/ipv6-address.h"
26
27
namespace
ns3 {
28
29
30
class
Node;
31
class
Packet;
32
44
class
Ipv6PacketInfoTag
:
public
Tag
45
{
46
public
:
47
Ipv6PacketInfoTag
();
48
53
static
TypeId
GetTypeId
(
void
);
54
60
void
SetAddress
(
Ipv6Address
addr);
61
67
Ipv6Address
GetAddress
(
void
)
const
;
68
74
void
SetRecvIf
(uint32_t ifindex);
75
81
uint32_t
GetRecvIf
(
void
)
const
;
82
88
void
SetHoplimit
(uint8_t ttl);
89
95
uint8_t
GetHoplimit
(
void
)
const
;
96
102
void
SetTrafficClass
(uint8_t tclass);
103
109
uint8_t
GetTrafficClass
(
void
)
const
;
110
111
// inherited functions, no doc necessary
112
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
113
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
114
virtual
void
Serialize
(
TagBuffer
i)
const
;
115
virtual
void
Deserialize
(
TagBuffer
i);
116
virtual
void
Print
(std::ostream &os)
const
;
117
118
private
:
119
/*
120
* RFC 3542 includes
121
* for outgoing packet,
122
* 1. the source IPv6 address,
123
* 2. the outgoing interface index,
124
* 3. the outgoing hop limit,
125
* 4. the next hop address, and
126
* 5. the outgoing traffic class value.
127
*
128
* for incoming packet,
129
* 1. the destination IPv6 address,
130
* 2. the arriving interface index,
131
* 3. the arriving hop limit, and
132
* 4. the arriving traffic class value.
133
*/
134
Ipv6Address
m_addr
;
135
uint8_t
m_ifindex
;
136
uint8_t
m_hoplimit
;
137
uint8_t
m_tclass
;
138
};
139
}
// namespace ns3
140
141
#endif
/* IPV6_PACKET_INFO_TAG_H */
142
ns3::Ipv6PacketInfoTag::m_addr
Ipv6Address m_addr
the packet address (src or dst)
Definition:
ipv6-packet-info-tag.h:134
ns3::Ipv6PacketInfoTag::SetAddress
void SetAddress(Ipv6Address addr)
Set the tag's address.
Definition:
ipv6-packet-info-tag.cc:37
ns3::Ipv6PacketInfoTag::SetTrafficClass
void SetTrafficClass(uint8_t tclass)
Set the tag's Traffic Class.
Definition:
ipv6-packet-info-tag.cc:73
ns3::Ipv6PacketInfoTag::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Definition:
ipv6-packet-info-tag.cc:95
ns3::Ipv6PacketInfoTag::Print
virtual void Print(std::ostream &os) const
Definition:
ipv6-packet-info-tag.cc:129
ns3::Ipv6PacketInfoTag::m_ifindex
uint8_t m_ifindex
the Interface index
Definition:
ipv6-packet-info-tag.h:135
ns3::Ipv6PacketInfoTag::m_hoplimit
uint8_t m_hoplimit
the Hop Limit
Definition:
ipv6-packet-info-tag.h:136
ns3::Ipv6PacketInfoTag::GetHoplimit
uint8_t GetHoplimit(void) const
Get the tag's Hop Limit.
Definition:
ipv6-packet-info-tag.cc:67
ns3::Ipv6PacketInfoTag::Ipv6PacketInfoTag
Ipv6PacketInfoTag()
Definition:
ipv6-packet-info-tag.cc:28
ns3::Ipv6PacketInfoTag::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Definition:
ipv6-packet-info-tag.cc:101
ns3::Ipv6PacketInfoTag::GetAddress
Ipv6Address GetAddress(void) const
Get the tag's address.
Definition:
ipv6-packet-info-tag.cc:43
ns3::Ipv6PacketInfoTag::SetHoplimit
void SetHoplimit(uint8_t ttl)
Set the tag's Hop Limit.
Definition:
ipv6-packet-info-tag.cc:61
ns3::Tag
tag a set of bytes in a packet
Definition:
tag.h:36
ns3::Ipv6PacketInfoTag::Serialize
virtual void Serialize(TagBuffer i) const
Definition:
ipv6-packet-info-tag.cc:109
ns3::Ipv6PacketInfoTag::m_tclass
uint8_t m_tclass
the Traffic Class
Definition:
ipv6-packet-info-tag.h:137
ns3::Ipv6PacketInfoTag::GetTrafficClass
uint8_t GetTrafficClass(void) const
Get the tag's Traffic Class.
Definition:
ipv6-packet-info-tag.cc:79
ns3::Ipv6Address
Describes an IPv6 address.
Definition:
ipv6-address.h:46
ns3::TagBuffer
read and write tag data
Definition:
tag-buffer.h:51
ns3::Ipv6PacketInfoTag::GetRecvIf
uint32_t GetRecvIf(void) const
Get the tag's receiving interface.
Definition:
ipv6-packet-info-tag.cc:55
ns3::Ipv6PacketInfoTag
This class implements a tag that carries socket ancillary data to the socket interface.
Definition:
ipv6-packet-info-tag.h:44
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::Ipv6PacketInfoTag::SetRecvIf
void SetRecvIf(uint32_t ifindex)
Set the tag's receiving interface.
Definition:
ipv6-packet-info-tag.cc:49
ns3::Ipv6PacketInfoTag::Deserialize
virtual void Deserialize(TagBuffer i)
Definition:
ipv6-packet-info-tag.cc:119
ns3::Ipv6PacketInfoTag::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
ipv6-packet-info-tag.cc:86
src
internet
model
ipv6-packet-info-tag.h
Generated on Sat Apr 19 2014 14:06:57 for ns-3 by
1.8.6