Electroneum
Loading...
Searching...
No Matches
dname.h
Go to the documentation of this file.
1/*
2 * util/data/dname.h - domain name routines
3 *
4 * Copyright (c) 2007, NLnet Labs. All rights reserved.
5 *
6 * This software is open source.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * Neither the name of the NLNET LABS nor the names of its contributors may
20 * be used to endorse or promote products derived from this software without
21 * specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 */
35
44
45#ifndef UTIL_DATA_DNAME_H
46#define UTIL_DATA_DNAME_H
48struct sldns_buffer;
49
51#define MAX_COMPRESS_PTRS 256
52
59size_t query_dname_len(struct sldns_buffer* query);
60
67size_t dname_valid(uint8_t* dname, size_t len);
68
71
78void pkt_dname_tolower(struct sldns_buffer* pkt, uint8_t* dname);
79
100
110size_t pkt_dname_len(struct sldns_buffer* pkt);
111
122
131
144
151void dname_pkt_copy(struct sldns_buffer* pkt, uint8_t* to, uint8_t* dname);
152
159int dname_buffer_write(struct sldns_buffer* pkt, uint8_t* dname);
160
167
174int dname_count_size_labels(uint8_t* dname, size_t* size);
175
186int dname_lab_cmp(uint8_t* d1, int labs1, uint8_t* d2, int labs2, int* mlabs);
187
197int dname_lab_startswith(uint8_t* label, char* prefix, char** endptr);
198
208int dname_strict_subdomain(uint8_t* d1, int labs1, uint8_t* d2, int labs2);
209
217
225
232void dname_print(FILE* out, struct sldns_buffer* pkt, uint8_t* dname);
233
242void dname_str(uint8_t* dname, char* str);
243
250
257void dname_remove_label(uint8_t** dname, size_t* len);
258
267void dname_remove_labels(uint8_t** dname, size_t* len, int n);
268
276
283
295int dname_canon_lab_cmp(uint8_t* d1, int labs1, uint8_t* d2, int labs2,
296 int* mlabs);
297
307
315
316#endif /* UTIL_DATA_DNAME_H */
hashvalue_type dname_pkt_hash(struct sldns_buffer *pkt, uint8_t *dname, hashvalue_type h)
size_t dname_valid(uint8_t *dname, size_t len)
int dname_count_labels(uint8_t *dname)
void dname_print(FILE *out, struct sldns_buffer *pkt, uint8_t *dname)
int query_dname_compare(uint8_t *d1, uint8_t *d2)
void pkt_dname_tolower(struct sldns_buffer *pkt, uint8_t *dname)
int dname_lab_cmp(uint8_t *d1, int labs1, uint8_t *d2, int labs2, int *mlabs)
void dname_str(uint8_t *dname, char *str)
int dname_is_root(uint8_t *dname)
void query_dname_tolower(uint8_t *dname)
void dname_pkt_copy(struct sldns_buffer *pkt, uint8_t *to, uint8_t *dname)
int dname_canonical_compare(uint8_t *d1, uint8_t *d2)
size_t query_dname_len(struct sldns_buffer *query)
int dname_buffer_write(struct sldns_buffer *pkt, uint8_t *dname)
int dname_canon_lab_cmp(uint8_t *d1, int labs1, uint8_t *d2, int labs2, int *mlabs)
int dname_signame_label_count(uint8_t *dname)
int dname_strict_subdomain_c(uint8_t *d1, uint8_t *d2)
int dname_lab_startswith(uint8_t *label, char *prefix, char **endptr)
size_t pkt_dname_len(struct sldns_buffer *pkt)
void dname_remove_labels(uint8_t **dname, size_t *len, int n)
hashvalue_type dname_query_hash(uint8_t *dname, hashvalue_type h)
uint8_t * dname_get_shared_topdomain(uint8_t *d1, uint8_t *d2)
void dname_remove_label(uint8_t **dname, size_t *len)
int dname_pkt_compare(struct sldns_buffer *pkt, uint8_t *d1, uint8_t *d2)
int dname_strict_subdomain(uint8_t *d1, int labs1, uint8_t *d2, int labs2)
int dname_subdomain_c(uint8_t *d1, uint8_t *d2)
int dname_count_size_labels(uint8_t *dname, size_t *size)
int dname_is_wild(uint8_t *dname)
uint32_t hashvalue_type
Definition lruhash.h:119
unsigned char uint8_t
Definition stdint.h:124