* limitations under the License.
*/
-#ifdef OVS_DBG_MOD
-#undef OVS_DBG_MOD
-#endif
-#define OVS_DBG_MOD OVS_DBG_CONTRK
-
#include "Conntrack.h"
#include "Jhash.h"
#include "PacketParser.h"
-#include "Debug.h"
#include "Event.h"
#define WINDOWS_TICK 10000000
#define SEC_TO_UNIX_EPOCH 11644473600LL
#define SEC_TO_NANOSEC 1000000000LL
-typedef struct _OVS_CT_THREAD_CTX {
- KEVENT event;
- PVOID threadObject;
- UINT32 exit;
-} OVS_CT_THREAD_CTX, *POVS_CT_THREAD_CTX;
-
KSTART_ROUTINE ovsConntrackEntryCleaner;
static PLIST_ENTRY ovsConntrackTable;
static OVS_CT_THREAD_CTX ctThreadCtx;
#include "precomp.h"
#include "Flow.h"
+#include "Debug.h"
+#include <stddef.h>
+
+#ifdef OVS_DBG_MOD
+#undef OVS_DBG_MOD
+#endif
+#define OVS_DBG_MOD OVS_DBG_CONTRK
struct ct_addr {
union {
struct ovs_key_ct_labels labels;
} OVS_CT_ENTRY, *POVS_CT_ENTRY;
+typedef struct OVS_CT_REL_ENTRY {
+ OVS_CT_KEY key;
+ POVS_CT_ENTRY parent;
+ UINT64 expiration;
+ LIST_ENTRY link;
+} OVS_CT_REL_ENTRY, *POVS_CT_REL_ENTRY;
+
+typedef struct _OVS_CT_THREAD_CTX {
+ KEVENT event;
+ PVOID threadObject;
+ UINT32 exit;
+} OVS_CT_THREAD_CTX, *POVS_CT_THREAD_CTX;
+
typedef struct OvsConntrackKeyLookupCtx {
OVS_CT_KEY key;
POVS_CT_ENTRY entry;
enum CT_UPDATE_RES OvsConntrackUpdateIcmpEntry(OVS_CT_ENTRY* conn_,
BOOLEAN reply,
UINT64 now);
-NTSTATUS
-OvsCreateNlMsgFromCtEntry(POVS_CT_ENTRY entry,
- PVOID outBuffer,
- UINT32 outBufLen,
- UINT8 eventType,
- UINT32 nlmsgSeq,
- UINT32 nlmsgPid,
- UINT8 nfGenVersion,
- UINT32 dpIfIndex);
+NTSTATUS OvsCreateNlMsgFromCtEntry(POVS_CT_ENTRY entry,
+ PVOID outBuffer,
+ UINT32 outBufLen,
+ UINT8 eventType,
+ UINT32 nlmsgSeq,
+ UINT32 nlmsgPid,
+ UINT8 nfGenVersion,
+ UINT32 dpIfIndex);
+
+/* Tracking related connections */
+NTSTATUS OvsInitCtRelated(POVS_SWITCH_CONTEXT context);
+VOID OvsCleanupCtRelated(VOID);
+NDIS_STATUS OvsCtRelatedEntryCreate(UINT8 ipProto,
+ UINT16 dl_type,
+ UINT32 serverIp,
+ UINT32 clientIp,
+ UINT16 serverPort,
+ UINT16 clientPort,
+ UINT64 currentTime,
+ POVS_CT_ENTRY parent);
+POVS_CT_ENTRY OvsCtRelatedLookup(OVS_CT_KEY key, UINT64 currentTime);
+
#endif /* __OVS_CONNTRACK_H_ */