Skip to content

Commit

Permalink
datapath-windows: Add Connection Tracking Support
Browse files Browse the repository at this point in the history
Enable support for Stateful Firewall in Hyper-V by adding a Connection
Tracking module. The module has been ported over from the userspace
implementation patch of a similar name.

The current version of the module supports ct - zone, mark and label for
TCP packets. Support for other packet formats will be added in subsequent
patches.

The conntrack-tcp module is adapted from FreeBSD's pf subsystem and hence
the BSD license. It has been ported over to match OVS Hyper-V coding
style.

Signed-off-by: Sairam Venugopal <[email protected]>
Signed-off-by: Daniele Di Proietto <[email protected]>
Co-Authored-by: Daniele Di Proietto <[email protected]>
Acked-by: Nithin Raju <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
2 people authored and blp committed Apr 14, 2016
1 parent ce05810 commit 792d377
Show file tree
Hide file tree
Showing 14 changed files with 1,350 additions and 4 deletions.
5 changes: 5 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,8 @@ Copyright (c) 2008, 2009, 2010 Sten Spans <[email protected]>
Auto Attach implementation
Copyright (c) 2014, 2015 WindRiver, Inc
Copyright (c) 2014, 2015 Avaya, Inc

TCP connection tracker from FreeBSD pf, BSD licensed
Copyright (c) 2001 Daniel Hartmeier
Copyright (c) 2002 - 2008 Henning Brauer
Copyright (c) 2012 Gleb Smirnoff <[email protected]>
3 changes: 3 additions & 0 deletions datapath-windows/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ EXTRA_DIST += \
datapath-windows/ovsext/Atomic.h \
datapath-windows/ovsext/BufferMgmt.c \
datapath-windows/ovsext/BufferMgmt.h \
datapath-windows/ovsext/Conntrack-tcp.c \
datapath-windows/ovsext/Conntrack.c \
datapath-windows/ovsext/Conntrack.h \
datapath-windows/ovsext/Datapath.c \
datapath-windows/ovsext/Datapath.h \
datapath-windows/ovsext/Debug.c \
Expand Down
23 changes: 23 additions & 0 deletions datapath-windows/ovsext/Actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "precomp.h"

#include "Actions.h"
#include "Conntrack.h"
#include "Debug.h"
#include "Event.h"
#include "Flow.h"
Expand Down Expand Up @@ -1786,6 +1787,28 @@ OvsDoExecuteActions(POVS_SWITCH_CONTEXT switchContext,
break;
}

case OVS_ACTION_ATTR_CT:
{
if (ovsFwdCtx.destPortsSizeOut > 0
|| ovsFwdCtx.tunnelTxNic != NULL
|| ovsFwdCtx.tunnelRxNic != NULL) {
status = OvsOutputBeforeSetAction(&ovsFwdCtx);
if (status != NDIS_STATUS_SUCCESS) {
dropReason = L"OVS-adding destination failed";
goto dropit;
}
}

status = OvsExecuteConntrackAction(ovsFwdCtx.curNbl, layers,
key, (const PNL_ATTR)a);
if (status != NDIS_STATUS_SUCCESS) {
OVS_LOG_ERROR("CT Action failed");
dropReason = L"OVS-conntrack action failed";
goto dropit;
}
break;
}

case OVS_ACTION_ATTR_RECIRC:
{
if (ovsFwdCtx.destPortsSizeOut > 0 || ovsFwdCtx.tunnelTxNic != NULL
Expand Down
Loading

0 comments on commit 792d377

Please sign in to comment.