Skip to content

Commit 64a1818

Browse files
committed
trivial whitespace edits
1 parent 3cd7e75 commit 64a1818

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

lib/SDN_OpenFlow0x01.ml

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ module AL = SDN_Types
22
module Core = OpenFlow0x01_Core
33
module Msg = OpenFlow0x01.Message
44

5-
65
exception Invalid_port of int32
76

87
let from_portId (pport_id : AL.portId) : Core.portId =
@@ -51,19 +50,19 @@ let from_pattern (pat : AL.Pattern.t) : Core.pattern =
5150
| None -> None
5251
| Some (p,m) ->
5352
let mo =
54-
if m = 32l then
55-
None
56-
else
57-
Some (Int32.sub 32l m) in
58-
Some { Core.m_value = p; Core.m_mask = mo })
53+
if m = 32l then
54+
None
55+
else
56+
Some (Int32.sub 32l m) in
57+
Some { Core.m_value = p; Core.m_mask = mo })
5958
; Core.nwDst = (match pat.AL.Pattern.nwDst with
6059
| None -> None
6160
| Some (p,m) ->
6261
let mo =
63-
if m = 32l then
64-
None
65-
else
66-
Some (Int32.sub 32l m) in
62+
if m = 32l then
63+
None
64+
else
65+
Some (Int32.sub 32l m) in
6766
Some { Core.m_value = p; Core.m_mask = mo })
6867
; Core.nwProto = pat.AL.Pattern.nwProto
6968
; Core.nwTos = None
@@ -92,11 +91,11 @@ module Common = HighLevelSwitch_common.Make (struct
9291
| AL.All ->
9392
(Mod.none, Output AllPorts)
9493
| AL.Physical pport_id ->
95-
let pport_id = from_portId pport_id in
96-
if Some pport_id = inPort then
97-
(Mod.none, Output InPort)
98-
else
99-
(Mod.none, Output (PhysicalPort pport_id))
94+
let pport_id = from_portId pport_id in
95+
if Some pport_id = inPort then
96+
(Mod.none, Output InPort)
97+
else
98+
(Mod.none, Output (PhysicalPort pport_id))
10099
| AL.Controller n ->
101100
(Mod.none, Output (Controller n))
102101
| AL.Local ->
@@ -129,34 +128,34 @@ module Common = HighLevelSwitch_common.Make (struct
129128
end
130129
| AL.Modify (AL.SetVlanPcp pcp) ->
131130
(Mod.dlVlanPcp, SetDlVlanPcp(VInt.(get_int4 (Int4 pcp))))
132-
| AL.Modify (AL.SetEthTyp _) ->
133-
raise (Invalid_argument "cannot set Ethernet type")
134-
| AL.Modify (AL.SetIPProto _) ->
135-
raise (Invalid_argument "cannot set IP protocol")
131+
| AL.Modify (AL.SetEthTyp _) ->
132+
raise (Invalid_argument "cannot set Ethernet type")
133+
| AL.Modify (AL.SetIPProto _) ->
134+
raise (Invalid_argument "cannot set IP protocol")
136135
| AL.Modify (AL.SetIP4Src nwAddr) ->
137136
(Mod.nwSrc, SetNwSrc nwAddr)
138137
| AL.Modify (AL.SetIP4Dst nwAddr) ->
139138
(Mod.nwDst, SetNwDst nwAddr)
140139
| AL.Modify (AL.SetTCPSrcPort tp) ->
141-
(Mod.tpSrc, SetTpSrc VInt.(get_int16 (Int16 tp)))
140+
(Mod.tpSrc, SetTpSrc VInt.(get_int16 (Int16 tp)))
142141
| AL.Modify (AL.SetTCPDstPort tp) ->
143142
(Mod.tpDst, SetTpDst VInt.(get_int16 (Int16 tp)))
144143
end)
145144

146145
let from_group (inPort : Core.portId option) (group : AL.group)
147-
: Core.action list =
146+
: Core.action list =
148147
match group with
149148
| [] -> []
150149
| [par] -> Common.flatten_par inPort par
151-
| _ ->
150+
| _ ->
152151
raise (SDN_Types.Unsupported "OpenFlow 1.0 does not support fast-failover")
153152

154153
let from_timeout (timeout : AL.timeout) : Core.timeout =
155154
match timeout with
156155
| AL.Permanent -> Core.Permanent
157156
| AL.ExpiresAfter n -> Core.ExpiresAfter n
158157

159-
let from_flow (priority : int) (flow : AL.flow) : Core.flowMod =
158+
let from_flow (priority : int) (flow : AL.flow) : Core.flowMod =
160159
let open AL in
161160
match flow with
162161
| { pattern; action; cookie; idle_timeout; hard_timeout } ->

0 commit comments

Comments
 (0)