src/node/nsc-sysctl.h
author Florian Westphal <fw@strlen.de>
Wed Jul 15 18:46:14 2009 +0200 (2009-07-15)
changeset 4685 ae536d9e0d6d
permissions -rw-r--r--
nsc: move nsc glue code from nsc-tcp-l4-protocol to node/nsc-glue.cc.

known problems:
- sim_interface.h is duplicated
- nsc-glue.cc adds hooks in node.cc, "hijacks" incoming packets
- nsc-glue exports NSCs INetStack (instead of wrapping it completely)
- nsc-tcp-l4-protocol and nsc-tcp-socket-impl make calls into nsc-glue
- nsc-tcp-socket-impl should really be "nsc-socket-core" (or something
like that)

needs fixing on nsc side:
- no support for multiple interfaces yet (also not yet supported
on nsc side)
- nsc initialisation still tied to IP (Adding an Interface and assigning the
IP address is a single step; it should be separate)

maybe there is more.

There is a NSC_NEXT define in nsc-glue.h, its main purpose is to flag
the places where the NSC API needs to be adapted to support multiple
interfaces in nsc.
     1 /* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
     2 /*
     3  * This program is free software; you can redistribute it and/or modify
     4  * it under the terms of the GNU General Public License version 2 as
     5  * published by the Free Software Foundation;
     6  *
     7  * This program is distributed in the hope that it will be useful,
     8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    10  * GNU General Public License for more details.
    11  *
    12  * You should have received a copy of the GNU General Public License
    13  * along with this program; if not, write to the Free Software
    14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    15  *
    16  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
    17  */
    18 
    19 #include <string>
    20 
    21 #include "ns3/attribute.h"
    22 #include "ns3/object.h"
    23 
    24 struct INetStack;
    25 
    26 namespace ns3 {
    27 
    28 // This object represents the underlying nsc stack,
    29 // which is aggregated to a Node object, and which provides access to the
    30 // sysctls of the nsc stack through attributes.
    31 class Ns3NscStack : public Object
    32 {
    33 public:
    34   static TypeId GetTypeId (void);
    35   virtual TypeId GetInstanceTypeId (void) const;
    36   void SetStack (INetStack *stack) {m_stack = stack;}
    37 
    38 private:
    39   friend class NscStackStringAccessor;
    40   void Set (std::string name, std::string value);
    41   std::string Get (std::string name) const;
    42   INetStack *m_stack;
    43 };
    44 } // namespace ns3