mirror of
https://github.com/soypat/lneto.git
synced 2026-09-11 00:59:30 +00:00
Add mdns package and Client implementation (#55)
* add mdns * define mdns.Client * fix some mdns stuff * refine dns package for use with mdns * remove Querier and Responder and replace with Client * add record setting methods on dns.record to reuse record buffer * protect against unbounded client answer growth * round off sharp mdns edges; reduce allocs * add mutlicast to stacks; add xnet tests for mdns * fix documentation on acceptmulticast field * mdns working
This commit is contained in:
@@ -6,6 +6,14 @@ const (
|
||||
sizeHeader = 20
|
||||
)
|
||||
|
||||
// IsMulticast reports whether addr is an IPv4 multicast address (224.0.0.0/4),
|
||||
// i.e. the most significant nibble is 0xE (1110 in binary) as defined in [RFC1112].
|
||||
//
|
||||
// [RFC1112]: https://datatracker.ietf.org/doc/html/rfc1112
|
||||
func IsMulticast(addr [4]byte) bool {
|
||||
return addr[0]&0xf0 == 0xe0
|
||||
}
|
||||
|
||||
// ToS represents the Traffic Class (a.k.a Type of Service). It is 8 bits long. 6 MSB are Differentiated Services; 2 LSB are Explicit Congenstion Notification.
|
||||
type ToS uint8
|
||||
|
||||
|
||||
Reference in New Issue
Block a user