enum LND_FilterRegObserverOp; void (*LND_FilterRegFunc) (LND_Filter *filter, void *user_data); void libnd_filter_registry_init (void); void libnd_filter_registry_add (LND_Filter *filter); void libnd_filter_registry_del (LND_Filter *filter); void libnd_filter_registry_foreach (LND_FilterRegFunc callback, void *user_data); LND_FilterRegObserver* libnd_filter_registry_observer_new (void); void libnd_filter_registry_observer_free (LND_FilterRegObserver *ob); void libnd_filter_registry_add_observer (LND_FilterRegObserver *ob); void libnd_filter_registry_del_observer (LND_FilterRegObserver *ob); void libnd_filter_registry_tell_observers (LND_Filter *filter, LND_FilterRegObserverOp op); |
typedef enum { LND_FILTER_ADDED = (1 << 0), LND_FILTER_DELETED = (1 << 1) } LND_FilterRegObserverOp; |
void (*LND_FilterRegFunc) (LND_Filter *filter, void *user_data); |
This is the signature for callbacks passed to
libnd_filter_registry_foreach()
.
filter passed in.
user data.
void libnd_filter_registry_init (void); |
The filter registry is Netdude's central repository for currently known packet filters. These can be implemented in any way desired, the typical example is a BPF filter. This function sets up the necessary data structures and is called when the library is initialized.
void libnd_filter_registry_add (LND_Filter *filter); |
In order to register a filter in the registry, use this function. It checks if the filter is already registered and in that case, simply returns.
the added filter.
void libnd_filter_registry_del (LND_Filter *filter); |
Removes a filter from the registry.
filter to remove.
void libnd_filter_registry_foreach (LND_FilterRegFunc callback, void *user_data); |
The function calls callback for every trace currently registered and passes it as first argument. The second argument is the user data, which is simply passed through.
a function of type LND_FilterRegFunc
arbitrary data passed through to the callback
LND_FilterRegObserver* libnd_filter_registry_observer_new (void); |
void libnd_filter_registry_observer_free (LND_FilterRegObserver *ob); |
The function releases all memory associated with ob.
observer to delete.
void libnd_filter_registry_add_observer (LND_FilterRegObserver *ob); |
The function registers the new observer for notifications about future changes to the filter registry.
new observer to register.
void libnd_filter_registry_del_observer (LND_FilterRegObserver *ob); |
The function stops filter registry updates from being reported to
ob. It does not release ob's memory, use libnd_filter_registry_observer_free()
for that.
observer to drop.
void libnd_filter_registry_tell_observers (LND_Filter *filter, LND_FilterRegObserverOp op); |