blob: 01d156a4ac1ca1aa63295f1233d963945471adec [file] [log] [blame]
Alexander Afanasyev60a7b622014-12-20 17:04:07 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (c) 2011-2015 Regents of the University of California.
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -08004 *
Alexander Afanasyev60a7b622014-12-20 17:04:07 -08005 * This file is part of ndnSIM. See AUTHORS for complete list of ndnSIM authors and
6 * contributors.
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -08007 *
Alexander Afanasyev60a7b622014-12-20 17:04:07 -08008 * ndnSIM is free software: you can redistribute it and/or modify it under the terms
9 * of the GNU General Public License as published by the Free Software Foundation,
10 * either version 3 of the License, or (at your option) any later version.
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080011 *
Alexander Afanasyev60a7b622014-12-20 17:04:07 -080012 * ndnSIM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080015 *
Alexander Afanasyev60a7b622014-12-20 17:04:07 -080016 * You should have received a copy of the GNU General Public License along with
17 * ndnSIM, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
18 **/
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080019
Alexander Afanasyev60a7b622014-12-20 17:04:07 -080020// hijacker.hpp
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080021
22#ifndef HIJACKER_H_
23#define HIJACKER_H_
24
25#include "ns3/core-module.h"
26#include "ns3/network-module.h"
27#include "ns3/ndnSIM-module.h"
28
29namespace ns3 {
30
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080031class Hijacker : public ndn::App {
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080032public:
33 static TypeId
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080034 GetTypeId();
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080035
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080036 Hijacker();
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080037
38 // Receive all Interests but do nothing in response
39 void
Spyridon Mastorakisdb8280f2014-11-21 20:00:17 -080040 OnInterest(shared_ptr<const ndn::Interest> interest);
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080041
42protected:
43 // inherited from Application base class.
44 virtual void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080045 StartApplication();
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080046
47 virtual void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080048 StopApplication();
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080049};
50
51} // namespace ns3
52
53#endif // HIJACKER_H_