[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

ns_add_filter Network Service


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;


nddp Specifies the ndd structure to which this add request applies.
filter Specifies the pointer to the receive filter.
len Specifies the length in bytes of the receive filter to which the filter parameter points.
ns_user Specifies the pointer to a ns_user structure that defines the 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);

Return Values

0 Indicates the operation was successful.

The network demuxer may supply other return values.

Related Information

The ns_del_filter network service.

[ Previous | Next | Contents | Home | Search ]