libexplain
1.4.D001
|
#include <libexplain/ac/errno.h>
#include <libexplain/ac/string.h>
#include <libexplain/buffer/errno/generic.h>
#include <libexplain/buffer/errno/gethostbyname.h>
#include <libexplain/buffer/gettext.h>
#include <libexplain/explanation.h>
Go to the source code of this file.
Data Structures | |
struct | label |
Defines | |
#define | ALLOW_UNDERSCORE 1 |
#define | ALLOW_LEADING_UNDERSCORE 1 |
#define | ALLOW_LEADING_HYPHEN 1 |
#define | ALLOW_LEADING_DIGIT 1 |
#define | ALLOW_ALL_NUMERIC 1 |
Typedefs | |
typedef struct label | label |
Functions | |
static void | explain_buffer_errno_gethostbyname_system_call (explain_string_buffer_t *sb, int errnum, const char *name) |
static int | valid_label (const label *lp) |
static label * | validate_hostname (const char *name) |
static int | check_valid_hostname (explain_string_buffer_t *sb, const char *name) |
void | explain_buffer_errno_gethostbyname_explanation (explain_string_buffer_t *sb, int errnum, const char *syscall_name, const char *name) |
void | explain_buffer_errno_gethostbyname (explain_string_buffer_t *sb, int errnum, const char *name) |
#define ALLOW_ALL_NUMERIC 1 |
Definition at line 46 of file gethostbyname.c.
#define ALLOW_LEADING_DIGIT 1 |
Definition at line 45 of file gethostbyname.c.
#define ALLOW_LEADING_HYPHEN 1 |
Definition at line 44 of file gethostbyname.c.
#define ALLOW_LEADING_UNDERSCORE 1 |
Definition at line 41 of file gethostbyname.c.
#define ALLOW_UNDERSCORE 1 |
Definition at line 40 of file gethostbyname.c.
Definition at line 49 of file gethostbyname.c.
static int check_valid_hostname | ( | explain_string_buffer_t * | sb, |
const char * | name | ||
) | [static] |
Definition at line 285 of file gethostbyname.c.
void explain_buffer_errno_gethostbyname | ( | explain_string_buffer_t * | sb, |
int | errnum, | ||
const char * | name | ||
) |
The explain_buffer_errno_gethostbyname function is used to obtain an explanation of an error returned by the gethostbyname(3) system call. The least the message will contain is the value of strerror(errnum)
, but usually it will do much better, and indicate the underlying cause in more detail.
sb | The string buffer to print the message into. If a suitable buffer is specified, this function is thread safe. |
errnum | The error value to be decoded, usually obtained from the errno global variable just before this function is called. This is necessary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. |
name | The original name, exactly as passed to the gethostbyname(3) system call. |
Definition at line 487 of file gethostbyname.c.
void explain_buffer_errno_gethostbyname_explanation | ( | explain_string_buffer_t * | sb, |
int | errnum, | ||
const char * | syscall_name, | ||
const char * | name | ||
) |
The explain_buffer_errno_gethostbyname_explanation function is used to obtain the explanation (the part after "because") of an error returned by the gethostbyname(3) system call (and similar).
sb | The string buffer to print the message into. If a suitable buffer is specified, this function is thread safe. |
errnum | The error value to be decoded, usually obtained from the errno global variable just before this function is called. This is necessary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. |
syscall_name | The name of the offending system call. |
name | The original name, exactly as passed to the gethostbyname(3) system call. |
Definition at line 355 of file gethostbyname.c.
static void explain_buffer_errno_gethostbyname_system_call | ( | explain_string_buffer_t * | sb, |
int | errnum, | ||
const char * | name | ||
) | [static] |
Definition at line 29 of file gethostbyname.c.
static int valid_label | ( | const label * | lp | ) | [static] |
The valid_label function is used to determien whether or not a hostname label is correctly formed.
lp | the label in question. |
Definition at line 68 of file gethostbyname.c.
static label* validate_hostname | ( | const char * | name | ) | [static] |
The validate_hostname function is used to check a hostname.
name | The hostname to be checked. |
Definition at line 204 of file gethostbyname.c.