"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.16.7/lib/isc/include/isc/httpd.h" (4 Sep 2020, 2289 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 "httpd.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 9.17.3_vs_9.17.4.

    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 ISC_HTTPD_H
   13 #define ISC_HTTPD_H 1
   14 
   15 /*! \file */
   16 
   17 #include <stdbool.h>
   18 
   19 #include <isc/event.h>
   20 #include <isc/eventclass.h>
   21 #include <isc/mutex.h>
   22 #include <isc/task.h>
   23 #include <isc/time.h>
   24 #include <isc/types.h>
   25 
   26 /*%
   27  * HTTP urls.  These are the URLs we manage, and the function to call to
   28  * provide the data for it.  We pass in the base url (so the same function
   29  * can handle multiple requests), and a structure to fill in to return a
   30  * result to the client.  We also pass in a pointer to be filled in for
   31  * the data cleanup function.
   32  */
   33 struct isc_httpdurl {
   34     char *         url;
   35     isc_httpdaction_t *action;
   36     void *         action_arg;
   37     bool           isstatic;
   38     isc_time_t     loadtime;
   39     ISC_LINK(isc_httpdurl_t) link;
   40 };
   41 
   42 #define HTTPD_EVENTCLASS ISC_EVENTCLASS(4300)
   43 #define HTTPD_SHUTDOWN   (HTTPD_EVENTCLASS + 0x0001)
   44 
   45 #define ISC_HTTPDMGR_FLAGSHUTTINGDOWN 0x00000001
   46 
   47 /*
   48  * Create a new http daemon which will send, once every time period,
   49  * a http-like header followed by HTTP data.
   50  */
   51 isc_result_t
   52 isc_httpdmgr_create(isc_mem_t *mctx, isc_socket_t *sock, isc_task_t *task,
   53             isc_httpdclientok_t * client_ok,
   54             isc_httpdondestroy_t *ondestory, void *cb_arg,
   55             isc_timermgr_t *tmgr, isc_httpdmgr_t **httpdp);
   56 
   57 void
   58 isc_httpdmgr_shutdown(isc_httpdmgr_t **httpdp);
   59 
   60 isc_result_t
   61 isc_httpdmgr_addurl(isc_httpdmgr_t *httpdmgr, const char *url,
   62             isc_httpdaction_t *func, void *arg);
   63 
   64 isc_result_t
   65 isc_httpdmgr_addurl2(isc_httpdmgr_t *httpdmgr, const char *url, bool isstatic,
   66              isc_httpdaction_t *func, void *arg);
   67 
   68 isc_result_t
   69 isc_httpd_response(isc_httpd_t *httpd);
   70 
   71 isc_result_t
   72 isc_httpd_addheader(isc_httpd_t *httpd, const char *name, const char *val);
   73 
   74 isc_result_t
   75 isc_httpd_addheaderuint(isc_httpd_t *httpd, const char *name, int val);
   76 
   77 isc_result_t
   78 isc_httpd_endheaders(isc_httpd_t *httpd);
   79 
   80 void
   81 isc_httpd_setfinishhook(void (*fn)(void));
   82 
   83 #endif /* ISC_HTTPD_H */