Adds a status filter for the routing of asynchronous status.
#include <sys/cdli.h> #include <sys/ndd.h>
int ns_add_status (nddp, statfilter, len, ns_statuser) struct ndd *nddp; caddr_t statfilter; int len; struct ns_statuser *ns_statuser;
The ns_add_status network service registers a status filter. The add request is passed on to the nd_add_status function of the demuxer for the specified network device driver (NDD). This network service enables the user to receive asynchronous status information from the specified device.
Note: The user's status processing function is specified by the isr field of the ns_statuser structure. The network demuxer calls the user's status processing function directly when asynchronous status information becomes available. Consequently; the status processing function cannot be a scheduled routine. The caller of the ns_add_status network service is responsible for relinquishing status filters before calling the ns_free network service.
The following example illustrates the ns_add_status network service:
struct ns_statuser user; struct ns_com_status filter; filter.filtertype = NS_STATUS_MASK; filter.mask = NDD_HARD_FAIL; filter.sid = 0; user.isr = status_fn; user.isr_data = whatever_makes_sense; error = ns_add_status(nddp, &filter, sizeof(filter), &user);
0 | Indicates the operation was successful. |
The network demuxer may supply other return values.
The ns_del_status network service.