| 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 |
typedef struct { |
|---|
| 14 |
struct sockaddr remote_addr; |
|---|
| 15 |
char *remote_cn; |
|---|
| 16 |
noit_hash_table *config; |
|---|
| 17 |
void *service_ctx; |
|---|
| 18 |
} acceptor_closure_t; |
|---|
| 19 |
|
|---|
| 20 |
typedef struct { |
|---|
| 21 |
int8_t family; |
|---|
| 22 |
unsigned short port; |
|---|
| 23 |
eventer_func_t dispatch_callback; |
|---|
| 24 |
acceptor_closure_t *dispatch_closure; |
|---|
| 25 |
noit_hash_table *sslconfig; |
|---|
| 26 |
} * listener_closure_t; |
|---|
| 27 |
|
|---|
| 28 |
API_EXPORT(void) noit_listener_init(const char *toplevel); |
|---|
| 29 |
|
|---|
| 30 |
API_EXPORT(int) |
|---|
| 31 |
noit_listener(char *host, unsigned short port, int type, |
|---|
| 32 |
int backlog, noit_hash_table *sslconfig, |
|---|
| 33 |
noit_hash_table *config, |
|---|
| 34 |
eventer_func_t handler, void *service_ctx); |
|---|
| 35 |
|
|---|
| 36 |
API_EXPORT(void) |
|---|
| 37 |
acceptor_closure_free(acceptor_closure_t *ac); |
|---|
| 38 |
|
|---|
| 39 |
#endif |
|---|