35#include "gnunet_signatures.h"
72 &cdata[sizeof (sets)],
77 for (i = 0; i < ntohl (sets.
set_count); i++)
160 char attr_str[253 + 1];
166 size_t tmp_data_size;
170 token = strtok (tmp_str,
",");
174 while (NULL != token)
182 _ (
"Unable to parse ATTR record string `%s'\n"),
189 token = strtok (NULL,
",");
194 token = strtok (tmp_str,
",");
205 for (i = 0; i < entries; i++)
225 token = strtok (NULL,
",");
229 if (-1 == tmp_data_size)
240 for (i = 0; i < entries; i++)
struct GNUNET_ABD_Delegate * GNUNET_ABD_delegate_deserialize(const char *data, size_t data_size)
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 chain.
int GNUNET_ABD_delegate_serialize(struct GNUNET_ABD_Delegate *dele, char **data)
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.
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 chain entries and abd.
API to serialize and deserialize delegation chains and abds.
char * GNUNET_ABD_delegate_to_string(const struct GNUNET_ABD_Delegate *cred)
struct GNUNET_ABD_Delegate * GNUNET_ABD_delegate_from_string(const char *s)
Delegate helper functions.
struct GNUNET_CRYPTO_PublicKey subject_pkey
Subject key.
static gnutls_certificate_credentials_t cred
The credential.
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.
API to the Credential service.
API that can be used to manipulate GNS record data.
Plugin API for GNS record types.
#define GNUNET_log(kind,...)
char * GNUNET_CRYPTO_public_key_to_string(const struct GNUNET_CRYPTO_PublicKey *key)
Creates a (Base32) string representation of the public key.
uint64_t GNUNET_ntohll(uint64_t n)
Convert unsigned 64-bit integer to host byte order.
uint64_t GNUNET_htonll(uint64_t n)
Convert unsigned 64-bit integer to network byte order.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_public_key_from_string(const char *str, struct GNUNET_CRYPTO_PublicKey *key)
Parses a (Base32) string representation of the public key.
@ GNUNET_ERROR_TYPE_ERROR
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
#define GNUNET_free_nz(ptr)
Wrapper around free.
static const char * abd_number_to_typename(void *cls, uint32_t type)
Convert a type number to the corresponding type string (e.g.
static int abd_string_to_value(void *cls, uint32_t type, const char *s, void **data, size_t *data_size)
Convert human-readable version of a 'value' of a record to the binary representation.
static char * abd_value_to_string(void *cls, uint32_t type, const void *data, size_t data_size)
Convert the 'value' of a record to a string.
void * libgnunet_plugin_gnsrecord_abd_done(void *cls)
Exit point from the plugin.
void * libgnunet_plugin_gnsrecord_abd_init(void *cls)
Entry point for the plugin.
static struct @0 name_map[]
Mapping of record type numbers to human-readable record type names.
static uint32_t abd_typename_to_number(void *cls, const char *gns_typename)
Convert a type name (e.g.
#define GNUNET_GNSRECORD_TYPE_ATTRIBUTE
For ABD reverse lookups.
#define GNUNET_GNSRECORD_TYPE_DELEGATE
For ABD policies.
The attribute delegation record.
uint64_t data_size
Length of delegation sets.
uint32_t set_count
Number of delegation sets in this record.
The attribute delegation record.
const char * subject_attribute
The subject attribute.
struct GNUNET_CRYPTO_PublicKey subject_key
Public key of the subject this attribute was delegated to.
uint32_t subject_attribute_len
Each plugin is required to return a pointer to a struct of this type as the return value from its ent...
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.