]> git.proxmox.com Git - mirror_ovs.git/commitdiff
datapath-windows: Cleanup Conntrack definitions and introduce related entries
authorSairam Venugopal <vsairam@vmware.com>
Fri, 16 Dec 2016 22:28:10 +0000 (14:28 -0800)
committerGurucharan Shetty <guru@ovn.org>
Tue, 20 Dec 2016 17:32:37 +0000 (09:32 -0800)
Consolidate the reusable structs and includes. Introduce the new
OVS_CT_REL_ENTRY to track related connections.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
datapath-windows/ovsext/Conntrack.c
datapath-windows/ovsext/Conntrack.h

index 47dba9dc8cfcdcec60d99f8634afdcf6c9dc5aa3..70c32a48f94aac25c671561ca37d9e9b9e512452 100644 (file)
  * 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;
index 733596df8bd01f17fe7c61bc9f23bcbc95b7a683..7f1ec6f524e5e3036a68682ac91929d862770319 100644 (file)
 
 #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 {
@@ -80,6 +87,19 @@ typedef struct OVS_CT_ENTRY {
     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;
@@ -158,13 +178,26 @@ enum CT_UPDATE_RES OvsConntrackUpdateOtherEntry(OVS_CT_ENTRY *conn_,
 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_ */