root/src/noit_listener.h

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

closes #52. flag-day(noitd,stratcond)

  • 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 #ifdef HAVE_SYS_FILIO_H
17 #include <sys/filio.h>
18 #endif
19 #include <netinet/in.h>
20
21 typedef struct {
22   union {
23     struct sockaddr remote_addr;
24     struct sockaddr_in remote_addr4;
25     struct sockaddr_in6 remote_addr6;
26   } remote;
27   char *remote_cn;
28   noit_hash_table *config;
29   void *service_ctx;
30   eventer_func_t dispatch;
31 } acceptor_closure_t;
32
33 typedef struct {
34   int8_t family;
35   unsigned short port;
36   eventer_func_t dispatch_callback;
37   acceptor_closure_t *dispatch_closure;
38   noit_hash_table *sslconfig;
39 } * listener_closure_t;
40
41 API_EXPORT(void) noit_listener_init(const char *toplevel);
42
43 API_EXPORT(int)
44   noit_listener(char *host, unsigned short port, int type,
45                 int backlog, noit_hash_table *sslconfig,
46                 noit_hash_table *config,
47                 eventer_func_t handler, void *service_ctx);
48
49 API_EXPORT(void)
50   acceptor_closure_free(acceptor_closure_t *ac);
51
52 API_EXPORT(void)
53   noit_control_dispatch_delegate(eventer_func_t listener_dispatch,
54                                  u_int32_t cmd,
55                                  eventer_func_t delegate_dispatch);
56
57 int noit_control_dispatch(eventer_t, int, void *, struct timeval *);
58
59 #endif
Note: See TracBrowser for help on using the browser.