FreeNOS
Public Member Functions | Private Member Functions
NetPing Class Reference

Network ping/pong application. More...

#include <NetPing.h>

Inheritance diagram for NetPing:
POSIXApplication Application

Public Member Functions

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

Private Member Functions

Result arpPing (const char *dev, const char *host)
 Send ARP ping/pong. More...
 
Result icmpPing (const char *dev, const char *host)
 Send ICMP ping/pong. More...
 

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. More...
 
int runProgram (const char *path, const char **argv)
 Runs an external program. More...
 
- Protected Member Functions inherited from Application
virtual Result initialize ()
 Initialize the application. More...
 
virtual Result output (String &string) const
 Print string to output. More...
 
ArgumentParserparser ()
 Get program arguments parser. More...
 
const ArgumentParserparser () const
 Get constant program arguments parser. More...
 
const ArgumentContainerarguments () const
 Get program arguments. More...
 
void setVersion (const String &version)
 Set program version. More...
 
- Protected Attributes inherited from Application
int m_argc
 Input argument count. More...
 
char ** m_argv
 Input argument values. More...
 

Detailed Description

Network ping/pong application.

Definition at line 33 of file NetPing.h.

Constructor & Destructor Documentation

◆ NetPing()

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

◆ ~NetPing()

NetPing::~NetPing ( )
virtual

Class destructor.

Definition at line 41 of file NetPing.cpp.

Member Function Documentation

◆ arpPing()

NetPing::Result NetPing::arpPing ( const char *  dev,
const char *  host 
)
private

◆ exec()

NetPing::Result NetPing::exec ( )
virtual

Execute the application event loop.

Implements Application.

Definition at line 45 of file NetPing.cpp.

References Application::arguments(), arpPing(), DEBUG, ArgumentContainer::get(), and icmpPing().

◆ icmpPing()

NetPing::Result NetPing::icmpPing ( const char *  dev,
const char *  host 
)
private

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