Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Of0x05 async messages #168

Open
wants to merge 68 commits into
base: of0x05
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
64ce330
preliminary OF1.4 implementation, with portdesc structure
fugitifduck Aug 5, 2014
372912e
import FlowMatch structure from OF1.4
fugitifduck Aug 5, 2014
1f160b3
add new OXM TLV (PBB UCA)
fugitifduck Aug 5, 2014
f2c73bd
import Instruction and Action structure from of1.4
fugitifduck Aug 5, 2014
2fc84b1
add experimenter and new message
fugitifduck Aug 5, 2014
3cf85b1
correct switchFeatures padding
fugitifduck Aug 5, 2014
8ccc756
add switchConfig module
fugitifduck Aug 5, 2014
d743fe7
fix padding
fugitifduck Aug 5, 2014
d73de80
add switchConfig type
fugitifduck Aug 5, 2014
4a179b8
add roundtrip test for of0x05
fugitifduck Aug 5, 2014
046040d
add quicheck file
fugitifduck Aug 6, 2014
f2b8662
export type as t for instruction
fugitifduck Aug 6, 2014
cc426ea
export type as t for instructions
fugitifduck Aug 6, 2014
a225b32
export type as t for action
fugitifduck Aug 6, 2014
f189d42
reuse of of1.3 module
fugitifduck Aug 6, 2014
0670255
Merge branch 'LearningSwitch0x04' into of0x05
fugitifduck Aug 6, 2014
860cc37
reuse of switchConfig from of1.3
fugitifduck Aug 6, 2014
3f005e8
add tablemod
fugitifduck Aug 7, 2014
5cce00f
add flowmod message
fugitifduck Aug 7, 2014
7c8f850
add rountrip test for flowmod
fugitifduck Aug 7, 2014
11282f8
Merge branch 'GroupMod' into of0x05_modifyState
fugitifduck Aug 7, 2014
4d2bb1d
import groupMod and Bucket from 1.3
fugitifduck Aug 7, 2014
f863084
add new message
fugitifduck Aug 7, 2014
a0ff54e
add PortMod module and properties tlv
fugitifduck Aug 7, 2014
ae145e0
add rountrip test for PortMod
fugitifduck Aug 7, 2014
f830c1c
add PortMod to message
fugitifduck Aug 7, 2014
36aa766
import MeterMod module from OF1.3
fugitifduck Aug 7, 2014
a742745
Merge branch 'tableFeat' into of0x05_multipart
fugitifduck Aug 8, 2014
f8b1706
import multipart request message from of1.3 and update existing multi…
fugitifduck Aug 9, 2014
b5baadb
add TableDesc Req message
fugitifduck Aug 10, 2014
b897511
add QueueDesc Req message
fugitifduck Aug 10, 2014
fcbc3a8
add FlowMonitor message to multipart
fugitifduck Aug 11, 2014
b268858
Merge branch 'tableFeat' into of0x05_multipart
fugitifduck Aug 11, 2014
e07264e
activity: record activity on echo reply
seliopou Aug 12, 2014
625b9e2
activity: remove unused optional argument
seliopou Aug 12, 2014
aa83da9
activity: rework handshake/activity distinction
seliopou Aug 12, 2014
28a843b
activity: record activity for all messages
seliopou Aug 12, 2014
2292620
add missing interface for length function
fugitifduck Aug 12, 2014
5e5069a
import multipart reply module from of1.3
fugitifduck Aug 12, 2014
d1dc4b4
add FlowMonitored Reply message
fugitifduck Aug 12, 2014
2111bea
multipart messages :
fugitifduck Aug 13, 2014
4de09fd
add multipart message Message module
fugitifduck Aug 13, 2014
aa63745
import PacketOut, RoleRequest, BarrierReq and BarrierReply from of1.3
fugitifduck Aug 13, 2014
6f84836
add BundleCtrl message
fugitifduck Aug 13, 2014
cc96a0c
activity: Make echo the first stage of the pipeline
seliopou Aug 13, 2014
026e6c2
add interface for Capabilities
fugitifduck Aug 14, 2014
5d647dc
Merge pull request #165 from frenetic-lang/type_t
seliopou Aug 14, 2014
62dc4fe
v0.6.0
seliopou Aug 14, 2014
1c73bb8
Merge pull request #155 from frenetic-lang/activity
seliopou Aug 14, 2014
0103876
use OF0x05 module for SwitchFeatures
fugitifduck Aug 14, 2014
a109b7f
Add BundleAdd message
fugitifduck Aug 14, 2014
24319ce
parse and marshal the message Header for BundleAdd
fugitifduck Aug 14, 2014
bed9adc
add BundleAdd interface
fugitifduck Aug 14, 2014
4174a19
add AsyncConfig message
fugitifduck Aug 15, 2014
997b907
add rountrip test for AsyncConfig and correct an error
fugitifduck Aug 15, 2014
e9b816b
Import PacketIn from OF1.3
fugitifduck Aug 15, 2014
5987278
export t type for every module
fugitifduck Aug 15, 2014
4f2f4a7
add to_string function for messages
fugitifduck Aug 15, 2014
a17cdea
Change sizeof_header function to be less specific
fugitifduck Aug 15, 2014
adb4b10
Delete TableFeatures module
fugitifduck Aug 15, 2014
9e15b2f
Rename MeterFeaturesStats to MeterFeatures
fugitifduck Aug 15, 2014
0b42e32
Initial documentation
fugitifduck Aug 15, 2014
901b8cd
AsyncConfig change :
fugitifduck Aug 15, 2014
12847b1
Merge branch 'of0x04_typeClean' into of0x05_asyncMessages and add Por…
fugitifduck Aug 15, 2014
b66708c
add interface for Role in RoleRequest
fugitifduck Aug 15, 2014
80dabe3
role status message and its roundtrip test
fugitifduck Aug 15, 2014
62ebbd4
add table status message and its roundtrip test
fugitifduck Aug 15, 2014
63eaabc
add request forward message
fugitifduck Aug 15, 2014
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
5 changes: 4 additions & 1 deletion _oasis
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
OASISFormat: 0.3
OCamlVersion: >= 4.01.0
Name: openflow
Version: 0.5.0
Version: 0.6.0
Synopsis: Serialization library for OpenFlow
Authors: https://github.com/frenetic-lang/ocaml-openflow/contributors
License: LGPL
Expand Down Expand Up @@ -41,6 +41,8 @@ Library openflow
OpenFlow0x01_Stats,
OpenFlow0x04,
OpenFlow0x04_Core,
OpenFlow0x05,
OpenFlow0x05_Core,
SDN_OpenFlow0x01,
SDN_OpenFlow0x04,
GroupTable0x04,
Expand Down Expand Up @@ -83,6 +85,7 @@ Library quickcheck
Arbitrary_OpenFlow,
Arbitrary_OpenFlow0x01,
Arbitrary_OpenFlow0x04,
Arbitrary_OpenFlow0x05,
Arbitrary_SDN_Types

