diff options
author | Olivier Gayot <duskcoder@gmail.com> | 2014-01-10 21:07:58 +0100 |
---|---|---|
committer | Olivier Gayot <olivier.gayot@intersec.com> | 2014-01-18 13:46:58 +0100 |
commit | ff98ee6f9e66ba850274463ca7f125c01a02d73e (patch) | |
tree | 56b4075f92cd90d855ae05c4a92d193d03297c7e /main.c | |
parent | c5b339e3964009d7eb917ff52e60ba69ff170c3c (diff) |
we need to access the opcode of the callbacks from outside of the server
(i.e. in the future clients).
the type callback_t is now a pointer to function and can be accessed
using callbacks_g[opcode] where the opcodes are enumerated in request.h
a new file named pub_callbacks.h has been added.
it will be used later by the client and must not be server dependant
closes #1
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -13,6 +13,7 @@ FILE *stream_g; static request_t buffer_g; +int callbacks_init(void); void *get_assoc_cb(int opcode); /* returns a socket listing to port or -1 if something failed */ @@ -81,6 +82,8 @@ int main(int argc, char *argv[]) int sock = bind_socket((argc < 2) ? 4333 : atoi(argv[1])); + callbacks_init(); + if (sock >= 0) { signal(SIGPIPE, SIG_IGN); |