ugidfw.h revision 104038
1101206Srwatson/*-
2101206Srwatson * Copyright (c) 2002 Networks Associates Technology, Inc.
3101206Srwatson * All rights reserved.
4101206Srwatson *
5101206Srwatson * This software was developed for the FreeBSD Project by NAI Labs, the
6101206Srwatson * Security Research Division of Network Associates, Inc. under
7101206Srwatson * DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA
8101206Srwatson * CHATS research program.
9101206Srwatson *
10101206Srwatson * Redistribution and use in source and binary forms, with or without
11101206Srwatson * modification, are permitted provided that the following conditions
12101206Srwatson * are met:
13101206Srwatson * 1. Redistributions of source code must retain the above copyright
14101206Srwatson *    notice, this list of conditions and the following disclaimer.
15101206Srwatson * 2. Redistributions in binary form must reproduce the above copyright
16101206Srwatson *    notice, this list of conditions and the following disclaimer in the
17101206Srwatson *    documentation and/or other materials provided with the distribution.
18101206Srwatson * 3. The names of the authors may not be used to endorse or promote
19101206Srwatson *    products derived from this software without specific prior written
20101206Srwatson *    permission.
21101206Srwatson *
22101206Srwatson * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
23101206Srwatson * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24101206Srwatson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25101206Srwatson * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
26101206Srwatson * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27101206Srwatson * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28101206Srwatson * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29101206Srwatson * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30101206Srwatson * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31101206Srwatson * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32101206Srwatson * SUCH DAMAGE.
33101206Srwatson *
34101206Srwatson * $FreeBSD: head/lib/libugidfw/ugidfw.h 104038 2002-09-27 16:35:19Z rwatson $
35101206Srwatson */
36101206Srwatson
37101206Srwatson#ifndef _UGIDFW_H
38101206Srwatson#define	_UGIDFW_H
39101206Srwatson
40101206Srwatson__BEGIN_DECLS
41101206Srwatsonint	bsde_rule_to_string(struct mac_bsdextended_rule *rule, char *buf,
42101206Srwatson	    size_t buflen);
43101206Srwatsonint	bsde_parse_identity(int argc, char *argv[],
44101206Srwatson	    struct mac_bsdextended_identity *identity, size_t buflen,
45101206Srwatson	    char *errstr);
46101206Srwatsonint	bsde_parse_mode(int argc, char *argv[], mode_t *mode, size_t buflen,
47101206Srwatson	    char *errstr);
48101206Srwatsonint	bsde_parse_rule(int argc, char *argv[],
49101206Srwatson	    struct mac_bsdextended_rule *rule, size_t buflen, char *errstr);
50101206Srwatsonint	bsde_parse_rule_string(const char *string,
51101206Srwatson	    struct mac_bsdextended_rule *rule, size_t buflen, char *errstr);
52104038Srwatsonint	bsde_get_mib(const char *string, int *name, size_t *namelen);
53101206Srwatsonint	bsde_get_rule_count(size_t buflen, char *errstr);
54101206Srwatsonint	bsde_get_rule_slots(size_t buflen, char *errstr);
55101206Srwatsonint	bsde_get_rule(int rulenum, struct mac_bsdextended_rule *rule,
56101206Srwatson	    size_t errlen, char *errstr);
57101206Srwatsonint	bsde_delete_rule(int rulenum, size_t buflen, char *errstr);
58101206Srwatsonint	bsde_set_rule(int rulenum, struct mac_bsdextended_rule *rule,
59101206Srwatson	    size_t buflen, char *errstr);
60101206Srwatson__END_DECLS
61101206Srwatson
62101206Srwatson#endif
63