FreeNOS
|
Network socket represents a single logical connection on a protocol. More...
#include <NetworkSocket.h>
Public Member Functions | |
NetworkSocket (const u32 inode, const Size packetSize, const ProcessID pid) | |
Constructor. More... | |
virtual | ~NetworkSocket () |
Destructor. More... | |
ProcessID | getProcessID () const |
Get owner ProcessID. More... | |
virtual FileSystem::Result | process (const NetworkQueue::Packet *pkt)=0 |
Process incoming network packet. More... | |
Public Member Functions inherited from File | |
File (const u32 inode, const FileSystem::FileType type=FileSystem::RegularFile, const UserID uid=ZERO, const GroupID gid=ZERO) | |
Constructor function. More... | |
virtual | ~File () |
Destructor function. More... | |
u32 | getInode () const |
Get inode number. More... | |
FileSystem::FileType | getType () const |
Retrieve our filetype. More... | |
virtual FileSystem::Result | read (IOBuffer &buffer, Size &size, const Size offset) |
Read bytes from the file. More... | |
virtual FileSystem::Result | write (IOBuffer &buffer, Size &size, const Size offset) |
Write bytes to the file. More... | |
virtual FileSystem::Result | status (FileSystem::FileStat &st) |
Retrieve file statistics. More... | |
virtual bool | canRead () const |
Check if the File has data ready for reading. More... | |
virtual bool | canWrite () const |
Check if the File can be written to. More... | |
Protected Attributes | |
const ProcessID | m_pid |
ProcessID which owns this socket. More... | |
NetworkQueue | m_receive |
Receive queue. More... | |
NetworkQueue | m_transmit |
Transmit queue. More... | |
NetworkClient::SocketInfo | m_info |
Socket connection. More... | |
Protected Attributes inherited from File | |
const u32 | m_inode |
Inode number. More... | |
const FileSystem::FileType | m_type |
Type of this file. More... | |
UserID | m_uid |
Owner of the file. More... | |
GroupID | m_gid |
Group of the file. More... | |
FileSystem::FileModes | m_access |
Access permissions. More... | |
Size | m_size |
Size of the file, in bytes. More... | |
Network socket represents a single logical connection on a protocol.
Definition at line 37 of file NetworkSocket.h.
Constructor.
inode | Inode number |
packetSize | Size of each network packet |
pid | ProcessID which owns this socket |
Definition at line 21 of file NetworkSocket.cpp.
References m_info, and MemoryBlock::set().
|
virtual |
Destructor.
Definition at line 32 of file NetworkSocket.cpp.
ProcessID NetworkSocket::getProcessID | ( | ) | const |
Get owner ProcessID.
Definition at line 36 of file NetworkSocket.cpp.
References m_pid.
Referenced by UDP::unregisterSockets(), and ICMP::unregisterSockets().
|
pure virtual |
Process incoming network packet.
pkt | Incoming packet pointer |
Implemented in UDPSocket, ICMPSocket, and ARPSocket.
|
protected |
Socket connection.
Definition at line 85 of file NetworkSocket.h.
Referenced by ICMPSocket::getAddress(), ICMPSocket::ICMPSocket(), NetworkSocket(), UDPSocket::write(), and ICMPSocket::write().
|
protected |
ProcessID which owns this socket.
Definition at line 76 of file NetworkSocket.h.
Referenced by getProcessID().
|
protected |
Receive queue.
Definition at line 79 of file NetworkSocket.h.
|
protected |
Transmit queue.
Definition at line 82 of file NetworkSocket.h.