1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/internet-stack/nat-rule.cc Thu Aug 06 11:16:51 2009 +0600
1.3 @@ -0,0 +1,59 @@
1.4 +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
1.5 +/*
1.6 + * Copyright (c) 2009 University of Texas at Dallas
1.7 + *
1.8 + * This program is free software; you can redistribute it and/or modify
1.9 + * it under the terms of the GNU General Public License version 2 as
1.10 + * published by the Free Software Foundation;
1.11 + *
1.12 + * This program is distributed in the hope that it will be useful,
1.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.15 + * GNU General Public License for more details.
1.16 + *
1.17 + * You should have received a copy of the GNU General Public License
1.18 + * along with this program; if not, write to the Free Software
1.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1.20 + *
1.21 + * Author: Qasim Javed <qasim@utdallas.edu>
1.22 + */
1.23 +#include "nat-rule.h"
1.24 +
1.25 +namespace ns3 {
1.26 +
1.27 +NatRule::NatRule (Ipv4Address orig, Ipv4Address mapped, Ptr<NetDevice> device) //, Ipv4Interface outInterface
1.28 +{
1.29 + m_originalSource = orig;
1.30 + m_mangledSource = mapped;
1.31 + m_device = device;
1.32 + //m_outInterface = outInterface;
1.33 +}
1.34 +
1.35 +bool
1.36 +NatRule::operator == (const NatRule& other) const
1.37 +{
1.38 + return (m_originalSource == other.m_originalSource) &&
1.39 + (m_mangledSource == other.m_mangledSource) &&
1.40 + (m_device == other.m_device);
1.41 + // (m_outInterface == other.m_outInterface);
1.42 +}
1.43 +
1.44 +Ipv4Address
1.45 +NatRule::GetOriginalSource () const
1.46 +{
1.47 + return m_originalSource;
1.48 +}
1.49 +
1.50 +Ipv4Address
1.51 +NatRule::GetMangledSource () const
1.52 +{
1.53 + return m_mangledSource;
1.54 +}
1.55 +
1.56 +Ptr<NetDevice>
1.57 +NatRule::GetDevice () const
1.58 +{
1.59 + return m_device;
1.60 +}
1.61 +
1.62 +}