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
ipv4-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 IPV4_PACKET_INFO_TAG_H
22
#define IPV4_PACKET_INFO_TAG_H
23
24
#include "ns3/tag.h"
25
#include "ns3/ipv4-address.h"
26
27
namespace
ns3 {
28
29
30
class
Node;
31
class
Packet;
32
42
class
Ipv4PacketInfoTag
:
public
Tag
43
{
44
public
:
45
Ipv4PacketInfoTag
();
46
// Implemented, but not used in the stack yet
47
void
SetAddress
(
Ipv4Address
addr);
48
// Implemented, but not used in the stack yet
49
Ipv4Address
GetAddress
(
void
)
const
;
50
// This corresponds to "ipi_spec_dst" in struct in_pktinfo.
51
// Implemented, but not used in the stack yet
52
void
SetLocalAddress
(
Ipv4Address
addr);
53
// This corresponds to "ipi_spec_dst" in struct in_pktinfo.
54
// Implemented, but not used in the stack yet
55
Ipv4Address
GetLocalAddress
(
void
)
const
;
56
void
SetRecvIf
(uint32_t ifindex);
57
uint32_t
GetRecvIf
(
void
)
const
;
58
// Implemented, but not used in the stack yet
59
void
SetTtl
(uint8_t ttl);
60
// Implemented, but not used in the stack yet
61
uint8_t
GetTtl
(
void
)
const
;
62
63
static
TypeId
GetTypeId
(
void
);
64
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
65
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
66
virtual
void
Serialize
(
TagBuffer
i)
const
;
67
virtual
void
Deserialize
(
TagBuffer
i);
68
virtual
void
Print
(std::ostream &os)
const
;
69
70
private
:
71
// Linux IP_PKTINFO ip(7) implementation
72
//
73
// struct in_pktinfo {
74
// unsigned int ipi_ifindex; /* Interface index */
75
// struct in_addr ipi_spec_dst; /* Local address */
76
// struct in_addr ipi_addr; /* Header Destination
77
// address */
78
// };
79
80
Ipv4Address
m_addr
;
81
Ipv4Address
m_spec_dst
;
82
uint32_t
m_ifindex
;
83
84
// Uset for IP_RECVTTL, though not implemented yet.
85
uint8_t
m_ttl
;
86
};
87
}
// namespace ns3
88
89
#endif
/* IPV4_PACKET_INFO_TAG_H */
ns3::Ipv4PacketInfoTag::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Definition:
ipv4-packet-info-tag.cc:115
ns3::Ipv4PacketInfoTag::Ipv4PacketInfoTag
Ipv4PacketInfoTag()
Definition:
ipv4-packet-info-tag.cc:31
ns3::Ipv4PacketInfoTag::m_addr
Ipv4Address m_addr
Definition:
ipv4-packet-info-tag.h:80
ns3::Ipv4PacketInfoTag::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Definition:
ipv4-packet-info-tag.cc:108
ns3::Ipv4PacketInfoTag::m_ifindex
uint32_t m_ifindex
Definition:
ipv4-packet-info-tag.h:82
ns3::Ipv4PacketInfoTag::SetTtl
void SetTtl(uint8_t ttl)
Definition:
ipv4-packet-info-tag.cc:83
ns3::Ipv4PacketInfoTag::m_spec_dst
Ipv4Address m_spec_dst
Definition:
ipv4-packet-info-tag.h:81
ns3::Ipv4PacketInfoTag::GetRecvIf
uint32_t GetRecvIf(void) const
Definition:
ipv4-packet-info-tag.cc:76
ns3::Ipv4PacketInfoTag::Serialize
virtual void Serialize(TagBuffer i) const
Definition:
ipv4-packet-info-tag.cc:123
ns3::Ipv4PacketInfoTag::GetTtl
uint8_t GetTtl(void) const
Definition:
ipv4-packet-info-tag.cc:90
ns3::Tag
tag a set of bytes in a packet
Definition:
tag.h:36
ns3::Ipv4PacketInfoTag::GetLocalAddress
Ipv4Address GetLocalAddress(void) const
Definition:
ipv4-packet-info-tag.cc:62
ns3::Ipv4PacketInfoTag::GetTypeId
static TypeId GetTypeId(void)
Definition:
ipv4-packet-info-tag.cc:99
ns3::Ipv4PacketInfoTag::m_ttl
uint8_t m_ttl
Definition:
ipv4-packet-info-tag.h:85
ns3::Ipv4PacketInfoTag
This class implements Linux struct pktinfo in order to deliver ancillary information to the socket in...
Definition:
ipv4-packet-info-tag.h:42
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:38
ns3::TagBuffer
read and write tag data
Definition:
tag-buffer.h:51
ns3::Ipv4PacketInfoTag::Deserialize
virtual void Deserialize(TagBuffer i)
Definition:
ipv4-packet-info-tag.cc:135
ns3::Ipv4PacketInfoTag::GetAddress
Ipv4Address GetAddress(void) const
Definition:
ipv4-packet-info-tag.cc:48
ns3::Ipv4PacketInfoTag::SetLocalAddress
void SetLocalAddress(Ipv4Address addr)
Definition:
ipv4-packet-info-tag.cc:55
ns3::Ipv4PacketInfoTag::Print
virtual void Print(std::ostream &os) const
Definition:
ipv4-packet-info-tag.cc:147
ns3::Ipv4PacketInfoTag::SetAddress
void SetAddress(Ipv4Address addr)
Definition:
ipv4-packet-info-tag.cc:41
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::Ipv4PacketInfoTag::SetRecvIf
void SetRecvIf(uint32_t ifindex)
Definition:
ipv4-packet-info-tag.cc:69
src
internet
model
ipv4-packet-info-tag.h
Generated on Sat Nov 16 2013 16:17:41 for ns-3 by
1.8.5