libwebsockets
Lightweight C library for HTML5 websockets
Loading...
Searching...
No Matches
WHOIS Client

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)

Detailed Description

WHOIS Client APIs


Data Structure Documentation

◆ lws_whois_results

struct lws_whois_results

Definition at line 36 of file lws-whois.h.

Collaboration diagram for lws_whois_results:
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]

◆ lws_whois_args

struct lws_whois_args

Definition at line 47 of file lws-whois.h.

Collaboration diagram for lws_whois_args:
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

Macro Definition Documentation

◆ LWS_WHOIS_CANON_MAX

#define LWS_WHOIS_CANON_MAX   4096

#include <lws-whois.h>

Definition at line 34 of file lws-whois.h.

◆ lws_whois_query

#define lws_whois_query ( _a)

#include <lws-whois.h>

Value:
(1)

lws_whois_query() - Trigger a WHOIS query for a domain

Parameters
argsstruct 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.

◆ lws_whois_json_purify

#define lws_whois_json_purify ( _o,
_ol,
_i,
_il,
_p )

#include <lws-whois.h>

Value:
((void)(_o), -1)

lws_whois_json_purify() - canonicalize untrusted whois JSON

Parameters
outbuffer to receive the canonical JSON; must be at least 4097 bytes
out_lensize of out in bytes
inthe untrusted JSON to purify
in_lenlength of in in bytes
problemsif 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 Documentation

◆ lws_whois_cb_t

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.