merge with tip

This commit is contained in:
Tom Henderson
2009-04-17 12:33:17 -07:00
89 changed files with 2926 additions and 1350 deletions

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

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 */

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
*/

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;

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)
{

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;
};

View File

@@ -252,6 +252,19 @@ Socket::NotifyDataRecv (void)
}
}
void
Socket::DoDispose (void)
{
m_connectionSucceeded = MakeNullCallback<void,Ptr<Socket> > ();
m_connectionFailed = MakeNullCallback<void,Ptr<Socket> > ();
m_connectionRequest = MakeNullCallback<bool,Ptr<Socket>, const Address &> ();
m_newConnectionCreated = MakeNullCallback<void,Ptr<Socket>, const Address &> ();
m_dataSent = MakeNullCallback<void,Ptr<Socket>, uint32_t> ();
m_sendCb = MakeNullCallback<void,Ptr<Socket>, uint32_t> ();
m_receivedData = MakeNullCallback<void,Ptr<Socket> > ();
}
/***************************************************************
* Socket Tags
***************************************************************/

View File

@@ -499,6 +499,7 @@ protected:
void NotifyDataSent (uint32_t size);
void NotifySend (uint32_t spaceAvailable);
void NotifyDataRecv (void);
virtual void DoDispose (void);
private:
Callback<void, Ptr<Socket> > m_connectionSucceeded;
Callback<void, Ptr<Socket> > m_connectionFailed;