summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2009-01-17 18:03:52 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2009-01-17 18:03:52 +0100
commitc54c8c9287fc87177daf9b51933f92c7e6402904 (patch)
tree6b7b3414803af1d2217d03b327b740d7982dbec8
parent7ae054f8aae252ee9c57e26327675e466fc1d15d (diff)
downloadconntrack-tools-c54c8c9287fc87177daf9b51933f92c7e6402904.tar.gz
conntrack-tools-c54c8c9287fc87177daf9b51933f92c7e6402904.zip
src: rename overrun handler to resync handler
This patch is a cleanup. The overrun handler is actually a way to resynchronize against the conntrack kernel table. The name overrun was used because it was initially its purpose. The new naming shows its genericity. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--include/conntrackd.h10
-rw-r--r--include/netlink.h4
-rw-r--r--src/netlink.c4
-rw-r--r--src/run.c22
-rw-r--r--src/stats-mode.c12
-rw-r--r--src/sync-mode.c12
6 files changed, 32 insertions, 32 deletions
diff --git a/include/conntrackd.h b/include/conntrackd.h
index ab5d825..d5b61c6 100644
--- a/include/conntrackd.h
+++ b/include/conntrackd.h
@@ -111,8 +111,8 @@ struct ct_general_state {
struct nfct_handle *dump; /* dump handler */
struct nfct_handle *request; /* request handler */
- struct nfct_handle *overrun; /* overrun handler */
- struct alarm_block overrun_alarm;
+ struct nfct_handle *resync; /* resync handler */
+ struct alarm_block resync_alarm;
struct fds *fds;
@@ -204,9 +204,9 @@ struct ct_mode {
int (*local)(int fd, int type, void *data);
void (*kill)(void);
void (*dump)(struct nf_conntrack *ct);
- int (*overrun)(enum nf_conntrack_msg_type type,
- struct nf_conntrack *ct,
- void *data);
+ int (*resync)(enum nf_conntrack_msg_type type,
+ struct nf_conntrack *ct,
+ void *data);
int (*purge)(void);
void (*event_new)(struct nf_conntrack *ct);
void (*event_upd)(struct nf_conntrack *ct);
diff --git a/include/netlink.h b/include/netlink.h
index 4bc5ee4..a8eb919 100644
--- a/include/netlink.h
+++ b/include/netlink.h
@@ -9,10 +9,10 @@ struct nfct_handle;
struct nfct_handle *nl_init_event_handler(void);
struct nfct_handle *nl_init_dump_handler(void);
struct nfct_handle *nl_init_request_handler(void);
-struct nfct_handle *nl_init_overrun_handler(void);
+struct nfct_handle *nl_init_resync_handler(void);
struct nlif_handle *nl_init_interface_handler(void);
-int nl_overrun_request_resync(struct nfct_handle *h);
+int nl_send_resync(struct nfct_handle *h);
void nl_resize_socket_buffer(struct nfct_handle *h);
int nl_dump_conntrack_table(struct nfct_handle *h);
int nl_flush_conntrack_table(struct nfct_handle *h);
diff --git a/src/netlink.c b/src/netlink.c
index 2266201..15a30f6 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -90,7 +90,7 @@ struct nfct_handle *nl_init_dump_handler(void)
return h;
}
-struct nfct_handle *nl_init_overrun_handler(void)
+struct nfct_handle *nl_init_resync_handler(void)
{
struct nfct_handle *h;
@@ -172,7 +172,7 @@ int nl_flush_conntrack_table(struct nfct_handle *h)
return nfct_query(h, NFCT_Q_FLUSH, &CONFIG(family));
}
-int nl_overrun_request_resync(struct nfct_handle *h)
+int nl_send_resync(struct nfct_handle *h)
{
int family = CONFIG(family);
return nfct_send(h, NFCT_Q_DUMP, &family);
diff --git a/src/run.c b/src/run.c
index 2e373ce..b436113 100644
--- a/src/run.c
+++ b/src/run.c
@@ -204,9 +204,9 @@ void local_handler(int fd, void *data)
STATE(stats).local_unknown_request++;
}
-static void do_overrun_alarm(struct alarm_block *a, void *data)
+static void do_resync_alarm(struct alarm_block *a, void *data)
{
- nl_overrun_request_resync(STATE(overrun));
+ nl_send_resync(STATE(resync));
STATE(stats).nl_kernel_table_resync++;
}
@@ -313,16 +313,16 @@ init(void)
return -1;
}
- STATE(overrun) = nl_init_overrun_handler();
- if (STATE(overrun)== NULL) {
+ STATE(resync) = nl_init_resync_handler();
+ if (STATE(resync)== NULL) {
dlog(LOG_ERR, "can't open netlink handler: %s",
strerror(errno));
dlog(LOG_ERR, "no ctnetlink kernel support?");
return -1;
}
- nfct_callback_register(STATE(overrun),
+ nfct_callback_register(STATE(resync),
NFCT_T_ALL,
- STATE(mode)->overrun,
+ STATE(mode)->resync,
NULL);
/* no callback, it does not do anything with the output */
@@ -334,7 +334,7 @@ init(void)
return -1;
}
- init_alarm(&STATE(overrun_alarm), NULL, do_overrun_alarm);
+ init_alarm(&STATE(resync_alarm), NULL, do_resync_alarm);
STATE(fds) = create_fds();
if (STATE(fds) == NULL) {
@@ -344,7 +344,7 @@ init(void)
register_fd(STATE(local).fd, STATE(fds));
register_fd(nfct_fd(STATE(event)), STATE(fds));
- register_fd(nfct_fd(STATE(overrun)), STATE(fds));
+ register_fd(nfct_fd(STATE(resync)), STATE(fds));
if (STATE(mode)->register_fds &&
STATE(mode)->register_fds(STATE(fds)) == -1) {
@@ -435,7 +435,7 @@ static void __run(struct timeval *next_alarm)
* we resync ourselves.
*/
nl_resize_socket_buffer(STATE(event));
- add_alarm(&STATE(overrun_alarm), OVRUN_INT, 0);
+ add_alarm(&STATE(resync_alarm), OVRUN_INT, 0);
STATE(stats).nl_catch_event_failed++;
STATE(stats).nl_overrun++;
break;
@@ -455,8 +455,8 @@ static void __run(struct timeval *next_alarm)
}
}
- if (FD_ISSET(nfct_fd(STATE(overrun)), &readfds)) {
- nfct_catch(STATE(overrun));
+ if (FD_ISSET(nfct_fd(STATE(resync)), &readfds)) {
+ nfct_catch(STATE(resync));
if (STATE(mode)->purge)
STATE(mode)->purge();
}
diff --git a/src/stats-mode.c b/src/stats-mode.c
index 679a50c..159bbef 100644
--- a/src/stats-mode.c
+++ b/src/stats-mode.c
@@ -102,9 +102,9 @@ static void dump_stats(struct nf_conntrack *ct)
debug_ct(ct, "resync entry");
}
-static int overrun_stats(enum nf_conntrack_msg_type type,
- struct nf_conntrack *ct,
- void *data)
+static int resync_stats(enum nf_conntrack_msg_type type,
+ struct nf_conntrack *ct,
+ void *data)
{
if (ct_filter_conntrack(ct, 1))
return NFCT_CB_CONTINUE;
@@ -118,7 +118,7 @@ static int overrun_stats(enum nf_conntrack_msg_type type,
nfct_attr_unset(ct, ATTR_USE);
if (!cache_update_force(STATE_STATS(cache), ct))
- debug_ct(ct, "overrun stats resync");
+ debug_ct(ct, "stats resync");
return NFCT_CB_CONTINUE;
}
@@ -130,7 +130,7 @@ static int purge_step(void *data1, void *data2)
ret = nfct_query(STATE(dump), NFCT_Q_GET, obj->ct);
if (ret == -1 && errno == ENOENT) {
- debug_ct(obj->ct, "overrun purge stats");
+ debug_ct(obj->ct, "purge stats");
cache_del(STATE_STATS(cache), obj);
cache_object_free(obj);
}
@@ -196,7 +196,7 @@ struct ct_mode stats_mode = {
.local = local_handler_stats,
.kill = kill_stats,
.dump = dump_stats,
- .overrun = overrun_stats,
+ .resync = resync_stats,
.purge = purge_stats,
.event_new = event_new_stats,
.event_upd = event_update_stats,
diff --git a/src/sync-mode.c b/src/sync-mode.c
index 0dbd12d..2e189cb 100644
--- a/src/sync-mode.c
+++ b/src/sync-mode.c
@@ -518,7 +518,7 @@ static int purge_step(void *data1, void *data2)
ret = nfct_query(h, NFCT_Q_GET, obj->ct);
if (ret == -1 && errno == ENOENT) {
- debug_ct(obj->ct, "overrun purge resync");
+ debug_ct(obj->ct, "purge resync");
if (obj->status != C_OBJ_DEAD) {
cache_object_set_status(obj, C_OBJ_DEAD);
mcast_send_sync(obj, NET_T_STATE_DEL);
@@ -536,9 +536,9 @@ static int purge_sync(void)
return 0;
}
-static int overrun_sync(enum nf_conntrack_msg_type type,
- struct nf_conntrack *ct,
- void *data)
+static int resync_sync(enum nf_conntrack_msg_type type,
+ struct nf_conntrack *ct,
+ void *data)
{
struct cache_object *obj;
@@ -553,7 +553,7 @@ static int overrun_sync(enum nf_conntrack_msg_type type,
nfct_attr_unset(ct, ATTR_USE);
if ((obj = cache_update_force(STATE_SYNC(internal), ct))) {
- debug_ct(obj->ct, "overrun resync");
+ debug_ct(obj->ct, "resync");
mcast_send_sync(obj, NET_T_STATE_UPD);
}
@@ -629,7 +629,7 @@ struct ct_mode sync_mode = {
.local = local_handler_sync,
.kill = kill_sync,
.dump = dump_sync,
- .overrun = overrun_sync,
+ .resync = resync_sync,
.purge = purge_sync,
.event_new = event_new_sync,
.event_upd = event_update_sync,