src/internet-node/ipv4-l3-protocol.h
changeset 1867 16deaedc0380
parent 1776 0d5be0c3d229
parent 1866 e7dbcc4df546
child 2232 9abd038ee588
equal deleted inserted replaced
1803:4078e5efdfc6 1867:16deaedc0380
   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);
   216   virtual Ptr<TraceResolver> GetTraceResolver (void) const;
   216   virtual Ptr<TraceResolver> GetTraceResolver (void) const;
   217 
   217 
   218 private:
   218 private:
   219   void Lookup (uint32_t ifIndex,
   219   void Lookup (uint32_t ifIndex,
   220                Ipv4Header const &ipHeader,
   220                Ipv4Header const &ipHeader,
   221                Packet packet,
   221                Ptr<Packet> packet,
   222                Ipv4RoutingProtocol::RouteReplyCallback routeReply);
   222                Ipv4RoutingProtocol::RouteReplyCallback routeReply);
   223 
   223 
   224   void SendRealOut (bool found,
   224   void SendRealOut (bool found,
   225                     Ipv4Route const &route,
   225                     Ipv4Route const &route,
   226                     Packet packet,
   226                     Ptr<Packet> packet,
   227                     Ipv4Header const &ipHeader);
   227                     Ipv4Header const &ipHeader);
   228   bool Forwarding (uint32_t ifIndex, 
   228   bool Forwarding (uint32_t ifIndex, 
   229                    Packet const &packet, 
   229                    Ptr<Packet> packet, 
   230                    Ipv4Header &ipHeader, 
   230                    Ipv4Header &ipHeader, 
   231                    Ptr<NetDevice> device);
   231                    Ptr<NetDevice> device);
   232   void ForwardUp (Packet p, Ipv4Header const&ip, Ptr<Ipv4Interface> incomingInterface);
   232   void ForwardUp (Ptr<Packet> p, Ipv4Header const&ip, Ptr<Ipv4Interface> incomingInterface);
   233   uint32_t AddIpv4Interface (Ptr<Ipv4Interface> interface);
   233   uint32_t AddIpv4Interface (Ptr<Ipv4Interface> interface);
   234   void SetupLoopback (void);
   234   void SetupLoopback (void);
   235 
   235 
   236   typedef std::list<Ptr<Ipv4Interface> > Ipv4InterfaceList;
   236   typedef std::list<Ptr<Ipv4Interface> > Ipv4InterfaceList;
   237   typedef std::list<std::pair<Ipv4Address, Ipv4Address> > 
   237   typedef std::list<std::pair<Ipv4Address, Ipv4Address> > 
   241   Ipv4InterfaceList m_interfaces;
   241   Ipv4InterfaceList m_interfaces;
   242   uint32_t m_nInterfaces;
   242   uint32_t m_nInterfaces;
   243   uint8_t m_defaultTtl;
   243   uint8_t m_defaultTtl;
   244   uint16_t m_identification;
   244   uint16_t m_identification;
   245   Ptr<Node> m_node;
   245   Ptr<Node> m_node;
   246   CallbackTraceSource<Packet const &, uint32_t> m_txTrace;
   246   CallbackTraceSource<Ptr<const Packet>, uint32_t> m_txTrace;
   247   CallbackTraceSource<Packet const &, uint32_t> m_rxTrace;
   247   CallbackTraceSource<Ptr<const Packet>, uint32_t> m_rxTrace;
   248   CallbackTraceSource<Packet const &> m_dropTrace;
   248   CallbackTraceSource<Ptr<const Packet> > m_dropTrace;
   249 
   249 
   250   Ipv4RoutingProtocolList m_routingProtocols;
   250   Ipv4RoutingProtocolList m_routingProtocols;
   251 
   251 
   252   Ptr<Ipv4StaticRouting> m_staticRouting;
   252   Ptr<Ipv4StaticRouting> m_staticRouting;
   253   Ipv4MulticastGroupList m_multicastGroups;
   253   Ipv4MulticastGroupList m_multicastGroups;