diff --git a/net_xfrm.go b/net_xfrm.go index 5a9f497d..204ff193 100644 --- a/net_xfrm.go +++ b/net_xfrm.go @@ -86,6 +86,16 @@ type XfrmStat struct { XfrmOutStateInvalid int // State hasn’t been fully acquired before use XfrmAcquireError int + // State direction mismatch + // i.e. lookup found an input state on the output path + XfrmOutStateDirError int + // State direction mismatch + // i.e. lookup found an output state on the input path + XfrmInStateDirError int + // IP-TFS inbound packet processing error + XfrmInIptfsError int + // IP-TFS outbound queue is full + XfrmOutNoQueueSpace int } // NewXfrmStat reads the xfrm_stat statistics. @@ -181,6 +191,14 @@ func (fs FS) NewXfrmStat() (XfrmStat, error) { x.XfrmOutStateInvalid = value case "XfrmAcquireError": x.XfrmAcquireError = value + case "XfrmOutStateDirError": + x.XfrmOutStateDirError = value + case "XfrmInStateDirError": + x.XfrmInStateDirError = value + case "XfrmInIptfsError": + x.XfrmInIptfsError = value + case "XfrmOutNoQueueSpace": + x.XfrmOutNoQueueSpace = value } } diff --git a/net_xfrm_test.go b/net_xfrm_test.go index d3bbbfe0..ddf73fbb 100644 --- a/net_xfrm_test.go +++ b/net_xfrm_test.go @@ -56,6 +56,10 @@ func TestXfrmStats(t *testing.T) { {name: "XfrmFwdHdrError", want: 6654, got: xfrmStats.XfrmFwdHdrError}, {name: "XfrmOutStateInvaliad", want: 28765, got: xfrmStats.XfrmOutStateInvalid}, {name: "XfrmAcquireError", want: 24532, got: xfrmStats.XfrmAcquireError}, + {name: "XfrmOutStateDirError", want: 11, got: xfrmStats.XfrmOutStateDirError}, + {name: "XfrmInStateDirError", want: 12, got: xfrmStats.XfrmInStateDirError}, + {name: "XfrmInIptfsError", want: 13, got: xfrmStats.XfrmInIptfsError}, + {name: "XfrmOutNoQueueSpace", want: 14, got: xfrmStats.XfrmOutNoQueueSpace}, {name: "XfrmInStateInvalid", want: 55555, got: xfrmStats.XfrmInStateInvalid}, {name: "XfrmOutError", want: 1000000, got: xfrmStats.XfrmOutError}, } { diff --git a/testdata/fixtures.ttar b/testdata/fixtures.ttar index 8be35d96..e879f873 100644 --- a/testdata/fixtures.ttar +++ b/testdata/fixtures.ttar @@ -2983,7 +2983,7 @@ Inter-| sta-| Quality | Discarded packets | Missed Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/proc/net/xfrm_stat -Lines: 28 +Lines: 32 XfrmInError 1 XfrmInBufferError 2 XfrmInHdrError 4 @@ -3012,6 +3012,10 @@ XfrmOutPolError 1454 XfrmFwdHdrError 6654 XfrmOutStateInvalid 28765 XfrmAcquireError 24532 +XfrmOutStateDirError 11 +XfrmInStateDirError 12 +XfrmInIptfsError 13 +XfrmOutNoQueueSpace 14 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/proc/pressure