Data Structures | |
struct | vc_err_listparser |
Information about parsing errors. More... | |
Functions | |
size_t | vc_get_nb_ipv4root () VC_ATTR_CONST |
Returns the value of NB_IPV4ROOT.
This function returns the value of NB_IPV4ROOT which was used when the library was built, but not the value which is used by the currently running kernel. | |
bool | vc_parseLimit (char const *str, vc_limit_t *res) |
Parses a string describing a limit
This function parses str and interprets special words like
| |
uint_least64_t | vc_text2bcap (char const *str, size_t len) |
Converts a single string into bcapability. | |
char const * | vc_lobcap2text (uint_least64_t *val) |
Converts the lowest bit of a bcapability or the entire value (when possible) to a textual representation. | |
int | vc_list2bcap (char const *str, size_t len, struct vc_err_listparser *err, struct vc_ctx_caps *cap) |
Converts a string into a bcapability-bitmask |
int vc_list2bcap | ( | char const * | str, | |
size_t | len, | |||
struct vc_err_listparser * | err, | |||
struct vc_ctx_caps * | cap | |||
) |
Converts a string into a bcapability-bitmask
Syntax of str:.
LIST <- ELEM | ELEM ',' LIST ELEM <- '~' ELEM | MASK | NAME MASK <- NUMBER | '^' NUMBER NUMBER <- 0[0-7]* | [1-9][0-9]* | 0x[0-9,a-f]+ NAME <- <literal name> | "all" | "any" | "none"
When the `~'
prefix is used, the bits will be unset and a `~' after another `~' will cancel both ones. The `^'
prefix specifies a bitnumber instead of a bitmask.
"literal name" is everything which will be accepted by the vc_text2bcap() function. The special values for NAME
will be recognized case insensitively
str | The string to be parsed | |
len | The length of the string, or 0 for automatic detection | |
err | Pointer to a structure for error-information, or NULL . | |
cap | Pointer to a vc_ctx_caps structure holding the results; only the bcaps and bmask fields will be changed and already set values will not be honored. When an error occured, cap will have the value of all processed valid BCAP parts. |
char const* vc_lobcap2text | ( | uint_least64_t * | val | ) |
Converts the lowest bit of a bcapability or the entire value (when possible) to a textual representation.
val | The string to be converted; on success, the detected bit(s) will be unset, in errorcase only the lowest set bit |
NULL
in errorcase. !=
0 <-->
*valold > *valnew
*valold ==
0 --->
result == 0
bool vc_parseLimit | ( | char const * | str, | |
vc_limit_t * | res | |||
) |
Parses a string describing a limit
This function parses str and interprets special words like "inf"
or suffixes. Valid suffixes are
k
... 1000m
... 1000000K
... 1024M
... 1048576.
str | The string which shall be parsed | |
res | Will be filled with the interpreted value; in errorcase, this value is undefined. |
uint_least64_t vc_text2bcap | ( | char const * | str, | |
size_t | len | |||
) |
Converts a single string into bcapability.
str | The string to be parsed; both "CAP_xxx" and "xxx" will be accepted | |
len | The length of the string, or 0 for automatic detection |