src/internet-stack/arp-ipv4-interface.h
changeset 5028 01f02baebba9
parent 5025 fc820a3a1975
parent 4475 a232dcbbe7a8
child 5029 141a8e5fd047
equal deleted inserted replaced
5025:fc820a3a1975 5028:01f02baebba9
     1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
       
     2 /*
       
     3  * Copyright (c) 2007 INRIA
       
     4  *
       
     5  * This program is free software; you can redistribute it and/or modify
       
     6  * it under the terms of the GNU General Public License version 2 as
       
     7  * published by the Free Software Foundation;
       
     8  *
       
     9  * This program is distributed in the hope that it will be useful,
       
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12  * GNU General Public License for more details.
       
    13  *
       
    14  * You should have received a copy of the GNU General Public License
       
    15  * along with this program; if not, write to the Free Software
       
    16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
       
    17  *
       
    18  * Authors: 
       
    19  *  Mathieu Lacage <mathieu.lacage@sophia.inria.fr>,
       
    20  */
       
    21 #ifndef ARP_IPV4_INTERFACE_H
       
    22 #define ARP_IPV4_INTERFACE_H
       
    23 
       
    24 #include "ipv4-interface.h"
       
    25 #include "ns3/ptr.h"
       
    26 
       
    27 namespace ns3 {
       
    28 
       
    29 class Node;
       
    30 class ArpCache;
       
    31 
       
    32 /**
       
    33  * \ingroup arp
       
    34  * \brief an Ipv4 Interface which uses ARP
       
    35  *
       
    36  * If you need to use ARP on top of a specific NetDevice, you
       
    37  * can use this Ipv4Interface subclass to wrap it for the Ipv4 class
       
    38  * when calling Ipv4::AggregateObject.
       
    39  */
       
    40 class ArpIpv4Interface : public Ipv4Interface
       
    41 {
       
    42 public:
       
    43   static TypeId GetTypeId (void);
       
    44 
       
    45   ArpIpv4Interface ();
       
    46   virtual ~ArpIpv4Interface ();
       
    47 
       
    48   void SetNode (Ptr<Node> node);
       
    49   void SetDevice (Ptr<NetDevice> device);
       
    50 
       
    51   virtual Ptr<NetDevice> GetDevice (void) const;
       
    52 
       
    53 private:
       
    54   virtual void SendTo (Ptr<Packet> p, Ipv4Address dest);
       
    55   virtual void DoDispose (void);
       
    56   void DoSetup (void);
       
    57   Ptr<Node> m_node;
       
    58   Ptr<NetDevice> m_device;
       
    59   Ptr<ArpCache> m_cache;
       
    60 };
       
    61 
       
    62 }//namespace ns3
       
    63 
       
    64 
       
    65 #endif /* ARP_IPV4_INTERFACE_H */