summaryrefslogtreecommitdiff
path: root/src/sync-mode.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2009-02-15 15:40:47 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2009-02-15 15:40:47 +0100
commitc4ef74420bc09b82146190870186fb067ac163e9 (patch)
tree48a54a159968119991d1d294af7ce613fa471c7d /src/sync-mode.c
parentfe42b4085b7dab5847bb29155ebc70b4d7880ebe (diff)
downloadconntrack-tools-c4ef74420bc09b82146190870186fb067ac163e9.tar.gz
conntrack-tools-c4ef74420bc09b82146190870186fb067ac163e9.zip
conntrackd: add `-f internal' and `-f external' options
This patch allows flushing the internal and/or the external cache. The `-f' with no extra parameters still works to flush both the internal and the external cache. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/sync-mode.c')
-rw-r--r--src/sync-mode.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sync-mode.c b/src/sync-mode.c
index 74eb36e..866b313 100644
--- a/src/sync-mode.c
+++ b/src/sync-mode.c
@@ -466,6 +466,16 @@ static int local_handler_sync(int fd, int type, void *data)
cache_flush(STATE_SYNC(internal));
cache_flush(STATE_SYNC(external));
break;
+ case FLUSH_INT_CACHE:
+ /* inmediate flush, remove pending flush scheduled if any */
+ del_alarm(&STATE_SYNC(reset_cache_alarm));
+ dlog(LOG_NOTICE, "flushing internal cache");
+ cache_flush(STATE_SYNC(internal));
+ break;
+ case FLUSH_EXT_CACHE:
+ dlog(LOG_NOTICE, "flushing external cache");
+ cache_flush(STATE_SYNC(external));
+ break;
case KILL:
killer(0);
break;