"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.16.7/lib/ns/include/ns/listenlist.h" (4 Sep 2020, 1985 Bytes) of package /linux/misc/dns/bind9/9.16.7/bind-9.16.7.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "listenlist.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
    3  *
    4  * This Source Code Form is subject to the terms of the Mozilla Public
    5  * License, v. 2.0. If a copy of the MPL was not distributed with this
    6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    7  *
    8  * See the COPYRIGHT file distributed with this work for additional
    9  * information regarding copyright ownership.
   10  */
   11 
   12 #ifndef NS_LISTENLIST_H
   13 #define NS_LISTENLIST_H 1
   14 
   15 /*****
   16 ***** Module Info
   17 *****/
   18 
   19 /*! \file
   20  * \brief
   21  * "Listen lists", as in the "listen-on" configuration statement.
   22  */
   23 
   24 /***
   25  *** Imports
   26  ***/
   27 
   28 #include <stdbool.h>
   29 
   30 #include <isc/net.h>
   31 
   32 #include <dns/types.h>
   33 
   34 /***
   35  *** Types
   36  ***/
   37 
   38 typedef struct ns_listenelt  ns_listenelt_t;
   39 typedef struct ns_listenlist ns_listenlist_t;
   40 
   41 struct ns_listenelt {
   42     isc_mem_t *mctx;
   43     in_port_t  port;
   44     isc_dscp_t dscp; /* -1 = not set, 0..63 */
   45     dns_acl_t *acl;
   46     ISC_LINK(ns_listenelt_t) link;
   47 };
   48 
   49 struct ns_listenlist {
   50     isc_mem_t *mctx;
   51     int    refcount;
   52     ISC_LIST(ns_listenelt_t) elts;
   53 };
   54 
   55 /***
   56  *** Functions
   57  ***/
   58 
   59 isc_result_t
   60 ns_listenelt_create(isc_mem_t *mctx, in_port_t port, isc_dscp_t dscp,
   61             dns_acl_t *acl, ns_listenelt_t **target);
   62 /*%<
   63  * Create a listen-on list element.
   64  */
   65 
   66 void
   67 ns_listenelt_destroy(ns_listenelt_t *elt);
   68 /*%<
   69  * Destroy a listen-on list element.
   70  */
   71 
   72 isc_result_t
   73 ns_listenlist_create(isc_mem_t *mctx, ns_listenlist_t **target);
   74 /*%<
   75  * Create a new, empty listen-on list.
   76  */
   77 
   78 void
   79 ns_listenlist_attach(ns_listenlist_t *source, ns_listenlist_t **target);
   80 /*%<
   81  * Attach '*target' to '*source'.
   82  */
   83 
   84 void
   85 ns_listenlist_detach(ns_listenlist_t **listp);
   86 /*%<
   87  * Detach 'listp'.
   88  */
   89 
   90 isc_result_t
   91 ns_listenlist_default(isc_mem_t *mctx, in_port_t port, isc_dscp_t dscp,
   92               bool enabled, ns_listenlist_t **target);
   93 /*%<
   94  * Create a listen-on list with default contents, matching
   95  * all addresses with port 'port' (if 'enabled' is true),
   96  * or no addresses (if 'enabled' is false).
   97  */
   98 
   99 #endif /* NS_LISTENLIST_H */