-
Notifications
You must be signed in to change notification settings - Fork 51
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
NetKAT JSON IP4 Inconsistency #450
Comments
mwhittaker
added a commit
to mwhittaker/frenetic
that referenced
this issue
Oct 27, 2015
Oh man :-( Thanks for fixing this. |
Oh wow. |
type ip_addr = Ipaddr.V4.Prefix.t
let ip_addr_to_yojson ip =
`String (Ipaddr.V4.Prefix.to_string ip)
let ip_addr_of_yojson = function
| `String str ->
begin match Ipaddr.V4.Prefix.of_string str with
| None -> `Error (Printf.sprintf "unable to parse: %S" str)
| Some ip -> `Ok ip
end
| _ -> `Error "expecting string but got someting else" Also see ocaml-ppx/ppx_deriving_yojson#37. Haven't gotten around to it yet. |
craig-riecke
added a commit
that referenced
this issue
Dec 3, 2015
Fix JSON inconsistencies mentioned in #450
Ok fixed is merged in. Thanks for pointing this out @mwhittaker and for fixing it @smolkaj. |
Oops, I had forgotten about this :P. Thanks for the fix @smolkaj! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are some inconsistencies between the parsing and serialization of IPv4 headers to and from JSON. More specifically,
Frenetic_NetKAT_Json.ml
serializesIP4Src
andIP4Dst
header values into JSON objects, but it parses IP source and destination addresses expecting they're just strings. There are some other discrepancies too (e.g."ip4dst"
vs"ipDst"
).I can write up a fix.
The text was updated successfully, but these errors were encountered: