|
suricata
|
The device storage API is a per-device storage. It is a mean to extend the LiveDevice structure with arbitrary data. More...
Functions | |
| SCLiveDevStorageId | SCLiveDevStorageRegister (const char *name, void(*Free)(void *)) |
| Register a LiveDevice storage. More... | |
| int | SCLiveDevSetStorageById (LiveDevice *d, SCLiveDevStorageId id, void *ptr) |
| Store a pointer in a given LiveDevice storage. More... | |
| void * | SCLiveDevGetStorageById (LiveDevice *d, SCLiveDevStorageId id) |
| Get a value from a given LiveDevice storage. More... | |
The device storage API is a per-device storage. It is a mean to extend the LiveDevice structure with arbitrary data.
You have first to register the storage via SCLiveDevStorageRegister() during the init of your module. Then you can attach data via SCLiveDevSetStorageById() and access them via SCLiveDevGetStorageById().
| void* SCLiveDevGetStorageById | ( | LiveDevice * | d, |
| SCLiveDevStorageId | id | ||
| ) |
Get a value from a given LiveDevice storage.
| d | a pointer to the LiveDevice |
| id | the id of the storage (return of SCLiveDevStorageRegister() call) |
Definition at line 87 of file device-storage.c.
References SCStorageGetById(), LiveDevice_::storage, and STORAGE_DEVICE.
Referenced by LiveDevAddBypassFail(), LiveDevAddBypassStats(), LiveDevAddBypassSuccess(), and LiveDevSubBypassStats().


| int SCLiveDevSetStorageById | ( | LiveDevice * | d, |
| SCLiveDevStorageId | id, | ||
| void * | ptr | ||
| ) |
Store a pointer in a given LiveDevice storage.
| d | a pointer to the LiveDevice |
| id | the id of the storage (return of SCHostStorageRegister() call) |
| ptr | pointer to the data to store |
Definition at line 74 of file device-storage.c.
References SCStorageSetById(), LiveDevice_::storage, and STORAGE_DEVICE.
Referenced by LiveDevUseBypass().


| SCLiveDevStorageId SCLiveDevStorageRegister | ( | const char * | name, |
| void(*)(void *) | Free | ||
| ) |
Register a LiveDevice 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 59 of file device-storage.c.
References LiveDevStorageId_::id, name, SCStorageRegister(), and STORAGE_DEVICE.
