#include <oskit/pd.h>oskit_s32_t oskit_packet_dispatcher_create( oskit_pd_t **pd, oskit_u32_t filter_type, oskit_netio_t **push_netio, oskit_netio_t *default_outgoing);
Upon successful return, pd points to the newly created packet dispatcher. In subsequent packet dispatcher operations, the caller must pass back a pointer to the same pd structure which acts as a handle for the packet dispatcher.The caller must provide a pointer to the default netio channel. Any packets which do not match any registered packet description will be pushed to the default netio. For example, after creation but before any oskit_packet_dispatcher_register calls, all received packets are routed to the default netio since there are no packet descriptions registered in the packet dispatcher.
The caller must provide a pointer to a netio\ object. This pointer is initialized during the call to represent the packet dispatcher's incoming channel.
- pd
- Pointer to the packet dispatcher just created. Used as a handle in subsequent packet dispatcher calls. The caller should think of packet dispatcher as an opaque object; modifications of the underlying structure are not allowed.
- filter_type
- A constant representing what filter machinery is desired for use inside the packet dispatcher. The valid types are defined in <oskit/pd.h>. As of this writing, there is only one valid type: OSKIT_PD_FILTER_DPF_INTERP .
- push_netio
- netio from which the packet dispatcher will receive packets. One might later pass this argument to oskit_etherdev_open, for example.
- default_outgoing
- The netio to which packets not matching any specified filter are pushed by the dispatcher.
Returns 0 on success, or an error code specified in <oskit/error.h>, on error.