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