mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-09 16:21:45 +00:00
Fix mongoose docs generation
PUBLISHED_FROM=331821dcd1f7dc8a94581cd8a9b51aa00a89fddc
This commit is contained in:
1 parent
ab000c684a
commit
3eb4eb8074
166 files changed
+3125
No files matched your search
@@ -0,0 +1,20 @@
|
||||
---
|
||||
title: "DNS API reference"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "mg_dns.h"
|
||||
items:
|
||||
- { name: mg_dns_copy_questions.md }
|
||||
- { name: mg_dns_encode_name.md }
|
||||
- { name: mg_dns_encode_record.md }
|
||||
- { name: mg_dns_insert_header.md }
|
||||
- { name: mg_dns_parse_record_data.md }
|
||||
- { name: mg_dns_uncompress_name.md }
|
||||
- { name: mg_parse_dns.md }
|
||||
- { name: mg_send_dns_query.md }
|
||||
- { name: mg_set_protocol_dns.md }
|
||||
- { name: struct_mg_dns_message.md }
|
||||
- { name: struct_mg_dns_resource_record.md }
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
title: "mg_dns_copy_questions()"
|
||||
decl_name: "mg_dns_copy_questions"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_dns_copy_questions(struct mbuf *io, struct mg_dns_message *msg);
|
||||
---
|
||||
|
||||
Appends already encoded questions from an existing message.
|
||||
|
||||
This is useful when generating a DNS reply message which includes
|
||||
all question records.
|
||||
|
||||
Returns the number of appended bytes.
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: "mg_dns_encode_name()"
|
||||
decl_name: "mg_dns_encode_name"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_dns_encode_name(struct mbuf *io, const char *name, size_t len);
|
||||
---
|
||||
|
||||
Encodes a DNS name.
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
title: "mg_dns_encode_record()"
|
||||
decl_name: "mg_dns_encode_record"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_dns_encode_record(struct mbuf *io, struct mg_dns_resource_record *rr,
|
||||
const char *name, size_t nlen, const void *rdata,
|
||||
size_t rlen);
|
||||
---
|
||||
|
||||
Encodes and appends a DNS resource record to an IO buffer.
|
||||
|
||||
The record metadata is taken from the `rr` parameter, while the name and data
|
||||
are taken from the parameters, encoded in the appropriate format depending on
|
||||
record type and stored in the IO buffer. The encoded values might contain
|
||||
offsets within the IO buffer. It's thus important that the IO buffer doesn't
|
||||
get trimmed while a sequence of records are encoded while preparing a DNS
|
||||
reply.
|
||||
|
||||
This function doesn't update the `name` and `rdata` pointers in the `rr`
|
||||
struct because they might be invalidated as soon as the IO buffer grows
|
||||
again.
|
||||
|
||||
Returns the number of bytes appended or -1 in case of error.
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
title: "mg_dns_insert_header()"
|
||||
decl_name: "mg_dns_insert_header"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_dns_insert_header(struct mbuf *io, size_t pos,
|
||||
struct mg_dns_message *msg);
|
||||
---
|
||||
|
||||
Inserts a DNS header to an IO buffer.
|
||||
|
||||
Returns the number of bytes inserted.
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
title: "mg_dns_parse_record_data()"
|
||||
decl_name: "mg_dns_parse_record_data"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_dns_parse_record_data(struct mg_dns_message *msg,
|
||||
struct mg_dns_resource_record *rr, void *data,
|
||||
size_t data_len);
|
||||
---
|
||||
|
||||
Parses the record data from a DNS resource record.
|
||||
|
||||
- A: struct in_addr *ina
|
||||
- AAAA: struct in6_addr *ina
|
||||
- CNAME: char buffer
|
||||
|
||||
Returns -1 on error.
|
||||
|
||||
TODO(mkm): MX
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
title: "mg_dns_uncompress_name()"
|
||||
decl_name: "mg_dns_uncompress_name"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
size_t mg_dns_uncompress_name(struct mg_dns_message *msg, struct mg_str *name,
|
||||
char *dst, int dst_len);
|
||||
---
|
||||
|
||||
Uncompresses a DNS compressed name.
|
||||
|
||||
The containing DNS message is required because of the compressed encoding
|
||||
and reference suffixes present elsewhere in the packet.
|
||||
|
||||
If the name is less than `dst_len` characters long, the remainder
|
||||
of `dst` is terminated with `\0` characters. Otherwise, `dst` is not
|
||||
terminated.
|
||||
|
||||
If `dst_len` is 0 `dst` can be NULL.
|
||||
Returns the uncompressed name length.
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: "mg_parse_dns()"
|
||||
decl_name: "mg_parse_dns"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_parse_dns(const char *buf, int len, struct mg_dns_message *msg);
|
||||
---
|
||||
|
||||
Low-level: parses a DNS response.
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
title: "mg_send_dns_query()"
|
||||
decl_name: "mg_send_dns_query"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_send_dns_query(struct mg_connection *nc, const char *name,
|
||||
int query_type);
|
||||
---
|
||||
|
||||
Sends a DNS query to the remote end.
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: "mg_set_protocol_dns()"
|
||||
decl_name: "mg_set_protocol_dns"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_set_protocol_dns(struct mg_connection *nc);
|
||||
---
|
||||
|
||||
Attaches a built-in DNS event handler to the given listening connection.
|
||||
|
||||
The DNS event handler parses the incoming UDP packets, treating them as DNS
|
||||
requests. If an incoming packet gets successfully parsed by the DNS event
|
||||
handler, a user event handler will receive an `MG_DNS_REQUEST` event, with
|
||||
`ev_data` pointing to the parsed `struct mg_dns_message`.
|
||||
|
||||
See
|
||||
[captive_dns_server](https://github.com/cesanta/mongoose/tree/master/examples/captive_dns_server)
|
||||
example on how to handle DNS request and send DNS reply.
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
title: "struct mg_dns_message"
|
||||
decl_name: "struct mg_dns_message"
|
||||
symbol_kind: "struct"
|
||||
signature: |
|
||||
struct mg_dns_message {
|
||||
struct mg_str pkt; /* packet body */
|
||||
uint16_t flags;
|
||||
uint16_t transaction_id;
|
||||
int num_questions;
|
||||
int num_answers;
|
||||
struct mg_dns_resource_record questions[MG_MAX_DNS_QUESTIONS];
|
||||
struct mg_dns_resource_record answers[MG_MAX_DNS_ANSWERS];
|
||||
};
|
||||
---
|
||||
|
||||
DNS message (request and response).
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
title: "struct mg_dns_resource_record"
|
||||
decl_name: "struct mg_dns_resource_record"
|
||||
symbol_kind: "struct"
|
||||
signature: |
|
||||
struct mg_dns_resource_record {
|
||||
struct mg_str name; /* buffer with compressed name */
|
||||
int rtype;
|
||||
int rclass;
|
||||
int ttl;
|
||||
enum mg_dns_resource_record_kind kind;
|
||||
struct mg_str rdata; /* protocol data (can be a compressed name) */
|
||||
};
|
||||
---
|
||||
|
||||
DNS resource record.
|
||||
|
||||
Reference in new issue
Block a user