#include <local-stream-socket-fd.h>
Public Member Functions | |
LocalStreamSocketFd (Ptr< LocalSocketFdFactory > f) | |
LocalStreamSocketFd (LocalStreamSocketFd *peer, std::string connectPath) | |
virtual | ~LocalStreamSocketFd () |
virtual int | Accept (struct sockaddr *my_addr, socklen_t *addrlen) |
virtual int | Bind (const struct sockaddr *my_addr, socklen_t addrlen) |
virtual bool | CanRecv (void) const |
virtual bool | CanSend (void) const |
virtual int | Close (void) |
virtual int | Connect (const struct sockaddr *my_addr, socklen_t addrlen) |
virtual void | DoDispose (void) |
virtual TypeId | GetInstanceTypeId (void) const |
virtual int | Getpeername (struct sockaddr *name, socklen_t *namelen) |
virtual int | Getsockname (struct sockaddr *name, socklen_t *namelen) |
virtual int | Getsockopt (int level, int optname, void *optval, socklen_t *optlen) |
virtual bool | HangupReceived (void) const |
virtual bool | Isatty (void) const |
virtual int | Listen (int backlog) |
virtual int | Poll (PollTable *ptable) |
virtual ssize_t | Read (void *buf, size_t count) |
virtual ssize_t | Recvmsg (struct msghdr *msg, int flags) |
virtual ssize_t | Sendmsg (const struct msghdr *msg, int flags) |
virtual int | Setsockopt (int level, int optname, const void *optval, socklen_t optlen) |
virtual int | Shutdown (int how) |
virtual ssize_t | Write (const void *buf, size_t count) |
![]() | |
LocalSocketFd () | |
virtual | ~LocalSocketFd () |
virtual int | Fcntl (int cmd, unsigned long arg) |
virtual int | Ftruncate (off_t length) |
virtual int | Fxstat (int ver, struct::stat *buf) |
virtual int | Fxstat64 (int ver, struct::stat64 *buf) |
virtual int | Gettime (struct itimerspec *cur_value) const |
virtual int | Ioctl (int request, char *argp) |
virtual off64_t | Lseek (off64_t offset, int whence) |
virtual void * | Mmap (void *start, size_t length, int prot, int flags, off64_t offset) |
virtual int | Settime (int flags, const struct itimerspec *new_value, struct itimerspec *old_value) |
![]() | |
void | DecFdCount (void) |
int | GetFdCount (void) const |
virtual int | GetRealFd (void) const |
void | IncFdCount (void) |
virtual char * | Ttyname (void) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Protected Member Functions | |
virtual void | ClearAll (bool andWakeUp) |
virtual bool | IsClosed (void) const |
![]() | |
void | ClearReadBuffer (void) |
ssize_t | DoRecvPacket (uint8_t *buf, size_t len) |
Time | GetRecvTimeout (void) |
Time | GetSendTimeout (void) |
size_t | ReadData (uint8_t *buf, size_t len, bool peek) |
![]() | |
UnixFd () | |
void | AddWaitQueue (WaitQueueEntry *, bool andRegister) |
void | RemoveWaitQueue (WaitQueueEntry *, bool andUnregister) |
void | WakeWaiters (void *key) |
Private Types | |
typedef std::list < LocalStreamSocketFd * > | FifoCnx |
enum | State { CREATED, BINDED, LISTENING, ACCEPTING, CONNECTING, CONNECTED, REMOTECLOSED, CLOSED } |
Private Member Functions | |
void | ConnectionCreated (LocalStreamSocketFd *sock, WaitQueueEntryTimeout *wq) |
bool | InternalConnect (void) |
bool | IsAccepting (void) |
bool | IsListening (void) |
bool | IsShutWrite (void) const |
void | PeerClosed (void) |
void | RemoveFromQueue (LocalStreamSocketFd *sock) |
void | SetPeer (LocalStreamSocketFd *sock) |
Private Attributes | |
int | m_backLog |
FifoCnx | m_cnxQueue |
LocalStreamSocketFd * | m_peer |
enum State | m_state |
Additional Inherited Members | |
![]() | |
typedef std::list< struct Buffer * > | FifoData |
![]() | |
std::string | m_bindPath |
std::string | m_connectPath |
Ptr< LocalSocketFdFactory > | m_factory |
int32_t | m_linger |
FifoData | m_readBuffer |
size_t | m_readBufferSize |
Time | m_recvTimeout |
Time | m_sendTimeout |
bool | m_shutRead |
bool | m_shutWrite |
Definition at line 49 of file local-stream-socket-fd.h.
|
private |
Definition at line 111 of file local-stream-socket-fd.h.
|
private |
Definition at line 100 of file local-stream-socket-fd.h.
ns3::LocalStreamSocketFd::LocalStreamSocketFd | ( | Ptr< LocalSocketFdFactory > | f | ) |
Definition at line 53 of file local-stream-socket-fd.cc.
References ns3::LocalSocketFd::m_factory.
Referenced by Accept().
ns3::LocalStreamSocketFd::LocalStreamSocketFd | ( | LocalStreamSocketFd * | peer, |
std::string | connectPath | ||
) |
Definition at line 61 of file local-stream-socket-fd.cc.
References ns3::LocalSocketFd::m_bindPath.
|
virtual |
Definition at line 70 of file local-stream-socket-fd.cc.
References ClearAll().
|
virtual |
Implements ns3::LocalSocketFd.
Definition at line 895 of file local-stream-socket-fd.cc.
References ACCEPTING, ns3::UnixFd::AddWaitQueue(), Close(), ns3::Current(), ns3::Thread::err, ns3::LocalSocketFd::GetRecvTimeout(), ns3::UnixFd::IncFdCount(), InternalConnect(), ns3::WaitPoint::INTERRUPTED, LISTENING, LocalStreamSocketFd(), ns3::LocalSocketFd::m_bindPath, m_cnxQueue, m_state, ns3::UnixFd::m_statusFlags, ns3::WaitPoint::OK, ns3::Process::openFiles, ns3::Thread::process, ns3::UnixFd::RemoveWaitQueue(), RETURNFREE, SetPeer(), ns3::WaitPoint::TIMEOUT, ns3::UtilsAllocateFd(), ns3::UtilsDoSignal(), and ns3::WaitQueueEntryTimeout::Wait().
|
virtual |
Implements ns3::LocalSocketFd.
Definition at line 735 of file local-stream-socket-fd.cc.
References BINDED, CREATED, ns3::Current(), ns3::Thread::err, errno, ns3::LocalSocketFd::m_bindPath, ns3::LocalSocketFd::m_factory, m_state, ns3::UtilsEnsureAllDirectoriesExist(), and ns3::UtilsGetRealFilePath().
|
virtual |
Implements ns3::LocalSocketFd.
Definition at line 984 of file local-stream-socket-fd.cc.
References ACCEPTING, CONNECTED, LISTENING, m_cnxQueue, ns3::LocalSocketFd::m_readBufferSize, m_state, and REMOTECLOSED.
Referenced by Poll().
|
virtual |
Implements ns3::LocalSocketFd.
Definition at line 1005 of file local-stream-socket-fd.cc.
References CONNECTED, LOCAL_SOCKET_MAX_BUFFER, m_peer, ns3::LocalSocketFd::m_readBufferSize, and m_state.
Referenced by Poll().
|
protectedvirtual |
Implements ns3::LocalSocketFd.
Definition at line 1083 of file local-stream-socket-fd.cc.
References ns3::LocalSocketFd::ClearReadBuffer(), CLOSED, ns3::LocalSocketFd::m_bindPath, m_cnxQueue, ns3::LocalSocketFd::m_connectPath, ns3::LocalSocketFd::m_factory, m_peer, m_state, and ns3::UnixFd::WakeWaiters().
Referenced by Close(), DoDispose(), and ~LocalStreamSocketFd().
|
virtual |
Implements ns3::LocalSocketFd.
Definition at line 86 of file local-stream-socket-fd.cc.
References ACCEPTING, BINDED, ClearAll(), CLOSED, CONNECTED, CONNECTING, CREATED, ns3::Current(), ns3::Thread::err, LISTENING, ns3::LocalSocketFd::m_bindPath, ns3::LocalSocketFd::m_factory, m_peer, m_state, PeerClosed(), and REMOTECLOSED.
Referenced by Accept().
|
virtual |
Implements ns3::LocalSocketFd.
Definition at line 781 of file local-stream-socket-fd.cc.
References ns3::UnixFd::AddWaitQueue(), CONNECTED, CONNECTING, ConnectionCreated(), ns3::Current(), ns3::Thread::err, ns3::LocalSocketFd::GetRecvTimeout(), GetTypeId(), ns3::WaitPoint::INTERRUPTED, IsAccepting(), IsListening(), ns3::LocalSocketFd::m_connectPath, ns3::LocalSocketFd::m_factory, m_state, ns3::UnixFd::m_statusFlags, ns3::WaitPoint::OK, REMOTECLOSED, RemoveFromQueue(), ns3::UnixFd::RemoveWaitQueue(), ns3::UtilsDoSignal(), ns3::UtilsGetRealFilePath(), and ns3::WaitQueueEntryTimeout::Wait().
|
private |
Definition at line 1046 of file local-stream-socket-fd.cc.
References m_cnxQueue, and ns3::UnixFd::WakeWaiters().
Referenced by Connect().
|
virtual |
Definition at line 78 of file local-stream-socket-fd.cc.
References ClearAll().
|
virtual |
Reimplemented from ns3::LocalSocketFd.
Definition at line 49 of file local-stream-socket-fd.cc.
References GetTypeId().
|
virtual |
Implements ns3::LocalSocketFd.
Definition at line 700 of file local-stream-socket-fd.cc.
References CONNECTED, ns3::Current(), ns3::Thread::err, ns3::LocalSocketFd::m_connectPath, m_state, REMOTECLOSED, and ns3::UtilsGetRealFilePath().
|
virtual |
Implements ns3::LocalSocketFd.
Definition at line 670 of file local-stream-socket-fd.cc.
References CLOSED, ns3::Current(), ns3::Thread::err, ns3::LocalSocketFd::m_bindPath, m_state, and ns3::UtilsGetRealFilePath().
|
virtual |
Implements ns3::LocalSocketFd.
Definition at line 526 of file local-stream-socket-fd.cc.
References ACCEPTING, ns3::Current(), ns3::Thread::err, LISTENING, LOCAL_SOCKET_MAX_BUFFER, ns3::LocalSocketFd::m_linger, ns3::LocalSocketFd::m_recvTimeout, ns3::LocalSocketFd::m_sendTimeout, m_state, and ns3::UtilsTimeToTimeval().
|
static |
Reimplemented from ns3::LocalSocketFd.
Definition at line 42 of file local-stream-socket-fd.cc.
Referenced by Connect(), and GetInstanceTypeId().
|
virtual |
Implements ns3::LocalSocketFd.
Definition at line 1011 of file local-stream-socket-fd.cc.
References m_state, and REMOTECLOSED.
Referenced by Poll().
|
private |
Definition at line 1017 of file local-stream-socket-fd.cc.
References CONNECTED, CONNECTING, m_state, and ns3::UnixFd::WakeWaiters().
Referenced by Accept().
|
private |
Definition at line 1034 of file local-stream-socket-fd.cc.
References ACCEPTING, and m_state.
Referenced by Connect().
|
virtual |
Reimplemented from ns3::LocalSocketFd.
Definition at line 431 of file local-stream-socket-fd.cc.
|
protectedvirtual |
Implements ns3::LocalSocketFd.
Definition at line 1107 of file local-stream-socket-fd.cc.
References CLOSED, and m_state.
Referenced by Poll().
|
private |
Definition at line 1040 of file local-stream-socket-fd.cc.
References LISTENING, and m_state.
Referenced by Connect().
|
private |
Definition at line 1101 of file local-stream-socket-fd.cc.
References ns3::LocalSocketFd::m_shutWrite.
Referenced by Read().
|
virtual |
Implements ns3::LocalSocketFd.
Definition at line 847 of file local-stream-socket-fd.cc.
References BINDED, ns3::Current(), ns3::Thread::err, LISTENING, m_backLog, ns3::LocalSocketFd::m_bindPath, ns3::LocalSocketFd::m_factory, and m_state.
|
private |
Definition at line 1069 of file local-stream-socket-fd.cc.
References CONNECTED, m_peer, m_state, REMOTECLOSED, and ns3::UnixFd::WakeWaiters().
Referenced by Close().
|
virtual |
Implements ns3::UnixFd.
Definition at line 1113 of file local-stream-socket-fd.cc.
References CanRecv(), CanSend(), HangupReceived(), IsClosed(), and ns3::PollTable::PollWait().
|
virtual |
Implements ns3::LocalSocketFd.
Definition at line 260 of file local-stream-socket-fd.cc.
References ns3::UnixFd::AddWaitQueue(), CONNECTED, ns3::Current(), ns3::Thread::err, ns3::LocalSocketFd::GetRecvTimeout(), ns3::WaitPoint::INTERRUPTED, IsShutWrite(), m_peer, ns3::LocalSocketFd::m_readBufferSize, m_state, ns3::UnixFd::m_statusFlags, ns3::WaitPoint::OK, ns3::LocalSocketFd::ReadData(), REMOTECLOSED, ns3::UnixFd::RemoveWaitQueue(), RETURNFREE, ns3::WaitPoint::TIMEOUT, ns3::UtilsDoSignal(), ns3::WaitQueueEntryTimeout::Wait(), and ns3::UnixFd::WakeWaiters().
Referenced by Recvmsg().
|
virtual |
Implements ns3::LocalSocketFd.
Definition at line 356 of file local-stream-socket-fd.cc.
References ns3::Current(), and Read().
|
private |
Definition at line 1056 of file local-stream-socket-fd.cc.
References m_cnxQueue.
Referenced by Connect().
|
virtual |
Implements ns3::LocalSocketFd.
Definition at line 394 of file local-stream-socket-fd.cc.
References ns3::Current(), ns3::Thread::err, and Write().
|
private |
Definition at line 1063 of file local-stream-socket-fd.cc.
References m_peer.
Referenced by Accept().
|
virtual |
Implements ns3::LocalSocketFd.
Definition at line 436 of file local-stream-socket-fd.cc.
References ns3::Current(), ns3::Thread::err, ns3::LocalSocketFd::m_linger, ns3::LocalSocketFd::m_recvTimeout, ns3::LocalSocketFd::m_sendTimeout, and ns3::UtilsTimevalToTime().
|
virtual |
Implements ns3::LocalSocketFd.
Definition at line 863 of file local-stream-socket-fd.cc.
References CONNECTED, ns3::Current(), ns3::Thread::err, ns3::LocalSocketFd::m_shutRead, ns3::LocalSocketFd::m_shutWrite, m_state, and REMOTECLOSED.
|
virtual |
Implements ns3::LocalSocketFd.
Definition at line 151 of file local-stream-socket-fd.cc.
References ns3::UnixFd::AddWaitQueue(), CONNECTED, ns3::Current(), ns3::LocalSocketFd::DoRecvPacket(), ns3::Thread::err, ns3::LocalSocketFd::GetSendTimeout(), ns3::WaitPoint::INTERRUPTED, m_peer, ns3::LocalSocketFd::m_shutWrite, m_state, ns3::UnixFd::m_statusFlags, ns3::WaitPoint::OK, REMOTECLOSED, ns3::UnixFd::RemoveWaitQueue(), RETURNFREE, ns3::WaitPoint::TIMEOUT, ns3::UtilsDoSignal(), and ns3::WaitQueueEntryTimeout::Wait().
Referenced by Sendmsg().
|
private |
Definition at line 115 of file local-stream-socket-fd.h.
Referenced by Listen().
|
private |
Definition at line 114 of file local-stream-socket-fd.h.
Referenced by Accept(), CanRecv(), ClearAll(), ConnectionCreated(), and RemoveFromQueue().
|
private |
Definition at line 116 of file local-stream-socket-fd.h.
Referenced by CanSend(), ClearAll(), Close(), PeerClosed(), Read(), SetPeer(), and Write().
|
private |
Definition at line 113 of file local-stream-socket-fd.h.
Referenced by Accept(), Bind(), CanRecv(), CanSend(), ClearAll(), Close(), Connect(), Getpeername(), Getsockname(), Getsockopt(), HangupReceived(), InternalConnect(), IsAccepting(), IsClosed(), IsListening(), Listen(), PeerClosed(), Read(), Shutdown(), and Write().