]>
git.ipfire.org Git - thirdparty/chrony.git/blob - addrfilt.h
2 chronyd/chronyc - Programs for keeping computer clocks accurate.
4 **********************************************************************
5 * Copyright (C) Richard P. Curnow 1997-2002
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of version 2 of the GNU General Public License as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 **********************************************************************
22 =======================================================================
24 Module for providing an authorisation filter on IP addresses
27 #ifndef GOT_ADDRFILT_H
28 #define GOT_ADDRFILT_H
30 #include "addressing.h"
32 typedef struct ADF_AuthTableInst
*ADF_AuthTable
;
40 /* Create a new table. The default rule is deny for everything */
41 extern ADF_AuthTable
ADF_CreateTable(void);
43 /* Allow anything in the supplied subnet, EXCEPT for any more specific
44 subnets that are already defined */
45 extern ADF_Status
ADF_Allow(ADF_AuthTable table
,
49 /* Allow anything in the supplied subnet, overwriting existing
50 definitions for any more specific subnets */
51 extern ADF_Status
ADF_AllowAll(ADF_AuthTable table
,
55 /* Deny anything in the supplied subnet, EXCEPT for any more specific
56 subnets that are already defined */
57 extern ADF_Status
ADF_Deny(ADF_AuthTable table
,
61 /* Deny anything in the supplied subnet, overwriting existing
62 definitions for any more specific subnets */
63 extern ADF_Status
ADF_DenyAll(ADF_AuthTable table
,
67 /* Clear up the table */
68 extern void ADF_DestroyTable(ADF_AuthTable table
);
70 /* Check whether a given IP address is allowed by the rules in
72 extern int ADF_IsAllowed(ADF_AuthTable table
,
75 /* Check if at least one address from a given family is allowed by
76 the rules in the table */
77 extern int ADF_IsAnyAllowed(ADF_AuthTable table
,
80 #endif /* GOT_ADDRFILT_H */