xref: /src/lib/libpfctl/libpfctl.h (revision 0d71f9f36e6c1849fdaf6c1edc1178be07357034)
10d71f9f3SKristof Provost /*-
20d71f9f3SKristof Provost  * SPDX-License-Identifier: BSD-2-Clause
30d71f9f3SKristof Provost  *
40d71f9f3SKristof Provost  * Copyright (c) 2021 Rubicon Communications, LLC (Netgate)
50d71f9f3SKristof Provost  * All rights reserved.
60d71f9f3SKristof Provost  *
70d71f9f3SKristof Provost  * Redistribution and use in source and binary forms, with or without
80d71f9f3SKristof Provost  * modification, are permitted provided that the following conditions
90d71f9f3SKristof Provost  * are met:
100d71f9f3SKristof Provost  *
110d71f9f3SKristof Provost  *    - Redistributions of source code must retain the above copyright
120d71f9f3SKristof Provost  *      notice, this list of conditions and the following disclaimer.
130d71f9f3SKristof Provost  *    - Redistributions in binary form must reproduce the above
140d71f9f3SKristof Provost  *      copyright notice, this list of conditions and the following
150d71f9f3SKristof Provost  *      disclaimer in the documentation and/or other materials provided
160d71f9f3SKristof Provost  *      with the distribution.
170d71f9f3SKristof Provost  *
180d71f9f3SKristof Provost  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
190d71f9f3SKristof Provost  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
200d71f9f3SKristof Provost  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
210d71f9f3SKristof Provost  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
220d71f9f3SKristof Provost  * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
230d71f9f3SKristof Provost  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
240d71f9f3SKristof Provost  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
250d71f9f3SKristof Provost  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
260d71f9f3SKristof Provost  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
270d71f9f3SKristof Provost  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
280d71f9f3SKristof Provost  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
290d71f9f3SKristof Provost  * POSSIBILITY OF SUCH DAMAGE.
300d71f9f3SKristof Provost  *
310d71f9f3SKristof Provost  * $FreeBSD$
320d71f9f3SKristof Provost  */
330d71f9f3SKristof Provost 
340d71f9f3SKristof Provost #ifndef _PFCTL_IOCTL_H_
350d71f9f3SKristof Provost #define _PFCTL_IOCTL_H_
360d71f9f3SKristof Provost 
370d71f9f3SKristof Provost #include <netpfil/pf/pf.h>
380d71f9f3SKristof Provost 
390d71f9f3SKristof Provost int	pfctl_get_rule(int dev, u_int32_t nr, u_int32_t ticket,
400d71f9f3SKristof Provost 	    const char *anchor, u_int32_t ruleset, struct pf_rule *rule,
410d71f9f3SKristof Provost 	    char *anchor_call);
420d71f9f3SKristof Provost int	pfctl_add_rule(int dev, const struct pf_rule *r, const char *anchor,
430d71f9f3SKristof Provost 	    const char *anchor_call, u_int32_t ticket, u_int32_t pool_ticket);
440d71f9f3SKristof Provost 
450d71f9f3SKristof Provost #endif
46