Skip to content

Commit

Permalink
Started fix for frenetic-lang#450
Browse files Browse the repository at this point in the history
  • Loading branch information
mwhittaker committed Oct 27, 2015
1 parent 3c25031 commit 1172d10
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Frenetic_NetKAT_Json.ml
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,13 @@ let from_json_header_val (json : json) : header_val =
| "vlanpcp" -> VlanPcp (value |> to_string |> Int.of_string)
| "ethtype" -> EthType (value |> to_string |> Int.of_string)
| "ipproto" -> IPProto (value |> to_string |> Int.of_string)
| "ipSrc" -> IP4Src (value |> to_string |> Frenetic_Packet.ip_of_string, 32l)
| "ipDst" -> IP4Dst (value |> to_string |> Frenetic_Packet.ip_of_string, 32l)
(* TODO(mwhittaker): fix IP4Src *)
| "ip4src" -> IP4Src (value |> to_string |> Frenetic_Packet.ip_of_string, 32l)
| "ip4dst" ->
let addr_json = value |> member "addr" in
let mask_json = value |> member "mask" in
IP4Dst (addr_json |> to_string |> Frenetic_Packet.ip_of_string,
mask_json |> to_string |> Int32.of_string)
| "tcpsrcport" -> TCPSrcPort (value |> to_string |> Int.of_string)
| "tcpdstport" -> TCPDstPort (value |> to_string |> Int.of_string)
| str -> raise (Invalid_argument ("invalid header " ^ str))
Expand Down

0 comments on commit 1172d10

Please sign in to comment.