#include <unix-stream-socket-fd.h>
Public Member Functions | |
UnixStreamSocketFd (Ptr< Socket > sock, bool connected=0) | |
virtual | ~UnixStreamSocketFd (void) |
![]() | |
virtual | ~UnixSocketFd () |
virtual int | Bind (const struct sockaddr *my_addr, socklen_t addrlen) |
virtual bool | CanRecv (void) const =0 |
virtual bool | CanSend (void) const =0 |
virtual int | Close (void) |
virtual int | Connect (const struct sockaddr *my_addr, socklen_t addrlen) |
virtual int | Ftruncate (off_t length) |
virtual int | Fxstat (int ver, struct stat *buf) |
virtual int | Fxstat64 (int ver, struct stat64 *buf) |
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 int | Gettime (struct itimerspec *cur_value) const |
virtual int | Ioctl (int request, char *argp) |
virtual bool | Isatty (void) const |
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 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 | Settime (int flags, const struct itimerspec *new_value, struct itimerspec *old_value) |
virtual ssize_t | Write (const void *buf, size_t count) |
![]() | |
virtual int | Accept (struct sockaddr *my_addr, socklen_t *addrlen)=0 |
void | DecFdCount (void) |
virtual int | Fcntl (int cmd, unsigned long arg) |
virtual int | Fxstat (int ver, struct::stat *buf)=0 |
virtual int | Fxstat64 (int ver, struct::stat64 *buf)=0 |
int | GetFdCount (void) const |
virtual int | GetRealFd (void) const |
virtual bool | HangupReceived (void) const =0 |
void | IncFdCount (void) |
virtual int | Listen (int backlog)=0 |
virtual int | Poll (PollTable *ptable)=0 |
virtual int | Shutdown (int how)=0 |
virtual char * | Ttyname (void) |
Private Types | |
enum | State { CREATED, LISTENING, CONNECTING, CONNECTED, REMOTECLOSED, CLOSING, CLOSED } |
Private Member Functions | |
virtual int | Accept (struct sockaddr *my_addr, socklen_t *addrlen) |
virtual bool | CanRecv (void) const |
virtual bool | CanSend (void) const |
virtual int | Close (void) |
void | CloseError (Ptr< Socket > sock) |
void | CloseSuccess (Ptr< Socket > sock) |
virtual int | Connect (const struct sockaddr *my_addr, socklen_t addrlen) |
void | ConnectionCreated (Ptr< Socket > sock, const Address &from) |
void | ConnectionError (Ptr< Socket > sock) |
bool | ConnectionRequest (Ptr< Socket > sock, const Address &from) |
void | ConnectionSuccess (Ptr< Socket > sock) |
virtual ssize_t | DoRecvmsg (struct msghdr *msg, int flags) |
virtual ssize_t | DoSendmsg (const struct msghdr *msg, int flags) |
virtual int | Getpeername (struct sockaddr *name, socklen_t *namelen) |
virtual bool | HangupReceived (void) const |
virtual int | Listen (int backlog) |
void | MainSend (int *r, Ptr< Packet > p) |
virtual int | Poll (PollTable *ptable) |
void | SetPeerAddress (Address *a) |
virtual int | Shutdown (int how) |
Private Attributes | |
int | m_backlog |
std::list< std::pair< Ptr < Socket >, Address > > | m_connectionQueue |
Address * | m_peerAddress |
bool | m_shutWrite |
State | m_state |
Additional Inherited Members | |
![]() | |
static TypeId | GetTypeId (void) |
![]() | |
UnixSocketFd (Ptr< Socket > sock) | |
void | AddPeekedData (const uint8_t *buf, uint32_t count, Address from) |
void | AddPeekedData (Ptr< Packet > p) |
void | ChangeSocket (Ptr< Socket > socket) |
void | ClearSocket (void) |
int | ErrnoToSimuErrno (void) const |
Address | GetPeekedFrom (void) |
Time | GetRecvTimeout (void) |
Time | GetSendTimeout (void) |
bool | isPeekedData (void) |
bool | IsRecvErr (void) const |
bool | IsRecvTtl (void) const |
int | Ns3AddressToDeviceIndependantPhysicalLayerAddress (const Address &nsaddr, const Packet &pac, struct sockaddr_ll *addr, socklen_t *addrlen) const |
int | Ns3AddressToPosixAddress (const Address &nsaddr, struct sockaddr *addr, socklen_t *addrlen) const |
Address | PosixAddressToNs3Address (const struct sockaddr *my_addr, socklen_t addrlen) const |
bool | WaitRecvDoSignal (bool blocking) |
![]() | |
Address | m_peekedAddress |
Ptr< Packet > | m_peekedData |
Ptr< Socket > | m_socket |
Definition at line 9 of file unix-stream-socket-fd.h.
|
private |
Definition at line 15 of file unix-stream-socket-fd.h.
ns3::UnixStreamSocketFd::UnixStreamSocketFd | ( | Ptr< Socket > | sock, |
bool | connected = 0 |
||
) |
Definition at line 19 of file unix-stream-socket-fd.cc.
References CloseError(), CloseSuccess(), CONNECTED, ConnectionCreated(), ConnectionError(), ConnectionRequest(), ConnectionSuccess(), CREATED, ns3::UnixSocketFd::m_socket, and m_state.
Referenced by Accept().
|
virtual |
Definition at line 35 of file unix-stream-socket-fd.cc.
References ns3::UnixSocketFd::ClearSocket(), and SetPeerAddress().
|
privatevirtual |
Definition at line 292 of file unix-stream-socket-fd.cc.
References ns3::UnixFd::AddWaitQueue(), ns3::Current(), ns3::Thread::err, ns3::UnixSocketFd::GetRecvTimeout(), ns3::UnixFd::IncFdCount(), ns3::WaitPoint::INTERRUPTED, m_connectionQueue, ns3::UnixFd::m_statusFlags, ns3::UnixSocketFd::Ns3AddressToPosixAddress(), ns3::WaitPoint::OK, ns3::Process::openFiles, ns3::Thread::process, ns3::UnixFd::RemoveWaitQueue(), RETURNFREE, SetPeerAddress(), ns3::WaitPoint::TIMEOUT, UnixStreamSocketFd(), ns3::UtilsAllocateFd(), ns3::UtilsDoSignal(), and ns3::WaitQueueEntryTimeout::Wait().
|
privatevirtual |
Definition at line 356 of file unix-stream-socket-fd.cc.
References CLOSED, CLOSING, CONNECTED, CONNECTING, CREATED, LISTENING, m_connectionQueue, ns3::UnixSocketFd::m_socket, m_state, and REMOTECLOSED.
Referenced by Poll().
|
privatevirtual |
Definition at line 399 of file unix-stream-socket-fd.cc.
References ns3::UnixSocketFd::m_socket.
Referenced by Poll().
|
privatevirtual |
Definition at line 651 of file unix-stream-socket-fd.cc.
References CLOSING, ns3::Current(), ns3::Thread::err, and m_state.
|
private |
Definition at line 504 of file unix-stream-socket-fd.cc.
References m_state.
Referenced by Connect(), and UnixStreamSocketFd().
|
private |
Definition at line 488 of file unix-stream-socket-fd.cc.
References CLOSED, CLOSING, m_state, REMOTECLOSED, SetPeerAddress(), and ns3::UnixFd::WakeWaiters().
Referenced by Connect(), and UnixStreamSocketFd().
|
privatevirtual |
Definition at line 510 of file unix-stream-socket-fd.cc.
References ns3::UnixFd::AddWaitQueue(), ns3::UnixSocketFd::ChangeSocket(), CLOSED, CloseError(), CloseSuccess(), CONNECTED, CONNECTING, ConnectionCreated(), ConnectionError(), ConnectionRequest(), ConnectionSuccess(), CREATED, ns3::Current(), ns3::Thread::err, ns3::UnixSocketFd::GetRecvTimeout(), ns3::WaitPoint::INTERRUPTED, m_state, ns3::Process::manager, ns3::WaitPoint::OK, ns3::UnixSocketFd::PosixAddressToNs3Address(), ns3::Thread::process, REMOTECLOSED, ns3::UnixFd::RemoveWaitQueue(), RETURNFREE, SetPeerAddress(), ns3::WaitPoint::TIMEOUT, ns3::UtilsDoSignal(), and ns3::WaitQueueEntryTimeout::Wait().
|
private |
Definition at line 416 of file unix-stream-socket-fd.cc.
References m_backlog, m_connectionQueue, and ns3::UnixFd::WakeWaiters().
Referenced by Connect(), and UnixStreamSocketFd().
|
private |
Definition at line 477 of file unix-stream-socket-fd.cc.
References CONNECTING, CREATED, m_state, and ns3::UnixFd::WakeWaiters().
Referenced by Connect(), and UnixStreamSocketFd().
|
private |
Definition at line 409 of file unix-stream-socket-fd.cc.
References m_backlog, and m_connectionQueue.
Referenced by Connect(), and UnixStreamSocketFd().
|
private |
Definition at line 461 of file unix-stream-socket-fd.cc.
References CONNECTED, CONNECTING, m_state, SetPeerAddress(), and ns3::UnixFd::WakeWaiters().
Referenced by Connect(), and UnixStreamSocketFd().
|
privatevirtual |
Definition at line 42 of file unix-stream-socket-fd.cc.
References ns3::UnixSocketFd::AddPeekedData(), CLOSED, CLOSING, CONNECTED, CREATED, ns3::Current(), ns3::Thread::err, ns3::UnixSocketFd::ErrnoToSimuErrno(), ns3::UnixSocketFd::GetPeekedFrom(), ns3::UnixSocketFd::isPeekedData(), ns3::UnixSocketFd::m_peekedData, ns3::UnixSocketFd::m_socket, m_state, ns3::UnixSocketFd::Ns3AddressToPosixAddress(), REMOTECLOSED, and ns3::UnixSocketFd::WaitRecvDoSignal().
|
privatevirtual |
Definition at line 151 of file unix-stream-socket-fd.cc.
References ns3::UnixFd::AddWaitQueue(), CONNECTED, ns3::Current(), ns3::Thread::err, ns3::UnixSocketFd::ErrnoToSimuErrno(), ns3::UnixSocketFd::GetSendTimeout(), ns3::WaitPoint::INTERRUPTED, m_shutWrite, ns3::UnixSocketFd::m_socket, m_state, MainSend(), ns3::WaitPoint::OK, ns3::UnixFd::RemoveWaitQueue(), RETURNFREE, ns3::WaitPoint::TIMEOUT, ns3::UtilsDoSignal(), and ns3::WaitQueueEntryTimeout::Wait().
|
privatevirtual |
Definition at line 598 of file unix-stream-socket-fd.cc.
References ns3::Current(), ns3::Thread::err, m_peerAddress, and ns3::UnixSocketFd::Ns3AddressToPosixAddress().
|
privatevirtual |
Definition at line 404 of file unix-stream-socket-fd.cc.
Referenced by Poll().
|
privatevirtual |
Definition at line 275 of file unix-stream-socket-fd.cc.
References ns3::Current(), ns3::Thread::err, ns3::UnixSocketFd::ErrnoToSimuErrno(), LISTENING, m_backlog, ns3::UnixSocketFd::m_socket, and m_state.
|
private |
Callback used to call the socket send using the main thread.
Definition at line 146 of file unix-stream-socket-fd.cc.
References ns3::UnixSocketFd::m_socket.
Referenced by DoSendmsg().
|
privatevirtual |
Definition at line 616 of file unix-stream-socket-fd.cc.
References CanRecv(), CanSend(), HangupReceived(), and ns3::PollTable::PollWait().
|
private |
Definition at line 641 of file unix-stream-socket-fd.cc.
References m_peerAddress.
Referenced by Accept(), CloseSuccess(), Connect(), ConnectionSuccess(), and ~UnixStreamSocketFd().
|
privatevirtual |
Definition at line 426 of file unix-stream-socket-fd.cc.
References CLOSED, ns3::Current(), ns3::Thread::err, ns3::UnixSocketFd::ErrnoToSimuErrno(), m_shutWrite, ns3::UnixSocketFd::m_socket, and m_state.
|
private |
Definition at line 54 of file unix-stream-socket-fd.h.
Referenced by ConnectionCreated(), ConnectionRequest(), and Listen().
|
private |
Definition at line 53 of file unix-stream-socket-fd.h.
Referenced by Accept(), CanRecv(), ConnectionCreated(), and ConnectionRequest().
|
private |
Definition at line 56 of file unix-stream-socket-fd.h.
Referenced by Getpeername(), and SetPeerAddress().
|
private |
Definition at line 57 of file unix-stream-socket-fd.h.
Referenced by DoSendmsg(), and Shutdown().
|
private |
Definition at line 55 of file unix-stream-socket-fd.h.
Referenced by CanRecv(), Close(), CloseError(), CloseSuccess(), Connect(), ConnectionError(), ConnectionSuccess(), DoRecvmsg(), DoSendmsg(), Listen(), Shutdown(), and UnixStreamSocketFd().