File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 6666// Action strings in lower case, as those are compared to the lower case letters
6767// in parseAction().
6868const (
69+ actionAll = "all"
6970 actionDrop = "drop"
7071 actionFlood = "flood"
7172 actionInPort = "in_port"
@@ -96,6 +97,8 @@ func (a *textAction) MarshalText() ([]byte, error) {
9697// GoString implements Action.
9798func (a * textAction ) GoString () string {
9899 switch a .action {
100+ case actionAll :
101+ return "ovs.All()"
99102 case actionDrop :
100103 return "ovs.Drop()"
101104 case actionFlood :
@@ -113,6 +116,14 @@ func (a *textAction) GoString() string {
113116 }
114117}
115118
119+ // All outputs the packet on all switch ports except
120+ // the port on which it was received.
121+ func All () Action {
122+ return & textAction {
123+ action : actionAll ,
124+ }
125+ }
126+
116127// Drop immediately discards the packet. It must be the only Action
117128// specified when used.
118129func Drop () Action {
Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ func TestActionConstants(t *testing.T) {
2424 a Action
2525 out string
2626 }{
27+ {
28+ a : All (),
29+ out : "all" ,
30+ },
2731 {
2832 a : Drop (),
2933 out : "drop" ,
You can’t perform that action at this time.
0 commit comments