Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Knot DNS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
24
Issues
24
List
Boards
Labels
Milestones
Merge Requests
6
Merge Requests
6
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Knot projects
Knot DNS
Commits
96bb0c09
Commit
96bb0c09
authored
Jan 25, 2013
by
Jan Kadlec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Buildable server.
- No transfers, no updates, no zone loading.
parent
c061191a
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
311 additions
and
410 deletions
+311
-410
src/Makefile.am
src/Makefile.am
+150
-110
src/knot/ctl/remote.h
src/knot/ctl/remote.h
+3
-4
src/knot/server/notify.c
src/knot/server/notify.c
+1
-0
src/knot/server/tcp-handler.c
src/knot/server/tcp-handler.c
+3
-1
src/knot/server/zones.c
src/knot/server/zones.c
+147
-277
src/knot/zone/zone-dump-text.h
src/knot/zone/zone-dump-text.h
+0
-5
src/libknot/rrset.c
src/libknot/rrset.c
+6
-12
src/libknot/rrset.h
src/libknot/rrset.h
+1
-1
No files found.
src/Makefile.am
View file @
96bb0c09
...
...
@@ -14,6 +14,8 @@ zscanner/scanner.c: zscanner/scanner.rl zscanner/scanner_body.rl
$(RAGEL)
-s
-o
zscanner/scanner.c zscanner/scanner.rl
knot_zcompile_SOURCES
=
\
knot/server/zones.c
\
knot/server/zones.h
\
libknot/packet/packet.h
\
libknot/packet/packet.c
\
libknot/packet/query.c
\
...
...
@@ -117,6 +119,24 @@ knot_zcompile_SOURCES = \
common/fdset_kqueue.c
\
common/fdset_epoll.h
\
common/fdset_epoll.c
\
knot/server/journal.h
\
knot/server/journal.c
\
knot/server/socket.c
\
knot/server/socket.h
\
knot/server/notify.h
\
knot/server/notify.c
\
knot/server/dthreads.c
\
knot/server/dthreads.h
\
knot/server/tcp-handler.c
\
knot/server/tcp-handler.h
\
knot/server/udp-handler.c
\
knot/server/udp-handler.h
\
knot/conf/conf.c
\
knot/conf/conf.h
\
knot/conf/logconf.c
\
knot/conf/logconf.h
\
knot/conf/cf-parse.y
\
knot/conf/cf-lex.l
\
common/log.c
\
common/log.h
\
zscanner/file_loader.h
\
...
...
@@ -127,116 +147,136 @@ knot_zcompile_SOURCES = \
zscanner/scanner_functions.c
unittests_libknot_SOURCES
=
\
libknot/packet/packet.h
\
libknot/packet/packet.c
\
libknot/packet/query.c
\
libknot/packet/query.h
\
libknot/packet/response.h
\
libknot/packet/response.c
\
libknot/rrset.c
\
libknot/rrset.h
\
common/slab/slab.c
\
zcompile/zcompile-error.c
\
zcompile/zcompile.c
\
zscanner/test/processing.h
\
zscanner/test/processing.c
\
libknot/util/utils.c
\
libknot/util/debug.c
\
libknot/util/debug.h
\
libknot/util/utils.h
\
libknot/util/tolower.h
\
libknot/util/tolower.c
\
libknot/util/wire.h
\
libknot/zone/zone.c
\
libknot/zone/zone-contents.c
\
libknot/nameserver/name-server.h
\
libknot/nameserver/name-server.c
\
libknot/zone/zone-tree.c
\
libknot/zone/zone-tree.h
\
libknot/zone/node.h
\
libknot/zone/zone.h
\
libknot/zone/zone-contents.h
\
libknot/zone/node.c
\
libknot/zone/dname-table.h
\
libknot/zone/dname-table.c
\
libknot/zone/zonedb.h
\
libknot/zone/zonedb.c
\
libknot/dname.c
\
libknot/dname.h
\
libknot/nsec3.h
\
libknot/nsec3.c
\
libknot/edns.h
\
libknot/edns.c
\
libknot/tsig.h
\
libknot/tsig.c
\
libknot/tsig-op.h
\
libknot/tsig-op.c
\
common/slab/slab.h
\
common/libtap/tap.c
\
common/libtap/tap.h
\
common/libtap/tap_unit.h
\
common/hattrie/ahtable.c
\
common/hattrie/ahtable.h
\
common/hattrie/hat-trie.c
\
common/hattrie/hat-trie.h
\
common/hattrie/murmurhash3.c
\
common/hattrie/murmurhash3.h
\
common/mempattern.h
\
common/mempattern.c
\
common/descriptor_new.h
\
common/descriptor_new.c
\
common/lists.c
\
common/base64.c
\
common/base64.h
\
common/lists.h
\
common/heap.h
\
common/heap.c
\
common/print.c
\
common/print.h
\
common/skip-list.c
\
common/base32hex.c
\
common/skip-list.h
\
common/general-tree.h
\
common/general-tree.c
\
common/tree.h
\
common/base32hex.h
\
common/evqueue.h
\
common/evqueue.c
\
common/evsched.h
\
common/evsched.c
\
common/acl.h
\
common/acl.c
\
common/sockaddr.h
\
common/sockaddr.c
\
common/crc.h
\
common/ref.h
\
common/ref.c
\
common/errors.h
\
common/errors.c
\
common/errcode.h
\
common/errcode.c
\
common/dSFMT.h
\
common/dSFMT-params.h
\
common/dSFMT-params521.h
\
common/dSFMT.c
\
common/prng.h
\
common/prng.c
\
common/fdset.h
\
common/fdset.c
\
common/fdset_poll.h
\
common/fdset_poll.c
\
common/fdset_kqueue.h
\
common/fdset_kqueue.c
\
common/fdset_epoll.h
\
common/fdset_epoll.c
\
common/log.c
\
common/log.h
\
zscanner/file_loader.h
\
zscanner/file_loader.c
\
zscanner/scanner.h
\
zscanner/scanner.c
\
zscanner/scanner_functions.h
\
zscanner/scanner_functions.c
\
knot/server/zones.c
\
knot/server/zones.h
\
libknot/packet/packet.h
\
libknot/packet/packet.c
\
libknot/packet/query.c
\
libknot/packet/query.h
\
libknot/packet/response.h
\
libknot/packet/response.c
\
libknot/rrset.c
\
libknot/rrset.h
\
common/slab/slab.c
\
zcompile/zcompile-error.c
\
zcompile/zcompile.c
\
zscanner/test/processing.h
\
zscanner/test/processing.c
\
libknot/util/utils.c
\
libknot/util/debug.c
\
libknot/util/debug.h
\
libknot/util/utils.h
\
libknot/util/tolower.h
\
libknot/util/tolower.c
\
libknot/util/wire.h
\
libknot/nameserver/name-server.h
\
libknot/nameserver/name-server.c
\
libknot/zone/zone.c
\
libknot/zone/zone-contents.c
\
libknot/zone/zone-tree.c
\
libknot/zone/zone-tree.h
\
libknot/zone/node.h
\
libknot/zone/zone.h
\
libknot/zone/zone-contents.h
\
libknot/zone/node.c
\
libknot/zone/dname-table.h
\
libknot/zone/dname-table.c
\
libknot/zone/zonedb.h
\
libknot/zone/zonedb.c
\
libknot/dname.c
\
libknot/dname.h
\
libknot/nsec3.h
\
libknot/nsec3.c
\
libknot/edns.h
\
libknot/edns.c
\
libknot/tsig.h
\
libknot/tsig.c
\
libknot/tsig-op.h
\
libknot/tsig-op.c
\
common/slab/slab.h
\
common/libtap/tap.c
\
common/libtap/tap.h
\
common/libtap/tap_unit.h
\
common/hattrie/ahtable.c
\
common/hattrie/ahtable.h
\
common/hattrie/hat-trie.c
\
common/hattrie/hat-trie.h
\
common/hattrie/murmurhash3.c
\
common/hattrie/murmurhash3.h
\
common/mempattern.h
\
common/mempattern.c
\
common/descriptor_new.h
\
common/descriptor_new.c
\
common/lists.c
\
common/base64.c
\
common/base64.h
\
common/lists.h
\
common/heap.h
\
common/heap.c
\
common/print.c
\
common/print.h
\
common/skip-list.c
\
common/base32hex.c
\
common/skip-list.h
\
common/general-tree.h
\
common/general-tree.c
\
common/tree.h
\
common/base32hex.h
\
common/evqueue.h
\
common/evqueue.c
\
common/evsched.h
\
common/evsched.c
\
common/acl.h
\
common/acl.c
\
common/sockaddr.h
\
common/sockaddr.c
\
common/crc.h
\
common/ref.h
\
common/ref.c
\
common/errors.h
\
common/errors.c
\
common/errcode.h
\
common/errcode.c
\
common/dSFMT.h
\
common/dSFMT-params.h
\
common/dSFMT-params521.h
\
common/dSFMT.c
\
common/prng.h
\
common/prng.c
\
common/fdset.h
\
common/fdset.c
\
common/fdset_poll.h
\
common/fdset_poll.c
\
common/fdset_kqueue.h
\
common/fdset_kqueue.c
\
common/fdset_epoll.h
\
common/fdset_epoll.c
\
knot/server/journal.h
\
knot/server/journal.c
\
knot/server/socket.c
\
knot/server/socket.h
\
knot/server/notify.h
\
knot/server/notify.c
\
knot/server/dthreads.c
\
knot/server/dthreads.h
\
knot/server/tcp-handler.c
\
knot/server/tcp-handler.h
\
knot/server/udp-handler.c
\
knot/server/udp-handler.h
\
knot/conf/conf.c
\
knot/conf/conf.h
\
knot/conf/logconf.c
\
knot/conf/logconf.h
\
knot/conf/cf-parse.y
\
knot/conf/cf-lex.l
\
common/log.c
\
common/log.h
\
zscanner/file_loader.h
\
zscanner/file_loader.c
\
zscanner/scanner.h
\
zscanner/scanner.c
\
zscanner/scanner_functions.h
\
zscanner/scanner_functions.c
\
tests/libknot/libknot/rrset_tests.c
\
tests/libknot/libknot/rrset_tests.h
\
tests/libknot/unittests_libknot.c
...
...
src/knot/ctl/remote.h
View file @
96bb0c09
...
...
@@ -31,7 +31,6 @@
#include "knot/conf/conf.h"
#include "libknot/packet/packet.h"
#include "libknot/rrset.h"
#include "libknot/rdata.h"
#include "knot/server/server.h"
/*! \brief Default remote control tool port. */
...
...
@@ -176,21 +175,21 @@ knot_rrset_t* remote_build_rr(const char *k, uint16_t t);
* \param v Text as a string.
* \return Created rdata or NULL.
*/
knot_r
data
_t
*
remote_create_txt
(
const
char
*
v
);
knot_r
rset
_t
*
remote_create_txt
(
const
char
*
v
);
/*!
* \brief Create a CNAME rdata.
* \param d Domain name as a string.
* \return Created rdata or NULL.
*/
knot_r
data
_t
*
remote_create_cname
(
const
char
*
d
);
knot_r
rset
_t
*
remote_create_cname
(
const
char
*
d
);
/*!
* \brief Parse TXT rdata to string.
* \param rd TXT rdata.
* \return Parsed string or NULL.
*/
char
*
remote_parse_txt
(
const
knot_r
data_t
*
rd
);
char
*
remote_parse_txt
(
const
knot_r
rset_t
*
rrset
);
/*!
* \brief Create dname from str and make sure the name is FQDN.
...
...
src/knot/server/notify.c
View file @
96bb0c09
...
...
@@ -19,6 +19,7 @@
#include "knot/server/notify.h"
#include "libknot/dname.h"
#include "common/descriptor_new.h"
#include "libknot/packet/packet.h"
#include "libknot/rrset.h"
#include "libknot/packet/response.h"
...
...
src/knot/server/tcp-handler.c
View file @
96bb0c09
...
...
@@ -234,7 +234,9 @@ static int tcp_handle(tcp_worker_t *w, int fd, uint8_t *qbuf, size_t qbuf_maxlen
}
/* Prepare context. */
res
=
xfr_request_init
(
&
xfr
,
xfrt
,
XFR_FLAG_TCP
,
packet
);
assert
(
0
);
//TODO
// res = xfr_request_init(&xfr, xfrt, XFR_FLAG_TCP, packet);
if
(
res
!=
KNOT_EOK
)
{
knot_ns_error_response_from_query
(
ns
,
packet
,
KNOT_RCODE_SERVFAIL
,
...
...
src/knot/server/zones.c
View file @
96bb0c09
This diff is collapsed.
Click to expand it.
src/knot/zone/zone-dump-text.h
View file @
96bb0c09
...
...
@@ -41,11 +41,6 @@
*/
int
zone_dump_text
(
knot_zone_contents_t
*
zone
,
FILE
*
f
);
/*! \note Exported for utils */
char
*
rdata_item_to_string
(
knot_rdata_zoneformat_t
type
,
knot_rdata_item_t
item
);
char
*
rdata_ipsecgateway_to_string
(
knot_rdata_item_t
item
,
const
knot_rrset_t
*
rrset
);
#endif // _KNOT_ZONE_DUMP_TEXT_H_
/*! @} */
src/libknot/rrset.c
View file @
96bb0c09
...
...
@@ -372,15 +372,6 @@ void knot_rrset_set_ttl(knot_rrset_t *rrset, uint32_t ttl)
/*----------------------------------------------------------------------------*/
void
knot_rrset_set_class
(
knot_rrset_t
*
rrset
,
uint16_t
rclass
)
{
if
(
rrset
)
{
rrset
->
rclass
=
rclass
;
}
}
/*----------------------------------------------------------------------------*/
uint16_t
knot_rrset_type
(
const
knot_rrset_t
*
rrset
)
{
return
rrset
->
type
;
...
...
@@ -2050,15 +2041,15 @@ static int rrset_deserialize_rr(knot_rrset_t *rrset, size_t rdata_pos,
return
KNOT_EOK
;
}
int
rrset_deserialize
(
uint8_t
*
stream
,
size_t
stream_size
,
int
rrset_deserialize
(
uint8_t
*
stream
,
size_t
*
stream_size
,
knot_rrset_t
**
rrset
)
{
if
(
sizeof
(
uint64_t
)
>
stream_size
)
{
if
(
sizeof
(
uint64_t
)
>
*
stream_size
)
{
return
KNOT_ESPACE
;
}
uint64_t
rrset_length
=
0
;
memcpy
(
&
rrset_length
,
stream
,
sizeof
(
uint64_t
));
if
(
rrset_length
>
stream_size
)
{
if
(
rrset_length
>
*
stream_size
)
{
return
KNOT_ESPACE
;
}
...
...
@@ -2112,6 +2103,8 @@ int rrset_deserialize(uint8_t *stream, size_t stream_size,
offset
+=
read
;
}
*
stream_size
=
*
stream_size
-
offset
;
return
KNOT_EOK
;
}
...
...
@@ -2176,3 +2169,4 @@ const knot_dname_t *knot_rrset_rdata_name(const knot_rrset_t *rrset,
return
NULL
;
}
src/libknot/rrset.h
View file @
96bb0c09
...
...
@@ -437,7 +437,7 @@ int rrset_serialize_alloc(const knot_rrset_t *rrset, uint8_t **stream,
size_t
*
size
);
//TODO test
int
rrset_deserialize
(
uint8_t
*
stream
,
size_t
stream_size
,
int
rrset_deserialize
(
uint8_t
*
stream
,
size_t
*
stream_size
,
knot_rrset_t
**
rrset
);
#endif
/* _KNOT_RRSET_H_ */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment