FreeNOS
Public Member Functions | Private Attributes
ICMPFactory Class Reference

Internet Control Message Protocol (ICMP) factory. More...

#include <ICMPFactory.h>

Inheritance diagram for ICMPFactory:
File

Public Member Functions

 ICMPFactory (const u32 inode, ICMP *icmp)
 Constructor. More...
 
virtual ~ICMPFactory ()
 Destructor. More...
 
virtual FileSystem::Result read (IOBuffer &buffer, Size &size, const Size offset)
 Create ICMP socket. 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 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...
 

Private Attributes

ICMPm_icmp
 ICMP protocol instance. More...
 

Additional Inherited Members

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

Detailed Description

Internet Control Message Protocol (ICMP) factory.

The ICMP factory creates new sockets for applications.

Definition at line 39 of file ICMPFactory.h.

Constructor & Destructor Documentation

◆ ICMPFactory()

ICMPFactory::ICMPFactory ( const u32  inode,
ICMP icmp 
)

Constructor.

Parameters
inodeInode number
icmpICMP object pointer

Definition at line 21 of file ICMPFactory.cpp.

References m_icmp.

◆ ~ICMPFactory()

ICMPFactory::~ICMPFactory ( )
virtual

Destructor.

Definition at line 28 of file ICMPFactory.cpp.

Member Function Documentation

◆ read()

FileSystem::Result ICMPFactory::read ( IOBuffer buffer,
Size size,
const Size  offset 
)
virtual

Create ICMP socket.

Parameters
bufferInput/Output buffer to output bytes to.
sizeMaximum number of bytes to read on input. On output, the actual number of bytes read.
offsetOffset inside the file to start reading.
Returns
Result code

Reimplemented from File.

Definition at line 32 of file ICMPFactory.cpp.

References ICMP::createSocket(), DEBUG, ERROR, ChannelMessage::from, IOBuffer::getMessage(), FileSystem::IOError, String::length(), m_icmp, FileSystem::Success, and IOBuffer::write().

Field Documentation

◆ m_icmp

ICMP* ICMPFactory::m_icmp
private

ICMP protocol instance.

Definition at line 74 of file ICMPFactory.h.

Referenced by ICMPFactory(), and read().


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