Home | History | Annotate | Line # | Download | only in pfctl
pfctl.h revision 1.1.1.2
      1  1.1.1.2    yamt /*	$OpenBSD: pfctl.h,v 1.36 2004/06/14 20:44:22 cedric Exp $ */
      2      1.1  itojun 
      3      1.1  itojun /*
      4      1.1  itojun  * Copyright (c) 2001 Daniel Hartmeier
      5      1.1  itojun  * All rights reserved.
      6      1.1  itojun  *
      7      1.1  itojun  * Redistribution and use in source and binary forms, with or without
      8      1.1  itojun  * modification, are permitted provided that the following conditions
      9      1.1  itojun  * are met:
     10      1.1  itojun  *
     11      1.1  itojun  *    - Redistributions of source code must retain the above copyright
     12      1.1  itojun  *      notice, this list of conditions and the following disclaimer.
     13      1.1  itojun  *    - Redistributions in binary form must reproduce the above
     14      1.1  itojun  *      copyright notice, this list of conditions and the following
     15      1.1  itojun  *      disclaimer in the documentation and/or other materials provided
     16      1.1  itojun  *      with the distribution.
     17      1.1  itojun  *
     18      1.1  itojun  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     19      1.1  itojun  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     20      1.1  itojun  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
     21      1.1  itojun  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
     22      1.1  itojun  * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
     23      1.1  itojun  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     24      1.1  itojun  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     25      1.1  itojun  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
     26      1.1  itojun  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     27      1.1  itojun  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     28      1.1  itojun  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29      1.1  itojun  * POSSIBILITY OF SUCH DAMAGE.
     30      1.1  itojun  *
     31      1.1  itojun  */
     32      1.1  itojun 
     33      1.1  itojun #ifndef _PFCTL_H_
     34      1.1  itojun #define _PFCTL_H_
     35      1.1  itojun 
     36      1.1  itojun enum {	PFRB_TABLES = 1, PFRB_TSTATS, PFRB_ADDRS, PFRB_ASTATS,
     37      1.1  itojun 	PFRB_IFACES, PFRB_TRANS, PFRB_MAX };
     38      1.1  itojun struct pfr_buffer {
     39      1.1  itojun 	int	 pfrb_type;	/* type of content, see enum above */
     40      1.1  itojun 	int	 pfrb_size;	/* number of objects in buffer */
     41      1.1  itojun 	int	 pfrb_msize;	/* maximum number of objects in buffer */
     42      1.1  itojun 	void	*pfrb_caddr;	/* malloc'ated memory area */
     43      1.1  itojun };
     44      1.1  itojun #define PFRB_FOREACH(var, buf)				\
     45      1.1  itojun 	for ((var) = pfr_buf_next((buf), NULL);		\
     46      1.1  itojun 	    (var) != NULL;				\
     47      1.1  itojun 	    (var) = pfr_buf_next((buf), (var)))
     48      1.1  itojun 
     49      1.1  itojun void	 pfr_set_fd(int);
     50      1.1  itojun int	 pfr_get_fd(void);
     51      1.1  itojun int	 pfr_clr_tables(struct pfr_table *, int *, int);
     52      1.1  itojun int	 pfr_add_tables(struct pfr_table *, int, int *, int);
     53      1.1  itojun int	 pfr_del_tables(struct pfr_table *, int, int *, int);
     54      1.1  itojun int	 pfr_get_tables(struct pfr_table *, struct pfr_table *, int *, int);
     55      1.1  itojun int	 pfr_get_tstats(struct pfr_table *, struct pfr_tstats *, int *, int);
     56      1.1  itojun int	 pfr_clr_tstats(struct pfr_table *, int, int *, int);
     57      1.1  itojun int	 pfr_clr_addrs(struct pfr_table *, int *, int);
     58      1.1  itojun int	 pfr_add_addrs(struct pfr_table *, struct pfr_addr *, int, int *, int);
     59      1.1  itojun int	 pfr_del_addrs(struct pfr_table *, struct pfr_addr *, int, int *, int);
     60      1.1  itojun int	 pfr_set_addrs(struct pfr_table *, struct pfr_addr *, int, int *,
     61      1.1  itojun 	    int *, int *, int *, int);
     62      1.1  itojun int	 pfr_get_addrs(struct pfr_table *, struct pfr_addr *, int *, int);
     63      1.1  itojun int	 pfr_get_astats(struct pfr_table *, struct pfr_astats *, int *, int);
     64      1.1  itojun int	 pfr_clr_astats(struct pfr_table *, struct pfr_addr *, int, int *, int);
     65      1.1  itojun int	 pfr_tst_addrs(struct pfr_table *, struct pfr_addr *, int, int *, int);
     66      1.1  itojun int	 pfr_set_tflags(struct pfr_table *, int, int, int, int *, int *, int);
     67      1.1  itojun int	 pfr_ina_define(struct pfr_table *, struct pfr_addr *, int, int *,
     68      1.1  itojun 	    int *, int, int);
     69      1.1  itojun void	 pfr_buf_clear(struct pfr_buffer *);
     70      1.1  itojun int	 pfr_buf_add(struct pfr_buffer *, const void *);
     71      1.1  itojun void	*pfr_buf_next(struct pfr_buffer *, const void *);
     72      1.1  itojun int	 pfr_buf_grow(struct pfr_buffer *, int);
     73      1.1  itojun int	 pfr_buf_load(struct pfr_buffer *, char *, int,
     74      1.1  itojun 	    int (*)(struct pfr_buffer *, char *, int));
     75      1.1  itojun char	*pfr_strerror(int);
     76      1.1  itojun int	 pfi_get_ifaces(const char *, struct pfi_if *, int *, int);
     77      1.1  itojun int	 pfi_clr_istats(const char *, int *, int);
     78      1.1  itojun 
     79      1.1  itojun void	 pfctl_print_title(char *);
     80  1.1.1.2    yamt int	 pfctl_clear_tables(const char *, int);
     81  1.1.1.2    yamt int	 pfctl_show_tables(const char *, int);
     82      1.1  itojun int	 pfctl_command_tables(int, char *[], char *, const char *, char *,
     83  1.1.1.2    yamt 	    const char *, int);
     84      1.1  itojun int	 pfctl_show_altq(int, const char *, int, int);
     85      1.1  itojun void	 warn_namespace_collision(const char *);
     86      1.1  itojun int	 pfctl_show_ifaces(const char *, int);
     87  1.1.1.2    yamt FILE	*pfctl_fopen(const char *, const char *);
     88      1.1  itojun 
     89      1.1  itojun #ifndef DEFAULT_PRIORITY
     90      1.1  itojun #define DEFAULT_PRIORITY	1
     91      1.1  itojun #endif
     92      1.1  itojun 
     93      1.1  itojun #ifndef DEFAULT_QLIMIT
     94      1.1  itojun #define DEFAULT_QLIMIT		50
     95      1.1  itojun #endif
     96      1.1  itojun 
     97      1.1  itojun /*
     98      1.1  itojun  * generalized service curve used for admission control
     99      1.1  itojun  */
    100      1.1  itojun struct segment {
    101      1.1  itojun 	LIST_ENTRY(segment)	_next;
    102      1.1  itojun 	double			x, y, d, m;
    103      1.1  itojun };
    104      1.1  itojun 
    105      1.1  itojun int		 check_commit_altq(int, int);
    106      1.1  itojun void		 pfaltq_store(struct pf_altq *);
    107      1.1  itojun void		 pfaltq_free(struct pf_altq *);
    108      1.1  itojun struct pf_altq	*pfaltq_lookup(const char *);
    109      1.1  itojun char		*rate2str(double);
    110      1.1  itojun 
    111      1.1  itojun void	 print_addr(struct pf_addr_wrap *, sa_family_t, int);
    112      1.1  itojun void	 print_host(struct pf_state_host *, sa_family_t, int);
    113      1.1  itojun void	 print_seq(struct pf_state_peer *);
    114      1.1  itojun void	 print_state(struct pf_state *, int);
    115      1.1  itojun int	 unmask(struct pf_addr *, sa_family_t);
    116      1.1  itojun 
    117      1.1  itojun int	 pfctl_cmdline_symset(char *);
    118  1.1.1.2    yamt int	 pfctl_add_trans(struct pfr_buffer *, int, const char *);
    119      1.1  itojun u_int32_t
    120  1.1.1.2    yamt 	 pfctl_get_ticket(struct pfr_buffer *, int, const char *);
    121      1.1  itojun int	 pfctl_trans(int, struct pfr_buffer *, u_long, int);
    122      1.1  itojun 
    123      1.1  itojun #endif /* _PFCTL_H_ */
    124