src/internet-node/ipv4-l3-protocol.h
changeset 1866 e7dbcc4df546
parent 1524 3ead2b66f2e4
child 1867 16deaedc0380
equal deleted inserted replaced
1865:829dc1815014 1866:e7dbcc4df546
   127    * The ARP subclass needs to know from which NetDevice this
   127    * The ARP subclass needs to know from which NetDevice this
   128    * packet is coming to:
   128    * packet is coming to:
   129    *    - implement a per-NetDevice ARP cache
   129    *    - implement a per-NetDevice ARP cache
   130    *    - send back arp replies on the right device
   130    *    - send back arp replies on the right device
   131    */
   131    */
   132   void Receive( Ptr<NetDevice> device, const Packet& p, uint16_t protocol, const Address &from);
   132   void Receive( Ptr<NetDevice> device, Ptr<Packet> p, uint16_t protocol, const Address &from);
   133 
   133 
   134   /**
   134   /**
   135    * \param packet packet to send
   135    * \param packet packet to send
   136    * \param source source address of packet
   136    * \param source source address of packet
   137    * \param destination address of packet
   137    * \param destination address of packet
   138    * \param protocol number of packet
   138    * \param protocol number of packet
   139    *
   139    *
   140    * Higher-level layers call this method to send a packet
   140    * Higher-level layers call this method to send a packet
   141    * down the stack to the MAC and PHY layers.
   141    * down the stack to the MAC and PHY layers.
   142    */
   142    */
   143   void Send (Packet const &packet, Ipv4Address source, 
   143   void Send (Ptr<Packet> packet, Ipv4Address source, 
   144 	     Ipv4Address destination, uint8_t protocol);
   144 	     Ipv4Address destination, uint8_t protocol);
   145 
   145 
   146 
   146 
   147     
   147     
   148   void AddHostRouteTo (Ipv4Address dest, 
   148   void AddHostRouteTo (Ipv4Address dest, 
   160                           uint32_t interface);
   160                           uint32_t interface);
   161   void SetDefaultRoute (Ipv4Address nextHop, 
   161   void SetDefaultRoute (Ipv4Address nextHop, 
   162                         uint32_t interface);
   162                         uint32_t interface);
   163 
   163 
   164   void Lookup (Ipv4Header const &ipHeader,
   164   void Lookup (Ipv4Header const &ipHeader,
   165                Packet packet,
   165                Ptr<Packet> packet,
   166                Ipv4RoutingProtocol::RouteReplyCallback routeReply);
   166                Ipv4RoutingProtocol::RouteReplyCallback routeReply);
   167 
   167 
   168   uint32_t GetNRoutes (void);
   168   uint32_t GetNRoutes (void);
   169   Ipv4Route *GetRoute (uint32_t i);
   169   Ipv4Route *GetRoute (uint32_t i);
   170   void RemoveRoute (uint32_t i);
   170   void RemoveRoute (uint32_t i);
   214   virtual Ptr<TraceResolver> GetTraceResolver (void) const;
   214   virtual Ptr<TraceResolver> GetTraceResolver (void) const;
   215 
   215 
   216 private:
   216 private:
   217   void Lookup (uint32_t ifIndex,
   217   void Lookup (uint32_t ifIndex,
   218                Ipv4Header const &ipHeader,
   218                Ipv4Header const &ipHeader,
   219                Packet packet,
   219                Ptr<Packet> packet,
   220                Ipv4RoutingProtocol::RouteReplyCallback routeReply);
   220                Ipv4RoutingProtocol::RouteReplyCallback routeReply);
   221 
   221 
   222   void SendRealOut (bool found,
   222   void SendRealOut (bool found,
   223                     Ipv4Route const &route,
   223                     Ipv4Route const &route,
   224                     Packet packet,
   224                     Ptr<Packet> packet,
   225                     Ipv4Header const &ipHeader);
   225                     Ipv4Header const &ipHeader);
   226   bool Forwarding (uint32_t ifIndex, 
   226   bool Forwarding (uint32_t ifIndex, 
   227                    Packet const &packet, 
   227                    Ptr<Packet> packet, 
   228                    Ipv4Header &ipHeader, 
   228                    Ipv4Header &ipHeader, 
   229                    Ptr<NetDevice> device);
   229                    Ptr<NetDevice> device);
   230   void ForwardUp (Packet p, Ipv4Header const&ip, Ptr<Ipv4Interface> incomingInterface);
   230   void ForwardUp (Ptr<Packet> p, Ipv4Header const&ip, Ptr<Ipv4Interface> incomingInterface);
   231   uint32_t AddIpv4Interface (Ptr<Ipv4Interface> interface);
   231   uint32_t AddIpv4Interface (Ptr<Ipv4Interface> interface);
   232   void SetupLoopback (void);
   232   void SetupLoopback (void);
   233 
   233 
   234   typedef std::list<Ptr<Ipv4Interface> > Ipv4InterfaceList;
   234   typedef std::list<Ptr<Ipv4Interface> > Ipv4InterfaceList;
   235   typedef std::list<std::pair<Ipv4Address, Ipv4Address> > 
   235   typedef std::list<std::pair<Ipv4Address, Ipv4Address> > 
   239   Ipv4InterfaceList m_interfaces;
   239   Ipv4InterfaceList m_interfaces;
   240   uint32_t m_nInterfaces;
   240   uint32_t m_nInterfaces;
   241   uint8_t m_defaultTtl;
   241   uint8_t m_defaultTtl;
   242   uint16_t m_identification;
   242   uint16_t m_identification;
   243   Ptr<Node> m_node;
   243   Ptr<Node> m_node;
   244   CallbackTraceSource<Packet const &, uint32_t> m_txTrace;
   244   CallbackTraceSource<Ptr<const Packet>, uint32_t> m_txTrace;
   245   CallbackTraceSource<Packet const &, uint32_t> m_rxTrace;
   245   CallbackTraceSource<Ptr<const Packet>, uint32_t> m_rxTrace;
   246   CallbackTraceSource<Packet const &> m_dropTrace;
   246   CallbackTraceSource<Ptr<const Packet> > m_dropTrace;
   247 
   247 
   248   Ipv4RoutingProtocolList m_routingProtocols;
   248   Ipv4RoutingProtocolList m_routingProtocols;
   249 
   249 
   250   Ptr<Ipv4StaticRouting> m_staticRouting;
   250   Ptr<Ipv4StaticRouting> m_staticRouting;
   251   Ipv4MulticastGroupList m_multicastGroups;
   251   Ipv4MulticastGroupList m_multicastGroups;