FreeNOS
Public Member Functions | Private Member Functions
NetCtl Class Reference

Network interface control application. More...

#include <NetCtl.h>

Inheritance diagram for NetCtl:
POSIXApplication Application

Public Member Functions

 NetCtl (int argc, char **argv)
 Class constructor.
 
virtual ~NetCtl ()
 Class destructor.
 
virtual Result initialize ()
 Initialize the application.
 
virtual Result exec ()
 Execute the application event loop.
 
- Public Member Functions inherited from POSIXApplication
 POSIXApplication (int argc, char **argv)
 Class constructor.
 
virtual ~POSIXApplication ()
 Class destructor.
 
- Public Member Functions inherited from Application
 Application (int argc, char **argv)
 Class constructor.
 
virtual ~Application ()
 Class destructor.
 
virtual int run ()
 Run the application.
 

Private Member Functions

Result showDevice (const char *deviceName)
 Output device information.
 

Additional Inherited Members

- Public Types inherited from Application
enum  Result {
  Success , NotFound , IOError , InvalidArgument ,
  ShowUsage , TimedOut , OutOfMemory
}
 Result codes. More...
 
- Protected Member Functions inherited from POSIXApplication
virtual Result output (const char *string) const
 Print text to output.
 
int runProgram (const char *path, const char **argv)
 Runs an external program.
 
- Protected Member Functions inherited from Application
virtual Result output (String &string) const
 Print string to output.
 
ArgumentParser & parser ()
 Get program arguments parser.
 
const ArgumentParser & parser () const
 Get constant program arguments parser.
 
const ArgumentContainer & arguments () const
 Get program arguments.
 
void setVersion (const String &version)
 Set program version.
 
- Protected Attributes inherited from Application
int m_argc
 Input argument count.
 
char ** m_argv
 Input argument values.
 

Detailed Description

Network interface control application.

Definition at line 33 of file NetCtl.h.

Constructor & Destructor Documentation

◆ NetCtl()

NetCtl::NetCtl ( int  argc,
char **  argv 
)

Class constructor.

Definition at line 33 of file NetCtl.cpp.

References Application::parser(), ArgumentParser::registerPositional(), and ArgumentParser::setDescription().

◆ ~NetCtl()

NetCtl::~NetCtl ( )
virtual

Class destructor.

Definition at line 40 of file NetCtl.cpp.

Member Function Documentation

◆ exec()

NetCtl::Result NetCtl::exec ( )
virtual

Execute the application event loop.

Implements Application.

Definition at line 50 of file NetCtl.cpp.

References DEBUG, FileSystemClient::getFileSystems(), showDevice(), strncmp(), and Application::Success.

◆ initialize()

NetCtl::Result NetCtl::initialize ( )
virtual

Initialize the application.

Reimplemented from Application.

Definition at line 44 of file NetCtl.cpp.

References DEBUG, and Application::Success.

◆ showDevice()

NetCtl::Result NetCtl::showDevice ( const char *  deviceName)
private

Output device information.

Parameters
deviceNameName of the network device
Returns
Result code

Definition at line 72 of file NetCtl.cpp.

References ALIGN, close(), DEBUG, O_RDONLY, open(), printf(), read(), Application::Success, Ethernet::toString(), and IPV4::toString().

Referenced by exec().


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