Skip to content

Commit

Permalink
Merge pull request #172 from avsm/domain-name-support
Browse files Browse the repository at this point in the history
[1.1 branch] Domain name 0.3.0 support
  • Loading branch information
avsm authored Jul 15, 2019
2 parents c61ce71 + 0c9cf8b commit 869aa48
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ env:
- PINS="mirage-dns:. dns-async:. dns-lwt:. dns-lwt-unix:."
- PACKAGE="dns"
- DEPOPTS="dns-async dns-lwt dns-lwt-unix"
- PRE_INSTALL_HOOK="cd /home/opam/opam-repository && git pull origin master && opam update -u -y"
matrix:
- DISTRO=debian-stable OCAML_VERSION=4.03
- DISTRO=debian-testing OCAML_VERSION=4.04
- DISTRO=debian-stable OCAML_VERSION=4.04
- DISTRO=ubuntu-lts OCAML_VERSION=4.05 DEPOPTS="mirage-dns dns-async dns-lwt dns-lwt-unix"
- DISTRO=alpine OCAML_VERSION=4.06 DEPOPTS="mirage-dns dns-async dns-lwt dns-lwt-unix"
- DISTRO=fedora OCAML_VERSION=4.07 DEPOPTS="mirage-dns dns-async dns-lwt dns-lwt-unix"
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### v1.1.3 (2019-07-16)

* Support domain-name.0.3.0 interface, which bumps the minimum
OCaml version supported to 4.04 due to that dependency (@avsm)
* Fix tests with recent OCaml (use mmap/bigarray-compat) (@avsm)

### v1.1.2 (2019-02-28)

* Mirage: adapt to mirage-kv 2.0.0 interface (#156 by @samoht)
Expand Down
1 change: 0 additions & 1 deletion async/async_dns_resolver_unix.mli
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

(** Async DNS resolution interface on Unix *)

open !Core
open !Async

val gethostbyname :
Expand Down
5 changes: 4 additions & 1 deletion dns.opam
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@ doc: "https://mirage.github.io/ocaml-dns/"
bug-reports: "https://github.com/mirage/ocaml-dns/issues"
depends: [
"ocaml" {>= "4.03.0"}
"dune" {build}
"dune"
"cstruct" {>= "3.0.2"}
"ppx_cstruct"
"re" {>="1.7.2"}
"ipaddr" {>= "2.6.0"}
"uri" {>= "1.7.0"}
"domain-name" {>="0.3.0"}
"base64" {>= "3.0.0"}
"hashcons"
"result"
"mmap" {with-test}
"bigarray-compat" {with-test}
"pcap-format" {with-test}
"ounit" {with-test}
]
Expand Down
2 changes: 1 addition & 1 deletion lib/name.ml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ let of_string (s:string) : t =
Re.Str.split (Re.Str.regexp "\\.") (String.lowercase_ascii s)
let string_to_domain_name = of_string

let of_ipaddr ip = of_string_list (Ipaddr.to_domain_name ip)
let of_ipaddr ip = of_string_list (Ipaddr.to_domain_name ip |> Domain_name.to_strings)

type label =
| L of string * int (* string *)
Expand Down
2 changes: 1 addition & 1 deletion lib_test/ounit/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(test
(name test)
(libraries dns oUnit pcap-format)
(libraries dns oUnit pcap-format bigarray-compat mmap)
(package dns)
(deps (glob_files *.pcap) (glob_files *.zone))
(preprocess (pps ppx_cstruct)))
2 changes: 1 addition & 1 deletion lib_test/ounit/test_packet.ml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type udpv4 = {

let load_pcap path =
let fd = Unix.(openfile path [O_RDONLY] 0) in
let buf = Bigarray.(Array1.map_file fd Bigarray.char c_layout false (-1)) in
let buf = Bigarray.(array1_of_genarray (Mmap.V1.map_file fd Bigarray.char c_layout false [|-1|])) in
let buf = Cstruct.of_bigarray buf in
let header, body = Cstruct.split buf Pcap.sizeof_pcap_header in
match Pcap.detect header with
Expand Down

0 comments on commit 869aa48

Please sign in to comment.