Commit a134b219 authored by Lubos Slovak's avatar Lubos Slovak

RRSet wire: Moved to packet/

parent 2f59d47d
......@@ -229,6 +229,8 @@ src/libknot/packet/compr.c
src/libknot/packet/compr.h
src/libknot/packet/pkt.c
src/libknot/packet/pkt.h
src/libknot/packet/rrset-wire.c
src/libknot/packet/rrset-wire.h
src/libknot/packet/wire.h
src/libknot/processing/process.c
src/libknot/processing/process.h
......
......@@ -171,6 +171,8 @@ libknot_la_SOURCES = \
libknot/packet/compr.h \
libknot/packet/pkt.c \
libknot/packet/pkt.h \
libknot/packet/rrset-wire.c \
libknot/packet/rrset-wire.h \
libknot/packet/wire.h \
libknot/processing/process.c \
libknot/processing/process.h \
......
......@@ -28,6 +28,7 @@
#include "libknot/packet/wire.h"
#include "libknot/rrset.h"
#include "libknot/rrtype/rrsig.h"
#include "libknot/packet/rrset-wire.h"
#define RRSIG_RDATA_SIGNER_OFFSET 18
......
......@@ -22,6 +22,7 @@
#include "libknot/dnssec/sig0.h"
#include "libknot/dnssec/sign.h"
#include "libknot/packet/wire.h"
#include "libknot/packet/rrset-wire.h"
/*!
* \brief Lifetime fudge of the SIG(0) packets in seconds.
......
......@@ -27,6 +27,7 @@
#include "libknot/packet/wire.h"
#include "libknot/rrtype/tsig.h"
#include "libknot/tsig-op.h"
#include "libknot/packet/rrset-wire.h"
/*! \brief Scan packet for RRSet existence. */
static bool pkt_contains(const knot_pkt_t *packet,
......
/*!
* \file pkt.h
*
* \author Lubos Slovak <lubos.slovak@nic.cz>
* \author Marek Vavrusa <marek.vavrusa@nic.cz>
*
* \brief Structure for holding DNS packet data and metadata.
*
......
This diff is collapsed.
/*!
* \file rrset.h
*
* \author Lubos Slovak <lubos.slovak@nic.cz>
* \author Jan Vcelak <jan.vcelak@nic.cz>
*
* \brief RRSet from/to wire conversion functions.
*
* \addtogroup libknot
* @{
*/
/* 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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "libknot/mempattern.h"
#include "libknot/dname.h"
#include "libknot/rrset.h"
struct knot_compr;
/*!
* \brief Flags controlling RR set from/to wire conversion.
*/
enum knot_rrset_wire_flags {
KNOT_RRSET_WIRE_NONE = 0,
KNOT_RRSET_WIRE_CANONICAL = 1 << 0,
};
typedef enum knot_rrset_wire_flags knot_rrset_wire_flags_t;
/*!
* \brief Write RR Set content to a wire.
*
* Function accepts \ref KNOT_RRSET_WIRE_CANONICAL flag, which causes the
* output to be written in canonical representation.
*
* \param rrset RRSet to be converted.
* \param wire Output wire buffer.
* \param max_size Capacity of wire buffer.
* \param compr Compression context.
* \param flags Flags controlling the output.
*
* \return Output size, negative number on error (KNOT_E*).
*/
int knot_rrset_to_wire(const knot_rrset_t *rrset, uint8_t *wire, uint16_t max_size,
struct knot_compr *compr, knot_rrset_wire_flags_t flags);
/*!
* \brief Creates one RR from wire, stores it into \a rrset.
*
* \param pkt_wire Source wire (the whole packet).
* \param pos Position in \a wire where to start parsing.
* \param pkt_size Total size of data in \a wire (size of the packet).
* \param mm Memory context.
* \param rrset Destination RRSet.
*
* \return KNOT_E*
*/
int knot_rrset_rr_from_wire(const uint8_t *pkt_wire, size_t *pos,
size_t pkt_size, mm_ctx_t *mm, knot_rrset_t *rrset);
This diff is collapsed.
......@@ -34,8 +34,6 @@
#include "libknot/dname.h"
#include "libknot/rdataset.h"
struct knot_compr;
/*!
* \brief Structure for representing RRSet.
*
......@@ -123,49 +121,6 @@ void knot_rrset_free(knot_rrset_t **rrset, mm_ctx_t *mm);
*/
void knot_rrset_clear(knot_rrset_t *rrset, mm_ctx_t *mm);
/* ---------- Wire conversions (legacy, to be done in knot_pkt_t) ----------- */
/*!
* \brief Flags controlling RR set from/to wire conversion.
*/
enum knot_rrset_wire_flags {
KNOT_RRSET_WIRE_NONE = 0,
KNOT_RRSET_WIRE_CANONICAL = 1 << 0,
};
typedef enum knot_rrset_wire_flags knot_rrset_wire_flags_t;
/*!
* \brief Write RR Set content to a wire.
*
* Function accepts \ref KNOT_RRSET_WIRE_CANONICAL flag, which causes the
* output to be written in canonical representation.
*
* \param rrset RRSet to be converted.
* \param wire Output wire buffer.
* \param max_size Capacity of wire buffer.
* \param compr Compression context.
* \param flags Flags controlling the output.
*
* \return Output size, negative number on error (KNOT_E*).
*/
int knot_rrset_to_wire(const knot_rrset_t *rrset, uint8_t *wire, uint16_t max_size,
struct knot_compr *compr, knot_rrset_wire_flags_t flags);
/*!
* \brief Creates one RR from wire, stores it into \a rrset.
*
* \param pkt_wire Source wire (the whole packet).
* \param pos Position in \a wire where to start parsing.
* \param pkt_size Total size of data in \a wire (size of the packet).
* \param mm Memory context.
* \param rrset Destination RRSet.
*
* \return KNOT_E*
*/
int knot_rrset_rr_from_wire(const uint8_t *pkt_wire, size_t *pos,
size_t pkt_size, mm_ctx_t *mm, knot_rrset_t *rrset);
/* ---------- RR addition. (legacy, functionality in knot_rdataset_t) ------- */
/*!
......
......@@ -31,6 +31,7 @@
#include "libknot/packet/wire.h"
#include "libknot/consts.h"
#include "libknot/dnssec/key.h"
#include "libknot/packet/rrset-wire.h"
const int KNOT_TSIG_MAX_DIGEST_SIZE = 64; // size of HMAC-SHA512 digest
const uint16_t KNOT_TSIG_FUDGE_DEFAULT = 300; // default Fudge value
......
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