libwebsockets
Lightweight C library for HTML5 websockets
Loading...
Searching...
No Matches
lws-dht-dnssec.h
Go to the documentation of this file.
1/*
2 * libwebsockets - small server side websockets and web server implementation
3 *
4 * Copyright (C) 2010 - 2026 Andy Green <andy@warmcat.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 * IN THE SOFTWARE.
23 */
24
25#if !defined(__LWS_DHT_DNSSEC_H__)
26#define __LWS_DHT_DNSSEC_H__
27
28struct lws_context;
29
31 const char *domain;
32 const char *workdir;
33 const char *type; /* e.g. "EC" or "RSA" */
34 const char *curve;
35 int bits;
36};
37
39 const char *domain;
40 const char *workdir;
41 const char *hash; /* E.g., "SHA256" */
42};
43
45 const char *domain;
46 const char *workdir;
48 char ipv4[64];
49 char ipv6[64];
50};
51
53 const char *domain;
54 const char *key1_prefix;
55 const char *key2_prefix; /* optional if only importing 1 key */
56};
57
58typedef void (*lws_dht_dnssec_fetch_cb_t)(void *opaque, const char *domain, int status);
59
61 struct lws_vhost *vhost;
62 const char *domain;
63 const char *cache_dir;
65 void *opaque;
66 int is_cancel; /* If 1, cancel an ongoing fetch for this domain/opaque pair */
67 int force_network; /* If 1, bypass local cache and query network directly */
68};
69
71 int (*keygen)(struct lws_context *context, struct lws_dht_dnssec_keygen_args *args);
72 int (*dsfromkey)(struct lws_context *context, struct lws_dht_dnssec_dsfromkey_args *args);
73 int (*signzone)(struct lws_context *context, struct lws_dht_dnssec_signzone_args *args);
74 int (*importnsd)(struct lws_context *context, struct lws_dht_dnssec_importnsd_args *args);
75 int (*bump_zone_serial)(struct lws_context *context, const char *zone_filepath);
76
77 int (*add_temp_zone)(struct lws_context *context, const char *domain, const char *zone_str, int ttl_secs);
78 int (*publish_jws)(struct lws_vhost *vhost, const char *jws_filepath);
79 int (*fetch_zone)(struct lws_context *cx,
81
82 /*
83 * Tell DHT plugin to actively subscribe to the network for changes
84 * to this domain using LWS_DHT_EVENT_NOTIFY pub/sub.
85 */
86 int (*subscribe_zone)(struct lws_vhost *vhost, const char *domain);
87
88 /*
89 * Actively repair an outdated peer we encountered by firing a targeted
90 * EVENT_NOTIFY packet at them containing the fresh SOA Serial.
91 */
92 int (*notify_peer_outdated)(struct lws_vhost *vhost, const char *domain,
93 const lws_sockaddr46 *sa46_peer, uint64_t newer_soa_serial);
94
95 void (*register_auth_cb)(struct lws_vhost *vh, void (*cb)(void *opaque, const char *domain, const char *payload_path), void *opaque);
96};
97
98
99#endif
unsigned int uint32_t
int(* bump_zone_serial)(struct lws_context *context, const char *zone_filepath)
int(* importnsd)(struct lws_context *context, struct lws_dht_dnssec_importnsd_args *args)
int(* notify_peer_outdated)(struct lws_vhost *vhost, const char *domain, const lws_sockaddr46 *sa46_peer, uint64_t newer_soa_serial)
int(* add_temp_zone)(struct lws_context *context, const char *domain, const char *zone_str, int ttl_secs)
int(* subscribe_zone)(struct lws_vhost *vhost, const char *domain)
int(* fetch_zone)(struct lws_context *cx, struct lws_dht_dnssec_fetch_zone_args *args)
void(* register_auth_cb)(struct lws_vhost *vh, void(*cb)(void *opaque, const char *domain, const char *payload_path), void *opaque)
int(* publish_jws)(struct lws_vhost *vhost, const char *jws_filepath)
lws_dht_dnssec_fetch_cb_t cb
int(* keygen)(struct lws_context *context, struct lws_dht_dnssec_keygen_args *args)
void(* lws_dht_dnssec_fetch_cb_t)(void *opaque, const char *domain, int status)
int(* signzone)(struct lws_context *context, struct lws_dht_dnssec_signzone_args *args)
int(* dsfromkey)(struct lws_context *context, struct lws_dht_dnssec_dsfromkey_args *args)