A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
emu-fd-net-device-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2012 INRIA, 2012 University of Washington
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
*/
7
8
#ifndef EMU_FD_NET_DEVICE_HELPER_H
9
#define EMU_FD_NET_DEVICE_HELPER_H
10
11
#include "
fd-net-device-helper.h
"
12
13
#include "ns3/attribute.h"
14
#include "ns3/fd-net-device.h"
15
#include "ns3/net-device-container.h"
16
#include "ns3/node-container.h"
17
#include "ns3/object-factory.h"
18
19
#include <string>
20
21
namespace
ns3
22
{
23
24
/**
25
* \ingroup fd-net-device
26
* \brief build a set of FdNetDevice objects attached to a physical network
27
* interface
28
*
29
*/
30
class
EmuFdNetDeviceHelper
:
public
FdNetDeviceHelper
31
{
32
public
:
33
/**
34
* Construct a EmuFdNetDeviceHelper.
35
*/
36
EmuFdNetDeviceHelper
();
37
38
~EmuFdNetDeviceHelper
()
override
39
{
40
}
41
42
/**
43
* Get the device name of this device.
44
*
45
* \returns The device name of this device.
46
*/
47
std::string
GetDeviceName
();
48
49
/**
50
* Set the device name of this device.
51
*
52
* \param deviceName The device name of this device.
53
*/
54
void
SetDeviceName
(std::string deviceName);
55
56
/**
57
* \brief Request host qdisc bypass
58
* \param hostQdiscBypass to enable host qdisc bypass
59
*/
60
void
HostQdiscBypass
(
bool
hostQdiscBypass);
61
62
protected
:
63
/**
64
* This method creates an ns3::FdNetDevice attached to a physical network
65
* interface
66
*
67
* \param node The node to install the device in
68
* \returns A container holding the added net device.
69
*/
70
Ptr<NetDevice>
InstallPriv
(
Ptr<Node>
node)
const override
;
71
72
/**
73
* Sets a file descriptor on the FileDescriptorNetDevice.
74
* \param device the device to install the file descriptor in
75
*/
76
virtual
void
SetFileDescriptor
(
Ptr<FdNetDevice>
device)
const
;
77
78
/**
79
* Call out to a separate process running as suid root in order to get a raw
80
* socket. We do this to avoid having the entire simulation running as root.
81
* \return the rawSocket number
82
*/
83
virtual
int
CreateFileDescriptor
()
const
;
84
85
/**
86
* The Unix/Linux name of the underlying device (e.g., eth0)
87
*/
88
std::string
m_deviceName
;
89
bool
m_hostQdiscBypass
;
//!< True if request host qdisc bypass
90
};
91
92
}
// namespace ns3
93
94
#endif
/* EMU_FD_NET_DEVICE_HELPER_H */
ns3::EmuFdNetDeviceHelper
build a set of FdNetDevice objects attached to a physical network interface
Definition
emu-fd-net-device-helper.h:31
ns3::EmuFdNetDeviceHelper::m_hostQdiscBypass
bool m_hostQdiscBypass
True if request host qdisc bypass.
Definition
emu-fd-net-device-helper.h:89
ns3::EmuFdNetDeviceHelper::m_deviceName
std::string m_deviceName
The Unix/Linux name of the underlying device (e.g., eth0)
Definition
emu-fd-net-device-helper.h:88
ns3::EmuFdNetDeviceHelper::HostQdiscBypass
void HostQdiscBypass(bool hostQdiscBypass)
Request host qdisc bypass.
Definition
emu-fd-net-device-helper.cc:62
ns3::EmuFdNetDeviceHelper::SetDeviceName
void SetDeviceName(std::string deviceName)
Set the device name of this device.
Definition
emu-fd-net-device-helper.cc:56
ns3::EmuFdNetDeviceHelper::~EmuFdNetDeviceHelper
~EmuFdNetDeviceHelper() override
Definition
emu-fd-net-device-helper.h:38
ns3::EmuFdNetDeviceHelper::InstallPriv
Ptr< NetDevice > InstallPriv(Ptr< Node > node) const override
This method creates an ns3::FdNetDevice attached to a physical network interface.
Definition
emu-fd-net-device-helper.cc:74
ns3::EmuFdNetDeviceHelper::SetFileDescriptor
virtual void SetFileDescriptor(Ptr< FdNetDevice > device) const
Sets a file descriptor on the FileDescriptorNetDevice.
Definition
emu-fd-net-device-helper.cc:83
ns3::EmuFdNetDeviceHelper::GetDeviceName
std::string GetDeviceName()
Get the device name of this device.
Definition
emu-fd-net-device-helper.cc:68
ns3::EmuFdNetDeviceHelper::CreateFileDescriptor
virtual int CreateFileDescriptor() const
Call out to a separate process running as suid root in order to get a raw socket.
Definition
emu-fd-net-device-helper.cc:210
ns3::EmuFdNetDeviceHelper::EmuFdNetDeviceHelper
EmuFdNetDeviceHelper()
Construct a EmuFdNetDeviceHelper.
Definition
emu-fd-net-device-helper.cc:49
ns3::FdNetDeviceHelper
build a set of FdNetDevice objects Normally we eschew multiple inheritance, however,...
Definition
fd-net-device-helper.h:35
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
fd-net-device-helper.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
fd-net-device
helper
emu-fd-net-device-helper.h
Generated on Fri Nov 8 2024 13:59:00 for ns-3 by
1.11.0