mongoose/docs/c-api/dns.h/mg_set_protocol_dns.md
Dmitry Frank 7bed7ff482 Docs are generated for Mongoose
Comments in headers are changed a bit: removed adoc-specific stuff,
markdown is used instead

PUBLISHED_FROM=9242cce85cc52a47a197d377e7e23804721a6bb5
2016-03-21 13:29:29 +01:00

661 B

title decl_name symbol_kind signature
mg_set_protocol_dns() mg_set_protocol_dns func void mg_set_protocol_dns(struct mg_connection *nc);

Attach built-in DNS event handler to the given listening connection.

DNS event handler parses incoming UDP packets, treating them as DNS requests. If incoming packet gets successfully parsed by the DNS event handler, a user event handler will receive MG_DNS_REQUEST event, with ev_data pointing to the parsed struct mg_dns_message.

See captive_dns_server example on how to handle DNS request and send DNS reply.