blob: c873f8165e7648a9c337faa7f053db9545194f42 [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
Alexander Afanasyevafe47fe2015-01-06 18:29:39 -080025#include "ns3/ndnSIM/apps/ndn-app.hpp"
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080026
27namespace ns3 {
28
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080029class Hijacker : public ndn::App {
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080030public:
31 static TypeId
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080032 GetTypeId();
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080033
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080034 Hijacker();
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080035
36 // Receive all Interests but do nothing in response
37 void
Alexander Afanasyevafe47fe2015-01-06 18:29:39 -080038 OnInterest(std::shared_ptr<const ndn::Interest> interest);
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080039
40protected:
41 // inherited from Application base class.
42 virtual void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080043 StartApplication();
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080044
45 virtual void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080046 StopApplication();
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080047};
48
49} // namespace ns3
50
51#endif // HIJACKER_H_