FreeNOS
|
Address Resolution Protocol (ARP) socket. More...
#include <ARPSocket.h>
Public Member Functions | |
ARPSocket (const u32 inode, ARP *arp) | |
Constructor. More... | |
virtual | ~ARPSocket () |
Destructor. More... | |
virtual FileSystem::Result | read (IOBuffer &buffer, Size &size, const Size offset) |
Receive ARP response. More... | |
virtual FileSystem::Result | write (IOBuffer &buffer, Size &size, const Size offset) |
Send ARP request. More... | |
virtual FileSystem::Result | process (const NetworkQueue::Packet *pkt) |
Process incoming network packet. More... | |
Public Member Functions inherited from NetworkSocket | |
NetworkSocket (const u32 inode, const Size packetSize, const ProcessID pid) | |
Constructor. More... | |
virtual | ~NetworkSocket () |
Destructor. More... | |
ProcessID | getProcessID () const |
Get owner ProcessID. 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 | 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... | |
Private Attributes | |
ARP * | m_arp |
ARP protocol instance. More... | |
IPV4::Address | m_ipAddr |
IPV4 address for request. More... | |
Ethernet::Address | m_ethAddr |
Ethernet address for reply. More... | |
Additional Inherited Members | |
Protected Attributes inherited from NetworkSocket | |
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... | |
Address Resolution Protocol (ARP) socket.
ARP sockets receive a copy of ARP reply packets.
Definition at line 40 of file ARPSocket.h.
Constructor.
inode | Inode number |
arp | ARP object pointer |
Definition at line 24 of file ARPSocket.cpp.
References m_arp, m_ethAddr, m_ipAddr, and MemoryBlock::set().
|
virtual |
Destructor.
Definition at line 33 of file ARPSocket.cpp.
|
virtual |
Process incoming network packet.
pkt | Incoming packet pointer |
Implements NetworkSocket.
Definition at line 85 of file ARPSocket.cpp.
References DEBUG, and FileSystem::Success.
Referenced by ARP::process().
|
virtual |
Receive ARP response.
buffer | Input/Output buffer to output bytes to. |
size | Maximum number of bytes to read on input. On output, the actual number of bytes read. |
offset | Offset inside the file to start reading. |
Reimplemented from File.
Definition at line 37 of file ARPSocket.cpp.
References DEBUG, FileSystem::InvalidArgument, ARP::lookupAddress(), m_arp, m_ethAddr, m_ipAddr, FileSystem::Success, and IOBuffer::write().
|
virtual |
Send ARP request.
buffer | Input/Output buffer to input bytes from. |
size | Maximum number of bytes to write on input. On output, the actual number of bytes written. |
offset | Offset inside the file to start writing. |
Reimplemented from File.
Definition at line 65 of file ARPSocket.cpp.
References DEBUG, ARP::lookupAddress(), m_arp, m_ethAddr, m_ipAddr, IOBuffer::read(), and FileSystem::Success.
|
private |
ARP protocol instance.
Definition at line 98 of file ARPSocket.h.
Referenced by ARPSocket(), read(), and write().
|
private |
Ethernet address for reply.
Definition at line 104 of file ARPSocket.h.
Referenced by ARPSocket(), read(), and write().
|
private |
IPV4 address for request.
Definition at line 101 of file ARPSocket.h.
Referenced by ARPSocket(), read(), and write().