Plumb in outbound SerialPhy
This commit is contained in:
1 parent
59823e7d22
commit
3d3c51ecf6
5 files changed
+20
-2
No files matched your search
@@ -27,6 +27,7 @@
|
||||
#include "queue.h"
|
||||
#include "serial-net-device.h"
|
||||
#include "serial-channel.h"
|
||||
#include "serial-phy.h"
|
||||
|
||||
NS_DEBUG_COMPONENT_DEFINE ("SerialNetDevice");
|
||||
|
||||
@@ -46,6 +47,8 @@ SerialNetDevice::SerialNetDevice(Node* node, const MacAddress& addr) :
|
||||
EnableMulticast();
|
||||
EnablePointToPoint();
|
||||
SetMtu(512); // bytes
|
||||
|
||||
m_phy = new SerialPhy(node, this);
|
||||
}
|
||||
|
||||
SerialNetDevice::~SerialNetDevice()
|
||||
|
||||
@@ -32,9 +32,11 @@
|
||||
namespace ns3 {
|
||||
|
||||
class SerialChannel;
|
||||
class SerialPhy;
|
||||
class Queue;
|
||||
|
||||
class SerialNetDevice : public NetDevice {
|
||||
friend class SerialPhy;
|
||||
public:
|
||||
SerialNetDevice(Node* node, const MacAddress& addr);
|
||||
virtual ~SerialNetDevice();
|
||||
@@ -52,13 +54,16 @@ public:
|
||||
|
||||
protected:
|
||||
Queue* GetQueue(void) const { return m_queue;};
|
||||
SerialChannel* GetChannel(void) const { return m_channel;};
|
||||
|
||||
private:
|
||||
virtual void NotifyDataAvailable (void);
|
||||
virtual bool SendTo (Packet& p, const MacAddress& dest);
|
||||
|
||||
SerialPhy* m_phy;
|
||||
SerialChannel* m_channel;
|
||||
Queue* m_queue;
|
||||
|
||||
};
|
||||
|
||||
}; // namespace ns3
|
||||
|
||||
@@ -164,4 +164,10 @@ UdpSocket::GetUdp (void) const
|
||||
return m_node->GetUdp ();
|
||||
}
|
||||
|
||||
Node *
|
||||
UdpSocket::GetNode (void) const
|
||||
{
|
||||
return m_node;
|
||||
}
|
||||
|
||||
}//namespace ns3
|
||||
@@ -114,6 +114,10 @@ public:
|
||||
* to keep track of it.
|
||||
*/
|
||||
void SetRxCallback (Callback<void,UdpSocket*,uint8_t const*,uint32_t,Ipv4Address,uint16_t> cb);
|
||||
/**
|
||||
* Return pointer to node
|
||||
*/
|
||||
Node* GetNode(void) const;
|
||||
|
||||
private:
|
||||
friend class Udp;
|
||||
|
||||
Reference in new issue
Block a user