ns-3 Direct Code Execution
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ns3::LocalStreamSocketFd Class Reference

#include <local-stream-socket-fd.h>

+ Inheritance diagram for ns3::LocalStreamSocketFd:
+ Collaboration diagram for ns3::LocalStreamSocketFd:

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)
- Public Member Functions inherited from ns3::LocalSocketFd
 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)
- Public Member Functions inherited from ns3::UnixFd
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
- Protected Member Functions inherited from ns3::LocalSocketFd
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)
- Protected Member Functions inherited from ns3::UnixFd
 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
LocalStreamSocketFdm_peer
enum State m_state

Additional Inherited Members

- Protected Types inherited from ns3::LocalSocketFd
typedef std::list< struct
Buffer * > 
FifoData
- Protected Attributes inherited from ns3::LocalSocketFd
std::string m_bindPath
std::string m_connectPath
Ptr< LocalSocketFdFactorym_factory
int32_t m_linger
FifoData m_readBuffer
size_t m_readBufferSize
Time m_recvTimeout
Time m_sendTimeout
bool m_shutRead
bool m_shutWrite

Detailed Description

Definition at line 49 of file local-stream-socket-fd.h.

Member Typedef Documentation

Definition at line 111 of file local-stream-socket-fd.h.

Member Enumeration Documentation

Enumerator:
CREATED 
BINDED 
LISTENING 
ACCEPTING 
CONNECTING 
CONNECTED 
REMOTECLOSED 
CLOSED 

Definition at line 100 of file local-stream-socket-fd.h.

Constructor & Destructor Documentation

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().

+ Here is the caller graph for this function:

ns3::LocalStreamSocketFd::LocalStreamSocketFd ( LocalStreamSocketFd peer,
std::string  connectPath 
)

Definition at line 61 of file local-stream-socket-fd.cc.

References ns3::LocalSocketFd::m_bindPath.

ns3::LocalStreamSocketFd::~LocalStreamSocketFd ( )
virtual

Definition at line 70 of file local-stream-socket-fd.cc.

References ClearAll().

+ Here is the call graph for this function:

Member Function Documentation

int ns3::LocalStreamSocketFd::Bind ( const struct sockaddr *  my_addr,
socklen_t  addrlen 
)
virtual
bool ns3::LocalStreamSocketFd::CanRecv ( void  ) const
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().

+ Here is the caller graph for this function:

bool ns3::LocalStreamSocketFd::CanSend ( void  ) const
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().

+ Here is the caller graph for this function:

void ns3::LocalStreamSocketFd::ClearAll ( bool  andWakeUp)
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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ns3::LocalStreamSocketFd::Close ( void  )
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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::LocalStreamSocketFd::ConnectionCreated ( LocalStreamSocketFd sock,
WaitQueueEntryTimeout wq 
)
private

Definition at line 1046 of file local-stream-socket-fd.cc.

References m_cnxQueue, and ns3::UnixFd::WakeWaiters().

Referenced by Connect().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::LocalStreamSocketFd::DoDispose ( void  )
virtual

Definition at line 78 of file local-stream-socket-fd.cc.

References ClearAll().

+ Here is the call graph for this function:

TypeId ns3::LocalStreamSocketFd::GetInstanceTypeId ( void  ) const
virtual

Reimplemented from ns3::LocalSocketFd.

Definition at line 49 of file local-stream-socket-fd.cc.

References GetTypeId().

+ Here is the call graph for this function:

int ns3::LocalStreamSocketFd::Getpeername ( struct sockaddr *  name,
socklen_t *  namelen 
)
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().

+ Here is the call graph for this function:

int ns3::LocalStreamSocketFd::Getsockname ( struct sockaddr *  name,
socklen_t *  namelen 
)
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().

+ Here is the call graph for this function:

int ns3::LocalStreamSocketFd::Getsockopt ( int  level,
int  optname,
void *  optval,
socklen_t *  optlen 
)
virtual
TypeId ns3::LocalStreamSocketFd::GetTypeId ( void  )
static

Reimplemented from ns3::LocalSocketFd.

Definition at line 42 of file local-stream-socket-fd.cc.

Referenced by Connect(), and GetInstanceTypeId().

+ Here is the caller graph for this function:

bool ns3::LocalStreamSocketFd::HangupReceived ( void  ) const
virtual

