![]() |
EpiRootkit
By STDBOOL
|
#include <linux/list.h>#include <linux/spinlock.h>#include <linux/types.h>Go to the source code of this file.
Classes | |
| struct | ulist_item |
| struct | ulist |
Functions | |
| static void | ulist_init (struct ulist *ul, const char *fname) |
| void | ulist_clear (struct ulist *ul) |
| int | ulist_contains (struct ulist *ul, const char *value) |
| int | ulist_load (struct ulist *ul) |
| int | ulist_save (struct ulist *ul) |
| int | ulist_add (struct ulist *ul, const char *value, u32 flags, const char *payload) |
| int | ulist_remove (struct ulist *ul, const char *value) |
| int | ulist_list (struct ulist *ul, char *buf, size_t buf_size) |
| int ulist_add | ( | struct ulist * | ul, |
| const char * | value, | ||
| u32 | flags, | ||
| const char * | payload | ||
| ) |
ulist_add - Adds a new item to the ulist.
| ul | Pointer to the ulist structure. |
| value | The string value to add. |
| flags | Flags associated with the item. |
| payload | Optional payload string (can be NULL). |
Returns 0 on success, -EEXIST if the item already exists, or -ENOMEM on memory allocation failure.
| void ulist_clear | ( | struct ulist * | ul | ) |
ulist_clear - Removes and frees all items from a ulist.
| ul | Pointer to the ulist structure to clear. |
| int ulist_contains | ( | struct ulist * | ul, |
| const char * | value | ||
| ) |
ulist_contains - Checks if a value exists in the ulist.
| ul | Pointer to the ulist structure. |
| value | The string value to check for. |
Returns 1 if the value is found, 0 otherwise.
|
inlinestatic |
| int ulist_list | ( | struct ulist * | ul, |
| char * | buf, | ||
| size_t | buf_size | ||
| ) |
ulist_list - Lists all items in the ulist into a buffer.
| ul | Pointer to the ulist structure. |
| buf | Buffer to store the list of items. |
| buf_size | Size of the buffer. |
Returns the number of bytes written to the buffer, or a negative error code on failure. The format is "value|flags|payload\n" for each item.
Definition at line 282 of file ulist.c.
| int ulist_load | ( | struct ulist * | ul | ) |
ulist_init - Initializes a ulist structure.
| ul | Pointer to the ulist structure to initialize. |
Initializes the ulist structure, setting up the lock and list head, and storing the filename for later use in loading/saving.
Definition at line 58 of file ulist.c.
| int ulist_remove | ( | struct ulist * | ul, |
| const char * | value | ||
| ) |
ulist_remove - Removes an item from the ulist by value.
| ul | Pointer to the ulist structure. |
| value | The string value to remove. |
Returns 0 on success, or -ENOENT if the item was not found.
| int ulist_save | ( | struct ulist * | ul | ) |
ulist_init - Initializes a ulist structure.
| ul | Pointer to the ulist structure to initialize. |
Initializes the ulist structure, setting up the lock and list head, and storing the filename for later use in loading/saving.
Definition at line 169 of file ulist.c.