Commit c8747698 authored by Daniel Salzman's avatar Daniel Salzman

contrib: move net and sockaddr from internal

parent d3bf7d7c
......@@ -38,12 +38,16 @@ src/contrib/base64.h
src/contrib/endian.h
src/contrib/getline.c
src/contrib/getline.h
src/contrib/net.c
src/contrib/net.h
src/contrib/openbsd/strlcat.c
src/contrib/openbsd/strlcat.h
src/contrib/openbsd/strlcpy.c
src/contrib/openbsd/strlcpy.h
src/contrib/print.c
src/contrib/print.h
src/contrib/sockaddr.c
src/contrib/sockaddr.h
src/contrib/string.c
src/contrib/string.h
src/contrib/tolower.h
......@@ -377,10 +381,6 @@ src/libknot/internal/namedb/namedb_lmdb.c
src/libknot/internal/namedb/namedb_lmdb.h
src/libknot/internal/namedb/namedb_trie.c
src/libknot/internal/namedb/namedb_trie.h
src/libknot/internal/net.c
src/libknot/internal/net.h
src/libknot/internal/sockaddr.c
src/libknot/internal/sockaddr.h
src/libknot/internal/trie/hat-trie.c
src/libknot/internal/trie/hat-trie.h
src/libknot/internal/trie/murmurhash3.c
......
......@@ -28,7 +28,9 @@ nobase_libcontrib_la_HEADERS = \
contrib/base64.h \
contrib/endian.h \
contrib/getline.h \
contrib/net.h \
contrib/print.h \
contrib/sockaddr.h \
contrib/string.h \
contrib/tolower.h \
contrib/wire_ctx.h \
......@@ -86,8 +88,6 @@ nobase_libknot_internal_la_HEADERS = \
libknot/internal/namedb/namedb.h \
libknot/internal/namedb/namedb_lmdb.h \
libknot/internal/namedb/namedb_trie.h \
libknot/internal/net.h \
libknot/internal/sockaddr.h \
libknot/internal/trie/hat-trie.h \
libknot/internal/trie/murmurhash3.h \
libknot/internal/utils.h
......@@ -104,7 +104,9 @@ libcontrib_la_SOURCES = \
contrib/base32hex.c \
contrib/base64.c \
contrib/getline.c \
contrib/net.c \
contrib/print.c \
contrib/sockaddr.c \
contrib/string.c \
contrib/openbsd/strlcat.c \
contrib/openbsd/strlcpy.c \
......@@ -153,8 +155,6 @@ libknot_internal_la_SOURCES = \
libknot/internal/mempattern.c \
libknot/internal/namedb/namedb_lmdb.c \
libknot/internal/namedb/namedb_trie.c \
libknot/internal/net.c \
libknot/internal/sockaddr.c \
libknot/internal/trie/hat-trie.c \
libknot/internal/trie/murmurhash3.c \
libknot/internal/utils.c \
......
......@@ -23,8 +23,9 @@
#include <sys/uio.h>
#include <unistd.h>
#include "libknot/internal/net.h"
#include "libknot/internal/errcode.h"
#include "contrib/net.h"
#include "contrib/sockaddr.h"
/*
* OS X doesn't support MSG_NOSIGNAL. Use SO_NOSIGPIPE socket option instead.
......
......@@ -17,8 +17,9 @@
#pragma once
#include <stdbool.h>
#include "libknot/internal/sockaddr.h"
#include <stdint.h>
#include <sys/socket.h>
#include <sys/time.h>
/*!
* \brief Network interface flags.
......
......@@ -14,15 +14,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <netdb.h>
#include "libknot/consts.h"
#include "libknot/internal/macros.h"
#include "libknot/internal/utils.h"
#include "libknot/internal/sockaddr.h"
#include "libknot/internal/errcode.h"
#include "contrib/sockaddr.h"
#include "contrib/openbsd/strlcpy.h"
int sockaddr_len(const struct sockaddr *ss)
......
......@@ -14,13 +14,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*!
* \file sockaddr.h
*
* \author Marek Vavrusa <marek.vavrusa@nic.cz>
* \file
*
* \brief Socket address abstraction layer.
*
* \addtogroup common_lib
* \addtogroup contrib
* @{
*/
......
......@@ -26,9 +26,9 @@
#include "knot/common/log.h"
#include "knot/nameserver/query_module.h"
#include "knot/nameserver/internet.h"
#include "libknot/internal/sockaddr.h"
#include "libknot/yparser/ypformat.h"
#include "libknot/yparser/yptrafo.h"
#include "contrib/sockaddr.h"
#include "contrib/string.h"
#include "contrib/ucw/mempool.h"
......
......@@ -24,8 +24,8 @@
#include "knot/server/dthreads.h"
#include "libknot/libknot.h"
#include "libknot/internal/macros.h"
#include "libknot/internal/sockaddr.h"
#include "libknot/yparser/yptrafo.h"
#include "contrib/sockaddr.h"
#include "contrib/string.h"
#include "contrib/wire_ctx.h"
#include "contrib/openbsd/strlcat.h"
......
......@@ -26,7 +26,6 @@
#endif
#include "dnssec/crypto.h"
#include "contrib/string.h"
#include "libknot/internal/macros.h"
#include "libknot/libknot.h"
#include "knot/common/log.h"
......@@ -36,6 +35,9 @@
#include "knot/server/tcp-handler.h"
#include "knot/zone/zonefile.h"
#include "knot/zone/zone-load.h"
#include "contrib/net.h"
#include "contrib/sockaddr.h"
#include "contrib/string.h"
/*! \brief Controller flags. */
enum knotc_flag_t {
......
......@@ -15,7 +15,6 @@
*/
#include <assert.h>
#include <sys/stat.h>
#include <urcu.h>
#include "dnssec/random.h"
......@@ -31,8 +30,9 @@
#include "knot/zone/timers.h"
#include "libknot/libknot.h"
#include "libknot/internal/macros.h"
#include "libknot/internal/net.h"
#include "libknot/yparser/yptrafo.h"
#include "contrib/net.h"
#include "contrib/sockaddr.h"
#include "contrib/string.h"
#include "contrib/openbsd/strlcpy.h"
......
......@@ -19,6 +19,7 @@
#include "knot/modules/dnsproxy.h"
#include "knot/nameserver/capture.h"
#include "knot/nameserver/process_query.h"
#include "contrib/net.h"
/* Module configuration scheme. */
#define MOD_REMOTE "\x06""remote"
......
......@@ -21,8 +21,8 @@
#include "knot/modules/rosedb.h"
#include "knot/nameserver/process_query.h"
#include "libknot/libknot.h"
#include "libknot/internal/net.h"
#include "libknot/internal/utils.h"
#include "contrib/net.h"
/* Module configuration scheme. */
#define MOD_DBDIR "\x05""dbdir"
......
......@@ -19,6 +19,8 @@
#include "knot/nameserver/internet.h"
#include "knot/common/log.h"
#include "libknot/descriptor.h"
#include "contrib/net.h"
#include "contrib/sockaddr.h"
/* Module configuration scheme. */
#define MOD_NET "\x07""network"
......
......@@ -27,6 +27,7 @@
#include "libknot/descriptor.h"
#include "libknot/internal/lists.h"
#include "contrib/print.h"
#include "contrib/sockaddr.h"
/* AXFR context. @note aliasing the generic xfr_proc */
struct axfr_proc {
......
......@@ -27,6 +27,7 @@
#include "knot/zone/serial.h"
#include "knot/zone/zonedb.h"
#include "libknot/dnssec/rrset-sign.h"
#include "contrib/sockaddr.h"
/*! \brief Check if given node was already visited. */
static int wildcard_has_visited(struct query_data *qdata, const zone_node_t *node)
......
......@@ -29,6 +29,7 @@
#include "libknot/internal/utils.h"
#include "libknot/rrtype/soa.h"
#include "contrib/print.h"
#include "contrib/sockaddr.h"
/* ------------------------ IXFR-out processing ----------------------------- */
......
......@@ -36,6 +36,7 @@
#include "knot/nameserver/tsig_ctx.h"
#include "knot/nameserver/process_answer.h"
#include "libknot/rrtype/soa.h"
#include "contrib/sockaddr.h"
/*----------------------------------------------------------------------------*/
/* API functions */
......
......@@ -21,6 +21,7 @@
#include "knot/nameserver/notify.h"
#include "knot/nameserver/ixfr.h"
#include "knot/nameserver/axfr.h"
#include "contrib/sockaddr.h"
/*! \brief Accessor to query-specific data. */
#define ANSWER_DATA(ctx) ((struct answer_data *)(ctx)->data)
......
......@@ -26,6 +26,8 @@
#pragma once
#include <sys/socket.h>
#include "knot/nameserver/process_query.h"
#include "knot/nameserver/tsig_ctx.h"
......
......@@ -19,6 +19,7 @@
#include "libknot/libknot.h"
#include "libknot/internal/macros.h"
#include "libknot/yparser/yptrafo.h"
#include "contrib/sockaddr.h"
/*! \brief Accessor to query-specific data. */
#define QUERY_DATA(ctx) ((struct query_data *)(ctx)->data)
......
......@@ -29,6 +29,7 @@
#include "libknot/processing/layer.h"
#include "knot/server/server.h"
#include "knot/updates/acl.h"
#include "contrib/sockaddr.h"
/* Query processing module implementation. */
const knot_layer_api_t *process_query_layer(void);
......
......@@ -36,7 +36,9 @@
#include "knot/server/udp-handler.h"
#include "knot/nameserver/capture.h"
#include "libknot/processing/requestor.h"
#include "contrib/net.h"
#include "contrib/print.h"
#include "contrib/sockaddr.h"
/* UPDATE-specific logging (internal, expects 'qdata' variable set). */
#define UPDATE_LOG(severity, msg, ...) \
......
......@@ -14,11 +14,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <time.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <assert.h>
#include <time.h>
#include "dnssec/random.h"
#include "knot/common/log.h"
......@@ -26,6 +23,7 @@
#include "knot/zone/zone.h"
#include "libknot/libknot.h"
#include "libknot/internal/trie/murmurhash3.h"
#include "contrib/sockaddr.h"
/* Hopscotch defines. */
#define HOP_LEN (sizeof(unsigned)*8)
......
......@@ -28,7 +28,7 @@
#include <stdint.h>
#include <pthread.h>
#include "libknot/internal/sockaddr.h"
#include <sys/socket.h>
#include "libknot/packet/pkt.h"
/* Defaults */
......
......@@ -33,6 +33,8 @@
#include "knot/worker/pool.h"
#include "knot/zone/timers.h"
#include "knot/zone/zonedb-load.h"
#include "contrib/net.h"
#include "contrib/sockaddr.h"
/*! \brief Minimal send/receive buffer sizes. */
enum {
......
......@@ -29,10 +29,11 @@
#pragma once
#include "sys/socket.h"
#include "knot/common/evsched.h"
#include "libknot/internal/lists.h"
#include "knot/common/fdset.h"
#include "libknot/internal/net.h"
#include "libknot/internal/namedb/namedb.h"
#include "knot/server/dthreads.h"
#include "knot/server/rrl.h"
......
......@@ -39,9 +39,9 @@
#include "knot/common/time.h"
#include "knot/nameserver/process_query.h"
#include "libknot/internal/macros.h"
#include "libknot/internal/net.h"
#include "libknot/internal/sockaddr.h"
#include "libknot/processing/overlay.h"
#include "contrib/net.h"
#include "contrib/sockaddr.h"
#include "contrib/ucw/mempool.h"
/*! \brief TCP context data. */
......
......@@ -37,11 +37,11 @@
#include "knot/server/udp-handler.h"
#include "knot/server/server.h"
#include "libknot/internal/sockaddr.h"
#include "libknot/internal/mempattern.h"
#include "libknot/internal/macros.h"
#include "libknot/libknot.h"
#include "libknot/processing/overlay.h"
#include "contrib/sockaddr.h"
#include "contrib/ucw/mempool.h"
/* Buffer identifiers. */
......
......@@ -14,20 +14,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <limits.h>
#include <stdbool.h>
#include "contrib/endian.h"
#include "knot/updates/acl.h"
#include "knot/conf/conf.h"
#include "libknot/libknot.h"
#include "libknot/internal/sockaddr.h"
#include "libknot/yparser/yptrafo.h"
#include "contrib/endian.h"
#include "contrib/sockaddr.h"
static const uint8_t* ipv4_addr(const struct sockaddr_storage *ss) {
struct sockaddr_in *ipv4 = (struct sockaddr_in *)ss;
......
......@@ -24,8 +24,9 @@
#pragma once
#include <sys/socket.h>
#include "libknot/internal/lists.h"
#include "libknot/internal/sockaddr.h"
#include "libknot/internal/mempattern.h"
#include "libknot/rrtype/tsig.h"
#include "knot/conf/conf.h"
......
......@@ -19,7 +19,8 @@
#include "libknot/processing/requestor.h"
#include "libknot/errcode.h"
#include "libknot/internal/macros.h"
#include "libknot/internal/net.h"
#include "contrib/net.h"
#include "contrib/sockaddr.h"
static bool use_tcp(struct knot_request *request)
{
......
......@@ -16,12 +16,12 @@
#pragma once
#include <sys/socket.h>
#include <sys/time.h>
#include "libknot/processing/overlay.h"
#include "libknot/rrtype/tsig.h"
#include "libknot/internal/lists.h"
#include "libknot/internal/sockaddr.h"
#include "libknot/internal/mempattern.h"
struct knot_request;
......
......@@ -18,12 +18,12 @@
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <sys/socket.h>
#include "libknot/consts.h"
#include "libknot/rrtype/opt.h"
#include "libknot/descriptor.h"
#include "libknot/internal/macros.h"
#include "libknot/internal/sockaddr.h"
#include "contrib/wire_ctx.h"
/*! \brief Some implementation-related constants. */
......
......@@ -22,9 +22,9 @@
#include "libknot/yparser/yptrafo.h"
#include "libknot/internal/macros.h"
#include "libknot/internal/sockaddr.h"
#include "libknot/libknot.h"
#include "contrib/base64.h"
#include "contrib/sockaddr.h"
#include "contrib/wire_ctx.h"
enum {
......
......@@ -25,8 +25,8 @@
#include "utils/common/params.h"
#include "libknot/libknot.h"
#include "libknot/internal/lists.h"
#include "libknot/internal/sockaddr.h"
#include "contrib/print.h"
#include "contrib/sockaddr.h"
#include "contrib/openbsd/strlcat.h"
#include "contrib/wire_ctx.h"
......
......@@ -29,7 +29,7 @@
#include "utils/common/netio.h"
#include "utils/common/msg.h"
#include "libknot/libknot.h"
#include "libknot/internal/sockaddr.h"
#include "contrib/sockaddr.h"
srv_info_t* srv_info_create(const char *name, const char *service)
{
......
......@@ -26,7 +26,7 @@
#include "utils/common/sign.h"
#include "libknot/libknot.h"
#include "libknot/internal/lists.h"
#include "libknot/internal/sockaddr.h"
#include "contrib/sockaddr.h"
#include "contrib/print.h"
#if USE_DNSTAP
......
......@@ -28,7 +28,7 @@
#include "libknot/descriptor.h"
#include "libknot/libknot.h"
#include "libknot/internal/lists.h"
#include "libknot/internal/sockaddr.h"
#include "contrib/sockaddr.h"
#define DEFAULT_RETRIES_DIG 2
#define DEFAULT_TIMEOUT_DIG 5
......
......@@ -32,7 +32,7 @@
#include "utils/common/exec.h"
#include "utils/common/sign.h"
#include "libknot/libknot.h"
#include "libknot/internal/sockaddr.h"
#include "contrib/sockaddr.h"
#if USE_DNSTAP
# include "dnstap/reader.h"
......
......@@ -20,8 +20,8 @@
#include "test_conf.h"
#include "libknot/libknot.h"
#include "libknot/internal/sockaddr.h"
#include "knot/updates/acl.h"
#include "contrib/sockaddr.h"
static void check_sockaddr_set(struct sockaddr_storage *ss, int family,
const char *straddr, int port)
......
......@@ -20,7 +20,7 @@
#include "libknot/libknot.h"
#include "libknot/rrtype/opt.h"
#include "libknot/descriptor.h"
#include "libknot/internal/sockaddr.h"
#include "contrib/sockaddr.h"
static const uint16_t E_MAX_PLD = 10000;
static const uint16_t E_MAX_PLD2 = 20000;
......
......@@ -25,8 +25,8 @@
#include <unistd.h>
#include "libknot/errcode.h"
#include "libknot/internal/net.h"
#include "libknot/internal/sockaddr.h"
#include "contrib/net.h"
#include "contrib/sockaddr.h"
#undef ENABLE_NET_UNREACHABLE_TEST
//#define ENABLE_NET_UNREACHABLE_TEST
......
......@@ -26,7 +26,8 @@
#include <netdb.h>
#include "libknot/errcode.h"
#include "libknot/internal/net.h"
#include "contrib/net.h"
#include "contrib/sockaddr.h"
const struct timeval TIMEOUT = { .tv_sec = 2 };
......
......@@ -21,9 +21,10 @@
#include <fcntl.h>
#include "knot/conf/conf.h"
#include "libknot/internal/net.h"
#include "libknot/processing/layer.h"
#include "libknot/processing/requestor.h"
#include "contrib/net.h"
#include "contrib/sockaddr.h"
#include "contrib/ucw/mempool.h"
/* @note Purpose of this test is not to verify process_answer functionality,
......
......@@ -24,7 +24,7 @@
#include "knot/server/rrl.h"
#include "knot/zone/zone.h"
#include "libknot/descriptor.h"
#include "libknot/internal/sockaddr.h"
#include "contrib/sockaddr.h"
/* Enable time-dependent tests. */
//#define ENABLE_TIMED_TESTS
......
......@@ -17,10 +17,10 @@
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/socket.h>
#include <tap/basic.h>
#include "libknot/yparser/yptrafo.h"
#include "libknot/internal/sockaddr.h"
#include "libknot/libknot.h"
static void int_test(const char *txt, int64_t num, yp_style_t s,
......
......@@ -17,6 +17,7 @@
#include <dirent.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <tap/basic.h>
#include "libknot/internal/namedb/namedb.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment