src/internet-node/arp-private.cc
changeset 1737 e72c130c3a59
parent 1728 190372a33951
parent 1312 8bc3f26344b9
child 1738 6a3e37af9d24
equal deleted inserted replaced
1728:190372a33951 1737:e72c130c3a59
     1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
       
     2 /*
       
     3  * Copyright (c) 2007 INRIA
       
     4  * All rights reserved.
       
     5  *
       
     6  * This program is free software; you can redistribute it and/or modify
       
     7  * it under the terms of the GNU General Public License version 2 as
       
     8  * published by the Free Software Foundation;
       
     9  *
       
    10  * This program is distributed in the hope that it will be useful,
       
    11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    13  * GNU General Public License for more details.
       
    14  *
       
    15  * You should have received a copy of the GNU General Public License
       
    16  * along with this program; if not, write to the Free Software
       
    17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
       
    18  *
       
    19  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
       
    20  */
       
    21 #include "arp-private.h"
       
    22 #include "arp-l3-protocol.h"
       
    23 #include "ns3/assert.h"
       
    24 #include "ns3/net-device.h"
       
    25 
       
    26 namespace ns3 {
       
    27 
       
    28 const InterfaceId ArpPrivate::iid = MakeInterfaceId ("ArpPrivate", Object::iid);
       
    29 
       
    30 ArpPrivate::ArpPrivate (Ptr<ArpL3Protocol> arp)
       
    31   : m_arp (arp)
       
    32 {
       
    33   SetInterfaceId (ArpPrivate::iid);
       
    34 }
       
    35 ArpPrivate::~ArpPrivate ()
       
    36 {
       
    37   NS_ASSERT (m_arp == 0);
       
    38 }
       
    39 
       
    40 bool 
       
    41 ArpPrivate::Lookup (Packet &p, Ipv4Address destination, 
       
    42 		     Ptr<NetDevice> device,
       
    43 		     MacAddress *hardwareDestination)
       
    44 {
       
    45   return m_arp->Lookup (p, destination, device, hardwareDestination);
       
    46 }
       
    47 
       
    48 void
       
    49 ArpPrivate::DoDispose (void)
       
    50 {
       
    51   m_arp = 0;
       
    52   Object::DoDispose ();
       
    53 }
       
    54 
       
    55 
       
    56 } // namespace ns3