Implements ns3::LocalSocketFd.

Definition at line 1011 of file local-stream-socket-fd.cc.

References m_state, and REMOTECLOSED.

Referenced by Poll().

+ Here is the caller graph for this function:

bool ns3::LocalStreamSocketFd::InternalConnect ( void  )
private

Definition at line 1017 of file local-stream-socket-fd.cc.

References CONNECTED, CONNECTING, m_state, and ns3::UnixFd::WakeWaiters().

Referenced by Accept().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::LocalStreamSocketFd::IsAccepting ( void  )
private

Definition at line 1034 of file local-stream-socket-fd.cc.

References ACCEPTING, and m_state.

Referenced by Connect().

+ Here is the caller graph for this function:

bool ns3::LocalStreamSocketFd::Isatty ( void  ) const
virtual

Reimplemented from ns3::LocalSocketFd.

Definition at line 431 of file local-stream-socket-fd.cc.

bool ns3::LocalStreamSocketFd::IsClosed ( void  ) const
protectedvirtual

Implements ns3::LocalSocketFd.

Definition at line 1107 of file local-stream-socket-fd.cc.

References CLOSED, and m_state.

Referenced by Poll().

+ Here is the caller graph for this function:

bool ns3::LocalStreamSocketFd::IsListening ( void  )
private

Definition at line 1040 of file local-stream-socket-fd.cc.

References LISTENING, and m_state.

Referenced by Connect().

+ Here is the caller graph for this function:

bool ns3::LocalStreamSocketFd::IsShutWrite ( void  ) const
private

Definition at line 1101 of file local-stream-socket-fd.cc.

References ns3::LocalSocketFd::m_shutWrite.

Referenced by Read().

+ Here is the caller graph for this function:

int ns3::LocalStreamSocketFd::Listen ( int  backlog)
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.

+ Here is the call graph for this function:

void ns3::LocalStreamSocketFd::PeerClosed ( void  )
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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ns3::LocalStreamSocketFd::Poll ( PollTable ptable)
virtual

Implements ns3::UnixFd.

Definition at line 1113 of file local-stream-socket-fd.cc.

References CanRecv(), CanSend(), HangupReceived(), IsClosed(), and ns3::PollTable::PollWait().

+ Here is the call graph for this function:

ssize_t ns3::LocalStreamSocketFd::Recvmsg ( struct msghdr *  msg,
int  flags 
)
virtual

Implements ns3::LocalSocketFd.

Definition at line 356 of file local-stream-socket-fd.cc.

References ns3::Current(), and Read().

+ Here is the call graph for this function:

void ns3::LocalStreamSocketFd::RemoveFromQueue ( LocalStreamSocketFd sock)
private

Definition at line 1056 of file local-stream-socket-fd.cc.

References m_cnxQueue.

Referenced by Connect().

+ Here is the caller graph for this function:

ssize_t ns3::LocalStreamSocketFd::Sendmsg ( const struct msghdr *  msg,
int  flags 
)
virtual

Implements ns3::LocalSocketFd.

Definition at line 394 of file local-stream-socket-fd.cc.

References ns3::Current(), ns3::Thread::err, and Write().

+ Here is the call graph for this function:

void ns3::LocalStreamSocketFd::SetPeer ( LocalStreamSocketFd sock)
private

Definition at line 1063 of file local-stream-socket-fd.cc.

References m_peer.

Referenced by Accept().

+ Here is the caller graph for this function:

int ns3::LocalStreamSocketFd::Setsockopt ( int  level,
int  optname,
const void *  optval,
socklen_t  optlen 
)
virtual
int ns3::LocalStreamSocketFd::Shutdown ( int  how)
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.

+ Here is the call graph for this function:

Member Data Documentation

int ns3::LocalStreamSocketFd::m_backLog
private

Definition at line 115 of file local-stream-socket-fd.h.

Referenced by Listen().

FifoCnx ns3::LocalStreamSocketFd::m_cnxQueue
private
LocalStreamSocketFd* ns3::LocalStreamSocketFd::m_peer
private

Definition at line 116 of file local-stream-socket-fd.h.

Referenced by CanSend(), ClearAll(), Close(), PeerClosed(), Read(), SetPeer(), and Write().


The documentation for this class was generated from the following files: