GNUnet  0.11.x
abd_serialization.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2009-2013, 2016 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 
21 
28 #ifndef ABD_SERIALIZATION_H
29 #define ABD_SERIALIZATION_H
30 
31 #include "platform.h"
32 #include "gnunet_util_lib.h"
33 #include "gnunet_constants.h"
34 #include "gnunet_abd_service.h"
35 
44 size_t
46  unsigned int ds_count,
47  const struct GNUNET_ABD_DelegationSet *dsr);
48 
58 ssize_t
60  unsigned int d_count,
61  const struct GNUNET_ABD_DelegationSet *dsr,
62  size_t dest_size,
63  char *dest);
64 
65 
75 int
77  size_t len,
78  const char *src,
79  unsigned int d_count,
80  struct GNUNET_ABD_DelegationSet *dsr);
81 
92 size_t
94  unsigned int d_count,
95  const struct GNUNET_ABD_Delegation *dd,
96  unsigned int c_count,
97  const struct GNUNET_ABD_Delegate *cd);
98 
110 ssize_t
112  unsigned int d_count,
113  const struct GNUNET_ABD_Delegation *dd,
114  unsigned int c_count,
115  const struct GNUNET_ABD_Delegate *cd,
116  size_t dest_size,
117  char *dest);
118 
119 
131 int
133  size_t len,
134  const char *src,
135  unsigned int d_count,
136  struct GNUNET_ABD_Delegation *dd,
137  unsigned int c_count,
138  struct GNUNET_ABD_Delegate *cd);
139 
140 size_t
142  unsigned int c_count,
143  const struct GNUNET_ABD_Delegate *cd);
144 
145 ssize_t
147  unsigned int c_count,
148  const struct GNUNET_ABD_Delegate *cd,
149  size_t dest_size,
150  char *dest);
151 
152 
153 int
155  const char *src,
156  unsigned int c_count,
157  struct GNUNET_ABD_Delegate *cd);
158 
159 int
161  char **data);
162 
163 struct GNUNET_ABD_Delegate *
164 GNUNET_ABD_delegate_deserialize (const char *data, size_t data_size);
165 
166 #endif
167 /* end of abd_serialization.h */
int GNUNET_ABD_delegate_serialize(struct GNUNET_ABD_Delegate *cred, char **data)
static size_t data_size
Number of bytes in data.
Definition: gnunet-abd.c:187
int GNUNET_ABD_delegates_deserialize(size_t len, const char *src, unsigned int c_count, struct GNUNET_ABD_Delegate *cd)
Deserialize the given destination.
int GNUNET_ABD_delegation_set_deserialize(size_t len, const char *src, unsigned int d_count, struct GNUNET_ABD_DelegationSet *dsr)
Deserialize the given destination.
The attribute delegation record.
ssize_t GNUNET_ABD_delegates_serialize(unsigned int c_count, const struct GNUNET_ABD_Delegate *cd, size_t dest_size, char *dest)
Serizalize the given abds.
size_t GNUNET_ABD_delegation_chain_get_size(unsigned int d_count, const struct GNUNET_ABD_Delegation *dd, unsigned int c_count, const struct GNUNET_ABD_Delegate *cd)
Calculate how many bytes we will need to serialize the given delegation chain and abd...
int GNUNET_ABD_delegation_chain_deserialize(size_t len, const char *src, unsigned int d_count, struct GNUNET_ABD_Delegation *dd, unsigned int c_count, struct GNUNET_ABD_Delegate *cd)
Deserialize the given destination.
size_t GNUNET_ABD_delegation_set_get_size(unsigned int ds_count, const struct GNUNET_ABD_DelegationSet *dsr)
Calculate how many bytes we will need to serialize the given delegation record.
size_t GNUNET_ABD_delegates_get_size(unsigned int c_count, const struct GNUNET_ABD_Delegate *cd)
Calculate how many bytes we will need to serialize the abds.
ssize_t GNUNET_ABD_delegation_set_serialize(unsigned int d_count, const struct GNUNET_ABD_DelegationSet *dsr, size_t dest_size, char *dest)
Serizalize the given delegation record entries.
ssize_t GNUNET_ABD_delegation_chain_serialize(unsigned int d_count, const struct GNUNET_ABD_Delegation *dd, unsigned int c_count, const struct GNUNET_ABD_Delegate *cd, size_t dest_size, char *dest)
Serizalize the given delegation chain entries and abd.
struct GNUNET_ABD_Delegate * GNUNET_ABD_delegate_deserialize(const char *data, size_t data_size)
uint32_t data
The data value.
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...