diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2008-08-25 00:24:03 +0200 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2008-08-25 00:24:03 +0200 |
commit | 918405c75cf7caff99354131896a664b7a6dadf4 (patch) | |
tree | 50eb59b0afc620405240e275ef1f4f47e6427ab0 /eurephiafw.c | |
parent | 580dbb7480b89dbde721968dccaeb703b48b00c8 (diff) | |
download | eurephia-918405c75cf7caff99354131896a664b7a6dadf4.tar.gz eurephia-918405c75cf7caff99354131896a664b7a6dadf4.tar.xz eurephia-918405c75cf7caff99354131896a664b7a6dadf4.zip |
Added main loop for the firewall interface module
Diffstat (limited to 'eurephiafw.c')
-rw-r--r-- | eurephiafw.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/eurephiafw.c b/eurephiafw.c index 47324f7..db51abe 100644 --- a/eurephiafw.c +++ b/eurephiafw.c @@ -99,10 +99,19 @@ int eFW_load(eurephiaCTX *ctx, const char *intf) { void eFW_StartFirewall(eurephiaCTX *ctx) { struct mq_attr mqattr; + eurephiaCTX *shadowctx = NULL; ctx->fwcfg = (eurephiaFWINTF *) malloc(sizeof(eurephiaFWINTF)+2); memset(ctx->fwcfg, 0, sizeof(eurephiaFWINTF)+2); + // Create a fake eurephia context, just for logging + shadowctx = (eurephiaCTX *) malloc(sizeof(eurephiaCTX)+2); + memset(shadowctx, 0, sizeof(eurephiaCTX)+2); + shadowctx->loglevel = ctx->loglevel; + shadowctx->log = ctx->log; + (*ctx->fwcfg).thrdata.ctx = shadowctx; + + eurephia_log(ctx, LOG_INFO, 3, "Starting eurephia firewall interface"); // Initialise driver semaphore if( sem_init(&(*ctx->fwcfg).thrdata.semp_driver, 0, 0) != 0 ) { @@ -153,6 +162,7 @@ void eFW_StopFirewall(eurephiaCTX *ctx) { return; } + eurephia_log(ctx, LOG_INFO, 3, "Stopping eurephia firewall interface"); // Send shutdown message to the firewall module thread snprintf(buf, 48, "FWSHUTDOWN%c", 0); @@ -187,5 +197,6 @@ void eFW_StopFirewall(eurephiaCTX *ctx) { } free_nullsafe(ctx->fwcfg); + eurephia_log(ctx, LOG_INFO, 3, "eurephia firewall interface is stopped"); } |