Repo of no-std crates for my personal embedded projects

feat: WIP MDNS crate #6

merged opened by sachy.dev targeting main from wip-mdns

Adds a mdns resolver/state-machine crate for providing MDNS-SD functionality for an embedded device.

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:usjm3ynnir6y4inkcdovrfei/sh.tangled.repo.pull/3ma23jz3akl22
+23 -12
Interdiff #0 #1
.tangled/workflows/miri.yml

This file has not been changed.

Cargo.lock

This file has not been changed.

Cargo.toml

This file has not been changed.

sachy-mdns/Cargo.toml

This file has not been changed.

sachy-mdns/src/dns.rs

This file has not been changed.

sachy-mdns/src/dns/flags.rs

This file has not been changed.

+2 -1
sachy-mdns/src/dns/label.rs
··· 145 145 len => { 146 146 if len > MAX_STR_LEN { 147 147 return Err(ErrMode::Cut(ContextError::from_external_error( 148 - input, DnsError::LabelTooLong, 148 + input, 149 + DnsError::LabelTooLong, 149 150 ))); 150 151 } 151 152
sachy-mdns/src/dns/query.rs

This file has not been changed.

sachy-mdns/src/dns/records.rs

This file has not been changed.

+2
sachy-mdns/src/dns/reqres.rs
··· 226 226 227 227 #[test] 228 228 fn parse_response_two_records() { 229 + #[rustfmt::skip] 229 230 let data = [ 230 231 0xAA, 0xAA, // 231 232 0x81, 0x80, // ··· 345 346 346 347 #[test] 347 348 fn parse_response_back_forth() { 349 + #[rustfmt::skip] 348 350 let data = [ 349 351 0, 0, // Transaction ID 350 352 132, 0, // Response, Authoritative Answer, No Recursion
sachy-mdns/src/dns/traits.rs

This file has not been changed.

sachy-mdns/src/encoder.rs

This file has not been changed.

sachy-mdns/src/lib.rs

This file has not been changed.

+19 -11
sachy-mdns/src/server.rs
··· 74 74 Request::parse(&mut &incoming[..], incoming) 75 75 .ok() 76 76 .and_then(|req| { 77 - let valid_queries = req 78 - .queries 79 - .iter() 80 - .filter_map(|q| match q.qtype { 81 - QType::A | QType::AAAA | QType::TXT | QType::SRV => { 82 - (q.name == self.service.hostname()).then_some((q.qtype, q.qclass)) 83 - } 84 - QType::PTR => (q.name == self.service.service_type()).then_some((q.qtype, q.qclass)), 85 - QType::Any | QType::Unknown(_) => None, 86 - }).collect::<Vec<_>>(); 77 + let valid_queries = 78 + req.queries 79 + .iter() 80 + .filter_map(|q| match q.qtype { 81 + QType::A | QType::AAAA | QType::TXT | QType::SRV => { 82 + (q.name == self.service.hostname()).then_some((q.qtype, q.qclass)) 83 + } 84 + QType::PTR => (q.name == self.service.service_type()) 85 + .then_some((q.qtype, q.qclass)), 86 + QType::Any | QType::Unknown(_) => None, 87 + }) 88 + .collect::<Vec<_>>(); 87 89 88 90 if !valid_queries.is_empty() { 89 - self.broadcast(ResponseKind::QueryResponse(valid_queries), req.flags, req.id, req.queries, outgoing) 91 + self.broadcast( 92 + ResponseKind::QueryResponse(valid_queries), 93 + req.flags, 94 + req.id, 95 + req.queries, 96 + outgoing, 97 + ) 90 98 } else { 91 99 None 92 100 }
sachy-mdns/src/service.rs

This file has not been changed.

sachy-mdns/src/state.rs

This file has not been changed.

History

2 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
feat: WIP MDNS crate
2/2 success
expand
expand 0 comments
pull request successfully merged
1 commit
expand
feat: WIP MDNS crate
1/2 failed, 1/2 timeout
expand
expand 0 comments