#include <linux-socket-fd-factory.h>
Classes | |
struct | EventIdHolder |
Public Member Functions | |
LinuxSocketFdFactory () | |
virtual | ~LinuxSocketFdFactory () |
virtual UnixFd * | CreateSocket (int domain, int type, int protocol) |
std::string | Get (std::string path) |
void | ScheduleTask (EventImpl *event) |
void | Set (std::string path, std::string value) |
![]() | |
virtual | ~SocketFdFactory () |
virtual void | UnlinkNotify (std::string path) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Private Member Functions | |
int | Accept (struct SimSocket *socket, struct sockaddr *my_addr, socklen_t *addrlen) |
int | Bind (struct SimSocket *socket, const struct sockaddr *my_addr, socklen_t addrlen) |
bool | CanRecv (struct SimSocket *socket) |
bool | CanSend (struct SimSocket *socket) |
int | Close (struct SimSocket *socket) |
int | Connect (struct SimSocket *socket, const struct sockaddr *my_addr, socklen_t addrlen, int flags) |
struct SimDevice * | DevToDev (Ptr< NetDevice > dev) |
virtual void | DoDispose (void) |
void | DoSet (std::string path, std::string value) |
void | EventTrampoline (void(*fn)(void *context), void *context, void(*pre_fn)(void), Ptr< EventIdHolder > event) |
void | FreePoll (struct SimSocket *socket, void *ctxt) |
int | Getpeername (struct SimSocket *socket, struct sockaddr *name, socklen_t *namelen) |
int | Getsockname (struct SimSocket *socket, struct sockaddr *name, socklen_t *namelen) |
int | Getsockopt (struct SimSocket *socket, int level, int optname, void *optval, socklen_t *optlen) |
std::vector< std::pair < std::string, struct SimSysFile * > > | GetSysFileList (void) |
void | InitializeStack (void) |
int | Ioctl (struct SimSocket *socket, int request, char *argp) |
int | Listen (struct SimSocket *socket, int backlog) |
void | NotifyAddDevice (Ptr< NetDevice > device) |
void | NotifyAddDeviceTask (Ptr< NetDevice > device) |
void | NotifyDeviceStateChange (Ptr< NetDevice > device) |
void | NotifyDeviceStateChangeTask (Ptr< NetDevice > device) |
virtual void | NotifyNewAggregate (void) |
int | Poll (struct SimSocket *socket, PollTable *ptable) |
void | PollFreeWait (void *ref) |
void * | PollWait (struct SimSocket *socket, void *ctxt) |
ssize_t | Recvmsg (struct SimSocket *socket, struct msghdr *msg, int flags) |
void | RxFromDevice (Ptr< NetDevice > device, Ptr< const Packet > p, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType type) |
ssize_t | Sendmsg (struct SimSocket *socket, const struct msghdr *msg, int flags) |
int | Setsockopt (struct SimSocket *socket, int level, int optname, const void *optval, socklen_t optlen) |
void | SetTask (std::string path, std::string value) |
int | Shutdown (struct SimSocket *socket, int how) |
void | StartInitializationTask (void) |
Static Private Member Functions | |
static int | __Fxstat (struct SimKernel *kernel, int ver, int fd, void *buf) |
static int | Access (struct SimKernel *kernel, const char *pathname, int mode) |
static int | AtExit (struct SimKernel *kernel, void(*function)(void)) |
static void | DevXmit (struct SimKernel *kernel, struct SimDevice *dev, unsigned char *data, int len) |
static void | EventCancel (struct SimKernel *kernel, void *ev) |
static void * | EventScheduleNs (struct SimKernel *kernel, __u64 ns, void(*fn)(void *context), void *context, void(*pre_fn)(void)) |
static int | Fclose (struct SimKernel *kernel, FILE *fp) |
static FILE * | FdOpen (struct SimKernel *kernel, int fd, const char *mode) |
static size_t | Fread (struct SimKernel *kernel, void *ptr, size_t size, size_t nmemb, FILE *stream) |
static void | Free (struct SimKernel *kernel, void *buffer) |
static int | Fseek (struct SimKernel *kernel, FILE *stream, long offset, int whence) |
static long | Ftell (struct SimKernel *kernel, FILE *stream) |
static size_t | Fwrite (struct SimKernel *kernel, const void *ptr, size_t size, size_t nmemb, FILE *stream) |
static char * | Getenv (struct SimKernel *kernel, const char *name) |
static void * | Malloc (struct SimKernel *kernel, unsigned long size) |
static void * | Memcpy (struct SimKernel *kernel, void *dst, const void *src, unsigned long size) |
static void * | Memset (struct SimKernel *kernel, void *dst, char value, unsigned long size) |
static int | Mkdir (struct SimKernel *kernel, const char *pathname, mode_t mode) |
static int | Open (struct SimKernel *kernel, const char *pathname, int flags) |
static void | PollEvent (int flag, void *context) |
static unsigned long | Random (struct SimKernel *kernel) |
static void | ScheduleTaskTrampoline (void *context) |
static void | SendMain (bool *r, NetDevice *d, Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber) |
static void | Setbuf (struct SimKernel *kernel, FILE *stream, char *buf) |
static void | SignalRaised (struct SimKernel *kernel, struct SimTask *task, int signalNumber) |
static struct SimTask * | TaskCurrent (struct SimKernel *kernel) |
static struct SimTask * | TaskStart (struct SimKernel *kernel, void(*callback)(void *), void *context) |
static void | TaskSwitch (enum Task::SwitchType type, void *context) |
static void | TaskWait (struct SimKernel *kernel) |
static int | TaskWakeup (struct SimKernel *kernel, struct SimTask *task) |
static void | TaskYield (struct SimKernel *kernel) |
static int | Vprintf (struct SimKernel *kernel, const char *str, va_list args) |
Private Attributes | |
KingsleyAlloc * | m_alloc |
std::vector< std::pair< Ptr < NetDevice >, struct SimDevice * > > | m_devices |
std::list< std::pair < std::string, std::string > > | m_earlySysfs |
struct SimExported * | m_exported |
std::list< Task * > | m_kernelTasks |
std::string | m_library |
std::vector< Ptr < LinuxDeviceStateListener > > | m_listeners |
Loader * | m_loader |
FILE * | m_logFile |
TypeId | m_lteUeTid |
Ptr< TaskManager > | m_manager |
uint16_t | m_pid |
RandomVariable | m_ranvar |
double | m_rate |
UniformVariable | m_variable |
Friends | |
class | LinuxDeviceStateListener |
class | LinuxSocketFd |
Definition at line 37 of file linux-socket-fd-factory.h.
ns3::LinuxSocketFdFactory::LinuxSocketFdFactory | ( | ) |
Definition at line 91 of file linux-socket-fd-factory.cc.
References m_lteUeTid.
|
virtual |
Definition at line 100 of file linux-socket-fd-factory.cc.
References m_alloc, m_devices, m_exported, m_loader, and m_logFile.
|
staticprivate |
Definition at line 213 of file linux-socket-fd-factory.cc.
References dce___fxstat().
Referenced by InitializeStack().
|
private |
Definition at line 885 of file linux-socket-fd-factory.cc.
References GET_CURRENT, ns3::UnixFd::IncFdCount(), LinuxSocketFd, m_exported, m_loader, ns3::Loader::NotifyEndExecute(), ns3::Loader::NotifyStartExecute(), and ns3::UtilsAllocateFd().
|
staticprivate |
Definition at line 193 of file linux-socket-fd-factory.cc.
References dce_access().
Referenced by InitializeStack().
|
staticprivate |
Definition at line 178 of file linux-socket-fd-factory.cc.
References ns3::AtExitHandler::NORMAL, ns3::AtExitHandler::normal, ns3::AtExitHandler::type, and ns3::AtExitHandler::value.
Referenced by InitializeStack().
|
private |
Definition at line 828 of file linux-socket-fd-factory.cc.
References GET_CURRENT, m_exported, m_loader, ns3::Loader::NotifyEndExecute(), and ns3::Loader::NotifyStartExecute().
|
private |
|
private |
|
private |
Definition at line 758 of file linux-socket-fd-factory.cc.
References GET_CURRENT, m_exported, m_loader, ns3::Loader::NotifyEndExecute(), and ns3::Loader::NotifyStartExecute().
|
private |
Definition at line 842 of file linux-socket-fd-factory.cc.
References GET_CURRENT, m_exported, m_loader, ns3::Loader::NotifyEndExecute(), and ns3::Loader::NotifyStartExecute().
|
virtual |
Implements ns3::SocketFdFactory.
Definition at line 742 of file linux-socket-fd-factory.cc.
References GET_CURRENT, LinuxSocketFd, m_exported, m_loader, ns3::Loader::NotifyEndExecute(), and ns3::Loader::NotifyStartExecute().
|
readprivate |
Definition at line 414 of file linux-socket-fd-factory.cc.
References m_devices.
Referenced by NotifyDeviceStateChangeTask(), and RxFromDevice().
|
staticprivate |
Definition at line 383 of file linux-socket-fd-factory.cc.
References ns3::Current(), ns3::TaskManager::ExecOnMain(), m_exported, and SendMain().
Referenced by InitializeStack().
|
privatevirtual |
Definition at line 122 of file linux-socket-fd-factory.cc.
References m_kernelTasks, m_listeners, and m_manager.
|
private |
|
staticprivate |
Definition at line 291 of file linux-socket-fd-factory.cc.
Referenced by InitializeStack().
|
staticprivate |
Definition at line 278 of file linux-socket-fd-factory.cc.
References ns3::Current(), and EventTrampoline().
Referenced by InitializeStack().
|
private |
Definition at line 268 of file linux-socket-fd-factory.cc.
References m_loader, ns3::Loader::NotifyEndExecute(), and ns3::Loader::NotifyStartExecute().
Referenced by EventScheduleNs().
|
staticprivate |
Definition at line 248 of file linux-socket-fd-factory.cc.
References dce_fclose().
Referenced by InitializeStack().
|
staticprivate |
Definition at line 233 of file linux-socket-fd-factory.cc.
References dce_fdopen().
Referenced by InitializeStack().
|
staticprivate |
Definition at line 238 of file linux-socket-fd-factory.cc.
References dce_fread().
Referenced by InitializeStack().
|
staticprivate |
Definition at line 158 of file linux-socket-fd-factory.cc.
Referenced by InitializeStack().
|
private |
|
staticprivate |
Definition at line 218 of file linux-socket-fd-factory.cc.
References dce_fseek().
Referenced by InitializeStack().
|
staticprivate |
Definition at line 228 of file linux-socket-fd-factory.cc.
References dce_ftell().
Referenced by InitializeStack().
|
staticprivate |
Definition at line 243 of file linux-socket-fd-factory.cc.
References dce_fwrite().
Referenced by InitializeStack().
std::string ns3::LinuxSocketFdFactory::Get | ( | std::string | path | ) |
Definition at line 622 of file linux-socket-fd-factory.cc.
References GetSysFileList(), and m_exported.
|
staticprivate |
Definition at line 198 of file linux-socket-fd-factory.cc.
References dce_getenv().
Referenced by InitializeStack().
|
private |
Definition at line 814 of file linux-socket-fd-factory.cc.
References GET_CURRENT, m_exported, m_loader, ns3::Loader::NotifyEndExecute(), and ns3::Loader::NotifyStartExecute().
|
private |
Definition at line 800 of file linux-socket-fd-factory.cc.
References GET_CURRENT, m_exported, m_loader, ns3::Loader::NotifyEndExecute(), and ns3::Loader::NotifyStartExecute().
|
private |
Definition at line 957 of file linux-socket-fd-factory.cc.
References GET_CURRENT, m_exported, m_loader, ns3::Loader::NotifyEndExecute(), and ns3::Loader::NotifyStartExecute().
|
private |
Definition at line 554 of file linux-socket-fd-factory.cc.
References m_exported, m_loader, ns3::Loader::NotifyEndExecute(), and ns3::Loader::NotifyStartExecute().
Referenced by Get(), and SetTask().
|
static |
Reimplemented from ns3::SocketFdFactory.
Definition at line 71 of file linux-socket-fd-factory.cc.
|
private |
Definition at line 644 of file linux-socket-fd-factory.cc.
References __Fxstat(), Access(), AtExit(), ns3::CurrentNs(), DevXmit(), EventCancel(), EventScheduleNs(), Fclose(), FdOpen(), Fread(), Free(), Fseek(), Ftell(), Fwrite(), Getenv(), ns3::Loader::Load(), ns3::Loader::Lookup(), m_earlySysfs, m_exported, m_library, m_loader, m_pid, Malloc(), Memcpy(), Memset(), Mkdir(), NotifyAddDevice(), Open(), PollEvent(), Random(), ns3::SearchExecFile(), Set(), Setbuf(), SignalRaised(), TaskCurrent(), TaskStart(), TaskWait(), TaskWakeup(), TaskYield(), and Vprintf().
Referenced by NotifyNewAggregate().
|
private |
Definition at line 928 of file linux-socket-fd-factory.cc.
References GET_CURRENT, m_exported, m_loader, ns3::Loader::NotifyEndExecute(), and ns3::Loader::NotifyStartExecute().
|
private |
Definition at line 857 of file linux-socket-fd-factory.cc.
References GET_CURRENT, m_exported, m_loader, ns3::Loader::NotifyEndExecute(), and ns3::Loader::NotifyStartExecute().
|
staticprivate |
Definition at line 141 of file linux-socket-fd-factory.cc.
Referenced by InitializeStack().
|
staticprivate |
Definition at line 168 of file linux-socket-fd-factory.cc.
Referenced by InitializeStack().
|
staticprivate |
Definition at line 173 of file linux-socket-fd-factory.cc.
Referenced by InitializeStack().
|
staticprivate |
Definition at line 203 of file linux-socket-fd-factory.cc.
References dce_mkdir().
Referenced by InitializeStack().
|
private |
Definition at line 506 of file linux-socket-fd-factory.cc.
References NotifyAddDeviceTask(), and ScheduleTask().
Referenced by InitializeStack().
|
private |
Definition at line 511 of file linux-socket-fd-factory.cc.
References m_devices, m_exported, m_listeners, m_loader, m_lteUeTid, ns3::LinuxDeviceStateListener::NotifyDeviceStateChange(), NotifyDeviceStateChangeTask(), ns3::Loader::NotifyEndExecute(), ns3::Loader::NotifyStartExecute(), and RxFromDevice().
Referenced by NotifyAddDevice().
|
private |
Definition at line 459 of file linux-socket-fd-factory.cc.
References NotifyDeviceStateChangeTask(), and ScheduleTask().
|
private |
Definition at line 465 of file linux-socket-fd-factory.cc.
References DevToDev(), m_exported, m_loader, ns3::Loader::NotifyEndExecute(), and ns3::Loader::NotifyStartExecute().
Referenced by NotifyAddDeviceTask(), and NotifyDeviceStateChange().
|
privatevirtual |
Definition at line 718 of file linux-socket-fd-factory.cc.
References InitializeStack(), m_loader, m_logFile, m_manager, ScheduleTask(), ns3::UtilsEnsureDirectoryExists(), and ns3::UtilsGetAbsRealFilePath().
|
staticprivate |
Definition at line 208 of file linux-socket-fd-factory.cc.
References dce_open().
Referenced by InitializeStack().
|
private |
Definition at line 999 of file linux-socket-fd-factory.cc.
References GET_CURRENT, ns3::PollTable::GetEventMask(), m_exported, m_loader, ns3::Loader::NotifyEndExecute(), ns3::Loader::NotifyStartExecute(), ns3::poll_table_ref::opaque, PollFreeWait(), ns3::PollTable::PollWait(), and ns3::poll_table_ref::ret.
|
staticprivate |
Definition at line 972 of file linux-socket-fd-factory.cc.
References ns3::WaitPoint::WakeUpCallback().
Referenced by InitializeStack().
|
private |
Definition at line 1025 of file linux-socket-fd-factory.cc.
References m_exported, m_loader, ns3::Loader::NotifyEndExecute(), and ns3::Loader::NotifyStartExecute().
Referenced by Poll().
|
private |
|
staticprivate |
Definition at line 253 of file linux-socket-fd-factory.cc.
References m_variable.
Referenced by InitializeStack().
|
private |
Definition at line 772 of file linux-socket-fd-factory.cc.
References GET_CURRENT, m_exported, m_loader, ns3::Loader::NotifyEndExecute(), and ns3::Loader::NotifyStartExecute().
|
private |
Definition at line 428 of file linux-socket-fd-factory.cc.
References DevToDev(), m_exported, m_loader, m_lteUeTid, ns3::Loader::NotifyEndExecute(), and ns3::Loader::NotifyStartExecute().
Referenced by NotifyAddDeviceTask().
void ns3::LinuxSocketFdFactory::ScheduleTask | ( | EventImpl * | event | ) |
Definition at line 496 of file linux-socket-fd-factory.cc.
References m_kernelTasks, m_loader, m_manager, ScheduleTaskTrampoline(), ns3::Task::SetExtraContext(), ns3::Task::SetSwitchNotifier(), and TaskSwitch().
Referenced by NotifyAddDevice(), NotifyDeviceStateChange(), NotifyNewAggregate(), Set(), and ns3::LinuxStackHelper::SysctlGet().
|
staticprivate |
Definition at line 483 of file linux-socket-fd-factory.cc.
References ns3::Current(), ns3::Task::GetExtraContext(), and ns3::Task::SetExtraContext().
Referenced by ScheduleTask().
|
staticprivate |
Definition at line 378 of file linux-socket-fd-factory.cc.
Referenced by DevXmit().
|
private |
Definition at line 786 of file linux-socket-fd-factory.cc.
References GET_CURRENT, m_exported, m_loader, ns3::Loader::NotifyEndExecute(), and ns3::Loader::NotifyStartExecute().
void ns3::LinuxSocketFdFactory::Set | ( | std::string | path, |
std::string | value | ||
) |
Definition at line 609 of file linux-socket-fd-factory.cc.
References m_earlySysfs, m_manager, ScheduleTask(), and SetTask().
Referenced by ns3::Mip6dHelper::EnableHA(), ns3::Mip6dHelper::EnableMR(), InitializeStack(), and ns3::LinuxStackHelper::SysctlSet().
|
staticprivate |
Definition at line 223 of file linux-socket-fd-factory.cc.
References dce_setbuf().
Referenced by InitializeStack().
|
private |
Definition at line 942 of file linux-socket-fd-factory.cc.
References GET_CURRENT, m_exported, m_loader, ns3::Loader::NotifyEndExecute(), and ns3::Loader::NotifyStartExecute().
|
private |
Definition at line 591 of file linux-socket-fd-factory.cc.
References GetSysFileList(), and m_exported.
Referenced by Set().
|
private |
Definition at line 871 of file linux-socket-fd-factory.cc.
References GET_CURRENT, m_exported, m_loader, ns3::Loader::NotifyEndExecute(), and ns3::Loader::NotifyStartExecute().
|
staticprivate |
Definition at line 408 of file linux-socket-fd-factory.cc.
Referenced by InitializeStack().
|
private |
|
staticreadprivate |
Definition at line 329 of file linux-socket-fd-factory.cc.
References ns3::Current(), ns3::TaskManager::CurrentTask(), ns3::Task::GetContext(), ns3::Task::GetExtraContext(), ns3::Process::pid, ns3::Thread::process, and ns3::Task::SetExtraContext().
Referenced by InitializeStack(), TaskWait(), and TaskYield().
|
staticreadprivate |
Definition at line 318 of file linux-socket-fd-factory.cc.
References ns3::Task::GetExtraContext(), ns3::Task::SetExtraContext(), ns3::Task::SetSwitchNotifier(), and TaskSwitch().
Referenced by InitializeStack().
|
staticprivate |
Definition at line 302 of file linux-socket-fd-factory.cc.
References ns3::Task::FROM, ns3::Loader::NotifyEndExecute(), ns3::Loader::NotifyStartExecute(), and ns3::Task::TO.
Referenced by ScheduleTask(), and TaskStart().
|
staticprivate |
Definition at line 348 of file linux-socket-fd-factory.cc.
References ns3::Current(), and TaskCurrent().
Referenced by InitializeStack().
|
staticprivate |
Definition at line 356 of file linux-socket-fd-factory.cc.
References ns3::Current(), ns3::Task::IsBlocked(), and ns3::TaskManager::Wakeup().
Referenced by InitializeStack().
|
staticprivate |
Definition at line 370 of file linux-socket-fd-factory.cc.
References ns3::Current(), and TaskCurrent().
Referenced by InitializeStack().
|
staticprivate |
Definition at line 134 of file linux-socket-fd-factory.cc.
Referenced by InitializeStack().
|
friend |
Definition at line 52 of file linux-socket-fd-factory.h.
|
friend |
Definition at line 51 of file linux-socket-fd-factory.h.
Referenced by Accept(), and CreateSocket().
|
private |
Definition at line 148 of file linux-socket-fd-factory.h.
Referenced by ~LinuxSocketFdFactory().
|
private |
Definition at line 141 of file linux-socket-fd-factory.h.
Referenced by DevToDev(), NotifyAddDeviceTask(), and ~LinuxSocketFdFactory().
|
private |
Definition at line 150 of file linux-socket-fd-factory.h.
Referenced by InitializeStack(), and Set().
|
private |
Definition at line 144 of file linux-socket-fd-factory.h.
Referenced by Accept(), Bind(), Close(), Connect(), CreateSocket(), DevXmit(), Get(), Getpeername(), Getsockname(), Getsockopt(), GetSysFileList(), InitializeStack(), Ioctl(), Listen(), NotifyAddDeviceTask(), NotifyDeviceStateChangeTask(), Poll(), PollFreeWait(), Recvmsg(), RxFromDevice(), Sendmsg(), Setsockopt(), SetTask(), Shutdown(), and ~LinuxSocketFdFactory().
|
private |
Definition at line 145 of file linux-socket-fd-factory.h.
Referenced by DoDispose(), and ScheduleTask().
|
private |
Definition at line 142 of file linux-socket-fd-factory.h.
Referenced by GetTypeId(), and InitializeStack().
|
private |
Definition at line 151 of file linux-socket-fd-factory.h.
Referenced by DoDispose(), and NotifyAddDeviceTask().
|
private |
Definition at line 143 of file linux-socket-fd-factory.h.
Referenced by Accept(), Bind(), Close(), Connect(), CreateSocket(), EventTrampoline(), Getpeername(), Getsockname(), Getsockopt(), GetSysFileList(), InitializeStack(), Ioctl(), Listen(), NotifyAddDeviceTask(), NotifyDeviceStateChangeTask(), NotifyNewAggregate(), Poll(), PollFreeWait(), Recvmsg(), RxFromDevice(), ScheduleTask(), Sendmsg(), Setsockopt(), Shutdown(), and ~LinuxSocketFdFactory().
|
private |
Definition at line 149 of file linux-socket-fd-factory.h.
Referenced by NotifyNewAggregate(), and ~LinuxSocketFdFactory().
|
private |
Definition at line 155 of file linux-socket-fd-factory.h.
Referenced by LinuxSocketFdFactory(), NotifyAddDeviceTask(), and RxFromDevice().
|
private |
Definition at line 146 of file linux-socket-fd-factory.h.
Referenced by DoDispose(), NotifyNewAggregate(), ScheduleTask(), and Set().
|
private |
Definition at line 154 of file linux-socket-fd-factory.h.
Referenced by InitializeStack().
|
private |
Definition at line 153 of file linux-socket-fd-factory.h.
Referenced by GetTypeId().
|
private |
Definition at line 152 of file linux-socket-fd-factory.h.
Referenced by GetTypeId().
|
private |
Definition at line 147 of file linux-socket-fd-factory.h.
Referenced by Random().