Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Knot Resolver
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
140
Issues
140
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Knot projects
Knot Resolver
Commits
9ed2558b
Commit
9ed2558b
authored
Apr 10, 2015
by
Karel Slaný
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: Fixed indentation and removed trailing white spaces in C code.
parent
8842548d
Changes
33
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
131 additions
and
131 deletions
+131
-131
daemon/bindings.c
daemon/bindings.c
+2
-2
daemon/engine.c
daemon/engine.c
+4
-4
daemon/engine.h
daemon/engine.h
+1
-1
daemon/main.c
daemon/main.c
+2
-2
daemon/network.c
daemon/network.c
+1
-1
daemon/worker.h
daemon/worker.h
+1
-1
include/kgetdns.h
include/kgetdns.h
+1
-1
lib/cache.c
lib/cache.c
+3
-3
lib/cache.h
lib/cache.h
+1
-1
lib/defines.h
lib/defines.h
+2
-2
lib/generic/array.h
lib/generic/array.h
+5
-5
lib/generic/map.c
lib/generic/map.c
+1
-1
lib/generic/map.h
lib/generic/map.h
+9
-9
lib/generic/set.h
lib/generic/set.h
+5
-5
lib/layer.h
lib/layer.h
+1
-1
lib/layer/iterate.c
lib/layer/iterate.c
+4
-4
lib/layer/itercache.c
lib/layer/itercache.c
+1
-1
lib/module.c
lib/module.c
+18
-19
lib/module.h
lib/module.h
+4
-4
lib/nsrep.c
lib/nsrep.c
+1
-1
lib/nsrep.h
lib/nsrep.h
+1
-1
lib/resolve.c
lib/resolve.c
+4
-4
lib/resolve.h
lib/resolve.h
+1
-1
lib/rplan.h
lib/rplan.h
+1
-1
lib/utils.c
lib/utils.c
+35
-34
lib/utils.h
lib/utils.h
+1
-1
lib/zonecut.c
lib/zonecut.c
+1
-1
lib/zonecut.h
lib/zonecut.h
+1
-1
modules/cachectl/cachectl.c
modules/cachectl/cachectl.c
+12
-12
modules/hints/hints.c
modules/hints/hints.c
+3
-3
tests/test_cache.c
tests/test_cache.c
+1
-1
tests/test_integration.c
tests/test_integration.c
+2
-2
tests/test_rplan.c
tests/test_rplan.c
+1
-1
No files found.
daemon/bindings.c
View file @
9ed2558b
...
...
@@ -204,7 +204,7 @@ static int net_interfaces(lua_State *L)
}
*
(
p
-
1
)
=
'\0'
;
lua_pushstring
(
L
,
buf
);
lua_setfield
(
L
,
-
2
,
"mac"
);
lua_setfield
(
L
,
-
2
,
"mac"
);
/* Push table */
lua_setfield
(
L
,
-
2
,
iface
.
name
);
...
...
@@ -273,4 +273,4 @@ int lib_cache(lua_State *L)
register_lib
(
L
,
"cache"
,
lib
);
return
1
;
}
\ No newline at end of file
}
daemon/engine.c
View file @
9ed2558b
...
...
@@ -37,7 +37,7 @@
/** Print help and available commands. */
static
int
l_help
(
lua_State
*
L
)
{
static
const
char
*
help_str
=
static
const
char
*
help_str
=
"help()
\n
show this help
\n
"
"quit()
\n
quit
\n
"
"modules.list()
\n
list modules
\n
"
...
...
@@ -242,7 +242,7 @@ int engine_start(struct engine *engine)
return
ret
;
}
return
uv_run
(
uv_default_loop
(),
UV_RUN_DEFAULT
);
return
uv_run
(
uv_default_loop
(),
UV_RUN_DEFAULT
);
}
void
engine_stop
(
struct
engine
*
engine
)
...
...
@@ -320,8 +320,8 @@ void engine_lualib(struct engine *engine, const char *name, lua_CFunction lib_cb
struct
engine
*
engine_luaget
(
lua_State
*
L
)
{
lua_getglobal
(
L
,
"__engine"
);
lua_getglobal
(
L
,
"__engine"
);
struct
engine
*
engine
=
lua_touserdata
(
L
,
-
1
);
lua_pop
(
engine
->
L
,
1
);
return
engine
;
}
\ No newline at end of file
}
daemon/engine.h
View file @
9ed2558b
...
...
@@ -41,4 +41,4 @@ int engine_register(struct engine *engine, const char *module);
int
engine_unregister
(
struct
engine
*
engine
,
const
char
*
module
);
/** Return engine light userdata. */
void
engine_lualib
(
struct
engine
*
engine
,
const
char
*
name
,
int
(
*
lib_cb
)
(
struct
lua_State
*
));
struct
engine
*
engine_luaget
(
struct
lua_State
*
L
);
\ No newline at end of file
struct
engine
*
engine_luaget
(
struct
lua_State
*
L
);
daemon/main.c
View file @
9ed2558b
...
...
@@ -70,7 +70,7 @@ static const char *set_addr(char *addr, int *port)
*
port
=
atoi
(
p
+
1
);
*
p
=
'\0'
;
}
return
addr
;
}
...
...
@@ -114,7 +114,7 @@ int main(int argc, char **argv)
return
EXIT_FAILURE
;
}
printf
(
"[system] rundir '%s'
\n
"
,
argv
[
optind
]);
}
}
/* Block signals. */
uv_loop_t
*
loop
=
uv_default_loop
();
...
...
daemon/network.c
View file @
9ed2558b
...
...
@@ -161,7 +161,7 @@ int network_close(struct network *net, const char *addr, uint16_t port)
break
;
}
}
/* Collapse key if it has no endpoint. */
if
(
ep_array
->
len
==
0
)
{
free
(
ep_array
);
...
...
daemon/worker.h
View file @
9ed2558b
...
...
@@ -31,7 +31,7 @@ struct worker_ctx {
/**
* Resolve query.
*
*
* @param worker
* @param answer
* @param query
...
...
include/kgetdns.h
View file @
9ed2558b
...
...
@@ -346,7 +346,7 @@ getdns_return_t getdns_context_set_edns_version(
/**
* Set EDNS DO (DNSSEC OK) bit.
*
*
* @param value EDNS DO bit (0 or 1, default 0).
*/
getdns_return_t
getdns_context_set_edns_do_bit
(
...
...
lib/cache.c
View file @
9ed2558b
...
...
@@ -163,7 +163,7 @@ knot_rrset_t kr_cache_materialize(const knot_rrset_t *src, uint32_t drift, mm_ct
if
(
copy
.
owner
==
NULL
)
{
return
copy
;
}
for
(
uint16_t
i
=
0
;
i
<
src
->
rrs
.
rr_count
;
++
i
)
{
knot_rdata_t
*
rd
=
knot_rdataset_at
(
&
src
->
rrs
,
i
);
if
(
knot_rdata_ttl
(
rd
)
>
drift
)
{
...
...
@@ -173,13 +173,13 @@ knot_rrset_t kr_cache_materialize(const knot_rrset_t *src, uint32_t drift, mm_ct
}
}
}
/* Update TTLs. */
for
(
uint16_t
i
=
0
;
i
<
copy
.
rrs
.
rr_count
;
++
i
)
{
knot_rdata_t
*
rd
=
knot_rdataset_at
(
&
copy
.
rrs
,
i
);
knot_rdata_set_ttl
(
rd
,
knot_rdata_ttl
(
rd
)
-
drift
);
}
return
copy
;
}
...
...
lib/cache.h
View file @
9ed2558b
...
...
@@ -15,7 +15,7 @@
*/
/** \addtogroup cache
* @{
* @{
*/
#pragma once
...
...
lib/defines.h
View file @
9ed2558b
...
...
@@ -15,7 +15,7 @@
*/
/** \addtogroup resolution
* @{
* @{
*/
#pragma once
...
...
@@ -47,6 +47,6 @@
*/
#define KR_DNS_PORT 53
#define KR_EDNS_VERSION 0
#define KR_EDNS_PAYLOAD 4096
#define KR_EDNS_PAYLOAD 4096
/** @} */
lib/generic/array.h
View file @
9ed2558b
...
...
@@ -20,17 +20,17 @@
* \note The C has no generics, so it is implemented mostly using macros.
* Be aware of that, as direct usage of the macros in the evaluating macros
* may lead to different expectations, i.e.
*
*
* MIN(array_push(arr, val))
*
* May evaluate the code twice, leading to unexpected behaviour.
* This is a price to pay for absence of proper generics.
*
* Example usage:
*
*
* array_t(const char*) arr;
* array_init(arr);
*
*
* // Reserve memory in advance
* if (array_reserve(arr, 2) < 0) {
* return ENOMEM;
...
...
@@ -52,9 +52,9 @@
*
* // Random delete
* array_del(arr, 0);
*
*
* \addtogroup generics
* @{
* @{
*/
#pragma once
...
...
lib/generic/map.c
View file @
9ed2558b
...
...
@@ -108,7 +108,7 @@ static cb_data_t *cbt_make_data(map_t *map, const uint8_t *str, size_t len, void
x
->
value
=
value
;
memcpy
(
x
->
key
,
str
,
len
);
}
return
x
;
return
x
;
}
/*! Creates a new, empty critbit map */
...
...
lib/generic/map.h
View file @
9ed2558b
...
...
@@ -7,14 +7,14 @@
* Generics - A Crit-bit tree 'map' implementation.
*
* @warning If the user provides a custom allocator, it must return addresses aligned to 2B boundary.
*
*
* Example usage:
*
*
* map_t map = map_make();
*
*
// Custom allocator (optional)
*
map.malloc = &mymalloc;
*
map.baton = &mymalloc_context;
*
// Custom allocator (optional)
*
map.malloc = &mymalloc;
*
map.baton = &mymalloc_context;
*
* // Insert keys
* if (map_set(&map, "princess") != 0 ||
...
...
@@ -29,7 +29,7 @@
* }
*
* // Prefix search
* int i = 0;
* int i = 0;
* int count(const char *s, void *n) { (*(int *)n)++; return 0; }
* if (map_walk_prefixed(map, "princ", count, &i) == 0) {
* printf("%d matches\n", i);
...
...
@@ -42,9 +42,9 @@
*
* // Clear the map
* map_clear(&map);
*
*
* \addtogroup generics
* @{
* @{
*/
#pragma once
...
...
@@ -94,4 +94,4 @@ int map_walk_prefixed(map_t *map, const char *prefix,
}
#endif
/** @} */
\ No newline at end of file
/** @} */
lib/generic/set.h
View file @
9ed2558b
...
...
@@ -2,9 +2,9 @@
* Generics - A Crit-bit set implementation.
*
* @note The API is based on @fn map.h, see it for more examples.
*
*
* Example usage:
*
*
* set_t set = set_make();
*
* // Insert keys
...
...
@@ -20,7 +20,7 @@
* }
*
* // Prefix search
* int i = 0;
* int i = 0;
* int count(const char *s, void *n) { (*(int *)n)++; return 0; }
* if (set_walk_prefixed(set, "princ", count, &i) == 0) {
* printf("%d matches\n", i);
...
...
@@ -33,9 +33,9 @@
*
* // Clear the set
* set_clear(&set);
*
*
* \addtogroup generics
* @{
* @{
*/
#pragma once
...
...
lib/layer.h
View file @
9ed2558b
...
...
@@ -17,7 +17,7 @@
#pragma once
/** \addtogroup rplan
* @{
* @{
*/
#include <libknot/processing/layer.h>
...
...
lib/layer/iterate.c
View file @
9ed2558b
...
...
@@ -35,7 +35,7 @@ enum {
PKT_NOERROR
=
1
<<
0
,
/* Positive response */
PKT_NODATA
=
1
<<
1
,
/* No data response */
PKT_NXDOMAIN
=
1
<<
2
,
/* Negative response */
PKT_ERROR
=
1
<<
3
/* Refused or server failure */
PKT_ERROR
=
1
<<
3
/* Refused or server failure */
};
/* Iterator often walks through packet section, this is an abstraction. */
...
...
@@ -155,7 +155,7 @@ int rr_update_parent(const knot_rrset_t *rr, unsigned hint, struct kr_layer_para
int
rr_update_answer
(
const
knot_rrset_t
*
rr
,
unsigned
hint
,
struct
kr_layer_param
*
param
)
{
knot_pkt_t
*
answer
=
param
->
answer
;
/* Write copied RR to the result packet. */
int
ret
=
knot_pkt_put
(
answer
,
KNOT_COMPR_HINT_NONE
,
rr
,
hint
);
if
(
ret
!=
KNOT_EOK
)
{
...
...
@@ -176,7 +176,7 @@ static bool has_glue(const knot_dname_t *ns_name, knot_pkt_t *pkt)
const
knot_rrset_t
*
rr
=
knot_pkt_rr
(
ar
,
i
);
if
((
rr
->
type
==
KNOT_RRTYPE_A
||
rr
->
type
==
KNOT_RRTYPE_AAAA
)
&&
(
knot_dname_is_equal
(
ns_name
,
rr
->
owner
)))
{
return
true
;
return
true
;
}
}
return
false
;
...
...
@@ -372,7 +372,7 @@ static int prepare_query(knot_layer_t *ctx, knot_pkt_t *pkt)
query
->
id
=
dnssec_random_uint16_t
();
knot_wire_set_id
(
pkt
->
wire
,
query
->
id
);
/* Declare EDNS0 support. */
knot_rrset_t
opt_rr
;
ret
=
knot_edns_init
(
&
opt_rr
,
KR_EDNS_PAYLOAD
,
0
,
KR_EDNS_VERSION
,
&
pkt
->
mm
);
...
...
lib/layer/itercache.c
View file @
9ed2558b
...
...
@@ -50,7 +50,7 @@ static int update_answer(const knot_rrset_t *rr, unsigned drift, struct kr_layer
if
(
rr_copy
.
rrs
.
rr_count
==
0
)
{
return
KNOT_STATE_FAIL
;
}
return
rr_update_answer
(
&
rr_copy
,
0
,
param
);
}
...
...
lib/module.c
View file @
9ed2558b
...
...
@@ -19,20 +19,20 @@
/** Check ABI version, return error on mismatch. */
#define ABI_CHECK(m, prefix, symname, required) do { \
if ((m)->lib != RTLD_DEFAULT) { \
module_api_cb *_api = NULL; \
*(void **) (&_api) = load_symbol((m)->lib, (prefix), (symname)); \
if (_api == NULL) { \
return kr_error(ENOENT); \
} \
if (_api() != (required)) { \
return kr_error(ENOTSUP); \
} \
}\
} while (0)
/** Load ABI by symbol names. */
module_api_cb *_api = NULL; \
*(void **) (&_api) = load_symbol((m)->lib, (prefix), (symname)); \
if (_api == NULL) { \
return kr_error(ENOENT); \
} \
if (_api() != (required)) { \
return kr_error(ENOTSUP); \
} \
}\
} while (0)
/** Load ABI by symbol names. */
#define ABI_LOAD(m, prefix, s_init, s_deinit, s_config, s_layer, s_prop) do { \
module_prop_cb *module_prop = NULL; \
module_prop_cb *module_prop = NULL; \
*(void **) (&(m)->init) = load_symbol((m)->lib, (prefix), (s_init)); \
*(void **) (&(m)->deinit) = load_symbol((m)->lib, (prefix), (s_deinit)); \
*(void **) (&(m)->config) = load_symbol((m)->lib, (prefix), (s_config)); \
...
...
@@ -76,9 +76,9 @@ static int load_library(struct kr_module *module, const char *name, const char *
/** Load C module symbols. */
static
int
load_sym_c
(
struct
kr_module
*
module
,
uint32_t
api_required
)
{
auto_free
char
*
module_prefix
=
kr_strcatdup
(
2
,
module
->
name
,
"_"
);
ABI_CHECK
(
module
,
module_prefix
,
"api"
,
api_required
);
ABI_LOAD
(
module
,
module_prefix
,
"init"
,
"deinit"
,
"config"
,
"layer"
,
"props"
);
auto_free
char
*
module_prefix
=
kr_strcatdup
(
2
,
module
->
name
,
"_"
);
ABI_CHECK
(
module
,
module_prefix
,
"api"
,
api_required
);
ABI_LOAD
(
module
,
module_prefix
,
"init"
,
"deinit"
,
"config"
,
"layer"
,
"props"
);
return
kr_ok
();
}
...
...
@@ -114,7 +114,7 @@ static int bootstrap_libgo(struct kr_module *module)
return
kr_ok
();
}
/** Load Go module symbols. */
/** Load Go module symbols. */
static
int
load_ffi_go
(
struct
kr_module
*
module
,
uint32_t
api_required
)
{
/* Bootstrap libgo */
...
...
@@ -149,7 +149,7 @@ int kr_module_load(struct kr_module *module, const char *name, const char *path)
auto_free
char
*
local_path
=
kr_strcatdup
(
2
,
getenv
(
"HOME"
),
"/.local"
MODULEDIR
);
if
(
load_library
(
module
,
name
,
local_path
)
!=
0
)
{
if
(
load_library
(
module
,
name
,
PREFIX
MODULEDIR
)
!=
0
)
{
module
->
lib
=
RTLD_DEFAULT
;
module
->
lib
=
RTLD_DEFAULT
;
}
}
}
...
...
@@ -168,7 +168,6 @@ int kr_module_load(struct kr_module *module, const char *name, const char *path)
kr_module_unload
(
module
);
}
return
ret
;
}
...
...
lib/module.h
View file @
9ed2558b
...
...
@@ -15,7 +15,7 @@
*/
/** \addtogroup modules
* @{
* @{
*/
#pragma once
...
...
@@ -73,7 +73,7 @@ struct kr_module {
/**
* Load module instance into memory.
*
*
* @param module module structure
* @param name module name
* @param path module search path
...
...
@@ -83,14 +83,14 @@ int kr_module_load(struct kr_module *module, const char *name, const char *path)
/**
* Unload module instance.
*
*
* @param module module structure
*/
void
kr_module_unload
(
struct
kr_module
*
module
);
/**
* Export module API version (place this at the end of your module).
*
*
* @param module module name (f.e. hints)
*/
#define KR_MODULE_EXPORT(module) \
...
...
lib/nsrep.c
View file @
9ed2558b
...
...
@@ -4,4 +4,4 @@ int kr_nsrep_score(const knot_dname_t *ns, struct kr_layer_param *param)
{
/* TODO: stub, always returns valid */
return
KR_NS_VALID
;
}
\ No newline at end of file
}
lib/nsrep.h
View file @
9ed2558b
...
...
@@ -15,7 +15,7 @@
*/
/** \addtogroup nameservers
* @{
* @{
*/
#pragma once
...
...
lib/resolve.c
100755 → 100644
View file @
9ed2558b
...
...
@@ -39,7 +39,7 @@ static int invalidate_ns(struct kr_rplan *rplan, struct kr_query *qry)
if
(
txn
==
NULL
)
{
return
KNOT_EOK
;
}
/* Fetch current nameserver cache. */
uint32_t
drift
=
qry
->
timestamp
.
tv_sec
;
knot_rrset_t
cached
;
...
...
@@ -49,7 +49,7 @@ static int invalidate_ns(struct kr_rplan *rplan, struct kr_query *qry)
return
KNOT_EOK
;
}
cached
=
kr_cache_materialize
(
&
cached
,
drift
,
rplan
->
pool
);
/* Find a matching RD. */
knot_rdataset_t
to_remove
;
knot_rdataset_init
(
&
to_remove
);
...
...
@@ -61,7 +61,7 @@ static int invalidate_ns(struct kr_rplan *rplan, struct kr_query *qry)
}
knot_rdataset_subtract
(
&
cached
.
rrs
,
&
to_remove
,
rplan
->
pool
);
knot_rdataset_clear
(
&
to_remove
,
rplan
->
pool
);
/* Remove record(s) */
int
ret
=
KNOT_EOK
;
if
(
cached
.
rrs
.
rr_count
==
0
)
{
...
...
@@ -78,7 +78,7 @@ static int invalidate_ns(struct kr_rplan *rplan, struct kr_query *qry)
static
int
ns_resolve_addr
(
struct
kr_query
*
cur
,
struct
kr_layer_param
*
param
)
{
if
(
kr_rplan_satisfies
(
cur
,
cur
->
zone_cut
.
ns
,
KNOT_CLASS_IN
,
KNOT_RRTYPE_A
)
||
if
(
kr_rplan_satisfies
(
cur
,
cur
->
zone_cut
.
ns
,
KNOT_CLASS_IN
,
KNOT_RRTYPE_A
)
||
kr_rplan_satisfies
(
cur
,
cur
->
zone_cut
.
ns
,
KNOT_CLASS_IN
,
KNOT_RRTYPE_AAAA
))
{
DEBUG_MSG
(
"=> dependency loop, bailing out
\n
"
);
kr_rplan_pop
(
param
->
rplan
,
cur
);
...
...
lib/resolve.h
View file @
9ed2558b
...
...
@@ -15,7 +15,7 @@
*/
/** \addtogroup resolution
* @{
* @{
*/
#pragma once
...
...
lib/rplan.h
View file @
9ed2558b
...
...
@@ -15,7 +15,7 @@
*/
/** \addtogroup rplan
* @{
* @{
*/
#pragma once
...
...
lib/utils.c
View file @
9ed2558b
...
...
@@ -2,6 +2,7 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "lib/defines.h"
#include "lib/utils.h"
...
...
@@ -15,49 +16,49 @@
*/
void
_cleanup_free
(
char
**
p
)
{
free
(
*
p
);
free
(
*
p
);
}
void
_cleanup_close
(
int
*
p
)
{
if
(
*
p
>
0
)
close
(
*
p
);
if
(
*
p
>
0
)
close
(
*
p
);
}
void
_cleanup_fclose
(
FILE
**
p
)
{
if
(
*
p
)
fclose
(
*
p
);
if
(
*
p
)
fclose
(
*
p
);
}
char
*
kr_strcatdup
(
unsigned
n
,
...)
{
/* Calculate total length */
size_t
total_len
=
0
;
va_list
vl
;
va_start
(
vl
,
n
);
for
(
unsigned
i
=
0
;
i
<
n
;
++
i
)
{
char
*
item
=
va_arg
(
vl
,
char
*
);
total_len
+=
strlen_safe
(
item
);
}
va_end
(
vl
);
/* Allocate result and fill */
char
*
result
=
NULL
;
if
(
total_len
>
0
)
{
result
=
malloc
(
total_len
+
1
);
}
if
(
result
)
{
char
*
stream
=
result
;
va_start
(
vl
,
n
);
for
(
unsigned
i
=
0
;
i
<
n
;
++
i
)
{
char
*
item
=
va_arg
(
vl
,
char
*
);
if
(
item
)
{
size_t
len
=
strlen
(
item
);
memcpy
(
stream
,
item
,
len
+
1
);
stream
+=
len
;
}
}
va_end
(
vl
);
}
return
result
;
}
\ No newline at end of file
/* Calculate total length */
size_t
total_len
=
0
;
va_list
vl
;
va_start
(
vl
,
n
);
for
(
unsigned
i
=
0
;
i
<
n
;
++
i
)
{
char
*
item
=
va_arg
(
vl
,
char
*
);
total_len
+=
strlen_safe
(
item
);
}
va_end
(
vl
);
/* Allocate result and fill */
char
*
result
=
NULL
;
if
(
total_len
>
0
)
{
result
=
malloc
(
total_len
+
1
);
}
if
(
result
)
{
char
*
stream
=
result
;
va_start
(
vl
,
n
);
for
(
unsigned
i
=
0
;
i
<
n
;
++
i
)
{
char
*
item
=
va_arg
(
vl
,
char
*
);
if
(
item
)
{
size_t
len
=
strlen
(
item
);
memcpy
(
stream
,
item
,
len
+
1
);
stream
+=
len
;
}
}
va_end
(
vl
);
}
return
result
;
}
lib/utils.h
View file @
9ed2558b
...
...
@@ -15,7 +15,7 @@
*/
/** \addtogroup utils
* @{
* @{
*/
#pragma once
...
...
lib/zonecut.c
View file @
9ed2558b
...
...
@@ -137,7 +137,7 @@ static int fetch_ns(struct kr_zonecut *cut, const knot_dname_t *name, namedb_txn
if
(
ret
!=
KNOT_EOK
)
{
return
ret
;
}
/* Accept only if has address records cached. */
for
(
unsigned
i
=
0
;
i
<
cached_rr
.
rrs
.
rr_count
;
++
i
)
{
kr_set_zone_cut
(
cut
,
name
,
knot_ns_name
(
&
cached_rr
.
rrs
,
i
));
...
...
lib/zonecut.h
View file @
9ed2558b
...
...
@@ -15,7 +15,7 @@
*/
/** \addtogroup rplan
* @{
* @{
*/
#pragma once
...
...
modules/cachectl/cachectl.c
View file @
9ed2558b
...
...
@@ -40,7 +40,7 @@
*
* Input: N/A
* Output: { size: int }
*
*
*/
static
char
*
get_size
(
void
*
env
,
struct
kr_module
*
module
,
const
char
*
args
)
{
...
...
@@ -57,7 +57,7 @@ static char* get_size(void *env, struct kr_module *module, const char *args)
}
else
{
asprintf
(
&
result
,
"{
\"
error
\"
:
\"
%s
\"
}"
,
knot_strerror
(
ret
));
}
return
result
;
}
...
...
@@ -84,7 +84,7 @@ static int is_expired(struct kr_cache_rrset *rr, uint32_t drift)
*
* Input: N/A
* Output: { pruned: int }
*
*
*/
static
char
*
prune
(
void
*
env
,
struct
kr_module
*
module
,
const
char
*
args
)
{
...
...
@@ -124,7 +124,7 @@ static char* prune(void *env, struct kr_module *module, const char *args)
}
else
{
asprintf
(
&
result
,
"{
\"
pruned
\"
: %d }"
,
pruned
);
}
return
result
;
}
...
...
@@ -133,7 +133,7 @@ static char* prune(void *env, struct kr_module *module, const char *args)
*
* Input: N/A
* Output: { result: bool }