Commit Graph

13 Commits

Author SHA1 Message Date
Matt Ellison
1e2e7ab670 Add Support for Virtual XFRM Interfaces
XFRM interfaces are available in Linux Kernel 4.19+

When an IF_ID is applied to a XFRM policy and state, the corresponding
traffic will be sent through the virtual interface with the same IF_ID.
2019-01-05 11:40:40 -08:00
Chris Telfer
8aa85bfa77 Add support for action and ifindex in XFRM policy
The action and ifindex fields aren't represented in the XfrmPolicy type
although they exist in the the linux equivalent data structures.   They
are represented in the serialized versions of those datatypes.  So this
patch simply exposes those fields to the user-consumable side of the
API.  This patch makes the policy's action a specific type in the same
style as the Dir field in XfrmPolicy.

Update the existing unit tests to compare Ifindex and Action fields in
the XFRM structure.  Verify that the default policy returns an action of
ALLOW and an ifindex of 0.  Add a unit test to add and read back a
policy to the loopback interface (ifindex 1) with action "block".

Signed-off-by: Chris Telfer <ctelfer@docker.com>
2018-08-14 10:33:37 -07:00
Alessandro Boch
f67b75edbf Properly tear down netns at the end of test
Signed-off-by: Alessandro Boch <aboch@tetrationanalytics.com>
2017-11-28 09:08:21 -08:00
Aithal
dedc638a06 Fix compilation errors for non linux platforms.
The go get command and make both fail when executed on
non-linux platforms. Modified it so that there are no
compilation errors when developing in such an
environment.
2017-02-20 12:00:54 -08:00
Alessandro Boch
9b552a7a61 Allow SPI to be passed in policy template (#127)
- It is part of the ID and it is needed when you
  program policies for different SAs which share
  same src and dst

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-25 11:10:56 -07:00
Alessandro Boch
f9bc7a684e Support xfrm state/policy flush (#122)
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-13 16:42:24 -07:00
Alessandro Boch
d975f28755 XFRM Get/Delete state/policy should share same code (#119)
- Currently they are not and GET methods are passing
  the wrong structure. Also they are setting the incorrect
  XFRM_F_DUMP flag. Because of this, current get methods
  do not return expected error when query target is not found.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-12 13:16:26 -07:00
Alessandro Boch
ef0e63f64d Fix a bug in selFromPolicy() (#120)
- It assumes Src and Dst *ipNet are always specified

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-12 10:52:20 -07:00
Alessandro Boch
cb0b035c41 Provide method to query for specific policy (#115)
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-09 16:52:35 -07:00
Alessandro Boch
a123807666 Allow to program L4 fields in policy selector (#113)
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-09 09:19:18 -07:00
Alessandro Boch
7ec3682687 Support xfrm state/policy update
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-03 22:52:55 -07:00
Alessandro Boch
18e9389da5 Add Mark field to xrfm state and policy (#110)
* Add Mark to xrfm state

Signed-off-by: Alessandro Boch <aboch@docker.com>

* Add Mark to xfrm policies

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-04-30 20:31:59 -07:00
Vishvananda Ishaya
8dab8b7462 Initial commit of netlink package 2014-08-31 20:34:46 -07:00