A Discrete-Event Network Simulator
API
ipv4-packet-filter.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II
3  * 2016 University of Washington
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: Stefano Avallone <stavallo@unina.it>
19  * Tom Henderson <tomhend@u.washington.edu>
20  * Pasquale Imputato <p.imputato@gmail.com>
21  */
22 
23 #ifndef IPV4_PACKET_FILTER_H
24 #define IPV4_PACKET_FILTER_H
25 
26 #include "ns3/object.h"
27 #include "ns3/packet-filter.h"
28 
29 namespace ns3
30 {
31 
39 {
40  public:
45  static TypeId GetTypeId();
46 
48  ~Ipv4PacketFilter() override;
49 
50  private:
51  bool CheckProtocol(Ptr<QueueDiscItem> item) const override;
52  int32_t DoClassify(Ptr<QueueDiscItem> item) const override = 0;
53 };
54 
55 } // namespace ns3
56 
57 #endif /* IPV4_PACKET_FILTER */
Ipv4PacketFilter is the abstract base class for filters defined for IPv4 packets.
int32_t DoClassify(Ptr< QueueDiscItem > item) const override=0
Classify a packet.
static TypeId GetTypeId()
Get the type ID.
bool CheckProtocol(Ptr< QueueDiscItem > item) const override
Checks if the filter is able to classify a kind of items.
PacketFilter is the abstract base class for filters used by queue discs to classify packets.
Definition: packet-filter.h:35
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.