summaryrefslogtreecommitdiff
path: root/src/network.c
diff options
context:
space:
mode:
authorGaurav Sinha <gaurav.sinha@vyatta.com>2012-01-12 14:45:24 -0800
committerGaurav Sinha <gaurav.sinha@vyatta.com>2012-01-12 14:45:24 -0800
commitca37a710d526d17490ebdc3af760bfddd316426d (patch)
treecaeb883cf2302d30e010909bc543b09e191472cb /src/network.c
parentc4414d9a8b31bedfb7471cd2365aaf5ea5cf55d5 (diff)
parent414fedd879fdc3cd0a910acd2fd9262251a6bfe7 (diff)
downloadconntrack-tools-ca37a710d526d17490ebdc3af760bfddd316426d.tar.gz
conntrack-tools-ca37a710d526d17490ebdc3af760bfddd316426d.zip
Updating upstream with merged content from netfilter conntrack-tools version 1.0.1
Diffstat (limited to 'src/network.c')
-rw-r--r--src/network.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/network.c b/src/network.c
index 6a66a2b..13db37c 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1,6 +1,7 @@
/*
- * (C) 2006-2007 by Pablo Neira Ayuso <pablo@netfilter.org>
- *
+ * (C) 2006-2011 by Pablo Neira Ayuso <pablo@netfilter.org>
+ * (C) 2011 by Vyatta Inc. <http://www.vyatta.com>
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -119,13 +120,20 @@ int nethdr_track_is_seq_set()
#include "cache.h"
-static int status2type[] = {
- [C_OBJ_NEW] = NET_T_STATE_NEW,
- [C_OBJ_ALIVE] = NET_T_STATE_UPD,
- [C_OBJ_DEAD] = NET_T_STATE_DEL,
+static int status2type[CACHE_T_MAX][C_OBJ_MAX] = {
+ [CACHE_T_CT] = {
+ [C_OBJ_NEW] = NET_T_STATE_CT_NEW,
+ [C_OBJ_ALIVE] = NET_T_STATE_CT_UPD,
+ [C_OBJ_DEAD] = NET_T_STATE_CT_DEL,
+ },
+ [CACHE_T_EXP] = {
+ [C_OBJ_NEW] = NET_T_STATE_EXP_NEW,
+ [C_OBJ_ALIVE] = NET_T_STATE_EXP_UPD,
+ [C_OBJ_DEAD] = NET_T_STATE_EXP_DEL,
+ },
};
-int object_status_to_network_type(int status)
+int object_status_to_network_type(struct cache_object *obj)
{
- return status2type[status];
+ return status2type[obj->cache->type][obj->status];
}