Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.6.0
v0.6.1
28 changes: 28 additions & 0 deletions ofctrl/ofAction.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ const (
ActTypeSetField = "setField"
ActTypeCopyField = "copyField"
ActTypeMeter = "meter"
ActTypeEncapsulate = "encap"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A similar question on the name to this one antrea-io/libOpenflow#25 (comment)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not only for nsh,it is for ethernet、nsh、mpls and mplstc

ActTypeDecapsulate = "decap"
)

type OFAction interface {
Expand Down Expand Up @@ -878,3 +880,29 @@ func NewMeterAction(meterId uint32) *MeterAction {
MeterId: meterId,
}
}

type NXEncapsulate struct {
HeaderSize uint16
HeaderType uint32
Properties []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
}