Skip to content

Commit

Permalink
extract dns_parser.rs into its own crate mdns-parser (#284)
Browse files Browse the repository at this point in the history
- the new crate is kept in this same repo to keep things easier to manage (and the patch diff easier to track).
- mdns-sd crate will depend on the new crate mdns-parser (inside the repo)
  • Loading branch information
keepsimple1 authored Dec 21, 2024
1 parent 7afed98 commit b1795c9
Show file tree
Hide file tree
Showing 11 changed files with 702 additions and 587 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# Generated by Cargo
# will have compiled files and executables
/target/
mdns-parser/target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if-addrs = { version = "0.13", features = ["link-local"] } # get local IP addres
log = { version = "0.4", optional = true } # logging
mio = { version = "1.0", features = ["os-poll", "net"] } # select/poll sockets
socket2 = { version = "0.5.5", features = ["all"] } # socket APIs
mdns-parser = { path = "mdns-parser" } # DNS message parsing

[dev-dependencies]
env_logger = { version = "= 0.10.2", default-features = false, features= ["humantime"] }
Expand Down
19 changes: 19 additions & 0 deletions mdns-parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "mdns-parser"
version = "0.1.0"
edition = "2018"
rust-version = "1.65.0"
authors = ["keepsimple <[email protected]>"]
keywords = ["mdns", "service-discovery", "zeroconf", "dns-sd"]
license = "Apache-2.0 OR MIT"
repository = "https://github.com/keepsimple1/mdns-sd"
description = "DNS message parsing for mDNS Service Discovery"

[features]
logging = ["log"]

[dependencies]
log = { version = "0.4", optional = true } # logging

[dev-dependencies]
fastrand = "2.1"
12 changes: 12 additions & 0 deletions mdns-parser/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# mdns-parser

A DNS message parsing utility for mDNS service discovery. Originally it was just a file in the [`mdns-sd`](https://crates.io/crates/mdns-sd) crate, and now it is built into its own crate so that it can be used in other cases. Please note that the API is still experimental and might change in near future.

## Contribution

Contributions are welcome! Please open an issue in GitHub if any questions.

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the above license(s), shall be
dual licensed as above, without any additional terms or conditions.

Loading

0 comments on commit b1795c9

Please sign in to comment.