root/src/noit_listener.h

Revision a9077178423e39a94a9b624e44cd4b37899d6fd3, 1.5 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 5 years ago)

refs #122, this stuff works well enough to pull dev back into trunk.
Closing the #122 branch.

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   u_int32_t cmd;
32 } acceptor_closure_t;
33
34 typedef struct {
35   int8_t family;
36   unsigned short port;
37   eventer_func_t dispatch_callback;
38   acceptor_closure_t *dispatch_closure;
39   noit_hash_table *sslconfig;
40 } * listener_closure_t;
41
42 API_EXPORT(void) noit_listener_init(const char *toplevel);
43
44 API_EXPORT(int)
45   noit_listener(char *host, unsigned short port, int type,
46                 int backlog, noit_hash_table *sslconfig,
47                 noit_hash_table *config,
48                 eventer_func_t handler, void *service_ctx);
49
50 API_EXPORT(void)
51   acceptor_closure_free(acceptor_closure_t *ac);
52
53 API_EXPORT(void)
54   noit_control_dispatch_delegate(eventer_func_t listener_dispatch,
55                                  u_int32_t cmd,
56                                  eventer_func_t delegate_dispatch);
57
58 API_EXPORT(int)
59   noit_control_dispatch(eventer_t, int, void *, struct timeval *);
60
61 API_EXPORT(noit_hash_table *)
62   noit_listener_commands();
63
64 #endif
Note: See TracBrowser for help on using the browser.