libexplain
1.4.D001
|
Go to the source code of this file.
Data Structures | |
struct | explain_iocontrol_t |
Defines | |
#define | NOT_A_POINTER (unsigned)(-1) |
#define | VOID_STAR (unsigned)(-2) |
#define | IOCONTROL_FLAG_SIZE_DOES_NOT_AGREE 0x0001 |
#define | IOCONTROL_FLAG_NON_META 0x0002 |
#define | IOCONTROL_FLAG_RW 0x0004 |
#define | DISAMBIGUATE_USE 0 |
#define | DISAMBIGUATE_DO_NOT_USE -1 |
Typedefs | |
typedef struct explain_iocontrol_t | explain_iocontrol_t |
typedef void(* | expain_iocontrol_print_func_t )(const explain_iocontrol_t *p, struct explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data) |
Functions | |
const explain_iocontrol_t * | explain_iocontrol_find_by_number (int fildes, int request, const void *data) |
const explain_iocontrol_t * | explain_iocontrol_request_by_name (const char *name) |
void | explain_iocontrol_print_name (const explain_iocontrol_t *p, struct explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data) |
void | explain_iocontrol_print_data (const explain_iocontrol_t *p, struct explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data) |
void | explain_iocontrol_print_explanation (const explain_iocontrol_t *p, struct explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data) |
int | explain_parse_ioctl_request_or_die (const char *text) |
void | explain_iocontrol_statistics (int *total, int *active) |
void | explain_iocontrol_check_conflicts (void) |
int | explain_iocontrol_disambiguate_true (int fildes, int request, const void *data) |
int | explain_iocontrol_disambiguate_false (int fildes, int request, const void *data) |
int | explain_iocontrol_disambiguate_is_a_socket (int fildes, int request, const void *data) |
int | explain_iocontrol_disambiguate_is_not_a_socket (int fildes, int request, const void *data) |
int | explain_iocontrol_disambiguate_is_if_eql (int fildes, int request, const void *data) |
int | explain_iocontrol_disambiguate_is_v4l2 (int fildes, int request, const void *data) |
int | explain_iocontrol_disambiguate_scc (int fildes, int request, const void *data) |
int | explain_iocontrol_disambiguate_net_dev_name (int fildes, const char *name) |
#define DISAMBIGUATE_DO_NOT_USE -1 |
The DISAMBIGUATE_DO_NOT_USE symbol is used to indicate that a disambiguate function returns a negative result, the iocontrol entry shall not be used.
Definition at line 435 of file iocontrol.h.
#define DISAMBIGUATE_USE 0 |
The DISAMBIGUATE_USE symbol is used to indicate that a disambiguate function returns an OK result, the iocontrol entry can be used.
Definition at line 428 of file iocontrol.h.
#define IOCONTROL_FLAG_NON_META 0x0002 |
The IOCONTROL_FLAG_NON_META flag value indicates that the request is just a random number, and was not defined using the _IOC(a,b,c) macro, and thus it contains no useful meta-data for checking size and direction.
Definition at line 416 of file iocontrol.h.
#define IOCONTROL_FLAG_RW 0x0004 |
The IOCONTROL_FLAG_RW flag is used to indicate that _IOR() is actually _IORW() in behaviour.
Definition at line 422 of file iocontrol.h.
#define IOCONTROL_FLAG_SIZE_DOES_NOT_AGREE 0x0001 |
The IOCONTROL_FLAG_SIZE_DOES_NOT_AGREE flag value indicares the the size in the define from IOC(a,b,c) does not correspond to the actual data type used in the kernel.
Definition at line 408 of file iocontrol.h.
#define NOT_A_POINTER (unsigned)(-1) |
The NOT_A_POINTER value is assigned to an iocontrol::data_size member to indicate that a given ioctl does not take a pointer argument.
Definition at line 399 of file iocontrol.h.
#define VOID_STAR (unsigned)(-2) |
Definition at line 401 of file iocontrol.h.
typedef void(* expain_iocontrol_print_func_t)(const explain_iocontrol_t *p, struct explain_string_buffer_t *sb, int errnum, int fildes, int request, const void *data) |
The expain_iocontrol_print_func_t type is used to represent a pointer to a function that prints somethign related to an ioctl request.
p | Pointer to the explain_iocontrol_t instance, rather like "this" in C++ code. |
sb | The string buffer to print into. |
errnum | The error number that caused all this, obtained from the global errno variable, possibly indirectly. |
fildes | The original fildes, exactly as passed to the ioctl(2) system call. |
request | The original request, exactly as passed to the ioctl(2) system call. |
data | The original data, exactly as passed to the ioctl(2) system call. |
Definition at line 46 of file iocontrol.h.
typedef struct explain_iocontrol_t explain_iocontrol_t |
Definition at line 24 of file iocontrol.h.
void explain_iocontrol_check_conflicts | ( | void | ) |
The explain_iocontrol_check_conflicts function is sued to verify that there are no un-expected ioctl request number conflicts. (Expected conflicts have disambiguate functions defined.)
Definition at line 64 of file check_conflicts.c.
int explain_iocontrol_disambiguate_false | ( | int | fildes, |
int | request, | ||
const void * | data | ||
) |
int explain_iocontrol_disambiguate_is_a_socket | ( | int | fildes, |
int | request, | ||
const void * | data | ||
) |
For use by individual ioctl handlers, a disambiguation that reports success (0) for sockets, and failure (-1) otherwise.
Definition at line 27 of file is_a_socket.c.
int explain_iocontrol_disambiguate_is_if_eql | ( | int | fildes, |
int | request, | ||
const void * | data | ||
) |
int explain_iocontrol_disambiguate_is_not_a_socket | ( | int | fildes, |
int | request, | ||
const void * | data | ||
) |
For use by individual ioctl handlers, a disambiguation that reports failure (-1) for sockets, and success (0) otherwise.
Definition at line 27 of file is_not_a_socket.c.
int explain_iocontrol_disambiguate_is_v4l2 | ( | int | fildes, |
int | request, | ||
const void * | data | ||
) |
int explain_iocontrol_disambiguate_net_dev_name | ( | int | fildes, |
const char * | name | ||
) |
The explain_iocontrol_disambiguate_net_dev_name helper function is used to decide whether or not a file descriptor is associated with a network device of the given name.
fildes | The file descriptor if interest |
name | The name of the network device of interest. The actual network device could also have an optional trailing number (e.g. name="eth" will also match "eth0"). |
Definition at line 30 of file net_dev_name.c.
int explain_iocontrol_disambiguate_scc | ( | int | fildes, |
int | request, | ||
const void * | data | ||
) |
The explain_iocontrol_disambiguate_scc function is used to test for a Z8530 SCC device, i.e. "scc" network devices.
fildes | The file descriptor to test, |
request | probably not relevant |
data | probably not relevant |
int explain_iocontrol_disambiguate_true | ( | int | fildes, |
int | request, | ||
const void * | data | ||
) |
const explain_iocontrol_t* explain_iocontrol_find_by_number | ( | int | fildes, |
int | request, | ||
const void * | data | ||
) |
The explain_iocontrol_find_by_number function may be used to locate an ioctl by number. A few ioctl(2) calls are ambiguous, so the more information you can give the better.
fildes | The file descriptor the ioctl(2) call is made against |
request | The request passed to the ioctl(2) system call. |
data | The data passed to the ioctl(2) system call. |
Definition at line 26 of file request_by_number.c.
void explain_iocontrol_print_data | ( | const explain_iocontrol_t * | p, |
struct explain_string_buffer_t * | sb, | ||
int | errnum, | ||
int | fildes, | ||
int | request, | ||
const void * | data | ||
) |
The explain_iocontrol_print_data function is used to print a representation of the data argument passed to an ioctl(2) system call.
p | Pointer to the explain_iocontrol_t instance, rather like "this" in C++ code. |
sb | The string buffer to print into. |
errnum | The error number that caused all this, obtained from the global errno variable, possibly indirectly. |
fildes | The original fildes, exactly as passed to the ioctl(2) system call. |
request | The original request, exactly as passed to the ioctl(2) system call. |
data | The original data, exactly as passed to the ioctl(2) system call. |
Definition at line 28 of file print_data.c.
void explain_iocontrol_print_explanation | ( | const explain_iocontrol_t * | p, |
struct explain_string_buffer_t * | sb, | ||
int | errnum, | ||
int | fildes, | ||
int | request, | ||
const void * | data | ||
) |
The explain_iocontrol_print_explanation function is used to print an explanation for an error reported by an ioctl(2) system call.
p | Pointer to the explain_iocontrol_t instance, rather like "this" in C++ code. |
sb | The string buffer to print into. |
errnum | The error number that caused all this, obtained from the global errno variable, possibly indirectly. |
fildes | The original fildes, exactly as passed to the ioctl(2) system call. |
request | The original request, exactly as passed to the ioctl(2) system call. |
data | The original data, exactly as passed to the ioctl(2) system call. |
Definition at line 26 of file print_explanation.c.
void explain_iocontrol_print_name | ( | const explain_iocontrol_t * | p, |
struct explain_string_buffer_t * | sb, | ||
int | errnum, | ||
int | fildes, | ||
int | request, | ||
const void * | data | ||
) |
The explain_iocontrol_print_name function is used to print the name of a request argument passed to an ioctl(2) system call.
p | Pointer to the explain_iocontrol_t instance, rather like "this" in C++ code. |
sb | The string buffer to print into. |
errnum | The error number that caused all this, obtained from the global errno variable, possibly indirectly. |
fildes | The original fildes, exactly as passed to the ioctl(2) system call. |
request | The original request, exactly as passed to the ioctl(2) system call. |
data | The original data, exactly as passed to the ioctl(2) system call. |
Definition at line 28 of file print_name.c.
const explain_iocontrol_t* explain_iocontrol_request_by_name | ( | const char * | name | ) |
The explain_iocontrol_request_by_name function may be used to locate an ioctl by name.
name | The name of the ioctl(2) request. |
Definition at line 27 of file request_by_name.c.
void explain_iocontrol_statistics | ( | int * | total, |
int * | active | ||
) |
The explain_iocontrol_statistics function is used to obtaion statistics about the ioctl commands supported by libexplain.
total | The total number of ioctls understood by libexplain. |
active | The number of ioctls relevant to this system. assert(active <= total) |
Definition at line 25 of file statistics.c.
int explain_parse_ioctl_request_or_die | ( | const char * | text | ) |
The explain_parse_ioctl_request_or_die function is used to parse a text string to produce an ioctl(2) request value.
text | The text string to be parsed. |
Definition at line 28 of file parse_request_or_die.c.