Registers a receive filter to enable the reception of packets.
#include <sys/cdli.h> #include <sys/ndd.h>
int ns_add_filter (nddp, filter, len, ns_user) struct ndd *nddp; caddr_t filter; int len; struct ns_user *ns_user;
The ns_add_filter network service registers a receive filter for the reception of packets and enables a network demuxer to route packets to the appropriate users. The add request is passed on to the nd_add_filter function of the demuxer for the specified NDD. The caller of the ns_add_filter network service is responsible for relinquishing filters before calling the ns_free network service.
The following example illustrates the ns_add_filter network service:
struct ns_8022 dl; struct ns_user ns_user; dl.filtertype = NS_LLC_DSAP_SNAP; dl.dsap = 0xaa; dl.orgcode[0] = 0x0; dl.orgcode[1] = 0x0; dl.orgcode[2] = 0x0; dl.ethertype = 0x0800; ns_user.isr = ipintr; ns_user.protoq = &ipintrq; ns_user.netisr = NETISR_IP; ns_user.ifp = ifp; ns_user.pkt_format = NS_PROTO_SNAP; ns_add_filter(nddp, &dl, sizeof(dl), &ns_user);
0 | Indicates the operation was successful. |
The network demuxer may supply other return values.
The ns_del_filter network service.