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 DNS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
22
Issues
22
List
Boards
Labels
Service Desk
Milestones
Merge Requests
17
Merge Requests
17
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 DNS
Commits
236ff8ba
Commit
236ff8ba
authored
Oct 24, 2014
by
Daniel Salzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libknot: move common.h to common/macros.h
parent
c08577b8
Changes
67
Hide whitespace changes
Inline
Side-by-side
Showing
67 changed files
with
179 additions
and
165 deletions
+179
-165
src/Makefile.am
src/Makefile.am
+1
-1
src/common/array-sort.h
src/common/array-sort.h
+5
-2
src/common/binsearch.h
src/common/binsearch.h
+2
-0
src/common/hhash.c
src/common/hhash.c
+1
-2
src/common/log.c
src/common/log.c
+5
-4
src/common/macros.h
src/common/macros.h
+21
-20
src/dnstap/reader.c
src/dnstap/reader.c
+1
-2
src/dnstap/writer.c
src/dnstap/writer.c
+0
-1
src/knot/conf/conf.c
src/knot/conf/conf.c
+4
-3
src/knot/ctl/estimator.c
src/knot/ctl/estimator.c
+2
-1
src/knot/ctl/knotc_main.c
src/knot/ctl/knotc_main.c
+20
-19
src/knot/ctl/remote.c
src/knot/ctl/remote.c
+6
-5
src/knot/dnssec/nsec3-chain.c
src/knot/dnssec/nsec3-chain.c
+4
-3
src/knot/dnssec/zone-keys.c
src/knot/dnssec/zone-keys.c
+3
-3
src/knot/dnssec/zone-sign.c
src/knot/dnssec/zone-sign.c
+6
-6
src/knot/main.c
src/knot/main.c
+0
-1
src/knot/nameserver/internet.c
src/knot/nameserver/internet.c
+0
-1
src/knot/nameserver/notify.c
src/knot/nameserver/notify.c
+0
-1
src/knot/nameserver/nsec_proofs.c
src/knot/nameserver/nsec_proofs.c
+0
-1
src/knot/nameserver/process_query.c
src/knot/nameserver/process_query.c
+3
-2
src/knot/nameserver/update.c
src/knot/nameserver/update.c
+2
-1
src/knot/server/journal.c
src/knot/server/journal.c
+0
-1
src/knot/server/tcp-handler.c
src/knot/server/tcp-handler.c
+3
-2
src/knot/server/udp-handler.c
src/knot/server/udp-handler.c
+6
-5
src/knot/updates/apply.c
src/knot/updates/apply.c
+15
-15
src/knot/updates/changesets.c
src/knot/updates/changesets.c
+2
-2
src/knot/updates/ddns.c
src/knot/updates/ddns.c
+0
-1
src/knot/zone/contents.c
src/knot/zone/contents.c
+2
-1
src/knot/zone/events/handlers.c
src/knot/zone/events/handlers.c
+5
-4
src/knot/zone/events/replan.c
src/knot/zone/events/replan.c
+2
-2
src/knot/zone/zone-tree.c
src/knot/zone/zone-tree.c
+2
-1
src/knot/zone/zonedb.c
src/knot/zone/zonedb.c
+2
-2
src/knot/zone/zonefile.c
src/knot/zone/zonefile.c
+2
-2
src/libknot/binary.c
src/libknot/binary.c
+1
-1
src/libknot/consts.c
src/libknot/consts.c
+1
-2
src/libknot/descriptor.c
src/libknot/descriptor.c
+1
-2
src/libknot/dname.c
src/libknot/dname.c
+1
-1
src/libknot/dname.h
src/libknot/dname.h
+0
-1
src/libknot/dnssec/crypto.c
src/libknot/dnssec/crypto.c
+3
-3
src/libknot/dnssec/key.c
src/libknot/dnssec/key.c
+1
-0
src/libknot/dnssec/policy.c
src/libknot/dnssec/policy.c
+1
-1
src/libknot/dnssec/rrset-sign.c
src/libknot/dnssec/rrset-sign.c
+1
-1
src/libknot/dnssec/sig0.c
src/libknot/dnssec/sig0.c
+1
-0
src/libknot/dnssec/sign.c
src/libknot/dnssec/sign.c
+2
-2
src/libknot/errcode.c
src/libknot/errcode.c
+1
-2
src/libknot/packet/compr.c
src/libknot/packet/compr.c
+3
-2
src/libknot/packet/pkt.c
src/libknot/packet/pkt.c
+1
-0
src/libknot/packet/rrset-wire.c
src/libknot/packet/rrset-wire.c
+7
-7
src/libknot/processing/layer.c
src/libknot/processing/layer.c
+1
-0
src/libknot/processing/overlay.c
src/libknot/processing/overlay.c
+1
-0
src/libknot/processing/requestor.c
src/libknot/processing/requestor.c
+1
-0
src/libknot/rdata.c
src/libknot/rdata.c
+2
-2
src/libknot/rdataset.c
src/libknot/rdataset.c
+1
-1
src/libknot/rrset-dump.c
src/libknot/rrset-dump.c
+1
-1
src/libknot/rrset.c
src/libknot/rrset.c
+1
-1
src/libknot/rrtype/nsec3.c
src/libknot/rrtype/nsec3.c
+1
-1
src/libknot/rrtype/nsec3param.c
src/libknot/rrtype/nsec3param.c
+1
-1
src/libknot/rrtype/opt.c
src/libknot/rrtype/opt.c
+1
-1
src/libknot/rrtype/tsig.c
src/libknot/rrtype/tsig.c
+1
-1
src/libknot/tsig-op.c
src/libknot/tsig-op.c
+1
-1
src/libknot/util/tolower.c
src/libknot/util/tolower.c
+1
-2
src/libknot/util/utils.c
src/libknot/util/utils.c
+1
-1
src/utils/nsupdate/nsupdate_exec.c
src/utils/nsupdate/nsupdate_exec.c
+5
-5
tests/hhash.c
tests/hhash.c
+3
-2
tests/namedb.c
tests/namedb.c
+1
-1
tests/zone_timers.c
tests/zone_timers.c
+1
-1
tests/zone_update.c
tests/zone_update.c
+2
-1
No files found.
src/Makefile.am
View file @
236ff8ba
...
...
@@ -97,6 +97,7 @@ libknotcs_la_SOURCES = \
common/lists.h
\
common/log.c
\
common/log.h
\
common/macros.h
\
common/mem.c
\
common/mem.h
\
common/mempattern.c
\
...
...
@@ -144,7 +145,6 @@ libknot_la_LDFLAGS = \
libknot_la_SOURCES
=
\
libknot/binary.c
\
libknot/binary.h
\
libknot/common.h
\
libknot/consts.c
\
libknot/consts.h
\
libknot/consts.h
\
...
...
src/common/array-sort.h
View file @
236ff8ba
...
...
@@ -40,6 +40,10 @@
* undef'd.
*/
#pragma once
#include "common/macros.h"
typedef
unsigned
uns
;
#ifndef ASORT_LT
...
...
@@ -162,8 +166,7 @@ static void ASORT_PREFIX(sort)(ASORT_ARRAY_ARG uns array_size ASORT_EXTRA_ARGS)
*/
/* Find minimal element which will serve as a barrier */
/*! \todo This requires libknot/common.h!!! Define also in common/ */
r
=
KNOT_MIN
(
array_size
,
ASORT_THRESHOLD
);
r
=
MIN
(
array_size
,
ASORT_THRESHOLD
);
m
=
0
;
for
(
l
=
1
;
l
<
r
;
l
++
)
if
(
ASORT_LT
(
ASORT_ELT
(
l
),
ASORT_ELT
(
m
)))
...
...
src/common/binsearch.h
View file @
236ff8ba
...
...
@@ -7,6 +7,8 @@
* of the GNU Lesser General Public License.
*/
#pragma once
/***
* [[defs]]
* Definitions
...
...
src/common/hhash.c
View file @
236ff8ba
...
...
@@ -6,7 +6,6 @@
#include "common/binsearch.h"
#include "common/trie/murmurhash3.h"
#include "libknot/errcode.h"
#include "libknot/common.h"
/* UCW array sorting defines. */
static
int
universal_cmp
(
uint32_t
k1
,
uint32_t
k2
,
hhash_t
*
tbl
);
...
...
@@ -72,7 +71,7 @@ static int reduce_dist(hhash_t *t, int idx, int *empty)
/*! \brief Item comparator. */
static
int
key_cmp
(
const
char
*
k1
,
uint16_t
k1_len
,
const
char
*
k2
,
uint16_t
k2_len
)
{
int
ret
=
memcmp
(
k1
,
k2
,
KNOT_
MIN
(
k1_len
,
k2_len
));
int
ret
=
memcmp
(
k1
,
k2
,
MIN
(
k1_len
,
k2_len
));
if
(
ret
!=
0
)
{
return
ret
;
}
...
...
src/common/log.c
View file @
236ff8ba
...
...
@@ -28,6 +28,7 @@
#include "common/log.h"
#include "common/lists.h"
#include "common/macros.h"
#include "common/strlcpy.h"
#include "knot/conf/conf.h"
#include "libknot/errcode.h"
...
...
@@ -123,7 +124,7 @@ static uint8_t sink_levels(struct log_sink *log, int facility, logsrc_t src)
assert
(
log
);
// Check facility
if
(
knot_
unlikely
(
log
->
facility_count
==
0
||
facility
>=
log
->
facility_count
))
{
if
(
unlikely
(
log
->
facility_count
==
0
||
facility
>=
log
->
facility_count
))
{
return
0
;
}
...
...
@@ -133,7 +134,7 @@ static uint8_t sink_levels(struct log_sink *log, int facility, logsrc_t src)
static
int
sink_levels_set
(
struct
log_sink
*
log
,
int
facility
,
logsrc_t
src
,
uint8_t
levels
)
{
// Check facility
if
(
knot_
unlikely
(
log
->
facility_count
==
0
||
facility
>=
log
->
facility_count
))
{
if
(
unlikely
(
log
->
facility_count
==
0
||
facility
>=
log
->
facility_count
))
{
return
KNOT_EINVAL
;
}
...
...
@@ -204,7 +205,7 @@ bool log_isopen()
static
int
log_open_file
(
struct
log_sink
*
log
,
const
char
*
filename
)
{
// Check facility
if
(
knot_
unlikely
(
log
->
facility_count
==
0
||
if
(
unlikely
(
log
->
facility_count
==
0
||
LOGT_FILE
+
log
->
file_count
>=
log
->
facility_count
))
{
return
KNOT_ERROR
;
}
...
...
@@ -461,7 +462,7 @@ int log_update_privileges(int uid, int gid)
int
log_reconfigure
(
const
struct
conf_t
*
conf
,
void
*
data
)
{
// Data not used
KNOT_
UNUSED
(
data
);
UNUSED
(
data
);
// Use defaults if no 'log' section is configured.
if
(
EMPTY_LIST
(
conf
->
logs
))
{
...
...
src/
libknot/common
.h
→
src/
common/macros
.h
View file @
236ff8ba
/*!
* \file libknot/common.h
*
* \author Lubos Slovak <lubos.slovak@nic.cz>
*
* \brief Common macros, includes and utilities.
*
* \addtogroup libknot
* @{
*/
/* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2014 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -23,33 +13,44 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*!
* \file common/macros.h
*
* \author Lubos Slovak <lubos.slovak@nic.cz>
*
* \brief Common macros.
*
* \addtogroup common_lib
* @{
*/
#pragma once
/*! \brief Library visibility macros. */
#define _public_ __attribute__((visibility("default")))
#define _hidden_ __attribute__((visibility("hidden")))
/*! \brief Eliminate compiler warning with unused parameters. */
#define
KNOT_
UNUSED(param) (void)(param)
#define UNUSED(param) (void)(param)
#ifndef
KNOT_
MIN
#ifndef MIN
/*! \brief Type-safe minimum macro. */
#define
KNOT_
MIN(a, b) \
#define MIN(a, b) \
({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
/*! \brief Type-safe maximum macro. */
#define
KNOT_
MAX(a, b) \
#define MAX(a, b) \
({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a > _b ? _a : _b; })
#endif
/* Optimisation macros. */
#ifndef knot_likely
#ifndef likely
/*! \brief Optimize for x to be true value. */
#define
knot_likely(x) __builtin_expect((x),
1)
#define
likely(x) __builtin_expect((x),
1)
#endif
#ifndef knot_unlikely
#ifndef unlikely
/*! \brief Optimize for x to be false value. */
#define
knot_unlikely(x) __builtin_expect((x),
0)
#define
unlikely(x) __builtin_expect((x),
0)
#endif
/*! @} */
src/dnstap/reader.c
View file @
236ff8ba
...
...
@@ -20,7 +20,6 @@
#include <string.h> // strdup
#include "libknot/errcode.h"
#include "libknot/common.h"
#include "dnstap/dnstap.h"
#include "dnstap/reader.h"
...
...
@@ -98,7 +97,7 @@ void dt_reader_free_frame(dt_reader_t *reader, Dnstap__Dnstap **frame_ptr)
return
;
}
KNOT_
UNUSED
(
reader
);
UNUSED
(
reader
);
dnstap__dnstap__free_unpacked
(
*
frame_ptr
,
NULL
);
*
frame_ptr
=
NULL
;
...
...
src/dnstap/writer.c
View file @
236ff8ba
...
...
@@ -20,7 +20,6 @@
#include <string.h> // strdup
#include "libknot/errcode.h"
#include "libknot/common.h"
#include "dnstap/dnstap.h"
#include "dnstap/writer.h"
...
...
src/knot/conf/conf.c
View file @
236ff8ba
...
...
@@ -27,6 +27,7 @@
#include <urcu.h>
#include "common-knot/strlcat.h"
#include "common/strlcpy.h"
#include "common/macros.h"
#include "common/mem.h"
#include "knot/conf/conf.h"
#include "knot/conf/extra.h"
...
...
@@ -794,7 +795,7 @@ int conf_open(const char* path)
/* Update hooks. */
conf_update_hooks
(
nconf
);
/* Free old config. */
conf_free
(
oldconf
);
}
...
...
@@ -876,13 +877,13 @@ size_t conf_udp_threads(const conf_t *conf)
size_t
conf_tcp_threads
(
const
conf_t
*
conf
)
{
size_t
thrcount
=
conf_udp_threads
(
conf
);
return
KNOT_
MAX
(
thrcount
*
2
,
CONFIG_XFERS
);
return
MAX
(
thrcount
*
2
,
CONFIG_XFERS
);
}
int
conf_bg_threads
(
const
conf_t
*
conf
)
{
if
(
conf
->
bg_workers
<
1
)
{
return
KNOT_
MIN
(
dt_optimal_size
(),
CONFIG_XFERS
);
return
MIN
(
dt_optimal_size
(),
CONFIG_XFERS
);
}
return
conf
->
bg_workers
;
...
...
src/knot/ctl/estimator.c
View file @
236ff8ba
...
...
@@ -19,6 +19,7 @@
#include "knot/ctl/estimator.h"
#include "libknot/dname.h"
#include "common/lists.h"
#include "common/macros.h"
#include "common/mem.h"
#include "knot/zone/node.h"
#include "libknot/descriptor.h"
...
...
@@ -172,7 +173,7 @@ void estimator_rrset_memsize_wrap(zs_scanner_t *scanner)
int
estimator_free_trie_node
(
value_t
*
val
,
void
*
data
)
{
KNOT_
UNUSED
(
data
);
UNUSED
(
data
);
list_t
*
trie_n
=
(
list_t
*
)(
*
val
);
WALK_LIST_FREE
(
*
trie_n
);
free
(
trie_n
);
...
...
src/knot/ctl/knotc_main.c
View file @
236ff8ba
...
...
@@ -26,6 +26,7 @@
#endif
#include "knot/knot.h"
#include "common/macros.h"
#include "common/mem.h"
#include "libknot/descriptor.h"
#include "knot/ctl/process.h"
...
...
@@ -585,25 +586,25 @@ exit:
static
int
cmd_stop
(
int
argc
,
char
*
argv
[],
unsigned
flags
)
{
KNOT_
UNUSED
(
argc
);
KNOT_
UNUSED
(
argv
);
KNOT_
UNUSED
(
flags
);
UNUSED
(
argc
);
UNUSED
(
argv
);
UNUSED
(
flags
);
return
cmd_remote
(
"stop"
,
KNOT_RRTYPE_TXT
,
0
,
NULL
);
}
static
int
cmd_reload
(
int
argc
,
char
*
argv
[],
unsigned
flags
)
{
KNOT_
UNUSED
(
argc
);
KNOT_
UNUSED
(
argv
);
KNOT_
UNUSED
(
flags
);
UNUSED
(
argc
);
UNUSED
(
argv
);
UNUSED
(
flags
);
return
cmd_remote
(
"reload"
,
KNOT_RRTYPE_TXT
,
0
,
NULL
);
}
static
int
cmd_refresh
(
int
argc
,
char
*
argv
[],
unsigned
flags
)
{
KNOT_
UNUSED
(
flags
);
UNUSED
(
flags
);
if
(
flags
&
F_FORCE
)
{
return
cmd_remote
(
"retransfer"
,
KNOT_RRTYPE_NS
,
argc
,
argv
);
...
...
@@ -614,25 +615,25 @@ static int cmd_refresh(int argc, char *argv[], unsigned flags)
static
int
cmd_flush
(
int
argc
,
char
*
argv
[],
unsigned
flags
)
{
KNOT_
UNUSED
(
flags
);
UNUSED
(
flags
);
return
cmd_remote
(
"flush"
,
KNOT_RRTYPE_NS
,
argc
,
argv
);
}
static
int
cmd_status
(
int
argc
,
char
*
argv
[],
unsigned
flags
)
{
KNOT_
UNUSED
(
argc
);
KNOT_
UNUSED
(
argv
);
KNOT_
UNUSED
(
flags
);
UNUSED
(
argc
);
UNUSED
(
argv
);
UNUSED
(
flags
);
return
cmd_remote
(
"status"
,
KNOT_RRTYPE_TXT
,
0
,
NULL
);
}
static
int
cmd_zonestatus
(
int
argc
,
char
*
argv
[],
unsigned
flags
)
{
KNOT_
UNUSED
(
argc
);
KNOT_
UNUSED
(
argv
);
KNOT_
UNUSED
(
flags
);
UNUSED
(
argc
);
UNUSED
(
argv
);
UNUSED
(
flags
);
return
cmd_remote
(
"zonestatus"
,
KNOT_RRTYPE_TXT
,
0
,
NULL
);
}
...
...
@@ -644,9 +645,9 @@ static int cmd_signzone(int argc, char *argv[], unsigned flags)
static
int
cmd_checkconf
(
int
argc
,
char
*
argv
[],
unsigned
flags
)
{
KNOT_
UNUSED
(
argc
);
KNOT_
UNUSED
(
argv
);
KNOT_
UNUSED
(
flags
);
UNUSED
(
argc
);
UNUSED
(
argv
);
UNUSED
(
flags
);
log_info
(
"configuration is valid"
);
...
...
@@ -684,7 +685,7 @@ static bool fetch_zone(int argc, char *argv[], conf_zone_t *zone)
static
int
cmd_checkzone
(
int
argc
,
char
*
argv
[],
unsigned
flags
)
{
KNOT_
UNUSED
(
flags
);
UNUSED
(
flags
);
/* Zone checking */
int
rc
=
0
;
...
...
@@ -723,7 +724,7 @@ static int cmd_checkzone(int argc, char *argv[], unsigned flags)
static
int
cmd_memstats
(
int
argc
,
char
*
argv
[],
unsigned
flags
)
{
KNOT_
UNUSED
(
flags
);
UNUSED
(
flags
);
/* Zone checking */
double
total_size
=
0
;
...
...
src/knot/ctl/remote.c
View file @
236ff8ba
...
...
@@ -18,6 +18,7 @@
#include <sys/stat.h>
#include "knot/ctl/remote.h"
#include "common/log.h"
#include "common/macros.h"
#include "common/mem.h"
#include "common-knot/fdset.h"
#include "knot/knot.h"
...
...
@@ -222,8 +223,8 @@ static int remote_zone_sign(zone_t *zone)
*/
static
int
remote_c_stop
(
server_t
*
s
,
remote_cmdargs_t
*
a
)
{
KNOT_
UNUSED
(
a
);
KNOT_
UNUSED
(
s
);
UNUSED
(
a
);
UNUSED
(
s
);
return
KNOT_CTL_STOP
;
}
...
...
@@ -235,7 +236,7 @@ static int remote_c_stop(server_t *s, remote_cmdargs_t* a)
*/
static
int
remote_c_reload
(
server_t
*
s
,
remote_cmdargs_t
*
a
)
{
KNOT_
UNUSED
(
a
);
UNUSED
(
a
);
return
server_reload
(
s
,
conf
()
->
filename
);
}
...
...
@@ -247,8 +248,8 @@ static int remote_c_reload(server_t *s, remote_cmdargs_t* a)
*/
static
int
remote_c_status
(
server_t
*
s
,
remote_cmdargs_t
*
a
)
{
KNOT_
UNUSED
(
s
);
KNOT_
UNUSED
(
a
);
UNUSED
(
s
);
UNUSED
(
a
);
dbg_server
(
"remote: %s
\n
"
,
__func__
);
return
KNOT_EOK
;
}
...
...
src/knot/dnssec/nsec3-chain.c
View file @
236ff8ba
...
...
@@ -17,6 +17,7 @@
#include <assert.h>
#include "common/base32hex.h"
#include "common/macros.h"
#include "knot/dnssec/nsec3-chain.h"
#include "libknot/dname.h"
#include "libknot/packet/wire.h"
...
...
@@ -364,7 +365,7 @@ static int connect_nsec3_nodes(zone_node_t *a, zone_node_t *b,
{
assert
(
a
);
assert
(
b
);
KNOT_
UNUSED
(
data
);
UNUSED
(
data
);
assert
(
a
->
rrset_count
==
1
);
...
...
@@ -496,7 +497,7 @@ static bool nsec3_is_empty(zone_node_t *node)
*/
static
int
nsec3_mark_empty
(
zone_node_t
**
node_p
,
void
*
data
)
{
KNOT_
UNUSED
(
data
);
UNUSED
(
data
);
zone_node_t
*
node
=
*
node_p
;
if
(
!
(
node
->
flags
&
NODE_FLAGS_EMPTY
)
&&
nsec3_is_empty
(
node
))
{
...
...
@@ -545,7 +546,7 @@ static void mark_empty_nodes_tmp(const zone_contents_t *zone)
*/
static
int
nsec3_reset
(
zone_node_t
**
node_p
,
void
*
data
)
{
KNOT_
UNUSED
(
data
);
UNUSED
(
data
);
zone_node_t
*
node
=
*
node_p
;
if
(
node
->
flags
&
NODE_FLAGS_EMPTY
)
{
...
...
src/knot/dnssec/zone-keys.c
View file @
236ff8ba
...
...
@@ -20,9 +20,9 @@
#include <inttypes.h>
#include "common/debug.h"
#include "common/macros.h"
#include "common/mem.h"
#include "libknot/errcode.h"
#include "libknot/common.h"
#include "libknot/dname.h"
#include "libknot/consts.h"
#include "libknot/rrtype/dnskey.h"
...
...
@@ -206,7 +206,7 @@ int knot_load_zone_keys(const char *keydir_name, const knot_dname_t *zone_name,
int
written
=
snprintf
(
path
,
path_len
+
1
,
"%s/%s"
,
keydir_name
,
entry
->
d_name
);
KNOT_
UNUSED
(
written
);
UNUSED
(
written
);
assert
(
written
==
path_len
);
knot_key_params_t
params
=
{
0
};
...
...
@@ -339,7 +339,7 @@ uint32_t knot_get_next_zone_key_event(const knot_zone_keys_t *keys)
node_t
*
node
=
NULL
;
WALK_LIST
(
node
,
keys
->
list
)
{
knot_zone_key_t
*
key
=
(
knot_zone_key_t
*
)
node
;
result
=
KNOT_
MIN
(
result
,
key
->
next_event
);
result
=
MIN
(
result
,
key
->
next_event
);
}
return
result
;
...
...
src/knot/dnssec/zone-sign.c
View file @
236ff8ba
...
...
@@ -21,10 +21,10 @@
#include <time.h>
#include "common/debug.h"
#include "common/macros.h"
#include "libknot/descriptor.h"
#include "libknot/errcode.h"
#include "common/trie/hat-trie.h"
#include "libknot/common.h"
#include "libknot/dname.h"
#include "libknot/rrset.h"
#include "libknot/dnssec/key.h"
...
...
@@ -1151,7 +1151,7 @@ static int sign_changeset_wrap(knot_rrset_t *chg_rrset, changeset_signing_data_t
*/
static
int
free_helper_trie_node
(
value_t
*
val
,
void
*
d
)
{
KNOT_
UNUSED
(
d
);
UNUSED
(
d
);
signed_info_t
*
info
=
(
signed_info_t
*
)
*
val
;
if
(
info
->
type_list
&&
!
EMPTY_LIST
(
*
(
info
->
type_list
)))
{
WALK_LIST_FREE
(
*
(
info
->
type_list
));
...
...
@@ -1215,7 +1215,7 @@ int knot_zone_sign(const zone_contents_t *zone,
}
// renew the signatures a little earlier
uint32_t
expiration
=
KNOT_
MIN
(
normal_tree_expiration
,
nsec3_tree_expiration
);
uint32_t
expiration
=
MIN
(
normal_tree_expiration
,
nsec3_tree_expiration
);
// DNSKEY updates
uint32_t
dnskey_update
=
knot_get_next_zone_key_event
(
zone_keys
);
...
...
@@ -1354,7 +1354,7 @@ int knot_zone_sign_changeset(const zone_contents_t *zone,
}
changeset_iter_t
itt
;
changeset_iter_all
(
&
itt
,
in_ch
,
false
);
knot_rrset_t
rr
=
changeset_iter_next
(
&
itt
);
while
(
!
knot_rrset_empty
(
&
rr
))
{
int
ret
=
sign_changeset_wrap
(
&
rr
,
&
args
);
...
...
@@ -1385,7 +1385,7 @@ int knot_zone_sign_nsecs_in_changeset(const knot_zone_keys_t *zone_keys,
changeset_iter_t
itt
;
changeset_iter_add
(
&
itt
,
changeset
,
false
);
knot_rrset_t
rr
=
changeset_iter_next
(
&
itt
);
while
(
!
knot_rrset_empty
(
&
rr
))
{
if
(
rr
.
type
==
KNOT_RRTYPE_NSEC
||
...
...
@@ -1400,7 +1400,7 @@ int knot_zone_sign_nsecs_in_changeset(const knot_zone_keys_t *zone_keys,
rr
=
changeset_iter_next
(
&
itt
);
}
changeset_iter_clear
(
&
itt
);
return
KNOT_EOK
;
}
...
...
src/knot/main.c
View file @
236ff8ba
...
...
@@ -29,7 +29,6 @@
#include <systemd/sd-daemon.h>
#endif
#include "libknot/common.h"
#include "libknot/dnssec/crypto.h"
#include "knot/knot.h"
#include "knot/server/server.h"
...
...
src/knot/nameserver/internet.c
View file @
236ff8ba
...
...
@@ -16,7 +16,6 @@
#include "common/debug.h"
#include "libknot/descriptor.h"
#include "libknot/common.h"
#include "libknot/rrtype/rdname.h"
#include "libknot/rrtype/soa.h"
#include "libknot/dnssec/rrset-sign.h"
...
...
src/knot/nameserver/notify.c
View file @
236ff8ba
...
...
@@ -25,7 +25,6 @@
#include "libknot/consts.h"
#include "knot/zone/zonedb.h"
#include "knot/zone/timers.h"
#include "libknot/common.h"
#include "libknot/packet/wire.h"
#include "knot/updates/acl.h"
#include "common-knot/evsched.h"
...
...
src/knot/nameserver/nsec_proofs.c
View file @
236ff8ba
...
...
@@ -3,7 +3,6 @@
#include "knot/nameserver/internet.h"
#include "knot/dnssec/zone-nsec.h"
#include "libknot/common.h"
#include "common/debug.h"
#define DNSSEC_ENABLED 1
...
...
src/knot/nameserver/process_query.c
View file @
236ff8ba
...
...
@@ -16,6 +16,7 @@
#include "libknot/tsig-op.h"
#include "libknot/descriptor.h"
#include "common/debug.h"
#include "common/macros.h"
/*! \brief Accessor to query-specific data. */
#define QUERY_DATA(ctx) ((struct query_data *)(ctx)->data)
...
...
@@ -322,8 +323,8 @@ static int prepare_answer(const knot_pkt_t *query, knot_pkt_t *resp, knot_layer_
if
(
knot_pkt_has_edns
(
query
))
{
uint16_t
client
=
knot_edns_get_payload
(
query
->
opt_rr
);
uint16_t
server
=
conf
()
->
max_udp_payload
;
uint16_t
transfer
=
KNOT_
MIN
(
client
,
server
);
resp
->
max_size
=
KNOT_
MAX
(
resp
->
max_size
,
transfer
);
uint16_t
transfer
=
MIN
(
client
,
server
);
resp
->
max_size
=
MAX
(
resp
->
max_size
,
transfer
);
}
}
else
{
resp
->
max_size
=
KNOT_WIRE_MAX_PKTSIZE
;
...
...
src/knot/nameserver/update.c
View file @
236ff8ba
...
...
@@ -20,6 +20,7 @@
#include "knot/updates/apply.h"
#include "knot/dnssec/zone-sign.h"
#include "common/debug.h"
#include "common/macros.h"
#include "knot/dnssec/zone-events.h"
#include "knot/updates/ddns.h"
#include "knot/updates/zone-update.h"
...
...
@@ -548,7 +549,7 @@ int updates_execute(zone_t *zone)
"DDNS, processing %zu updates"
,
update_count
);
ret
=
process_requests
(
zone
,
&
updates
);
}
KNOT_
UNUSED
(
ret
);
/* Don't care about the Knot code, RCODEs are set. */
UNUSED
(
ret
);
/* Don't care about the Knot code, RCODEs are set. */
/* Send responses. */
send_update_responses
(
zone
,
&
updates
);
...
...
src/knot/server/journal.c
View file @
236ff8ba
...
...
@@ -25,7 +25,6 @@
#include <assert.h>
#include "common-knot/crc.h"
#include "libknot/common.h"
#include "knot/other/debug.h"
#include "knot/server/journal.h"
#include "knot/server/serialization.h"
...
...
src/knot/server/tcp-handler.c
View file @
236ff8ba
...
...
@@ -33,6 +33,7 @@
#include "common/sockaddr.h"
#include "common-knot/fdset.h"
#include "common/macros.h"
#include "common/mempool.h"
#include "common/net.h"
...
...
@@ -70,7 +71,7 @@ static inline int tcp_throttle() {
/*! \brief Sweep TCP connection. */
static
enum
fdset_sweep_state
tcp_sweep
(
fdset_t
*
set
,
int
i
,
void
*
data
)
{
KNOT_
UNUSED
(
data
);
UNUSED
(
data
);
assert
(
set
&&
i
<
set
->
n
&&
i
>=
0
);
int
fd
=
set
->
pfd
[
i
].
fd
;
...
...
@@ -344,7 +345,7 @@ int tcp_master(dthread_t *thread)
for
(;;)
{
/* Check handler state. */
if
(
knot_
unlikely
(
*
iostate
&
ServerReload
))
{
if
(
unlikely
(
*
iostate
&
ServerReload
))
{
*
iostate
&=
~
ServerReload
;
/* Cancel client connections. */
...
...
src/knot/server/udp-handler.c
View file @
236ff8ba
...
...
@@ -37,6 +37,7 @@
#endif
/* HAVE_CAP_NG_H */
#include "common/sockaddr.h"
#include "common/macros.h"
#include "common/mempattern.h"
#include "common/mempool.h"
#include "knot/knot.h"
...
...
@@ -128,7 +129,7 @@ void udp_handle(udp_context_t *udp, int fd, struct sockaddr_storage *ss,
param
.
thread_id
=
udp
->
thread_id
;
/* Rate limit is applied? */
if
(
knot_
unlikely
(
udp
->
server
->
rrl
!=
NULL
)
&&
udp
->
server
->
rrl
->
rate
>
0
)
{
if
(
unlikely
(
udp
->
server
->
rrl
!=
NULL
)
&&
udp
->
server
->
rrl
->
rate
>
0
)
{
param
.
proc_flags
|=
NS_QUERY_LIMIT_RATE
;
}
...
...
@@ -304,7 +305,7 @@ static inline int sendmmsg(int fd, struct mmsghdr *mmsg, unsigned vlen,
*/
int
udp_sendmmsg
(
int
sock
,
struct
sockaddr
*
_
,
struct
mmsghdr
*
msgs
,
size_t
count
)
{
KNOT_
UNUSED
(
_
);
UNUSED
(
_
);