diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2011-10-27 12:04:50 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-01-10 01:54:45 +0100 |
commit | 395ac42f5f1844834698f29032b101c2890b6772 (patch) | |
tree | f305b2a1bea37516875d9125fee768dba89075d8 /src/sync-mode.c | |
parent | 65be3d49b0f4350a227dedd70ac17c7c9cf6274e (diff) |
conntrackd: generalize external handlers to prepare expectation support
This patch contains cleanups to prepare the expectation support for
external handlers. Mostly renamings.
I have also updated the file headers to include Vyatta in the copyright
statement.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/sync-mode.c')
-rw-r--r-- | src/sync-mode.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/sync-mode.c b/src/sync-mode.c index 34d9706..7f019f7 100644 --- a/src/sync-mode.c +++ b/src/sync-mode.c @@ -88,13 +88,13 @@ do_channel_handler_step(int i, struct nethdr *net, size_t remain) switch(net->type) { case NET_T_STATE_NEW: - STATE_SYNC(external)->new(ct); + STATE_SYNC(external)->ct.new(ct); break; case NET_T_STATE_UPD: - STATE_SYNC(external)->update(ct); + STATE_SYNC(external)->ct.upd(ct); break; case NET_T_STATE_DEL: - STATE_SYNC(external)->destroy(ct); + STATE_SYNC(external)->ct.del(ct); break; default: STATE_SYNC(error).msg_rcv_malformed++; @@ -387,7 +387,7 @@ static void run_sync(fd_set *readfds) if (FD_ISSET(get_read_evfd(STATE_SYNC(commit).evfd), readfds)) { read_evfd(STATE_SYNC(commit).evfd); - STATE_SYNC(external)->commit(STATE_SYNC(commit).h, 0); + STATE_SYNC(external)->ct.commit(STATE_SYNC(commit).h, 0); } /* flush pending messages */ @@ -478,7 +478,7 @@ static int local_handler_sync(int fd, int type, void *data) break; case DUMP_EXTERNAL: if (fork_process_new(CTD_PROC_ANY, 0, NULL, NULL) == 0) { - STATE_SYNC(external)->dump(fd, NFCT_O_PLAIN); + STATE_SYNC(external)->ct.dump(fd, NFCT_O_PLAIN); exit(EXIT_SUCCESS); } break; @@ -490,7 +490,7 @@ static int local_handler_sync(int fd, int type, void *data) break; case DUMP_EXT_XML: if (fork_process_new(CTD_PROC_ANY, 0, NULL, NULL) == 0) { - STATE_SYNC(external)->dump(fd, NFCT_O_XML); + STATE_SYNC(external)->ct.dump(fd, NFCT_O_XML); exit(EXIT_SUCCESS); } break; @@ -499,7 +499,7 @@ static int local_handler_sync(int fd, int type, void *data) del_alarm(&STATE_SYNC(reset_cache_alarm)); dlog(LOG_NOTICE, "committing external cache"); - ret = STATE_SYNC(external)->commit(STATE_SYNC(commit).h, fd); + ret = STATE_SYNC(external)->ct.commit(STATE_SYNC(commit).h, fd); break; case RESET_TIMERS: if (!alarm_pending(&STATE_SYNC(reset_cache_alarm))) { @@ -514,7 +514,7 @@ static int local_handler_sync(int fd, int type, void *data) del_alarm(&STATE_SYNC(reset_cache_alarm)); dlog(LOG_NOTICE, "flushing caches"); STATE(mode)->internal->ct.flush(); - STATE_SYNC(external)->flush(); + STATE_SYNC(external)->ct.flush(); break; case FLUSH_INT_CACHE: /* inmediate flush, remove pending flush scheduled if any */ @@ -524,14 +524,14 @@ static int local_handler_sync(int fd, int type, void *data) break; case FLUSH_EXT_CACHE: dlog(LOG_NOTICE, "flushing external cache"); - STATE_SYNC(external)->flush(); + STATE_SYNC(external)->ct.flush(); break; case KILL: killer(0); break; case STATS: STATE(mode)->internal->ct.stats(fd); - STATE_SYNC(external)->stats(fd); + STATE_SYNC(external)->ct.stats(fd); dump_traffic_stats(fd); multichannel_stats(STATE_SYNC(channel), fd); dump_stats_sync(fd); @@ -542,7 +542,7 @@ static int local_handler_sync(int fd, int type, void *data) break; case STATS_CACHE: STATE(mode)->internal->ct.stats_ext(fd); - STATE_SYNC(external)->stats_ext(fd); + STATE_SYNC(external)->ct.stats_ext(fd); break; case STATS_LINK: multichannel_stats_extended(STATE_SYNC(channel), |