20#ifndef IPV4_CLICK_ROUTING_H 
   21#define IPV4_CLICK_ROUTING_H 
   23#include "ns3/ipv4-routing-protocol.h" 
   25#include "ns3/object.h" 
   26#include "ns3/packet.h" 
   33#include <click/simclick.h> 
   39class ClickTrivialTest;
 
   40class ClickIfidFromNameTest;
 
   41class ClickIpMacAddressFromNameTest;
 
   52class UniformRandomVariable;
 
   64    friend class ::ClickTrivialTest;
 
   65    friend class ::ClickIfidFromNameTest;
 
   66    friend class ::ClickIpMacAddressFromNameTest;
 
   85    void SetClickFile(std::string clickfile);
 
   91    void SetDefines(std::map<std::string, std::string> defines);
 
   97    void SetNodeName(std::string name);
 
  103    void SetClickRoutingTableElement(std::string name);
 
  111    std::string ReadHandler(std::string elementName, std::string handlerName);
 
  120    int WriteHandler(std::string elementName, std::string handlerName, std::string writeString);
 
  126    void SetPromisc(
int ifid);
 
  129    simclick_node_t* m_simNode;
 
  135    static std::map<simclick_node_t*, Ptr<Ipv4ClickRouting>> m_clickInstanceFromSimNode;
 
  152    std::map<std::string, std::string> GetDefines();
 
  159    int GetInterfaceId(
const char* ifname);
 
  166    std::string GetIpAddressFromInterfaceId(
int ifid);
 
  173    std::string GetIpPrefixFromInterfaceId(
int ifid);
 
  180    std::string GetMacAddressFromInterfaceId(
int ifid);
 
  186    std::string GetNodeName();
 
  192    bool IsInterfaceReady(
int ifid);
 
  205    void AddSimNodeToClickMapping();
 
  210    struct timeval GetTimevalFromNow() const;
 
  215    void RunClickEvent();
 
  222    void HandleScheduleFromClick(
const struct timeval* when);
 
  231    void HandlePacketFromClick(
int ifid, 
int type, 
const unsigned char* 
data, 
int len);
 
  240    void SendPacketToClick(
int ifid, 
int type, 
const unsigned char* 
data, 
int len);
 
  278    std::string m_clickFile;
 
  279    std::map<std::string, std::string> m_defines;
 
  280    std::string m_nodeName;
 
  281    std::string m_clickRoutingTableElement;
 
  283    std::map<std::string, uint32_t> m_ifaceIdFromName;
 
  284    std::map<std::string, Address> m_ifaceMacFromName;
 
  285    std::map<std::string, Ipv4Address> m_ifaceAddrFromName;
 
  286    bool m_clickInitialised;
 
  287    bool m_nonDefaultName;
 
Ipv4 addresses are stored in host order in this class.
 
Class to allow a node to use Click for external routing.
 
a class to store IPv4 address information on an interface
 
Abstract base class for IPv4 routing protocols.
 
virtual void NotifyRemoveAddress(uint32_t interface, Ipv4InterfaceAddress address)=0
 
virtual bool RouteInput(Ptr< const Packet > p, const Ipv4Header &header, Ptr< const NetDevice > idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb)=0
Route an input packet (to be forwarded or locally delivered)
 
virtual void PrintRoutingTable(Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const =0
Print the Routing Table entries.
 
virtual void NotifyInterfaceDown(uint32_t interface)=0
 
virtual void NotifyInterfaceUp(uint32_t interface)=0
 
virtual Ptr< Ipv4Route > RouteOutput(Ptr< Packet > p, const Ipv4Header &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr)=0
Query routing cache for an existing route, for an outbound packet.
 
static TypeId GetTypeId()
Get the type ID.
 
virtual void NotifyAddAddress(uint32_t interface, Ipv4InterfaceAddress address)=0
 
virtual void SetIpv4(Ptr< Ipv4 > ipv4)=0
 
virtual void DoInitialize()
Initialize() implementation.
 
virtual void DoDispose()
Destructor implementation.
 
SocketErrno
Enumeration of the possible errors returned by a socket.
 
Unit
The unit to use to interpret a number representing time.
 
a unique identifier for an interface.
 
static void Send(Ptr< NetDevice > dev, int level, std::string emuMode)
 
Every class exported by the ns3 library is enclosed in the ns3 namespace.