listenlist.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004, 2005, 2007, 2013  Internet Systems Consortium, Inc. ("ISC")
00003  * Copyright (C) 2000, 2001  Internet Software Consortium.
00004  *
00005  * Permission to use, copy, modify, and/or distribute this software for any
00006  * purpose with or without fee is hereby granted, provided that the above
00007  * copyright notice and this permission notice appear in all copies.
00008  *
00009  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
00010  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
00011  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
00012  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
00013  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
00014  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
00015  * PERFORMANCE OF THIS SOFTWARE.
00016  */
00017 
00018 /* $Id: listenlist.h,v 1.15 2007/06/19 23:46:59 tbox Exp $ */
00019 
00020 #ifndef NAMED_LISTENLIST_H
00021 #define NAMED_LISTENLIST_H 1
00022 
00023 /*****
00024  ***** Module Info
00025  *****/
00026 
00027 /*! \file
00028  * \brief
00029  * "Listen lists", as in the "listen-on" configuration statement.
00030  */
00031 
00032 /***
00033  *** Imports
00034  ***/
00035 #include <isc/net.h>
00036 
00037 #include <dns/types.h>
00038 
00039 /***
00040  *** Types
00041  ***/
00042 
00043 typedef struct ns_listenelt ns_listenelt_t;
00044 typedef struct ns_listenlist ns_listenlist_t;
00045 
00046 struct ns_listenelt {
00047         isc_mem_t *                     mctx;
00048         in_port_t                       port;
00049         isc_dscp_t                      dscp;  /* -1 = not set, 0..63 */
00050         dns_acl_t *                     acl;
00051         ISC_LINK(ns_listenelt_t)        link;
00052 };
00053 
00054 struct ns_listenlist {
00055         isc_mem_t *                     mctx;
00056         int                             refcount;
00057         ISC_LIST(ns_listenelt_t)        elts;
00058 };
00059 
00060 /***
00061  *** Functions
00062  ***/
00063 
00064 isc_result_t
00065 ns_listenelt_create(isc_mem_t *mctx, in_port_t port, isc_dscp_t dscp,
00066                     dns_acl_t *acl, ns_listenelt_t **target);
00067 /*%
00068  * Create a listen-on list element.
00069  */
00070 
00071 void
00072 ns_listenelt_destroy(ns_listenelt_t *elt);
00073 /*%
00074  * Destroy a listen-on list element.
00075  */
00076 
00077 isc_result_t
00078 ns_listenlist_create(isc_mem_t *mctx, ns_listenlist_t **target);
00079 /*%
00080  * Create a new, empty listen-on list.
00081  */
00082 
00083 void
00084 ns_listenlist_attach(ns_listenlist_t *source, ns_listenlist_t **target);
00085 /*%
00086  * Attach '*target' to '*source'.
00087  */
00088 
00089 void
00090 ns_listenlist_detach(ns_listenlist_t **listp);
00091 /*%
00092  * Detach 'listp'.
00093  */
00094 
00095 isc_result_t
00096 ns_listenlist_default(isc_mem_t *mctx, in_port_t port, isc_dscp_t dscp,
00097                       isc_boolean_t enabled, ns_listenlist_t **target);
00098 /*%
00099  * Create a listen-on list with default contents, matching
00100  * all addresses with port 'port' (if 'enabled' is ISC_TRUE),
00101  * or no addresses (if 'enabled' is ISC_FALSE).
00102  */
00103 
00104 #endif /* NAMED_LISTENLIST_H */
00105 
00106 

Generated on Tue Apr 28 17:40:54 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha