util.h File Reference
Misc utility functions.
More...
Go to the source code of this file.
|
Defines |
#define | STATUS_BUF_SIZ 16384 |
#define | LOCK_GHBN() |
#define | UNLOCK_GHBN() |
Functions |
int | execute (char *cmd_line, int quiet) |
| Execute a shell command.
|
struct in_addr * | wd_gethostbyname (const char *name) |
char * | get_iface_ip (const char *ifname) |
char * | get_iface_mac (const 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 () |
Detailed Description
Misc utility functions.
- Author:
- Copyright (C) 2004 Philippe April <papril777@yahoo.com>
Definition in file util.h.
Define Documentation
Value:
do { \
debug(LOG_DEBUG, "Locking wd_gethostbyname()"); \
pthread_mutex_lock(&ghbn_mutex); \
debug(LOG_DEBUG, "wd_gethostbyname() locked"); \
} while (0)
Definition at line 65 of file util.h.
Value:
do { \
debug(LOG_DEBUG, "Unlocking wd_gethostbyname()"); \
pthread_mutex_unlock(&ghbn_mutex); \
debug(LOG_DEBUG, "wd_gethostbyname() unlocked"); \
} while (0)
Definition at line 71 of file util.h.
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 97 of file util.c.
References debug.