root/src/noitd.c

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

update.. prep for config system and module loading

  • Property mode set to 100644
Line 
1 #include "noit_defines.h"
2
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <errno.h>
6 #include <sys/ioctl.h>
7 #include <fcntl.h>
8
9 #include "eventer/eventer.h"
10 #include "utils/noit_log.h"
11 #include "noit_listener.h"
12 #include "noit_console.h"
13
14 int main(int argc, char **argv) {
15
16   noit_log_init();
17   noit_log_stream_add_stream(noit_debug, noit_stderr);
18   noit_log_stream_add_stream(noit_error, noit_stderr);
19
20   noit_conf_init();
21
22   if(eventer_choose("kqueue") == -1) {
23     fprintf(stderr, "Cannot choose kqueue\n");
24     exit(-1);
25   }
26   if(eventer_init() == -1) {
27     fprintf(stderr, "Cannot init kqueue\n");
28     exit(-1);
29   }
30
31   noit_listener("127.0.0.1", 23123, SOCK_STREAM, 5, noit_console_handler, NULL);
32   eventer_loop();
33   return 0;
34 }
Note: See TracBrowser for help on using the browser.