GNUnet 0.21.1
gnunet_gnsrecord_plugin.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet
3 Copyright (C) 2012, 2013 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
37#ifndef GNUNET_GNSRECORD_PLUGIN_H
38#define GNUNET_GNSRECORD_PLUGIN_H
39
40#ifdef __cplusplus
41extern "C"
42{
43#if 0 /* keep Emacsens' auto-indent happy */
44}
45#endif
46#endif
47
48
59typedef char *
60(*GNUNET_GNSRECORD_ValueToStringFunction) (void *cls,
61 uint32_t type,
62 const void *data,
63 size_t data_size);
64
65
78typedef int
80 uint32_t type,
81 const char *s,
82 void **data,
83 size_t *data_size);
84
85
94typedef uint32_t
96 const char *dns_typename);
97
98
107typedef const char *
108(*GNUNET_GNSRECORD_NumberToTypenameFunction) (void *cls,
109 uint32_t type);
110
118typedef enum GNUNET_GenericReturnValue
120 uint32_t type);
121
122
123
129{
133 void *cls;
134
139
144
149
154
159};
160 /* end of group */
162 /* end of group addition */
164
165#if 0 /* keep Emacsens' auto-indent happy */
166{
167#endif
168#ifdef __cplusplus
169}
170#endif
171
172#endif
static char * data
The data to insert into the dht.
static uint32_t type
Type string converted to DNS type value.
static size_t data_size
Number of bytes in data.
int(* GNUNET_GNSRECORD_StringToValueFunction)(void *cls, uint32_t type, const char *s, void **data, size_t *data_size)
Function called to convert human-readable version of the value s of a record of type type to the resp...
const char *(* GNUNET_GNSRECORD_NumberToTypenameFunction)(void *cls, uint32_t type)
Function called to convert a type number to the corresponding type string (e.g.
uint32_t(* GNUNET_GNSRECORD_TypenameToNumberFunction)(void *cls, const char *dns_typename)
Function called to convert a type name (e.g.
enum GNUNET_GenericReturnValue(* GNUNET_GNSRECORD_IsCriticalFunction)(void *cls, uint32_t type)
Function called to check for critical records.
char *(* GNUNET_GNSRECORD_ValueToStringFunction)(void *cls, uint32_t type, const void *data, size_t data_size)
Function called to convert the binary value data of a record of type type to a human-readable string.
GNUNET_GenericReturnValue
Named constants for return values.
Each plugin is required to return a pointer to a struct of this type as the return value from its ent...
GNUNET_GNSRECORD_IsCriticalFunction is_critical
Is critical.
GNUNET_GNSRECORD_TypenameToNumberFunction typename_to_number
Typename to number.
GNUNET_GNSRECORD_NumberToTypenameFunction number_to_typename
Number to typename.
GNUNET_GNSRECORD_ValueToStringFunction value_to_string
Conversion to string.
void * cls
Closure for all of the callbacks.
GNUNET_GNSRECORD_StringToValueFunction string_to_value
Conversion to binary.