build a set of FdNetDevice objects attached to a virtua TAP network interface More...
#include <tap-fd-net-device-helper.h>
Inheritance diagram for ns3::TapFdNetDeviceHelper:Public Member Functions | |
| TapFdNetDeviceHelper () | |
| void | SetModePi (bool pi) |
| void | SetTapIpv4Address (Ipv4Address address) |
| void | SetTapIpv4Mask (Ipv4Mask mask) |
| void | SetTapIpv6Address (Ipv6Address address) |
| void | SetTapIpv6Prefix (int prefix) |
| void | SetTapMacAddress (Mac48Address mac) |
Public Member Functions inherited from ns3::EmuFdNetDeviceHelper | |
| EmuFdNetDeviceHelper () | |
| std::string | GetDeviceName (void) |
| void | SetDeviceName (std::string deviceName) |
Public Member Functions inherited from ns3::FdNetDeviceHelper | |
| FdNetDeviceHelper () | |
| virtual NetDeviceContainer | Install (Ptr< Node > node) const |
| virtual NetDeviceContainer | Install (std::string name) const |
| virtual NetDeviceContainer | Install (const NodeContainer &c) const |
| void | SetAttribute (std::string n1, const AttributeValue &v1) |
Public Member Functions inherited from ns3::PcapHelperForDevice | |
| PcapHelperForDevice () | |
| Construct a PcapHelperForDevice. | |
| virtual | ~PcapHelperForDevice () |
| Destroy a PcapHelperForDevice. | |
| void | EnablePcap (std::string prefix, Ptr< NetDevice > nd, bool promiscuous=false, bool explicitFilename=false) |
| Enable pcap output the indicated net device. More... | |
| void | EnablePcap (std::string prefix, std::string ndName, bool promiscuous=false, bool explicitFilename=false) |
| Enable pcap output the indicated net device using a device previously named using the ns-3 object name service. More... | |
| void | EnablePcap (std::string prefix, NetDeviceContainer d, bool promiscuous=false) |
| Enable pcap output on each device in the container which is of the appropriate type. More... | |
| void | EnablePcap (std::string prefix, NodeContainer n, bool promiscuous=false) |
| Enable pcap output on each device (which is of the appropriate type) in the nodes provided in the container. More... | |
| void | EnablePcap (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool promiscuous=false) |
| Enable pcap output on the device specified by a global node-id (of a previously created node) and associated device-id. More... | |
| void | EnablePcapAll (std::string prefix, bool promiscuous=false) |
| Enable pcap output on each device (which is of the appropriate type) in the set of all nodes created in the simulation. More... | |
Public Member Functions inherited from ns3::AsciiTraceHelperForDevice | |
| AsciiTraceHelperForDevice () | |
| Construct an AsciiTraceHelperForDevice. | |
| virtual | ~AsciiTraceHelperForDevice () |
| Destroy an AsciiTraceHelperForDevice. | |
| void | EnableAscii (std::string prefix, Ptr< NetDevice > nd, bool explicitFilename=false) |
| Enable ascii trace output on the indicated net device. More... | |
| void | EnableAscii (Ptr< OutputStreamWrapper > stream, Ptr< NetDevice > nd) |
| Enable ascii trace output on the indicated net device. More... | |
| void | EnableAscii (std::string prefix, std::string ndName, bool explicitFilename=false) |
| Enable ascii trace output the indicated net device using a device previously named using the ns-3 object name service. More... | |
| void | EnableAscii (Ptr< OutputStreamWrapper > stream, std::string ndName) |
| Enable ascii trace output the indicated net device using a device previously named using the ns-3 object name service. More... | |
| void | EnableAscii (std::string prefix, NetDeviceContainer d) |
| Enable ascii trace output on each device in the container which is of the appropriate type. More... | |
| void | EnableAscii (Ptr< OutputStreamWrapper > stream, NetDeviceContainer d) |
| Enable ascii trace output on each device in the container which is of the appropriate type. More... | |
| void | EnableAscii (std::string prefix, NodeContainer n) |
| Enable ascii trace output on each device (which is of the appropriate type) in the nodes provided in the container. More... | |
| void | EnableAscii (Ptr< OutputStreamWrapper > stream, NodeContainer n) |
| Enable ascii trace output on each device (which is of the appropriate type) in the nodes provided in the container. More... | |
| void | EnableAscii (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool explicitFilename) |
| Enable ascii trace output on the device specified by a global node-id (of a previously created node) and associated device-id. More... | |
| void | EnableAscii (Ptr< OutputStreamWrapper > stream, uint32_t nodeid, uint32_t deviceid) |
| Enable ascii trace output on the device specified by a global node-id (of a previously created node) and associated device-id. More... | |
| void | EnableAsciiAll (std::string prefix) |
| Enable ascii trace output on each device (which is of the appropriate type) in the set of all nodes created in the simulation. More... | |
| void | EnableAsciiAll (Ptr< OutputStreamWrapper > stream) |
| Enable ascii trace output on each device (which is of the appropriate type) in the set of all nodes created in the simulation. More... | |
Protected Member Functions | |
| virtual int | CreateFileDescriptor (void) const |
| Ptr< NetDevice > | InstallPriv (Ptr< Node > node) const |
| virtual void | SetFileDescriptor (Ptr< FdNetDevice > device) const |
Protected Attributes | |
| bool | m_modePi |
| Ipv4Address | m_tapIp4 |
| Ipv6Address | m_tapIp6 |
| Mac48Address | m_tapMac |
| Ipv4Mask | m_tapMask4 |
| int | m_tapPrefix6 |
Protected Attributes inherited from ns3::EmuFdNetDeviceHelper | |
| std::string | m_deviceName |
build a set of FdNetDevice objects attached to a virtua TAP network interface
Definition at line 41 of file tap-fd-net-device-helper.h.
| ns3::TapFdNetDeviceHelper::TapFdNetDeviceHelper | ( | ) |
Construct a TapFdNetDeviceHelper.
Definition at line 63 of file tap-fd-net-device-helper.cc.
References ns3::Mac48Address::Allocate(), ns3::EmuFdNetDeviceHelper::m_deviceName, m_modePi, m_tapIp4, m_tapIp6, m_tapMac, m_tapMask4, and m_tapPrefix6.
|
protectedvirtual |
Call out to a separate process running as suid root in order to create a TAP device and obtain the file descriptor associated to it.
Reimplemented from ns3::EmuFdNetDeviceHelper.
Definition at line 146 of file tap-fd-net-device-helper.cc.
References ns3::BufferToString(), ns3::EmuFdNetDeviceHelper::m_deviceName, m_modePi, m_tapIp4, m_tapIp6, m_tapMac, m_tapMask4, m_tapPrefix6, NS_ABORT_MSG_IF, NS_ASSERT_MSG, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, and NS_LOG_INFO.
Referenced by SetFileDescriptor().
|
protectedvirtual |
Sets a file descriptor on the FileDescriptorNetDevice.
Reimplemented from ns3::EmuFdNetDeviceHelper.
Definition at line 133 of file tap-fd-net-device-helper.cc.
References CreateFileDescriptor(), and NS_LOG_LOGIC.
| void ns3::TapFdNetDeviceHelper::SetModePi | ( | bool | pi | ) |
Set flag IFF_NO_PI on the device.
| pi | Set the IFF_NO_PI flag if pi is false. |
Definition at line 75 of file tap-fd-net-device-helper.cc.
References m_modePi.
| void ns3::TapFdNetDeviceHelper::SetTapIpv4Address | ( | Ipv4Address | address | ) |
Set the device IPv4 address.
| address | The IPv4 address for the TAP device. |
Definition at line 81 of file tap-fd-net-device-helper.cc.
References m_tapIp4.
| void ns3::TapFdNetDeviceHelper::SetTapIpv4Mask | ( | Ipv4Mask | mask | ) |
Set the IPv4 network mask for the TAP device.
| mask | The IPv4 network mask for the TAP device. |
Definition at line 87 of file tap-fd-net-device-helper.cc.
References m_tapMask4.
| void ns3::TapFdNetDeviceHelper::SetTapIpv6Address | ( | Ipv6Address | address | ) |
Set the device IPv6 address.
| address | The IPv6 address for the TAP device. |
Definition at line 93 of file tap-fd-net-device-helper.cc.
References m_tapIp6.
| void ns3::TapFdNetDeviceHelper::SetTapIpv6Prefix | ( | int | prefix | ) |
Set the IPv6 network mask for the TAP device.
| prefix | The IPv6 network prefix for the TAP device. |
Definition at line 99 of file tap-fd-net-device-helper.cc.
References m_tapPrefix6.
| void ns3::TapFdNetDeviceHelper::SetTapMacAddress | ( | Mac48Address | mac | ) |
Set the MAC address for the TAP device.
| mac | The MAC address the TAP device. |
Definition at line 105 of file tap-fd-net-device-helper.cc.
References m_tapMac.
|
protected |
The TAP device flag IFF_NO_PI.
Definition at line 116 of file tap-fd-net-device-helper.h.
Referenced by CreateFileDescriptor(), SetModePi(), and TapFdNetDeviceHelper().
|
protected |
The IPv4 address for the TAP device.
Definition at line 123 of file tap-fd-net-device-helper.h.
Referenced by CreateFileDescriptor(), SetTapIpv4Address(), and TapFdNetDeviceHelper().
|
protected |
The IPv6 address for the TAP device.
Definition at line 130 of file tap-fd-net-device-helper.h.
Referenced by CreateFileDescriptor(), SetTapIpv6Address(), and TapFdNetDeviceHelper().
|
protected |
The TAP device MAC address.
Definition at line 153 of file tap-fd-net-device-helper.h.
Referenced by CreateFileDescriptor(), SetTapMacAddress(), and TapFdNetDeviceHelper().
|
protected |
The network mask IPv4 for the TAP device.
Definition at line 138 of file tap-fd-net-device-helper.h.
Referenced by CreateFileDescriptor(), SetTapIpv4Mask(), and TapFdNetDeviceHelper().
|
protected |
The network prefix IPv6 for the TAP device.
Definition at line 145 of file tap-fd-net-device-helper.h.
Referenced by CreateFileDescriptor(), SetTapIpv6Prefix(), and TapFdNetDeviceHelper().