libwebsockets
Lightweight C library for HTML5 websockets
Loading...
Searching...
No Matches
lws-auth-dns.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_WITH_AUTHORITATIVE_DNS)
26
27struct auth_dns_rr {
28 lws_dll2_t list;
29
30 char *rdata;
31 size_t rdata_len;
32
33 uint8_t *wire_rdata;
34 size_t wire_rdata_len;
35};
36
37struct auth_dns_rrset {
38 lws_dll2_t list;
39 lws_dll2_owner_t rr_list;
40
41 char *name;
42 uint32_t ttl;
43 uint16_t class_;
44 uint16_t type;
45};
46
47struct auth_dns_zone {
48 lws_dll2_owner_t rrset_list;
49 char default_ttl[16];
50 char origin[256];
51};
52
54lws_auth_dns_parse_zone_buf(const char *buf, size_t len, struct auth_dns_zone *zone);
55
57lws_auth_dns_free_zone(struct auth_dns_zone *z);
58
59struct lws_auth_dns_sign_info {
60 const char *input_filepath;
61 const char *output_filepath;
62 const char *jws_filepath; /* Path to output signed JWS of the zone */
63 const char *zsk_jwk_filepath; /* Path to ZSK JWK config */
64 const char *ksk_jwk_filepath; /* Path to KSK JWK config */
65 const char **subst_names; /* For lws_strexp */
66 const char **subst_values;
67 time_t sign_validity_start_time; /* 0 = now */
68 uint32_t sign_validity_duration; /* 0 = 30 days */
69 int num_substs;
70 struct lws_context *cx; /* For logging/alloc */
71};
72
79lws_auth_dns_sign_zone(struct lws_auth_dns_sign_info *info);
80
87lws_auth_dns_verify_zone(struct lws_auth_dns_sign_info *info);
88
89#endif
struct lws_dll2 lws_dll2_t
struct lws_dll2_owner lws_dll2_owner_t
unsigned short uint16_t
unsigned int uint32_t
#define LWS_EXTERN
unsigned char uint8_t
#define LWS_VISIBLE