-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathflow.go
37 lines (33 loc) · 852 Bytes
/
flow.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package ofputil
import (
of "github.com/netrack/openflow"
"github.com/netrack/openflow/ofp"
)
func TableFlush(table ofp.Table) *of.Request {
return of.NewRequest(of.TypeFlowMod, &ofp.FlowMod{
Table: table,
Command: ofp.FlowDelete,
Buffer: ofp.NoBuffer,
OutPort: ofp.PortAny,
OutGroup: ofp.GroupAny,
Match: ofp.Match{ofp.MatchTypeXM, nil},
})
}
func FlowFlush(table ofp.Table, match ofp.Match) *of.Request {
return of.NewRequest(of.TypeFlowMod, &ofp.FlowMod{
Table: table,
Command: ofp.FlowDelete,
Buffer: ofp.NoBuffer,
OutPort: ofp.PortAny,
OutGroup: ofp.GroupAny,
Match: match,
})
}
func FlowDrop(table ofp.Table) *of.Request {
return of.NewRequest(of.TypeFlowMod, &ofp.FlowMod{
Table: table,
Command: ofp.FlowAdd,
Buffer: ofp.NoBuffer,
Match: ofp.Match{ofp.MatchTypeXM, nil},
})
}