xref: /freebsd/lib/libugidfw/bsde_get_rule.3 (revision 7660b554bc59a07be0431c17e0e33815818baa69)
1.\" Copyright (c) 2003 Networks Associates Technology, Inc.
2.\" All rights reserved.
3.\"
4.\" This software was developed for the FreeBSD Project by Chris
5.\" Costello at Safeport Network Services and Network Associates
6.\" Laboratories, the Security Research Division of Network Associates,
7.\" Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part
8.\" of the DARPA CHATS research program.
9.\"
10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions
12.\" are met:
13.\" 1. Redistributions of source code must retain the above copyright
14.\"    notice, this list of conditions and the following disclaimer.
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\"    notice, this list of conditions and the following disclaimer in the
17.\"    documentation and/or other materials provided with the distribution.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\" $FreeBSD$
32.\"
33.Dd January 7, 2003
34.Os
35.Dt BSDE_GET_RULE 3
36.Sh NAME
37.Nm bsde_get_rule ,
38.Nm bsde_set_rule ,
39.Nm bsde_delete_rule
40.Nd "file system firewall rules list management"
41.Sh LIBRARY
42.Lb libugidfw
43.Sh SYNOPSIS
44.In ugidfw.h
45.Ft int
46.Fo bsde_get_rule
47.Fa "int rulenum" "struct mac_bsdextended_rule *rule"
48.Fa "size_t errlen" "char *errstr"
49.Fc
50.Ft int
51.Fo bsde_set_rule
52.Fa "int rulenum" "struct mac_bsdextended_rule *rule"
53.Fa "size_t errlen" "char *errstr"
54.Fc
55.Ft int
56.Fn bsde_delete_rule "int rulenum" "size_t errlen" "char *errstr"
57.Sh DESCRIPTION
58The
59.Fn bsde_get_rule
60function fills in
61.Fa *rule
62with the rule numbered
63.Fa rulenum .
64If an error occurs,
65.Fa *errstr
66is filled in with the error string
67(up to
68.Fa errlen
69characters, including the terminating
70.Dv NUL ) .
71.Pp
72The
73.Fn bsde_set_rule
74function fills the slot numbered
75.Fa rulenum
76with the specified rule
77(in
78.Vt "struct mac_bsdextended_rule"
79form, either from
80.Fn bsde_get_rule
81or
82.Xr bsde_parse_rule 3 ) .
83If an error occurs,
84.Fa *errstr
85is filled with the error string
86(up to
87.Fa errlen
88characters, including the terminating
89.Dv NUL ) .
90.Pp
91The
92.Fn bsde_delete_rule
93function deletes the rule numbered
94.Fa rulenum .
95If an error occurs,
96.Fa *errstr
97is filled with the error string
98(up to
99.Fa errlen
100characters, including the terminating
101.Dv NUL ) .
102.Sh RETURN VALUES
103The
104.Fn bsde_get_rule ,
105.Fn bsde_set_rule ,
106and
107.Fn bsde_delete_rule
108functions return 0 if successful;
109otherwise the value \-1 is returned and the value of
110.Fa *errstr
111is filled in as documented in
112.Sx DESCRIPTION .
113.Sh SEE ALSO
114.Xr bsde_get_rule_count 3 ,
115.Xr bsde_get_rule_slots 3 ,
116.Xr bsde_parse_rule 3 ,
117.Xr bsde_parse_rule_string 3 ,
118.Xr bsde_rule_to_string 3 ,
119.Xr libugidfw 3 ,
120.Xr mac_bsdextended 4 ,
121.Xr ugidfw 8
122.Sh AUTHORS
123This software was contributed to the
124.Fx
125Project by Network Associates Labs,
126the Security Research Division of Network Associates
127Inc. under DARPA/SPAWAR contract N66001-01-C-8035
128.Pq Dq CBOSS ,
129as part of the DARPA CHATS research program.
130