Executable testtool
Expand Down
2 changes: 1 addition & 1 deletion async/Async_OpenFlow.mli
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ module Chunk : sig
val set_idle_wait : t -> Time.Span.t -> unit
val set_kill_wait : t -> Time.Span.t -> unit

val echo : (t, h, h) Stage.t
val echo : (t, e, e) Stage.t
val handshake : int -> (t, e, h) Stage.t
end

Expand Down
2 changes: 1 addition & 1 deletion async/Async_OpenFlow0x01.ml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ module Controller = struct
let open ChunkController in
let stages =
(local (fun t -> t.sub)
(handshake 0x01 >=> echo))
(echo >=> handshake 0x01))
>=> openflow0x01 in
run stages t (listen t.sub)
end
2 changes: 1 addition & 1 deletion async/Async_OpenFlow0x04.ml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module Controller = struct
let open ChunkController in
let stages =
(local (fun t -> t.sub)
(handshake 0x04 >=> echo))
(echo >=> handshake 0x04))
>=> openflow0x04 in
run stages t (listen t.sub)

Expand Down
23 changes: 12 additions & 11 deletions async/Async_OpenFlowChunk.ml
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,26 @@ module Controller = struct

module Conn = struct
type t = {
state : [ `Handshake | `Active | `Idle | `Kill ];
state : [ `Active | `Idle | `Kill ];
version : int option;
state_entered : Time.t;
last_activity : Time.t
}

let create () : t =
let now = Time.now () in
{ state = `Handshake
{ state = `Active
; version = None
; state_entered = now
; last_activity = now
}

let activity (t:t) : t =
let t = { t with last_activity = Time.now () } in
if t.state = `Active then
t
else
if t.state = `Idle then
{ t with state = `Active; state_entered = t.last_activity }
else
t

let complete_handshake (t:t) (version:int) : t =
activity { t with version = Some(version) }
Expand Down Expand Up @@ -107,7 +107,7 @@ module Controller = struct
| None -> assert false
| Some(conn) -> Some(Conn.complete_handshake conn version))

let activity (t:t) ?ver (c_id:Client_id.t) =
let activity (t:t) (c_id:Client_id.t) =
ClientTbl.change t.clients c_id (function
| None -> assert false
| Some(conn) -> Some(Conn.activity conn))
Expand Down Expand Up @@ -194,8 +194,8 @@ module Controller = struct
let has_client_id t c_id =
Platform.has_client_id t.platform c_id &&
match ClientTbl.find t.clients c_id with
| Some(conn) -> not (conn.Conn.state = `Handshake)
| _ -> false
| Some({ Conn.version = Some(_) }) -> true
| _ -> false

let send t c_id m =
Platform.send t.platform c_id m
Expand Down Expand Up @@ -228,7 +228,7 @@ module Controller = struct
| `Message (c_id, msg) ->
begin match ClientTbl.find t.clients c_id with
| None -> assert false
| Some({ Conn.state = `Handshake }) ->
| Some({ Conn.version = None }) ->
let hdr, bits = msg in
begin
if not (hdr.type_code = type_code_hello) then begin
Expand All @@ -247,7 +247,7 @@ module Controller = struct
| `Disconnect (c_id, exn) ->
begin match ClientTbl.find t.clients c_id with
| None -> assert false
| Some({ Conn.state = `Handshake }) ->
| Some({ Conn.version = None }) ->
ClientTbl.remove t.clients c_id;
return []
| Some(_) ->
Expand All @@ -259,6 +259,7 @@ module Controller = struct
let open Header in
match evt with
| `Message (c_id, (hdr, bytes)) ->
Handler.activity t c_id;
begin if hdr.Header.type_code = type_code_echo_request then
(* Echo requests get a reply *)
let hdr = { hdr with type_code = type_code_echo_reply } in
Expand All @@ -272,7 +273,7 @@ module Controller = struct
* *)
>>| (function _ -> [])
else if hdr.Header.type_code = type_code_echo_reply then
(* Echo replies get eaten *)
(* Echo replies get eaten. The activity has been recorded above. *)
return []
else
(* All other messages get forwarded *)
Expand Down
8 changes: 4 additions & 4 deletions lib/META
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OASIS_START
# DO NOT EDIT (digest: adf89b68ac0ed5e7674e6d8f66515b39)
version = "0.5.0"
# DO NOT EDIT (digest: 70d46b868aee1843635d9d187dfc1041)
version = "0.6.0"
description = "Serialization library for OpenFlow"
requires =
"str cstruct cstruct.syntax packet core sexplib.syntax sexplib threads"
Expand All @@ -10,7 +10,7 @@ archive(native) = "openflow.cmxa"
archive(native, plugin) = "openflow.cmxs"
exists_if = "openflow.cma"
package "quickcheck" (
version = "0.5.0"
version = "0.6.0"
description = "Serialization library for OpenFlow"
requires = "quickcheck openflow packet.quickcheck"
archive(byte) = "quickcheck.cma"
Expand All @@ -21,7 +21,7 @@ package "quickcheck" (
)

package "async" (
version = "0.5.0"
version = "0.6.0"
description = "Serialization library for OpenFlow"
requires = "async openflow cstruct.async threads sexplib.syntax sexplib"
archive(byte) = "async.cma"
Expand Down
Loading