From 54b0d4358f46bd4f0862a4525aa321e5e107b044 Mon Sep 17 00:00:00 2001 From: zhenglinan Date: Sat, 13 Aug 2022 13:15:58 +0800 Subject: [PATCH 1/3] support nsh encap and decap Signed-off-by: zhenglinan --- ofctrl/ofAction.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/ofctrl/ofAction.go b/ofctrl/ofAction.go index 1345a89f..f9d6bcc0 100644 --- a/ofctrl/ofAction.go +++ b/ofctrl/ofAction.go @@ -57,6 +57,8 @@ const ( ActTypeSetField = "setField" ActTypeCopyField = "copyField" ActTypeMeter = "meter" + ActTypeEncapsulate = "encap" + ActTypeDecapsulate = "decap" ) type OFAction interface { @@ -878,3 +880,30 @@ func NewMeterAction(meterId uint32) *MeterAction { MeterId: meterId, } } + +type NXEncapsulate struct { + HeaderSize uint16 + HeaderType uint32 + Property []openflow15.PropTLV +} + +func (a *NXEncapsulate) GetActionMessage() openflow15.Action { + return openflow15.NewNXActionEncapsulate(a.HeaderSize, a.HeaderType, a.Property) +} + +func (a *NXEncapsulate) GetActionType() string { + return ActTypeEncapsulate +} + +type NXDecapsulate struct { + HeaderType uint32 +} + +func (a *NXDecapsulate) GetActionMessage() openflow15.Action { + return openflow15.NewNXActionDecapsulate(a.HeaderType) +} + +func (a *NXDecapsulate) GetActionType() string { + return ActTypeDecapsulate +} + From c2c349308da78584f3f8b04f68a1c9ab30b2205b Mon Sep 17 00:00:00 2001 From: zhenglinan Date: Sun, 21 Aug 2022 17:08:27 +0800 Subject: [PATCH 2/3] support encap and decap for nsh and ethernet Signed-off-by: zhenglinan --- ofctrl/ofAction.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ofctrl/ofAction.go b/ofctrl/ofAction.go index f9d6bcc0..e35e142d 100644 --- a/ofctrl/ofAction.go +++ b/ofctrl/ofAction.go @@ -884,7 +884,7 @@ func NewMeterAction(meterId uint32) *MeterAction { type NXEncapsulate struct { HeaderSize uint16 HeaderType uint32 - Property []openflow15.PropTLV + Properties []openflow15.PropTLV } func (a *NXEncapsulate) GetActionMessage() openflow15.Action { @@ -906,4 +906,3 @@ func (a *NXDecapsulate) GetActionMessage() openflow15.Action { func (a *NXDecapsulate) GetActionType() string { return ActTypeDecapsulate } - From b6a40ecfafc5c12330defcc4a7d69643cfd4b396 Mon Sep 17 00:00:00 2001 From: zhenglinan Date: Sun, 21 Aug 2022 17:21:27 +0800 Subject: [PATCH 3/3] support encap and decap for nsh and ethernet Signed-off-by: zhenglinan --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 60f63432..14909610 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.6.0 +v0.6.1