146d1a925SRobert Watson /*- 2*4d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause 35e53a4f9SPedro F. Giffuni * 447ab23aaSRobert Watson * Copyright (c) 2002, 2004 Networks Associates Technology, Inc. 546d1a925SRobert Watson * All rights reserved. 646d1a925SRobert Watson * 70285334bSRobert Watson * This software was developed for the FreeBSD Project by Network Associates 80285334bSRobert Watson * Laboratories, the Security Research Division of Network Associates, Inc. 90285334bSRobert Watson * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the 100285334bSRobert Watson * DARPA CHATS research program. 1146d1a925SRobert Watson * 1246d1a925SRobert Watson * Redistribution and use in source and binary forms, with or without 1346d1a925SRobert Watson * modification, are permitted provided that the following conditions 1446d1a925SRobert Watson * are met: 1546d1a925SRobert Watson * 1. Redistributions of source code must retain the above copyright 1646d1a925SRobert Watson * notice, this list of conditions and the following disclaimer. 1746d1a925SRobert Watson * 2. Redistributions in binary form must reproduce the above copyright 1846d1a925SRobert Watson * notice, this list of conditions and the following disclaimer in the 1946d1a925SRobert Watson * documentation and/or other materials provided with the distribution. 2046d1a925SRobert Watson * 2146d1a925SRobert Watson * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 2246d1a925SRobert Watson * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2346d1a925SRobert Watson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2446d1a925SRobert Watson * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 2546d1a925SRobert Watson * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2646d1a925SRobert Watson * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2746d1a925SRobert Watson * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2846d1a925SRobert Watson * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2946d1a925SRobert Watson * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3046d1a925SRobert Watson * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3146d1a925SRobert Watson * SUCH DAMAGE. 3246d1a925SRobert Watson */ 3346d1a925SRobert Watson 3446d1a925SRobert Watson #ifndef _UGIDFW_H 3546d1a925SRobert Watson #define _UGIDFW_H 3646d1a925SRobert Watson 3746d1a925SRobert Watson __BEGIN_DECLS 3846d1a925SRobert Watson int bsde_rule_to_string(struct mac_bsdextended_rule *rule, char *buf, 3946d1a925SRobert Watson size_t buflen); 4046d1a925SRobert Watson int bsde_parse_mode(int argc, char *argv[], mode_t *mode, size_t buflen, 4146d1a925SRobert Watson char *errstr); 4246d1a925SRobert Watson int bsde_parse_rule(int argc, char *argv[], 4346d1a925SRobert Watson struct mac_bsdextended_rule *rule, size_t buflen, char *errstr); 4446d1a925SRobert Watson int bsde_parse_rule_string(const char *string, 4546d1a925SRobert Watson struct mac_bsdextended_rule *rule, size_t buflen, char *errstr); 46da30581eSRobert Watson int bsde_get_mib(const char *string, int *name, size_t *namelen); 4746d1a925SRobert Watson int bsde_get_rule_count(size_t buflen, char *errstr); 4846d1a925SRobert Watson int bsde_get_rule_slots(size_t buflen, char *errstr); 4946d1a925SRobert Watson int bsde_get_rule(int rulenum, struct mac_bsdextended_rule *rule, 5046d1a925SRobert Watson size_t errlen, char *errstr); 5146d1a925SRobert Watson int bsde_delete_rule(int rulenum, size_t buflen, char *errstr); 5246d1a925SRobert Watson int bsde_set_rule(int rulenum, struct mac_bsdextended_rule *rule, 5346d1a925SRobert Watson size_t buflen, char *errstr); 5447ab23aaSRobert Watson int bsde_add_rule(int *rulename, struct mac_bsdextended_rule *rule, 5547ab23aaSRobert Watson size_t buflen, char *errstr); 5646d1a925SRobert Watson __END_DECLS 5746d1a925SRobert Watson 5846d1a925SRobert Watson #endif 59