A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
internet
model
ipv6-packet-filter.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2016 Universita' degli Studi di Napoli Federico II
4
* 2016 University of Washington
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License version 2 as
8
* published by the Free Software Foundation;
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
*
19
* Authors: Stefano Avallone <stavallo@unina.it>
20
* Tom Henderson <tomhend@u.washington.edu>
21
* Pasquale Imputato <p.imputato@gmail.com>
22
*/
23
24
#include "ns3/log.h"
25
#include "ns3/enum.h"
26
#include "ns3/uinteger.h"
27
#include "ns3/tcp-header.h"
28
#include "ns3/udp-header.h"
29
#include "
ipv6-queue-disc-item.h
"
30
#include "
ipv6-packet-filter.h
"
31
32
namespace
ns3
{
33
34
NS_LOG_COMPONENT_DEFINE
(
"Ipv6PacketFilter"
);
35
36
NS_OBJECT_ENSURE_REGISTERED
(Ipv6PacketFilter);
37
38
TypeId
39
Ipv6PacketFilter::GetTypeId
(
void
)
40
{
41
static
TypeId
tid =
TypeId
(
"ns3::Ipv6PacketFilter"
)
42
.
SetParent
<
PacketFilter
> ()
43
.SetGroupName (
"Internet"
)
44
;
45
return
tid;
46
}
47
48
Ipv6PacketFilter::Ipv6PacketFilter
()
49
{
50
NS_LOG_FUNCTION
(
this
);
51
}
52
53
Ipv6PacketFilter::~Ipv6PacketFilter
()
54
{
55
NS_LOG_FUNCTION
(
this
);
56
}
57
58
bool
59
Ipv6PacketFilter::CheckProtocol
(
Ptr<QueueDiscItem>
item)
const
60
{
61
NS_LOG_FUNCTION
(
this
<< item);
62
return
(DynamicCast<Ipv6QueueDiscItem> (item) != 0);
63
}
64
65
// ------------------------------------------------------------------------- //
66
67
68
}
// namespace ns3
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:73
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
Definition:
log-macros-enabled.h:213
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition:
object-base.h:45
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition:
log.h:202
ns3::Ipv6PacketFilter::Ipv6PacketFilter
Ipv6PacketFilter()
Definition:
ipv6-packet-filter.cc:48
ipv6-queue-disc-item.h
ns3::Ipv6PacketFilter::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
ipv6-packet-filter.cc:39
ns3::Ipv6PacketFilter::CheckProtocol
virtual bool CheckProtocol(Ptr< QueueDiscItem > item) const
Checks if the filter is able to classify a kind of items.
Definition:
ipv6-packet-filter.cc:59
ipv6-packet-filter.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Ipv6PacketFilter::~Ipv6PacketFilter
virtual ~Ipv6PacketFilter()
Definition:
ipv6-packet-filter.cc:53
ns3::PacketFilter
PacketFilter is the abstract base class for filters used by queue discs to classify packets...
Definition:
packet-filter.h:34
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition:
type-id.cc:915
Generated on Wed Nov 7 2018 10:01:55 for ns-3 by
1.8.14