|
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. | |
| virtual | ~NetworkSocket () |
| Destructor. | |
| ProcessID | getProcessID () const |
| Get owner ProcessID. | |
| virtual FileSystem::Result | process (const NetworkQueue::Packet *pkt)=0 |
| Process incoming network packet. | |
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. | |
| virtual | ~File () |
| Destructor function. | |
| u32 | getInode () const |
| Get inode number. | |
| FileSystem::FileType | getType () const |
| Retrieve our filetype. | |
| virtual FileSystem::Result | read (IOBuffer &buffer, Size &size, const Size offset) |
| Read bytes from the file. | |
| virtual FileSystem::Result | write (IOBuffer &buffer, Size &size, const Size offset) |
| Write bytes to the file. | |
| virtual FileSystem::Result | status (FileSystem::FileStat &st) |
| Retrieve file statistics. | |
| virtual bool | canRead () const |
| Check if the File has data ready for reading. | |
| virtual bool | canWrite () const |
| Check if the File can be written to. | |
Protected Attributes | |
| const ProcessID | m_pid |
| ProcessID which owns this socket. | |
| NetworkQueue | m_receive |
| Receive queue. | |
| NetworkQueue | m_transmit |
| Transmit queue. | |
| NetworkClient::SocketInfo | m_info |
| Socket connection. | |
Protected Attributes inherited from File | |
| const u32 | m_inode |
| Inode number. | |
| const FileSystem::FileType | m_type |
| Type of this file. | |
| UserID | m_uid |
| Owner of the file. | |
| GroupID | m_gid |
| Group of the file. | |
| FileSystem::FileModes | m_access |
| Access permissions. | |
| Size | m_size |
| Size of the file, in bytes. | |
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 ICMP::unregisterSockets(), and UDP::unregisterSockets().
|
pure virtual |
Process incoming network packet.
| pkt | Incoming packet pointer |
Implemented in ARPSocket, ICMPSocket, and UDPSocket.
|
protected |
Socket connection.
Definition at line 85 of file NetworkSocket.h.
Referenced by ICMPSocket::getAddress(), ICMPSocket::ICMPSocket(), NetworkSocket(), ICMPSocket::write(), and UDPSocket::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.