This commit is contained in:
Mathieu Lacage committed 2009-04-17 17:45:16 +02:00
commit 592a2e8ead
110 files changed
+4325 -1613

No files matched your search

-20
View File
@@ -35,34 +35,14 @@ Channel::GetTypeId (void)
}
Channel::Channel ()
: m_name("Channel")
{
NS_LOG_FUNCTION_NOARGS ();
}
Channel::Channel (std::string name)
: m_name(name)
{
NS_LOG_FUNCTION (this << name);
}
Channel::~Channel ()
{
NS_LOG_FUNCTION_NOARGS ();
}
void
Channel::SetName(std::string name)
{
NS_LOG_FUNCTION (this << name);
m_name = name;
}
std::string
Channel::GetName(void)
{
NS_LOG_FUNCTION_NOARGS ();
return m_name;
}
} // namespace ns3
+1 -7
View File
@@ -43,12 +43,8 @@ public:
static TypeId GetTypeId (void);
Channel ();
Channel (std::string name);
virtual ~Channel ();
void SetName(std::string);
std::string GetName(void);
/**
* \returns the number of NetDevices connected to this Channel.
*
@@ -63,10 +59,8 @@ public:
*/
virtual Ptr<NetDevice> GetDevice (uint32_t i) const = 0;
private:
std::string m_name;
};
}; // namespace ns3
} // namespace ns3
#endif /* NS3_CHANNEL_H */
+2 -1
View File
@@ -338,7 +338,8 @@ void Ipv6Address::Print (std::ostream& os) const
<< std::hex << std::setw(2) << std::setfill('0') << (unsigned int) m_address[12]
<< std::hex << std::setw(2) << std::setfill('0') << (unsigned int) m_address[13] << ":"
<< std::hex << std::setw(2) << std::setfill('0') << (unsigned int) m_address[14]
<< std::hex << std::setw(2) << std::setfill('0') << (unsigned int) m_address[15];
<< std::hex << std::setw(2) << std::setfill('0') << (unsigned int) m_address[15]
<< std::dec << std::setfill(' ');
}
bool Ipv6Address::IsLocalhost () const
-8
View File
@@ -67,14 +67,6 @@ public:
static TypeId GetTypeId (void);
virtual ~NetDevice();
/**
* \param name name of the device (e.g. "eth0")
*/
virtual void SetName(const std::string name) = 0;
/**
* \return name name of the device (e.g. "eth0")
*/
virtual std::string GetName(void) const = 0;
/**
* \param index ifIndex of the device
*/
+3 -4
View File
@@ -225,7 +225,7 @@ bool
Node::PromiscReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet> packet, uint16_t protocol,
const Address &from, const Address &to, NetDevice::PacketType packetType)
{
NS_LOG_FUNCTION(device->GetName ());
NS_LOG_FUNCTION(this);
return ReceiveFromDevice (device, packet, protocol, from, to, packetType, true);
}
@@ -233,7 +233,7 @@ bool
Node::NonPromiscReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet> packet, uint16_t protocol,
const Address &from)
{
NS_LOG_FUNCTION(device->GetName ());
NS_LOG_FUNCTION(this);
return ReceiveFromDevice (device, packet, protocol, from, from, NetDevice::PacketType (0), false);
}
@@ -242,8 +242,7 @@ Node::ReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet> packet, uint16
const Address &from, const Address &to, NetDevice::PacketType packetType, bool promiscuous)
{
NS_LOG_DEBUG("Node " << GetId () << " ReceiveFromDevice: dev "
<< device->GetIfIndex () << " ("
<< device->GetName () << " type " << device->GetInstanceTypeId ().GetName ()
<< device->GetIfIndex () << " (type=" << device->GetInstanceTypeId ().GetName ()
<< ") Packet UID " << packet->GetUid ());
bool found = false;
-11
View File
@@ -38,7 +38,6 @@ SimpleNetDevice::SimpleNetDevice ()
: m_channel (0),
m_node (0),
m_mtu (0xffff),
m_name (""),
m_ifIndex (0)
{}
@@ -83,16 +82,6 @@ SimpleNetDevice::SetAddress (Mac48Address address)
m_address = address;
}
void
SimpleNetDevice::SetName(const std::string name)
{
m_name = name;
}
std::string
SimpleNetDevice::GetName(void) const
{
return m_name;
}
void
SimpleNetDevice::SetIfIndex(const uint32_t index)
{
-3
View File
@@ -46,8 +46,6 @@ public:
void SetAddress (Mac48Address address);
// inherited from NetDevice base class.
virtual void SetName(const std::string name);
virtual std::string GetName(void) const;
virtual void SetIfIndex(const uint32_t index);
virtual uint32_t GetIfIndex(void) const;
virtual Ptr<Channel> GetChannel (void) const;
@@ -82,7 +80,6 @@ private:
NetDevice::PromiscReceiveCallback m_promiscCallback;
Ptr<Node> m_node;
uint16_t m_mtu;
std::string m_name;
uint32_t m_ifIndex;
Mac48Address m_address;
};