next up previous contents index
Next: 39.5.3 oskit_packet_dispatcher_delete: Disassociate a Up: 39.5 API reference Previous: 39.5.1 oskit_packet_dispatcher_create: Create a

39.5.2 oskit_packet_dispatcher_register: Register an packet owner

 

SYNOPSIS

#include <oskit/pd.h>

oskit_s32_t oskit_packet_dispatcher_register( oskit_pd_t **pd, oskit_s32_t *pdid, oskit_netio_t *out_netio, void *pdescr, oskit_s32_t sz);

DESCRIPTION

This function is used to associate a packet owner (flow, process, whatever) with a packet description. After successful registration, the packet dispatcher will push packets matching the given description to the given netio. It is the caller's responsibility to ensure their description is unique so that ambiguity is avoided.

The format of the packet description is determined by the filter_type argument to the oskit_packet_dispatcher_create call.

PARAMETERS

pd
Handle to the packet dispatcher returned from previous call to oskit_packet_dispatcher_create.
pdid
Upon return, the packet dispatcher ID associated with this packet descriptor/owner pair. The user should use this value to identify the pair when calling oskit_packet_dispatcher_delete. The value is undefined if insertion wasn't successful (see return value).
out_netio
Pointer to the netio to which packets matching pdescr are pushed.
pdescr
A description of the packet. The format of the packet description is dependent upon the type of filter machinery specified in the packet dispatcher creation call.
sz
The size of pdescr in bytes.

RETURNS

Returns 0 on success, or an error code specified in <oskit/error.h>, on error.



Utah Flux Research Group