mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-03 13:28:44 +00:00
Remove old docs, rename docs_new to docs
It would be probably good idea to also remove tools/docgen.py and asciidoc.mk, but asciidoc.mk is still mentioned under `cloud/doc`, which may contain some useful info which we'll need at least to review before removing. PUBLISHED_FROM=faf454d4c52a2f07ea8ac084cf0bd11a0c9c9b3b
This commit is contained in:
1 parent
f443c64341
commit
23122b327c
182 files changed
+3592
-263
No files matched your search
@@ -0,0 +1,8 @@
|
||||
---
|
||||
title: "DNS server"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "dns-server.h"
|
||||
---
|
||||
|
||||
Disabled by default; enable with `-DMG_ENABLE_DNS_SERVER`.
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "intro.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_dns_create_reply.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_dns_reply_record.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_dns_send_reply.md"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
title: "mg_dns_create_reply()"
|
||||
decl_name: "mg_dns_create_reply"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
struct mg_dns_reply mg_dns_create_reply(struct mbuf *io,
|
||||
struct mg_dns_message *msg);
|
||||
---
|
||||
|
||||
Create a DNS reply.
|
||||
|
||||
The reply will be based on an existing query message `msg`.
|
||||
The query body will be appended to the output buffer.
|
||||
"reply + recursion allowed" will be added to the message flags and
|
||||
message's num_answers will be set to 0.
|
||||
|
||||
Answer records can be appended with `mg_dns_send_reply` or by lower
|
||||
level function defined in the DNS API.
|
||||
|
||||
In order to send the reply use `mg_dns_send_reply`.
|
||||
It's possible to use a connection's send buffer as reply buffers,
|
||||
and it will work for both UDP and TCP connections.
|
||||
|
||||
Example:
|
||||
|
||||
```c
|
||||
reply = mg_dns_create_reply(&nc->send_mbuf, msg);
|
||||
for (i = 0; i < msg->num_questions; i++) {
|
||||
rr = &msg->questions[i];
|
||||
if (rr->rtype == MG_DNS_A_RECORD) {
|
||||
mg_dns_reply_record(&reply, rr, 3600, &dummy_ip_addr, 4);
|
||||
}
|
||||
}
|
||||
mg_dns_send_reply(nc, &reply);
|
||||
```
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
title: "mg_dns_reply_record()"
|
||||
decl_name: "mg_dns_reply_record"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_dns_reply_record(struct mg_dns_reply *reply,
|
||||
struct mg_dns_resource_record *question,
|
||||
const char *name, int rtype, int ttl, const void *rdata,
|
||||
size_t rdata_len);
|
||||
---
|
||||
|
||||
Append a DNS reply record to the IO buffer and to the DNS message.
|
||||
|
||||
The message num_answers field will be incremented. It's caller's duty
|
||||
to ensure num_answers is propertly initialized.
|
||||
|
||||
Returns -1 on error.
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: "mg_dns_send_reply()"
|
||||
decl_name: "mg_dns_send_reply"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_dns_send_reply(struct mg_connection *nc, struct mg_dns_reply *r);
|
||||
---
|
||||
|
||||
Send a DNS reply through a connection.
|
||||
|
||||
The DNS data is stored in an IO buffer pointed by reply structure in `r`.
|
||||
This function mutates the content of that buffer in order to ensure that
|
||||
the DNS header reflects size and flags of the mssage, that might have been
|
||||
updated either with `mg_dns_reply_record` or by direct manipulation of
|
||||
`r->message`.
|
||||
|
||||
Once sent, the IO buffer will be trimmed unless the reply IO buffer
|
||||
is the connection's send buffer and the connection is not in UDP mode.
|
||||
|
||||
Reference in new issue
Block a user