The Pedigree Project  0.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
UnixSocketSyscalls Class Reference
+ Inheritance diagram for UnixSocketSyscalls:
+ Collaboration diagram for UnixSocketSyscalls:

Public Member Functions

 UnixSocketSyscalls (int domain, int type, int protocol)
 
virtual ~UnixSocketSyscalls ()
 
virtual bool create ()
 Implementation-specific final socket creation logic.
 
virtual int connect (const struct sockaddr *address, socklen_t addrlen)
 
virtual ssize_t sendto_msg (const struct msghdr *msghdr)
 
virtual ssize_t recvfrom_msg (struct msghdr *msghdr)
 
virtual int listen (int backlog)
 
virtual int bind (const struct sockaddr *address, socklen_t addrlen)
 
virtual int accept (struct sockaddr *address, socklen_t *addrlen)
 
virtual int shutdown (int how)
 
virtual int getpeername (struct sockaddr *address, socklen_t *address_len)
 
virtual int getsockname (struct sockaddr *address, socklen_t *address_len)
 
virtual int setsockopt (int level, int optname, const void *optvalue, socklen_t optlen)
 
virtual int getsockopt (int level, int optname, void *optvalue, socklen_t *optlen)
 
virtual bool canPoll () const
 
virtual bool poll (bool &read, bool &write, bool &error, Semaphore *waiter)
 
virtual void unPoll (Semaphore *waiter)
 
virtual bool monitor (Thread *pThread, Event *pEvent)
 
virtual bool unmonitor (Event *pEvent)
 
bool pairWith (UnixSocketSyscalls *other)
 
- Public Member Functions inherited from NetworkSyscalls
 NetworkSyscalls (int domain, int type, int protocol)
 
virtual ssize_t sendto (const void *buffer, size_t bufferlen, int flags, const struct sockaddr *address, socklen_t addrlen)
 
virtual ssize_t recvfrom (void *buffer, size_t bufferlen, int flags, struct sockaddr *address, socklen_t *addrlen)
 
void associate (FileDescriptor *fd)
 
int getDomain () const
 
int getType () const
 
int getProtocol () const
 
FileDescriptorgetFileDescriptor () const
 
bool isBlocking () const
 
void setBlocking (bool blocking)
 

Private Member Functions

 NOT_COPYABLE_OR_ASSIGNABLE (UnixSocketSyscalls)
 
UnixSocketgetRemote () const
 
UnixSocket::SocketType getSocketType () const
 

Private Attributes

UnixSocketm_Socket
 
UnixSocketm_Remote
 
String m_LocalPath
 
String m_RemotePath
 

Additional Inherited Members

- Protected Attributes inherited from NetworkSyscalls
int m_Domain
 
int m_Type
 
int m_Protocol
 
bool m_Blocking
 
FileDescriptorm_Fd
 

Detailed Description

Definition at line 188 of file net-syscalls.h.

Constructor & Destructor Documentation

UnixSocketSyscalls::~UnixSocketSyscalls ( )
virtual
Todo:
should shutdown() which should wake up recv() or poll()

Definition at line 1525 of file net-syscalls.cc.

Member Function Documentation

int UnixSocketSyscalls::bind ( const struct sockaddr *  address,
socklen_t  addrlen 
)
virtual
Todo:
unbind existing socket if one exists.
Todo:
re-bind an unnamed address if we are bound already
Todo:
does this actually create a findable file?
Todo:
errno?

Implements NetworkSyscalls.

Definition at line 1761 of file net-syscalls.cc.

References Directory::addEphemeralFile(), create(), String::endswith(), FileDescriptor::fd, VFS::find(), Directory::fromFile(), File::getFullPath(), File::getName(), VFS::instance(), File::isDirectory(), and FileDescriptor::networkImpl.

int UnixSocketSyscalls::connect ( const struct sockaddr *  address,
socklen_t  addrlen 
)
virtual
Todo:
wrong error

Implements NetworkSyscalls.

Definition at line 1547 of file net-syscalls.cc.

References VFS::find(), Network::getType(), VFS::instance(), and File::isSocket().

int UnixSocketSyscalls::listen ( int  backlog)
virtual
Todo:
bind to an unnamed socket if we aren't already bound

Implements NetworkSyscalls.

Definition at line 1747 of file net-syscalls.cc.

bool UnixSocketSyscalls::pairWith ( UnixSocketSyscalls other)

Pair two UnixSocketSyscalls objects such that the referenced sockets directly communicate with each other.

Definition at line 2067 of file net-syscalls.cc.

References Network::getType().

ssize_t UnixSocketSyscalls::recvfrom_msg ( struct msghdr *  msghdr)
virtual
Todo:
get info from the socket about things like truncated buffer
Todo:
except that it could be.. need to detect shutdown()

Implements NetworkSyscalls.

Definition at line 1700 of file net-syscalls.cc.

ssize_t UnixSocketSyscalls::sendto_msg ( const struct msghdr *  msghdr)
virtual
Todo:
this doesn't handle a connection going away - only a connection not being made in the first place (I think it's a different errno)
Todo:
errno
Todo:
needs some sort of errno here
Todo:
wrong error
Todo:
except that it could be.. need to detect shutdown()

Implements NetworkSyscalls.

Definition at line 1606 of file net-syscalls.cc.

References VFS::find(), Network::getType(), VFS::instance(), File::isSocket(), and File::write().

int UnixSocketSyscalls::shutdown ( int  how)
virtual
Todo:

Reimplemented from NetworkSyscalls.

Definition at line 1904 of file net-syscalls.cc.

References Dec, ERROR, and UnixSocket::select().


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