"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.11.23/lib/lwres/context_p.h" (7 Sep 2020, 1531 Bytes) of package /linux/misc/dns/bind9/9.11.23/bind-9.11.23.tar.gz:


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 "context_p.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 /* $Id: context_p.h,v 1.19 2008/12/17 23:47:58 tbox Exp $ */
   13 
   14 #ifndef LWRES_CONTEXT_P_H
   15 #define LWRES_CONTEXT_P_H 1
   16 
   17 #include <inttypes.h>
   18 
   19 /*! \file */
   20 
   21 /*@{*/
   22 /**
   23  * Helper functions, assuming the context is always called "ctx" in
   24  * the scope these functions are called from.
   25  */
   26 #define CTXMALLOC(len)      ctx->malloc(ctx->arg, (len))
   27 #define CTXFREE(addr, len)  ctx->free(ctx->arg, (addr), (len))
   28 /*@}*/
   29 
   30 #define LWRES_DEFAULT_TIMEOUT   120 /* 120 seconds for a reply */
   31 
   32 /**
   33  * Not all the attributes here are actually settable by the application at
   34  * this time.
   35  */
   36 struct lwres_context {
   37     unsigned int        timeout;    /*%< time to wait for reply */
   38     uint32_t        serial;     /*%< serial number state */
   39 
   40     /*
   41      * For network I/O.
   42      */
   43     int         sock;       /*%< socket to send on */
   44     lwres_addr_t        address;    /*%< address to send to */
   45     int         use_ipv4;   /*%< use IPv4 transaction */
   46     int         use_ipv6;   /*%< use IPv6 transaction */
   47 
   48     /*@{*/
   49     /*
   50      * Function pointers for allocating memory.
   51      */
   52     lwres_malloc_t      malloc;
   53     lwres_free_t        free;
   54     void               *arg;
   55     /*@}*/
   56 
   57     /*%
   58      * resolv.conf-like data
   59      */
   60     lwres_conf_t        confdata;
   61 };
   62 
   63 #endif /* LWRES_CONTEXT_P_H */