X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Finclude%2Fgnunet_dnsparser_lib.h;h=9fe3491d672a734611d6dbad6e0f7194b44eacf9;hb=7a7ec54a324da4820202582126795a8ac6bbe94d;hp=fc4b7444eecbbaa768ccc4bac909106552c8f506;hpb=44aff2650f4c3d033049049ebbf08eed88b2b434;p=oweals%2Fgnunet.git diff --git a/src/include/gnunet_dnsparser_lib.h b/src/include/gnunet_dnsparser_lib.h index fc4b7444e..9fe3491d6 100644 --- a/src/include/gnunet_dnsparser_lib.h +++ b/src/include/gnunet_dnsparser_lib.h @@ -1,6 +1,6 @@ /* This file is part of GNUnet - (C) 2010-2013 Christian Grothoff (and other contributing authors) + Copyright (C) 2010-2014 GNUnet e.V. GNUnet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -14,15 +14,20 @@ You should have received a copy of the GNU General Public License along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /** - * @file include/gnunet_dnsparser_lib.h - * @brief API for helper library to parse DNS packets. * @author Philipp Toelke * @author Christian Grothoff + * + * @file + * API for helper library to parse DNS packets. + * + * @defgroup dns-parser DNS parser library + * Helper library to parse DNS packets. + * @{ */ #ifndef GNUNET_DNSPARSER_LIB_H #define GNUNET_DNSPARSER_LIB_H @@ -859,4 +864,31 @@ void GNUNET_DNSPARSER_free_cert (struct GNUNET_DNSPARSER_CertRecord *cert); +/** + * Convert a block of binary data to HEX. + * + * @param data binary data to convert + * @param data_size number of bytes in @a data + * @return HEX string (lower case) + */ +char * +GNUNET_DNSPARSER_bin_to_hex (const void *data, + size_t data_size); + + +/** + * Convert a HEX string to block of binary data. + * + * @param hex HEX string to convert (may contain mixed case) + * @param data where to write result, must be + * at least `strlen(hex)/2` bytes long + * @return number of bytes written to data + */ +size_t +GNUNET_DNSPARSER_hex_to_bin (const char *hex, + void *data); + + #endif + +/** @} */ /* end of group */