1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
3 * Copyright (c) 2009 University of Texas at Dallas
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Author: Qasim Javed <qasim@utdallas.edu>
20 #ifndef IP_CONNTRACK_INFO
21 #define IP_CONNTRACK_INFO
32 IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1
39 } ConntrackDirection_t;
43 IPS_EXPECTED = (1 << IPS_EXPECTED_BIT),
45 IPS_SEEN_REPLY_BIT = 1,
46 IPS_SEEN_REPLY = (1 << IPS_SEEN_REPLY_BIT),
49 IPS_ASSURED = (1 << IPS_ASSURED_BIT),
51 IPS_CONFIRMED_BIT = 3,
52 IPS_CONFIRMED = (1 << IPS_CONFIRMED_BIT),
55 IPS_SRC_NAT = (1 << IPS_SRC_NAT_BIT),
58 IPS_DST_NAT = (1 << IPS_DST_NAT_BIT),
60 IPS_NAT_MASK = (IPS_DST_NAT | IPS_SRC_NAT),
62 IPS_SEQ_ADJUST_BIT = 6,
63 IPS_SEQ_ADJUST = (1 << IPS_SEQ_ADJUST_BIT),
65 IPS_SRC_NAT_DONE_BIT = 7,
66 IPS_SRC_NAT_DONE = (1 << IPS_SRC_NAT_DONE_BIT),
68 IPS_DST_NAT_DONE_BIT = 8,
69 IPS_DST_NAT_DONE = (1 << IPS_DST_NAT_DONE_BIT),
71 IPS_NAT_DONE_MASK = (IPS_DST_NAT_DONE | IPS_SRC_NAT_DONE),
74 IPS_DYING = (1 << IPS_DYING_BIT),
78 class IpConntrackInfo {
81 IpConntrackInfo (uint32_t);
82 void SetStatus (uint32_t status);
83 uint32_t GetStatus ();
89 void SetInfo (uint8_t info);
92 ConntrackDirection_t ConntrackInfoToDirection (ConntrackInfo_t ctinfo);
101 #endif /* IP_CONNTRACK_INFO */