root/src/noit_listener.h

Revision 1f7cb6fc7d8ef26f3708152ed497a3d3dfaeb168, 1.1 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 6 years ago)

fixes #17

  • Property mode set to 100644
Line 
1 /*
2  * Copyright (c) 2007, OmniTI Computer Consulting, Inc.
3  * All rights reserved.
4  */
5
6 #ifndef _NOIT_LISTENER_H
7 #define _NOIT_LISTENER_H
8
9 #include "noit_defines.h"
10 #include "eventer/eventer.h"
11 #include "utils/noit_hash.h"
12
13 #include <sys/types.h>
14 #include <sys/socket.h>
15 #include <sys/ioctl.h>
16 #include <netinet/in.h>
17
18 typedef struct {
19   union {
20     struct sockaddr remote_addr;
21     struct sockaddr_in remote_addr4;
22     struct sockaddr_in6 remote_addr6;
23   } remote;
24   char *remote_cn;
25   noit_hash_table *config;
26   void *service_ctx;
27 } acceptor_closure_t;
28
29 typedef struct {
30   int8_t family;
31   unsigned short port;
32   eventer_func_t dispatch_callback;
33   acceptor_closure_t *dispatch_closure;
34   noit_hash_table *sslconfig;
35 } * listener_closure_t;
36
37 API_EXPORT(void) noit_listener_init(const char *toplevel);
38
39 API_EXPORT(int)
40   noit_listener(char *host, unsigned short port, int type,
41                 int backlog, noit_hash_table *sslconfig,
42                 noit_hash_table *config,
43                 eventer_func_t handler, void *service_ctx);
44
45 API_EXPORT(void)
46   acceptor_closure_free(acceptor_closure_t *ac);
47
48 #endif
Note: See TracBrowser for help on using the browser.