File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -339,6 +339,13 @@ func (f *Flow) MatchFlow() *MatchFlow {
339
339
}
340
340
}
341
341
342
+ // MatchFlowStrict converts Flow into a strict-matching-aware MatchFlow
343
+ func (f * Flow ) MatchFlowStrict () * MatchFlow {
344
+ mf := f .MatchFlow ()
345
+ mf .Strict = true
346
+ return mf
347
+ }
348
+
342
349
// marshalActions marshals all Actions in a Flow to their text form.
343
350
func (f * Flow ) marshalActions () ([]string , error ) {
344
351
fns := make ([]func () ([]byte , error ), 0 , len (f .Actions ))
Original file line number Diff line number Diff line change 37
37
// A MatchFlow is an OpenFlow flow intended for flow deletion. It can be marshaled to its textual
38
38
// form for use with Open vSwitch.
39
39
type MatchFlow struct {
40
- Protocol Protocol
40
+ Strict bool
41
41
InPort int
42
+ Priority int
43
+ Protocol Protocol
42
44
Matches []Match
43
45
Table int
44
46
@@ -83,6 +85,11 @@ func (f *MatchFlow) MarshalText() ([]byte, error) {
83
85
84
86
var b []byte
85
87
88
+ if f .Strict {
89
+ b = append (b , priority + "=" ... )
90
+ b = strconv .AppendInt (b , int64 (f .Priority ), 10 )
91
+ b = append (b , ',' )
92
+ }
86
93
if f .Protocol != "" {
87
94
b = append (b , f .Protocol ... )
88
95
b = append (b , ',' )
You can’t perform that action at this time.
0 commit comments