GNUnet  0.11.x
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 
34 #ifndef GNUNET_GNSRECORD_PLUGIN_H
35 #define GNUNET_GNSRECORD_PLUGIN_H
36 
37 #ifdef __cplusplus
38 extern "C"
39 {
40 #if 0 /* keep Emacsens' auto-indent happy */
41 }
42 #endif
43 #endif
44 
45 
56 typedef char *
57 (*GNUNET_GNSRECORD_ValueToStringFunction) (void *cls,
58  uint32_t type,
59  const void *data,
60  size_t data_size);
61 
62 
75 typedef int
77  uint32_t type,
78  const char *s,
79  void **data,
80  size_t *data_size);
81 
82 
91 typedef uint32_t
93  const char *dns_typename);
94 
95 
104 typedef const char *
105 (*GNUNET_GNSRECORD_NumberToTypenameFunction) (void *cls,
106  uint32_t type);
107 
108 
114 {
118  void *cls;
119 
124 
129 
134 
139 };
140  /* end of group */
142 
143 #if 0 /* keep Emacsens' auto-indent happy */
144 {
145 #endif
146 #ifdef __cplusplus
147 }
148 #endif
149 
150 #endif
GNUNET_GNSRECORD_TypenameToNumberFunction typename_to_number
Typename to number.
GNUNET_GNSRECORD_ValueToStringFunction value_to_string
Conversion to string.
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...
GNUNET_GNSRECORD_NumberToTypenameFunction number_to_typename
Number to typename.
GNUNET_GNSRECORD_StringToValueFunction string_to_value
Conversion to binary.
static size_t data_size
Number of bytes in data.
Definition: gnunet-abd.c:187
void * cls
Closure for all of the callbacks.
const char *(* GNUNET_GNSRECORD_NumberToTypenameFunction)(void *cls, uint32_t type)
Function called to convert a type number (i.e.
uint32_t(* GNUNET_GNSRECORD_TypenameToNumberFunction)(void *cls, const char *dns_typename)
Function called to convert a type name (i.e.
Each plugin is required to return a pointer to a struct of this type as the return value from its ent...
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
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...
uint32_t data
The data value.