LEFT | RIGHT |
(no file at all) | |
| 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. |
| 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: Sidharth Nabar <snabar@uw.edu>, He Wu <mdzz@u.washington.edu> |
| 19 */ |
| 20 |
| 21 #ifndef JAMMING_MITIGATION_HELPER_H |
| 22 #define JAMMING_MITIGATION_HELPER_H |
| 23 |
| 24 #include "ns3/attribute.h" |
| 25 #include "ns3/object-factory.h" |
| 26 #include "ns3/node-container.h" |
| 27 #include "ns3/ptr.h" |
| 28 #include "ns3/wireless-module-utility.h" |
| 29 #include "ns3/jamming-mitigation.h" |
| 30 #include "wireless-module-utility-helper.h" |
| 31 #include "jamming-mitigation-container.h" |
| 32 |
| 33 namespace ns3 { |
| 34 |
| 35 /** |
| 36 * \brief Creates JammingMitigation objects \ref ns3::JammingMitigation. |
| 37 * |
| 38 * Note that the JammingMitigation object depends on the WirelessModuleUtility |
| 39 * object. The helper will make sure a WirelessModuleUtility object is installed |
| 40 * before installing JammingMitigation object. |
| 41 * |
| 42 * New types of JammingMitigation object can reuse most of this base class by |
| 43 * inheriting from this base class and overwriting the DoInstall method. |
| 44 * |
| 45 * Note that this helper installs ns3::MitigateByChannelHop by default. |
| 46 */ |
| 47 class JammingMitigationHelper |
| 48 { |
| 49 public: |
| 50 |
| 51 JammingMitigationHelper (); |
| 52 ~JammingMitigationHelper (); |
| 53 |
| 54 /** |
| 55 * \param type The type of mitigation object to create. |
| 56 * |
| 57 * Sets the type of mitigation object to create for Install method. |
| 58 */ |
| 59 void SetJammingMitigationType (std::string type); |
| 60 |
| 61 /** |
| 62 * \returns The type name of mitigation object to create for Install method. |
| 63 */ |
| 64 std::string GetJammingMitigationType (void) const; |
| 65 |
| 66 /** |
| 67 * \brief Sets one of the attributes of underlying mitigation object. |
| 68 * |
| 69 * \param name Name of attribute to set. |
| 70 * \param v Value of the attribute. |
| 71 */ |
| 72 void Set (std::string name, const AttributeValue &v); |
| 73 |
| 74 /** |
| 75 * \param node The node on which a utility object must be created. |
| 76 * \returns Container contains all the JammingMitigation object created by |
| 77 * this method. |
| 78 */ |
| 79 JammingMitigationContainer Install (Ptr<Node> node) const; |
| 80 |
| 81 /** |
| 82 * \param c The set of nodes on which a utility object must be created. |
| 83 * \returns Container contains all the JammingMitigation object created by |
| 84 * this method. |
| 85 */ |
| 86 JammingMitigationContainer Install (NodeContainer c) const; |
| 87 |
| 88 /** |
| 89 * \param nodeName The name of node on which a utility object must be created. |
| 90 * \returns Container contains all the JammingMitigation object created by |
| 91 * this method. |
| 92 */ |
| 93 JammingMitigationContainer Install (std::string nodeName) const; |
| 94 |
| 95 /** |
| 96 * Helper to enable all JammingMitigation log components with one statement. |
| 97 */ |
| 98 static void EnableLogComponents (void); |
| 99 |
| 100 |
| 101 private: |
| 102 /** |
| 103 * \brief Installs a JammingMitigation object onto the specified node. |
| 104 * |
| 105 * \param node Pointer to node to install the JammingMitigation object. |
| 106 * \returns Pointer to the newly installed JammingMitigation object. |
| 107 */ |
| 108 virtual Ptr<JammingMitigation> DoInstall (Ptr<Node> node) const; |
| 109 |
| 110 private: |
| 111 ObjectFactory m_jammingMitigation; |
| 112 |
| 113 }; |
| 114 |
| 115 } // namespace ns3 |
| 116 |
| 117 #endif /* JAMMING_MITIGATION_HELPER_H */ |
LEFT | RIGHT |