Commit 7c74c5f1 authored by Marek Vavruša's avatar Marek Vavruša

common: moved strlcpy & sockaddr to common

parent 63a1e505
......@@ -41,8 +41,6 @@ src/common-knot/hex.c
src/common-knot/hex.h
src/common-knot/hhash.c
src/common-knot/hhash.h
src/common-knot/lists.c
src/common-knot/lists.h
src/common-knot/print.c
src/common-knot/print.h
src/common-knot/ref.c
......@@ -50,12 +48,8 @@ src/common-knot/ref.h
src/common-knot/slab/alloc-common.h
src/common-knot/slab/slab.c
src/common-knot/slab/slab.h
src/common-knot/sockaddr.c
src/common-knot/sockaddr.h
src/common-knot/strlcat.c
src/common-knot/strlcat.h
src/common-knot/strlcpy.c
src/common-knot/strlcpy.h
src/common-knot/strtonum.h
src/common-knot/trim.h
src/common/base32hex.c
......@@ -67,12 +61,18 @@ src/common/errors.c
src/common/errors.h
src/common/getline.c
src/common/getline.h
src/common/lists.c
src/common/lists.h
src/common/log.c
src/common/log.h
src/common/mem.c
src/common/mem.h
src/common/mempool.c
src/common/mempool.h
src/common/sockaddr.c
src/common/sockaddr.h
src/common/strlcpy.c
src/common/strlcpy.h
src/dnstap/Makefile.am
src/dnstap/convert.c
src/dnstap/convert.h
......@@ -137,8 +137,6 @@ src/knot/nameserver/process_query.c
src/knot/nameserver/process_query.h
src/knot/nameserver/query_module.c
src/knot/nameserver/query_module.h
src/knot/nameserver/requestor.c
src/knot/nameserver/requestor.h
src/knot/nameserver/tsig_ctx.c
src/knot/nameserver/tsig_ctx.h
src/knot/nameserver/update.c
......@@ -148,8 +146,6 @@ src/knot/server/dthreads.c
src/knot/server/dthreads.h
src/knot/server/journal.c
src/knot/server/journal.h
src/knot/server/net.c
src/knot/server/net.h
src/knot/server/rrl.c
src/knot/server/rrl.h
src/knot/server/serialization.c
......@@ -227,11 +223,15 @@ src/libknot/mempattern.c
src/libknot/mempattern.h
src/libknot/packet/compr.c
src/libknot/packet/compr.h
src/libknot/packet/net.c
src/libknot/packet/net.h
src/libknot/packet/pkt.c
src/libknot/packet/pkt.h
src/libknot/packet/wire.h
src/libknot/processing/process.c
src/libknot/processing/process.h
src/libknot/processing/requestor.c
src/libknot/processing/requestor.h
src/libknot/rdata.c
src/libknot/rdata.h
src/libknot/rdataset.c
......
......@@ -79,8 +79,6 @@ libknots_la_SOURCES = \
common-knot/hex.h \
common-knot/hhash.c \
common-knot/hhash.h \
common-knot/lists.c \
common-knot/lists.h \
common-knot/print.c \
common-knot/print.h \
common-knot/ref.c \
......@@ -88,17 +86,19 @@ libknots_la_SOURCES = \
common-knot/slab/alloc-common.h \
common-knot/slab/slab.c \
common-knot/slab/slab.h \
common-knot/sockaddr.c \
common-knot/sockaddr.h \
common-knot/strlcat.c \
common-knot/strlcat.h \
common-knot/strlcpy.c \
common-knot/strlcpy.h \
common-knot/strtonum.h \
common-knot/trim.h
# static: common shared (also in libknot)
libknotcs_la_SOURCES = \
common/strlcpy.c \
common/strlcpy.h \
common/lists.c \
common/lists.h \
common/sockaddr.c \
common/sockaddr.h \
common/base32hex.c \
common/base32hex.h \
common/base64.c \
......
......@@ -28,7 +28,7 @@
#include <stdlib.h>
#include <string.h>
#include "common-knot/lists.h"
#include "common/lists.h"
/**
* add_tail - append a node to a list
......
......@@ -23,8 +23,8 @@
#include <sys/time.h>
#include "common/log.h"
#include "common-knot/lists.h"
#include "common-knot/strlcpy.h"
#include "common/lists.h"
#include "common/strlcpy.h"
#include "knot/conf/conf.h"
/* Single log message buffer length (one line). */
......
......@@ -18,9 +18,9 @@
#include <string.h>
#include <netdb.h>
#include "common-knot/sockaddr.h"
#include "common/sockaddr.h"
#include "libknot/errcode.h"
#include "common-knot/strlcpy.h"
#include "common/strlcpy.h"
#include "libknot/consts.h"
int sockaddr_len(const struct sockaddr_storage *ss)
......
......@@ -17,7 +17,7 @@
#include <sys/types.h>
#include <string.h>
#include "common-knot/strlcpy.h"
#include "common/strlcpy.h"
size_t
knot_strlcpy(char *dst, const char *src, size_t siz)
......
......@@ -33,7 +33,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include "common-knot/sockaddr.h"
#include "common/sockaddr.h"
#include "knot/conf/conf.h"
#include "knot/conf/includes.h"
#include "knot/conf/extra.h"
......
......@@ -30,9 +30,9 @@
#include <stdlib.h>
#include <pwd.h>
#include <grp.h>
#include "common-knot/sockaddr.h"
#include "common/sockaddr.h"
#include "common-knot/strlcat.h"
#include "common-knot/strlcpy.h"
#include "common/strlcpy.h"
#include "libknot/dname.h"
#include "libknot/binary.h"
#include "libknot/rrtype/opt.h"
......
......@@ -26,7 +26,7 @@
#include <urcu.h>
#include "common-knot/strlcat.h"
#include "common-knot/strlcpy.h"
#include "common/strlcpy.h"
#include "common/mem.h"
#include "knot/conf/conf.h"
#include "knot/conf/extra.h"
......
......@@ -37,10 +37,10 @@
#include "libknot/rrtype/tsig.h"
#include "libknot/dnssec/key.h"
#include "libknot/dnssec/policy.h"
#include "common-knot/lists.h"
#include "common/lists.h"
#include "common/log.h"
#include "knot/updates/acl.h"
#include "common-knot/sockaddr.h"
#include "common/sockaddr.h"
#include "common-knot/hattrie/hat-trie.h"
#include "knot/nameserver/query_module.h"
......
......@@ -18,7 +18,7 @@
#include "knot/ctl/estimator.h"
#include "libknot/dname.h"
#include "common-knot/lists.h"
#include "common/lists.h"
#include "common/mem.h"
#include "knot/zone/node.h"
#include "zscanner/zscanner.h"
......
......@@ -25,7 +25,7 @@
#include "knot/server/tcp-handler.h"
#include "libknot/packet/wire.h"
#include "libknot/descriptor.h"
#include "common-knot/strlcpy.h"
#include "common/strlcpy.h"
#include "libknot/tsig-op.h"
#include "libknot/rrtype/rdname.h"
#include "libknot/rrtype/soa.h"
......
......@@ -30,7 +30,7 @@
#include <stdbool.h>
#include <stdint.h>
#include "common-knot/lists.h"
#include "common/lists.h"
#include "libknot/dname.h"
#include "libknot/dnssec/sign.h"
......
......@@ -22,7 +22,7 @@
#include "knot/zone/zonefile.h"
#include "common/debug.h"
#include "libknot/descriptor.h"
#include "common-knot/lists.h"
#include "common/lists.h"
/* AXFR context. @note aliasing the generic xfr_proc */
struct axfr_proc {
......
#include "knot/nameserver/query_module.h"
#include "libknot/mempattern.h"
#include "libknot/errcode.h"
#include "common-knot/strlcpy.h"
#include "common/strlcpy.h"
/* Compiled-in module headers. */
#include "knot/modules/synth_record.h"
......
......@@ -40,7 +40,7 @@
#pragma once
#include "common-knot/lists.h"
#include "common/lists.h"
#include "libknot/mempattern.h"
#include "libknot/consts.h"
#include "libknot/packet/pkt.h"
......
......@@ -28,7 +28,7 @@
#include <stdint.h>
#include <pthread.h>
#include "common-knot/sockaddr.h"
#include "common/sockaddr.h"
#include "libknot/packet/pkt.h"
/* Defaults */
......
......@@ -36,7 +36,7 @@
#pragma once
#include "common-knot/evsched.h"
#include "common-knot/lists.h"
#include "common/lists.h"
#include "common-knot/fdset.h"
#include "libknot/packet/net.h"
#include "knot/server/dthreads.h"
......
......@@ -31,7 +31,7 @@
#include <cap-ng.h>
#endif /* HAVE_CAP_NG_H */
#include "common-knot/sockaddr.h"
#include "common/sockaddr.h"
#include "common-knot/fdset.h"
#include "common/mempool.h"
#include "knot/knot.h"
......
......@@ -36,7 +36,7 @@
#include <cap-ng.h>
#endif /* HAVE_CAP_NG_H */
#include "common-knot/sockaddr.h"
#include "common/sockaddr.h"
#include "libknot/mempattern.h"
#include "common/mempool.h"
#include "knot/knot.h"
......
......@@ -29,8 +29,8 @@
#pragma once
#include "common-knot/lists.h"
#include "common-knot/sockaddr.h"
#include "common/lists.h"
#include "common/sockaddr.h"
#include "libknot/mempattern.h"
#include "libknot/rrtype/tsig.h"
......
......@@ -22,7 +22,7 @@
#include "libknot/common.h"
#include "knot/updates/changesets.h"
#include "knot/zone/zonefile.h"
#include "common-knot/lists.h"
#include "common/lists.h"
#include "libknot/rrtype/soa.h"
/* --------------------------- Update cleanup ------------------------------- */
......
......@@ -28,7 +28,7 @@
#include "libknot/rrset.h"
#include "knot/zone/contents.h"
#include "common-knot/lists.h"
#include "common/lists.h"
/*----------------------------------------------------------------------------*/
......
......@@ -26,7 +26,7 @@
#include "libknot/rrtype/soa.h"
#include "libknot/mempattern.h"
#include "libknot/descriptor.h"
#include "common-knot/lists.h"
#include "common/lists.h"
/* ----------------------------- prereq check ------------------------------- */
......
......@@ -16,7 +16,7 @@
#pragma once
#include "common-knot/lists.h"
#include "common/lists.h"
struct task;
typedef void (*task_cb)(struct task *);
......
......@@ -26,7 +26,7 @@
#pragma once
#include "common-knot/lists.h"
#include "common/lists.h"
#include "libknot/rrtype/nsec3param.h"
#include "knot/zone/node.h"
#include "knot/zone/zone-tree.h"
......
......@@ -21,7 +21,7 @@
#include "libknot/descriptor.h"
#include "common-knot/evsched.h"
#include "common-knot/lists.h"
#include "common/lists.h"
#include "common-knot/trim.h"
#include "knot/zone/node.h"
#include "knot/zone/zone.h"
......
......@@ -28,7 +28,7 @@
#include "common-knot/crc.h"
#include "common-knot/strlcat.h"
#include "common-knot/strlcpy.h"
#include "common/strlcpy.h"
#include "libknot/common.h"
#include "knot/zone/semantic-check.h"
#include "knot/zone/contents.h"
......
......@@ -29,7 +29,7 @@
#pragma once
/* POSIX only. */
#include "common-knot/sockaddr.h"
#include "common/sockaddr.h"
/******* #274, legacy API to be replaced below ********/
......
......@@ -16,8 +16,8 @@
#pragma once
#include "common-knot/lists.h"
#include "common-knot/sockaddr.h"
#include "common/lists.h"
#include "common/sockaddr.h"
#include "libknot/processing/process.h"
struct request;
......
......@@ -23,7 +23,7 @@
#include "libknot/common.h"
#include "libknot/descriptor.h"
#include "common/debug.h"
#include "common-knot/sockaddr.h"
#include "common/sockaddr.h"
/*! \brief Some implementation-related constants. */
enum knot_edns_private_consts {
......
......@@ -21,10 +21,10 @@
#include <arpa/inet.h> // inet_ntop
#include "libknot/libknot.h"
#include "common-knot/lists.h" // list
#include "common/lists.h" // list
#include "common/sockaddr.h" // IPV4_PREFIXLEN
#include "common-knot/print.h" // txt_print
#include "common-knot/strlcat.h" // strlcat
#include "common-knot/sockaddr.h" // IPV4_PREFIXLEN
#include "utils/common/msg.h" // WARN
#include "utils/common/params.h" // params_t
#include "utils/common/netio.h" // send_msg
......
......@@ -31,7 +31,7 @@
#include "utils/common/msg.h" // WARN
#include "libknot/descriptor.h" // KNOT_CLASS_IN
#include "libknot/errcode.h" // KNOT_E
#include "common-knot/sockaddr.h" // sockaddr_tostr, sockaddr_portnum
#include "common/sockaddr.h" // sockaddr_tostr, sockaddr_portnum
srv_info_t* srv_info_create(const char *name, const char *service)
{
......
......@@ -30,7 +30,7 @@
#include <netdb.h> // addrinfo
#include <sys/socket.h> // sockaddr_storage (BSD)
#include "common-knot/lists.h" // node
#include "common/lists.h" // node
#include "utils/common/params.h" // params_t
/*! \brief Structure containing server information. */
......
......@@ -30,7 +30,7 @@
#include "libknot/errcode.h" // KNOT_EOK
#include "libknot/mempattern.h" // strcdup
#include "libknot/descriptor.h" // KNOT_RRTYPE_
#include "common-knot/strlcpy.h" // strlcpy
#include "common/strlcpy.h" // strlcpy
#include "utils/common/msg.h" // WARN
#include "utils/common/resolv.h" // parse_nameserver
#include "utils/common/token.h" // token
......
......@@ -31,7 +31,7 @@
#include <stdbool.h> // bool
#include "libknot/libknot.h"
#include "common-knot/lists.h" // list
#include "common/lists.h" // list
#define DEFAULT_IPV4_NAME "127.0.0.1"
#define DEFAULT_IPV6_NAME "::1"
......
......@@ -19,7 +19,7 @@
#include <stdio.h> // fopen
#include <stdlib.h> // free
#include "common-knot/lists.h" // list
#include "common/lists.h" // list
#include "libknot/errcode.h" // KNOT_ENOENT
#include "utils/common/msg.h" // DBG_NULL
#include "utils/common/params.h" // DEFAULT_IPV6_NAME
......
......@@ -26,7 +26,7 @@
#pragma once
#include "common-knot/lists.h" // list
#include "common/lists.h" // list
#include "utils/common/netio.h" // server_t
srv_info_t* parse_nameserver(const char *str, const char *def_port);
......
......@@ -22,11 +22,11 @@
#include <netinet/in.h> // sockaddr_in (BSD)
#include "libknot/libknot.h"
#include "common-knot/lists.h" // list
#include "common/lists.h" // list
#include "common-knot/print.h" // time_diff
#include "libknot/errcode.h" // KNOT_EOK
#include "libknot/descriptor.h" // KNOT_RRTYPE_
#include "common-knot/sockaddr.h" // sockaddr_set_raw
#include "common/sockaddr.h" // sockaddr_set_raw
#include "utils/common/msg.h" // WARN
#include "utils/common/netio.h" // get_socktype
#include "utils/common/exec.h" // print_packet
......
......@@ -23,10 +23,10 @@
#include <locale.h> // setlocale
#include <arpa/inet.h> // inet_pton
#include "common-knot/lists.h" // list
#include "common/lists.h" // list
#include "libknot/errcode.h" // KNOT_EOK
#include "libknot/descriptor.h" // KNOT_CLASS_IN
#include "common-knot/sockaddr.h" // IPV4_PREFIXLEN
#include "common/sockaddr.h" // IPV4_PREFIXLEN
#include "utils/common/msg.h" // WARN
#include "utils/common/params.h" // parse_class
#include "utils/common/resolv.h" // get_nameservers
......
......@@ -29,7 +29,7 @@
#include <stdbool.h> // bool
#include "libknot/libknot.h" // knot_addr_family_t
#include "common-knot/sockaddr.h" // IPV6_PREFIXLEN
#include "common/sockaddr.h" // IPV6_PREFIXLEN
#include "utils/common/params.h" // protocol_t
#include "utils/common/exec.h" // sign_context_t
......
......@@ -22,7 +22,7 @@
#include <stdlib.h> // free
#include <locale.h> // setlocale
#include "common-knot/lists.h" // list
#include "common/lists.h" // list
#include "libknot/errcode.h" // KNOT_EOK
#include "libknot/descriptor.h" // KNOT_CLASS_IN
#include "utils/common/msg.h" // WARN
......
......@@ -31,7 +31,7 @@
#include "common/mem.h"
#include "libknot/errcode.h"
#include "libknot/descriptor.h"
#include "common-knot/strlcpy.h"
#include "common/strlcpy.h"
#include "libknot/common.h"
#include "libknot/libknot.h"
#include "libknot/dnssec/random.h"
......
......@@ -29,7 +29,7 @@
#include <stdint.h>
#include "libknot/libknot.h"
#include "common-knot/lists.h" // list
#include "common/lists.h" // list
#include "zscanner/zscanner.h" // zs_scanner_t
#include "utils/common/netio.h" // server_t
#include "utils/common/params.h" // protocol_t
......
......@@ -19,7 +19,7 @@
#include <tap/basic.h>
#include "libknot/errcode.h"
#include "common-knot/sockaddr.h"
#include "common/sockaddr.h"
#include "knot/updates/acl.h"
#include "knot/conf/conf.h"
......
......@@ -21,7 +21,7 @@
#include "libknot/errcode.h"
#include "common/base32hex.h"
#include "common-knot/strlcpy.h"
#include "common/strlcpy.h"
#define BUF_LEN 256
#define MAX_BIN_DATA_LEN ((INT32_MAX / 8) * 5)
......
......@@ -21,7 +21,7 @@
#include "libknot/errcode.h"
#include "common/base64.h"
#include "common-knot/strlcpy.h"
#include "common/strlcpy.h"
#define BUF_LEN 256
#define MAX_BIN_DATA_LEN ((INT32_MAX / 4) * 3)
......
......@@ -20,7 +20,7 @@
#include "libknot/errcode.h"
#include "libknot/rrtype/opt.h"
#include "libknot/descriptor.h"
#include "common-knot/sockaddr.h"
#include "common/sockaddr.h"
static const uint16_t E_MAX_PLD = 10000;
static const uint16_t E_MAX_PLD2 = 20000;
......
......@@ -17,7 +17,7 @@
#include <tap/basic.h>
#include "common-knot/strlcat.h"
#include "common-knot/strlcpy.h"
#include "common/strlcpy.h"
#include "knot/zone/zone.h"
#include "knot/zone/zonedb.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