|
suricata
|
The Host storage API is a per-host storage. It is a mean to extend the Host structure with arbitrary data. More...
Functions | |
| SCHostStorageId | SCHostStorageRegister (const char *name, void(*Free)(void *)) |
| Register a Host storage. More... | |
| int | SCHostSetStorageById (Host *h, SCHostStorageId id, void *ptr) |
| Store a pointer in a given Host storage. More... | |
| void * | SCHostGetStorageById (Host *h, SCHostStorageId id) |
| Get a value from a given Host storage. More... | |
The Host storage API is a per-host storage. It is a mean to extend the Host structure with arbitrary data.
You have first to register the storage via SCHostStorageRegister() during the init of your module. Then you can attach data via SCHostSetStorageById() and access them via SCHostGetStorageById().
| void* SCHostGetStorageById | ( | Host * | h, |
| SCHostStorageId | id | ||
| ) |
Get a value from a given Host storage.
| h | a pointer to the Host |
| id | the id of the storage (return of SCHostStorageRegister() call) |
Definition at line 85 of file host-storage.c.
References SCStorageGetById(), Host_::storage, and STORAGE_HOST.
Referenced by HostBitList(), HostBitsTimedoutCheck(), HostHasHostBits(), TagHashAddTag(), TagHostHasTag(), and TagTimeoutCheck().


| int SCHostSetStorageById | ( | Host * | h, |
| SCHostStorageId | id, | ||
| void * | ptr | ||
| ) |
Store a pointer in a given Host storage.
| h | a pointer to the Host |
| id | the id of the storage (return of SCHostStorageRegister() call) |
| ptr | pointer to the data to store |
Definition at line 72 of file host-storage.c.
References SCStorageSetById(), Host_::storage, and STORAGE_HOST.

| SCHostStorageId SCHostStorageRegister | ( | const char * | name, |
| void(*)(void *) | Free | ||
| ) |
Register a Host storage.
| name | the name of the storage |
| Free | free function for the new storage |
| The | ID of the newly register storage that will be used to access data |
It has to be called once during the init of the sub system
Definition at line 57 of file host-storage.c.
References HostStorageId_::id, name, SCStorageRegister(), and STORAGE_HOST.
