xref: /freebsd/lib/libugidfw/bsde_get_rule.3 (revision 4b2eaea43fec8e8792be611dea204071a10b655a)
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.Dd JANUARY 7, 2003
33.Os
34.Dt BSDE_GET_RULE 3
35.Sh NAME
36.Nm bsde_get_rule ,
37.Nm bsde_set_rule ,
38.Nm bsde_delete_rule
39.Nd file system firewall rules list management
40.Sh LIBRARY
41.Lb libugidfw
42.Sh SYNOPSIS
43.In ugidfw.h
44.Ft int
45.Fn bsde_get_rule "int rulenum" "struct mac_bsdextended_rule *rule" "size_t errlen" "char *errstr"
46.Ft int
47.Fn bsde_set_rule "int rulenum" "struct mac_bsdextended_rule *rule" "size_t errlen" "char *errstr"
48.Ft int
49.Fn bsde_delete_rule "int rulenum" "size_t errlen" "char *errstr"
50.Sh DESCRIPTION
51The
52.Fn bsde_get_rule
53function fills in
54.Fa *rule
55with the rule numbered
56.Fa rulenum .
57If an error occurs,
58.Fa *errstr
59is filled in with the error string
60(up to
61.Fa errlen
62characters, including the terminating NUL).
63.Pp
64The
65.Fn bsde_set_rule
66function fills the slot numbered
67.Fa rulenum
68with the specified rule
69(in
70.Vt "struct mac_bsdextended_rule"
71form, either from
72.Xr bsde_get_rule 3
73or
74.Xr bsde_parse_rule 3 ) .
75If an error occurs,
76.Fa *errstr
77is filled with the error string
78(up to
79.Fa errlen
80characters, including the terminating NUL).
81.Pp
82The
83.Fn bsde_delete_rule
84function deletes the rule numbered
85.Fa rulenum .
86If an error occurs,
87.Fa *errstr
88is filled with the error string
89(up to
90.Fa errlen
91characters, including the terminating NUL).
92.Sh RETURN VALUES
93The
94.Fn bsde_get_rule ,
95.Fn bsde_set_rule ,
96and
97.Fn bsde_delete_rule
98functions return
99.Li 0
100if successful;
101otherwise the value
102.Li \&-1
103is returned and the value of
104.Fa *errstr
105is filled in as documented in
106.Sx DESCRIPTION .
107.Sh SEE ALSO
108.Xr bsde_get_rule_count 3 ,
109.Xr bsde_get_rule_slots 3 ,
110.Xr bsde_parse_rule 3 ,
111.Xr bsde_parse_rule_string 3 ,
112.Xr bsde_rule_to_string 3 ,
113.Xr libugidfw 3 ,
114.Xr mac_bsdextended 4 ,
115.Xr ugidfw 8
116.Sh AUTHORS
117This software was contributed to the
118.Fx
119Project by Network Associates Labs,
120the Security Research Division of Network Associates
121Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"),
122as part of the DARPA CHATS research program.
123