4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1994, by Sun Microsytems, Inc.
26 #pragma ident "%Z%%M% %I% %E% SMI"
29 * Published kernel specific interfaces for libtnfctl.
30 * After doing some error checking, these just turn around and call
31 * internal interfaces that do the real work.
37 #include "tnfctl_int.h"
38 #include "kernel_int.h"
41 tnfctl_trace_state_set(tnfctl_handle_t
*hdl
, boolean_t mode
)
43 if (hdl
->mode
!= KERNEL_MODE
)
44 return (TNFCTL_ERR_BADARG
);
47 return (_tnfctl_prbk_set_tracing(hdl
, mode
));
51 tnfctl_filter_state_set(tnfctl_handle_t
*hdl
, boolean_t mode
)
53 if (hdl
->mode
!= KERNEL_MODE
)
54 return (TNFCTL_ERR_BADARG
);
57 return (_tnfctl_prbk_set_pfilter_mode(hdl
, mode
));
61 tnfctl_filter_list_get(tnfctl_handle_t
*hdl
, pid_t
**pid_list
, int *pid_count
)
63 if (hdl
->mode
!= KERNEL_MODE
)
64 return (TNFCTL_ERR_BADARG
);
67 return (_tnfctl_prbk_get_pfilter_list(hdl
, pid_list
, pid_count
));
71 tnfctl_filter_list_add(tnfctl_handle_t
*hdl
, pid_t pid
)
73 if (hdl
->mode
!= KERNEL_MODE
)
74 return (TNFCTL_ERR_BADARG
);
77 return (_tnfctl_prbk_pfilter_add(hdl
, pid
));
81 tnfctl_filter_list_delete(tnfctl_handle_t
*hdl
, pid_t pid
)
83 if (hdl
->mode
!= KERNEL_MODE
)
84 return (TNFCTL_ERR_BADARG
);
87 return (_tnfctl_prbk_pfilter_delete(hdl
, pid
));