add NetDevice::GetChannel method and doxygen-document it

This commit is contained in:
Mathieu Lacage committed 2007-03-29 17:07:04 +02:00
1 parent 35c7952d39
commit 879063ce06
5 files changed
+21 -38

No files matched your search

+1 -33
View File
@@ -27,40 +27,8 @@
namespace ns3 {
class Ipv4DummyNetDevice : public NetDevice
{
public:
Ipv4DummyNetDevice (Node *node);
Node *PeekNode (void) const;
private:
virtual bool SendTo (Packet& p, const MacAddress& dest);
virtual TraceResolver *DoCreateTraceResolver (TraceContext const &context);
};
Ipv4DummyNetDevice::Ipv4DummyNetDevice (Node *node)
: NetDevice (node, MacAddress ())
{
SetMtu (10000);
}
Node *
Ipv4DummyNetDevice::PeekNode (void) const
{
return GetNode ();
}
bool
Ipv4DummyNetDevice::SendTo (Packet& p, const MacAddress& dest)
{
return false;
}
TraceResolver *
Ipv4DummyNetDevice::DoCreateTraceResolver (TraceContext const &context)
{
return new EmptyTraceResolver (context);
}
Ipv4LoopbackInterface::Ipv4LoopbackInterface (Node *node)
: Ipv4Interface (new Ipv4DummyNetDevice (node)),
: Ipv4Interface (0),
m_node (node)
{
}
+6
View File
@@ -169,6 +169,12 @@ NetDevice::CreateTraceResolver (TraceContext const &context)
return DoCreateTraceResolver (context);
}
Channel *
NetDevice::GetChannel (void) const
{
return DoGetChannel ();
}
// Receive packet from below
bool
NetDevice::ForwardUp (Packet& packet)
+9 -1
View File
@@ -29,10 +29,10 @@
namespace ns3 {
class Ipv4L4Demux;
class Node;
class TraceResolver;
class TraceContext;
class Channel;
/**
* \brief Network layer to device interface
@@ -71,6 +71,13 @@ class NetDevice {
*/
TraceResolver *CreateTraceResolver (TraceContext const &context);
/**
* \return the channel this NetDevice is connected to. The value
* returned can be zero if the NetDevice is not yet connected
* to any channel.
*/
Channel *GetChannel (void) const;
/**
* \return the current MacAddress of this interface.
*/
@@ -218,6 +225,7 @@ class NetDevice {
virtual bool SendTo (Packet& p, const MacAddress& dest) = 0;
virtual TraceResolver *DoCreateTraceResolver (TraceContext const &context) = 0;
virtual Channel *DoGetChannel (void) const = 0;
Node* m_node;
std::string m_name;
uint16_t m_ifIndex;