util.c File Reference

Misc utility functions. More...

Go to the source code of this file.

Defines

#define _GNU_SOURCE

Functions

int execute (char *cmd_line, int quiet)
 Execute a shell command.
struct in_addr * wd_gethostbyname (const char *name)
char * get_iface_ip (char *ifname)
char * get_iface_mac (char *ifname)
char * get_ext_iface (void)
void mark_online ()
void mark_offline ()
int is_online ()
void mark_auth_online ()
void mark_auth_offline ()
int is_auth_online ()
char * get_status_text ()

Variables

static pthread_mutex_t ghbn_mutex = PTHREAD_MUTEX_INITIALIZER
time_t started_time
pthread_mutex_t client_list_mutex
pthread_mutex_t config_mutex
pid_t restart_orig_pid
static time_t last_online_time = 0
static time_t last_offline_time = 0
static time_t last_auth_online_time = 0
static time_t last_auth_offline_time = 0
long served_this_session = 0


Detailed Description

Misc utility functions.

Author:
Copyright (C) 2004 Philippe April <papril777@yahoo.com>

Copyright (C) 2006 Benoit Grégoire <bock@step.polymtl.ca>

Definition in file util.c.


Function Documentation

int execute ( char *  cmd_line,
int  quiet 
)

Execute a shell command.

Fork a child and execute a shell command, the parent process waits for the child to return and returns the child's exit() value.

Returns:
Return code of the command

Definition at line 96 of file util.c.


Variable Documentation

pthread_mutex_t client_list_mutex

Global mutex to protect access to the client list

Definition at line 48 of file client_list.c.

pthread_mutex_t config_mutex

Mutex for the configuration file, used by the auth_servers related functions.

Definition at line 56 of file conf.c.


Generated on Sun Apr 13 21:55:01 2008 for WifiDog by  doxygen 1.5.3