Main Page | Modules | Data Structures | File List | Data Fields

FPing Interface
[State Utility Library]


Data Structures

struct  sul_fping_t

Typedefs

typedef sul_fping_t sul_fping_t

Functions

 sul_fping_create (sul_fping_t **self, apr_pool_t *pool)
 sul_fping_spawn (sul_fping_t *self, const char *command)
 sul_fping_ping (sul_fping_t *self, const char *ip)
 sul_fping_get (sul_fping_t *self, char **identity, sul_boolean_t *alive, float *elapsed, apr_pool_t *pool)
 sul_fping_close (sul_fping_t *self, sul_boolean_t force)

Detailed Description

An fping interface for engaging in an interactive session with fping. First, an fping instance is spawned using the uproc system. Then, one or more IP's are written to fping's STDIN and then the stream is closed. As the pong's are received, the application gets them via successive calls to sul_fping_get until there are no more, and the session ends.

Typedef Documentation

typedef struct sul_fping_t sul_fping_t
 

An fping interface for engaging in a semi-interactive session with fping.


Function Documentation

sul_fping_close sul_fping_t self,
sul_boolean_t  force
 

Closes the fping interface, shutting down the fping executable.

Parameters:
self An fping interface.
force If true, then the fping executable will be forcefully killed.
Returns:
An sul_error_t instance if an error occured and NULL otherwise.

sul_fping_create sul_fping_t **  self,
apr_pool_t *  pool
 

Creates a new FPING interface. After this call, no fping process has been spawned yet, this happens in sul_fping_spawn.

Parameters:
self Pointer to receive the new fping interface.
pool A pool to allocate overhead from.
Returns:
An sul_error_t instance if an error occured and NULL otherwise.

sul_fping_get sul_fping_t self,
char **  identity,
sul_boolean_t alive,
float *  elapsed,
apr_pool_t *  pool
 

Gets a ping reply from fping. Once this function is called, on more addresses should be pinged via sul_fping_ping. Note that this function may also block while fping blocks for the ping replies itself.

Parameters:
self An fping interface.
identity String to receive the address of the ping reply. When fping is finished, this will be assigned NULL.
alive Flag indicating if the machine is alive or down.
elapsed Elapsed time of the ping, only available if -e is specified.
pool A pool to allocate overhead from.
Returns:
An sul_error_t instance if an error occured and NULL otherwise.

sul_fping_ping sul_fping_t self,
const char *  ip
 

Writes an IP to the fping interface for pinging. Please see the notes on the fping interface for the use of IP's and host names.

Parameters:
self An fping interface.
ip Address to be pinged.
Returns:
An sul_error_t instance if an error occured and NULL otherwise.

sul_fping_spawn sul_fping_t self,
const char *  command
 

Spawns the fping executable, and opens up stream for writing the IP's to be pinged and another stream for reading the returned pongs.

Parameters:
self An fping interface.
command Command to execute as the fping process. This should be the fping executable itself or one that behaves in the same way.
Returns:
An sul_error_t instance if an error occured and NULL otherwise.


Generated on Wed Apr 28 09:38:38 2004 for State by doxygen 1.3.5