acl.h revision 9c3531d72aeaad6c5f01efe6a1c82023e1379e4d
/*
* Copyright (C) 1999, 2000 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
/* $Id: acl.h,v 1.11 2000/06/22 21:55:05 tale Exp $ */
#ifndef DNS_ACL_H
#define DNS_ACL_H 1
/*****
***** Module Info
*****/
/*
* Address match list handling.
*/
/***
*** Imports
***/
/***
*** Types
***/
typedef enum {
struct dns_aclelement {
union {
struct {
unsigned int prefixlen;
} ip_prefix;
} u;
};
struct dns_acl {
unsigned int refcount;
unsigned int alloc; /* Elements allocated */
unsigned int length; /* Elements initialized */
char *name; /* Temporary use only */
};
struct dns_aclenv {
};
/***
*** Functions
***/
/*
* Create a new ACL with room for 'n' elements.
* The elements are uninitialized and the length is 0.
*/
/*
* Append an element to an existing ACL.
*/
/*
* Create a new ACL that matches everything.
*/
/*
* Create a new ACL that matches nothing.
*/
void
void
void
void
int *match,
/*
* General, low-level ACL matching. This is expected to
* be useful even for weird stuff like the topology and sortlist statements.
*
* Match the address 'reqaddr', and optionally the key name 'reqsigner',
* against 'acl'. 'reqsigner' may be NULL.
*
* If there is a positive match, '*match' will be set to a positive value
* indicating the distance from the beginning of the list.
*
* If there is a negative match, '*match' will be set to a negative value
* whose absoluate value indicates the distance from the beginning of
* the list.
*
* If there is a match (either positive or negative) and 'matchelt' is
* non-NULL, *matchelt will be attached to the primitive
* (non-indirect) address match list element that matched.
*
* If there is no match, *match will be set to zero.
*
* Returns:
* ISC_R_SUCCESS Always succeeds.
*/
#endif /* DNS_ACL_H */