Skip to content
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

Parsing of mdns packets #4

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

mchalain
Copy link

@mchalain mchalain commented Aug 3, 2020

This pull request allows to have a complete parsing of messages and the announcement.
It populates all fields of mdns_pkt on packet reception, and displays each entry in debug mode.

This a first step to activate a function on a specific answer.

mdns_init_reply set the flags to indique a reply to a question.
To populate correctly the other kinds of packets like answer or
announce, the flage must be 0000.
mdns_init_pkt does that, and mdns_init_reply uses mdns_init_pkt to
reduce the code.
parse_rr may be use for any kind of rr (answer, authority or
additionnal), but needs to indique which list to populate.
parse_qn is an uncompleted parse_rr and it is useful only for rr_qn
list. But to have the same arguments on the both functions, we pass the
rr_qn list like parse_rr instead the message.
This code will parse information about SRV entry found inside the
message.
mds_parse_rr is compatible with rr_auth, and rr_add, and mdns_parse_pkt
uses it.
for PTR the name should be in the name's field or inside the PTR entry.
Before to try the PTR entry, the validity of the entry must be checked.
There is any reason to forbidde the rr_qn list inside the packet. The
mdnsd server doesn't add qn then, rr_qn should be empty.
Currently the qn list is not correctly encoded a part must be deleted.
display_mdns_segment allows to display the rr's lists of messages.
This is useful for debuging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant