|
libwebsockets
Lightweight C library for HTML5 websockets
|
Data Structures | |
| struct | lws_whois_results |
| struct | lws_whois_args |
Macros | |
| #define | LWS_WHOIS_CANON_MAX 4096 |
| #define | lws_whois_query(_a) |
| #define | lws_whois_json_purify(_o, _ol, _i, _il, _p) |
Typedefs | |
| typedef void(* | lws_whois_cb_t) (void *opaque, const struct lws_whois_results *res) |
| struct lws_whois_results |
Definition at line 36 of file lws-whois.h.
| Data Fields | ||
|---|---|---|
| lws_usec_t | creation_date | |
| lws_usec_t | expiry_date | |
| lws_usec_t | updated_date | |
| char | nameservers[256] | |
| char | dnssec[64] | |
| char | ds_data[512] | |
| struct lws_whois_args |
Definition at line 47 of file lws-whois.h.
| Data Fields | ||
|---|---|---|
| struct lws_context * | context |
The lws context to run the query in |
| const char * | domain |
The domain name to query |
| const char * | server |
Optional: The WHOIS server to query directly. If NULL, recursive lookup starting from whois.iana.org is performed. |
| lws_whois_cb_t | cb |
Callback to receive results. Called once when query completes or fails. |
| void * | opaque |
User-supplied pointer passed to the callback |
| #define LWS_WHOIS_CANON_MAX 4096 |
#include <lws-whois.h>
Definition at line 34 of file lws-whois.h.
| #define lws_whois_query | ( | _a | ) |
#include <lws-whois.h>
lws_whois_query() - Trigger a WHOIS query for a domain
| args | struct containing query parameters |
Returns 0 if the query was successfully initiated, or nonzero if failed. The results are delivered asynchronously via the callback in args.
Definition at line 73 of file lws-whois.h.
| #define lws_whois_json_purify | ( | _o, | |
| _ol, | |||
| _i, | |||
| _il, | |||
| _p ) |
#include <lws-whois.h>
lws_whois_json_purify() - canonicalize untrusted whois JSON
| out | buffer to receive the canonical JSON; must be at least 4097 bytes |
| out_len | size of out in bytes |
| in | the untrusted JSON to purify |
| in_len | length of in in bytes |
| problems | if non-NULL, set nonzero if anything in the input was not schema-conformant and had to be dropped (unknown members, wrong-typed or out-of-range values, over-quota nameservers) or the canonical form hit its size cap |
Parses in against a fixed whitelist of whois members (creation_date, expiry_date, updated_date, nameservers, dnssec, ds_data) with type, charset and range validation, and re-emits the validated members as canonical JSON. Members that are absent in the input stay absent in the output; anything else in the input is dropped and flagged via problems.
Returns the length of the NUL-terminated canonical JSON written to out, or -1 if in does not parse as JSON at all (in which case nothing is written to out). The canonical form is never larger than 4096 bytes.
Definition at line 106 of file lws-whois.h.
| typedef void(* lws_whois_cb_t) (void *opaque, const struct lws_whois_results *res) |
#include <lws-whois.h>
Definition at line 45 of file lws-whois.h.