21 #ifndef IPV4_CLICK_ROUTING_H 
   22 #define IPV4_CLICK_ROUTING_H 
   24 #include "ns3/object.h" 
   25 #include "ns3/packet.h" 
   27 #include "ns3/ipv4-routing-protocol.h" 
   31 #include <sys/types.h> 
   34 #include <click/simclick.h> 
   40 class ClickTrivialTest;
 
   41 class ClickIfidFromNameTest;
 
   42 class ClickIpMacAddressFromNameTest;
 
   51 class UniformRandomVariable;
 
   63   friend class ::ClickTrivialTest;
 
   64   friend class ::ClickIfidFromNameTest;
 
   65   friend class ::ClickIpMacAddressFromNameTest;
 
   83   void SetClickFile (std::string clickfile);
 
   89   void SetDefines (std::map<std::string, std::string> defines);
 
   95   void SetNodeName (std::string name);
 
  101   void SetClickRoutingTableElement (std::string name);
 
  109   std::string ReadHandler (std::string elementName, std::string handlerName);
 
  118   int WriteHandler (std::string elementName, std::string handlerName, std::string writeString);
 
  124   void SetPromisc (
int ifid);
 
  128   simclick_node_t *m_simNode;
 
  133   static std::map < simclick_node_t *, Ptr<Ipv4ClickRouting> > m_clickInstanceFromSimNode;
 
  148   std::map<std::string, std::string> GetDefines (
void);
 
  155   int GetInterfaceId (
const char *ifname);
 
  162   std::string GetIpAddressFromInterfaceId (
int ifid);
 
  169   std::string GetIpPrefixFromInterfaceId (
int ifid);
 
  176   std::string GetMacAddressFromInterfaceId (
int ifid);
 
  182   std::string GetNodeName ();
 
  188   bool IsInterfaceReady (
int ifid);
 
  200   void AddSimNodeToClickMapping ();
 
  205   struct timeval GetTimevalFromNow () const;
 
  210   void RunClickEvent ();
 
  217   void HandleScheduleFromClick (
const struct timeval *when);
 
  226   void HandlePacketFromClick (
int ifid, 
int type, 
const unsigned char *
data, 
int len);
 
  235   void SendPacketToClick (
int ifid, 
int type, 
const unsigned char *
data, 
int len);
 
  265   std::string m_clickFile;
 
  266   std::map < std::string, std::string > m_defines;
 
  267   std::string m_nodeName;
 
  268   std::string m_clickRoutingTableElement;
 
  271   std::map < std::string, uint32_t > m_ifaceIdFromName;
 
  272   std::map < std::string, Address > m_ifaceMacFromName;
 
  273   std::map < std::string, Ipv4Address > m_ifaceAddrFromName;
 
  274   bool m_clickInitialised;
 
  275   bool m_nonDefaultName;