aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/vishvananda/netlink/xfrm_policy.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-01-23 06:15:11 -0800
committerGitHub <noreply@github.com>2020-01-23 06:15:11 -0800
commit8098cbbee192e644de505e62c4aa0341f4acb4a5 (patch)
tree50af7ba7e829ab4d6fc9ba143e13f79dc04f4f64 /vendor/github.com/vishvananda/netlink/xfrm_policy.go
parentc5f3899cb4133922a9732aff4680bb7eea3d391b (diff)
parent9f927c4709a51ef72d84bb557fc371d535c19fba (diff)
downloadpodman-8098cbbee192e644de505e62c4aa0341f4acb4a5.tar.gz
podman-8098cbbee192e644de505e62c4aa0341f4acb4a5.tar.bz2
podman-8098cbbee192e644de505e62c4aa0341f4acb4a5.zip
Merge pull request #4946 from containers/dependabot/go_modules/github.com/vishvananda/netlink-1.1.0
build(deps): bump github.com/vishvananda/netlink from 1.0.0 to 1.1.0
Diffstat (limited to 'vendor/github.com/vishvananda/netlink/xfrm_policy.go')
-rw-r--r--vendor/github.com/vishvananda/netlink/xfrm_policy.go26
1 files changed, 24 insertions, 2 deletions
diff --git a/vendor/github.com/vishvananda/netlink/xfrm_policy.go b/vendor/github.com/vishvananda/netlink/xfrm_policy.go
index c97ec43a2..6219d2772 100644
--- a/vendor/github.com/vishvananda/netlink/xfrm_policy.go
+++ b/vendor/github.com/vishvananda/netlink/xfrm_policy.go
@@ -35,6 +35,25 @@ func (d Dir) String() string {
return fmt.Sprintf("socket %d", d-XFRM_SOCKET_IN)
}
+// PolicyAction is an enum representing an ipsec policy action.
+type PolicyAction uint8
+
+const (
+ XFRM_POLICY_ALLOW PolicyAction = 0
+ XFRM_POLICY_BLOCK PolicyAction = 1
+)
+
+func (a PolicyAction) String() string {
+ switch a {
+ case XFRM_POLICY_ALLOW:
+ return "allow"
+ case XFRM_POLICY_BLOCK:
+ return "block"
+ default:
+ return fmt.Sprintf("action %d", a)
+ }
+}
+
// XfrmPolicyTmpl encapsulates a rule for the base addresses of an ipsec
// policy. These rules are matched with XfrmState to determine encryption
// and authentication algorithms.
@@ -64,11 +83,14 @@ type XfrmPolicy struct {
Dir Dir
Priority int
Index int
+ Action PolicyAction
+ Ifindex int
+ Ifid int
Mark *XfrmMark
Tmpls []XfrmPolicyTmpl
}
func (p XfrmPolicy) String() string {
- return fmt.Sprintf("{Dst: %v, Src: %v, Proto: %s, DstPort: %d, SrcPort: %d, Dir: %s, Priority: %d, Index: %d, Mark: %s, Tmpls: %s}",
- p.Dst, p.Src, p.Proto, p.DstPort, p.SrcPort, p.Dir, p.Priority, p.Index, p.Mark, p.Tmpls)
+ return fmt.Sprintf("{Dst: %v, Src: %v, Proto: %s, DstPort: %d, SrcPort: %d, Dir: %s, Priority: %d, Index: %d, Action: %s, Ifindex: %d, Ifid: %d, Mark: %s, Tmpls: %s}",
+ p.Dst, p.Src, p.Proto, p.DstPort, p.SrcPort, p.Dir, p.Priority, p.Index, p.Action, p.Ifindex, p.Ifid, p.Mark, p.Tmpls)
}