diff options
author | Gaurav Sinha <gaurav.sinha@vyatta.com> | 2012-01-18 12:05:50 -0800 |
---|---|---|
committer | Gaurav Sinha <gaurav.sinha@vyatta.com> | 2012-01-18 12:05:50 -0800 |
commit | e72ca98329a25414108e2af350c4014de9e8f736 (patch) | |
tree | dfd32da0647916edf9a055e44d9d59596a3721a8 /src/network.c | |
parent | fa0e506210775233cb34513d45878991ef50aae6 (diff) | |
parent | ca37a710d526d17490ebdc3af760bfddd316426d (diff) | |
download | conntrack-tools-e72ca98329a25414108e2af350c4014de9e8f736.tar.gz conntrack-tools-e72ca98329a25414108e2af350c4014de9e8f736.zip |
Creating development branch expect-sync, has merged content from oxnard and upstreamexpect-sync
Diffstat (limited to 'src/network.c')
-rw-r--r-- | src/network.c | 24 |
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]; } |