81 "Loading credential plugin `%s'\n",
110 RECLAIM_CREDENTIAL_fini ()
121 plugin = credential_plugins[i];
133 credential_plugins = NULL;
153 plugin = credential_plugins[i];
155 (ret = plugin->
api->typename_to_number (plugin->
api->
cls,
179 plugin = credential_plugins[i];
181 (ret = plugin->
api->number_to_typename (plugin->
api->
cls, type)))
210 plugin = credential_plugins[i];
242 plugin = credential_plugins[i];
243 if (NULL != (ret = plugin->
api->value_to_string (plugin->
api->
cls,
275 + strlen (attr_name_tmp) + 1 + data_size);
279 write_ptr = (
char *) &attr[1];
280 GNUNET_memcpy (write_ptr, attr_name_tmp, strlen (attr_name_tmp) + 1);
281 attr->
name = write_ptr;
282 write_ptr += strlen (attr->
name) + 1;
284 attr->
data = write_ptr;
355 const char *read_ptr;
359 if ((data_size <
sizeof(
struct 365 while (((data + data_size) - read_ptr) >=
sizeof(
struct Credential))
370 data_size - (read_ptr - data));
374 "Failed to deserialize malformed credential.\n");
452 return sizeof(
struct Credential) + strlen (credential->name)
453 + credential->data_size;
478 name_len = strlen (credential->
name);
480 write_ptr = (
char *) &atts[1];
490 return sizeof(
struct Credential) + strlen (credential->name)
491 + credential->data_size;
518 if (data_size <
sizeof(
struct Credential) + data_len + name_len)
521 "Buffer too small to deserialize\n");
525 + data_len + name_len + 1);
531 write_ptr = (
char *) &credential[1];
534 credential->
name = write_ptr;
536 write_ptr += name_len + 1;
539 credential->
data = write_ptr;
554 plugin = credential_plugins[i];
556 (ret = plugin->
api->get_attributes (plugin->
api->
cls,
574 plugin = credential_plugins[i];
576 (ret = plugin->
api->get_issuer (plugin->
api->
cls,
594 plugin = credential_plugins[i];
620 plugin = credential_plugins[i];
622 (ret = plugin->
api->typename_to_number_p (plugin->
api->
cls,
646 plugin = credential_plugins[i];
648 (ret = plugin->
api->number_to_typename_p (plugin->
api->
cls, type)))
677 plugin = credential_plugins[i];
709 plugin = credential_plugins[i];
710 if (NULL != (ret = plugin->
api->value_to_string_p (plugin->
api->
cls,
732 write_ptr = (
char *) &attr[1];
734 attr->
data = write_ptr;
752 for (le = presentations->
list_head; NULL != le; le = le->
next)
779 for (le = presentations->
list_head; NULL != le; le = le->
next)
804 const char *read_ptr;
812 while (((data + data_size) - read_ptr) >=
sizeof(
struct Presentation))
817 data_size - (read_ptr - data));
821 "Failed to deserialize malformed presentation.\n");
899 return sizeof(
struct Presentation) + presentation->data_size;
921 write_ptr = (
char *) &atts[1];
925 return sizeof(
struct Presentation) + presentation->data_size;
953 "Buffer too small to deserialize\n");
962 write_ptr = (
char *) &presentation[1];
964 presentation->
data = write_ptr;
980 plugin = credential_plugins[i];
982 (ret = plugin->
api->get_attributes_p (plugin->
api->
cls,
1001 plugin = credential_plugins[i];
1003 (ret = plugin->
api->get_issuer_p (plugin->
api->
cls,
1022 plugin = credential_plugins[i];
1054 plugin = credential_plugins[i];
1060 (*pres)->credential_id = cred->
id;
static void add_plugin(void *cls, const char *library_name, void *lib_ret)
Add a plugin.
Serialized credential claim.
uint32_t data_size
Data size.
int GNUNET_RECLAIM_presentation_get_expiration(const struct GNUNET_RECLAIM_Presentation *presentation, struct GNUNET_TIME_Absolute *exp)
uint32_t GNUNET_RECLAIM_credential_typename_to_number(const char *typename)
Convert an credential type name to the corresponding number.
struct GNUNET_RECLAIM_Credential * GNUNET_RECLAIM_credential_deserialize(const char *data, size_t data_size)
Deserialize an credential.
Project-specific data used to help the OS subsystem find installation paths.
struct GNUNET_RECLAIM_Identifier id
ID.
size_t GNUNET_RECLAIM_presentation_serialize(const struct GNUNET_RECLAIM_Presentation *presentation, char *result)
Serialize an presentation.
uint32_t type
Type/Format of Claim.
#define GNUNET_array_append(arr, len, element)
Append an element to an array (growing the array by one).
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
uint32_t type
Type/Format of Claim.
int GNUNET_RECLAIM_credential_string_to_value(uint32_t type, const char *s, void **data, size_t *data_size)
Convert human-readable version of a 'claim' of an credential to the binary representation.
static struct Plugin ** credential_plugins
Plugins.
uint32_t name_len
Name length.
size_t GNUNET_RECLAIM_credential_serialize_get_size(const struct GNUNET_RECLAIM_Credential *credential)
Get required size for serialization buffer.
struct GNUNET_RECLAIM_Credential * credential
The credential.
static size_t data_size
Number of bytes in data.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
int GNUNET_RECLAIM_credential_get_expiration(const struct GNUNET_RECLAIM_Credential *credential, struct GNUNET_TIME_Absolute *exp)
size_t data_size
Number of bytes in data.
struct GNUNET_RECLAIM_PresentationListEntry * next
DLL.
struct GNUNET_RECLAIM_CredentialListEntry * list_tail
List tail.
struct GNUNET_RECLAIM_CredentialListEntry * next
DLL.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
struct GNUNET_RECLAIM_PresentationListEntry * list_head
List head.
static int ret
Return value of the commandline.
static unsigned int num_plugins
Number of plugins.
struct GNUNET_RECLAIM_CredentialPluginFunctions * api
Plugin API.
A list of GNUNET_RECLAIM_Attribute structures.
const struct GNUNET_OS_ProjectData * GNUNET_OS_project_data_default(void)
Return default project data used by 'libgnunetutil' for GNUnet.
const void * data
Binary value stored as credential value.
size_t GNUNET_RECLAIM_credential_list_serialize(const struct GNUNET_RECLAIM_CredentialList *credentials, char *result)
Serialize an attribute list.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
GNUnet reclaim identity attribute credentials.
char * library_name
Name of the shared library.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
struct GNUNET_BLOCK_PluginFunctions * api
Plugin API.
Serialized presentation claim.
void * GNUNET_PLUGIN_unload(const char *library_name, void *arg)
Unload plugin (runs the "done" callback and returns whatever "done" returned).
const char * GNUNET_RECLAIM_credential_number_to_typename(uint32_t type)
Convert an credential type number to the corresponding credential type string.
size_t GNUNET_RECLAIM_credential_list_serialize_get_size(const struct GNUNET_RECLAIM_CredentialList *credentials)
Get required size for serialization buffer.
char * GNUNET_RECLAIM_credential_get_issuer(const struct GNUNET_RECLAIM_Credential *credential)
struct GNUNET_RECLAIM_Identifier credential_id
Credential ID.
struct GNUNET_RECLAIM_CredentialList * GNUNET_RECLAIM_credential_list_deserialize(const char *data, size_t data_size)
Deserialize an credential list.
int GNUNET_RECLAIM_credential_get_presentation(const struct GNUNET_RECLAIM_Credential *cred, const struct GNUNET_RECLAIM_AttributeList *attrs, struct GNUNET_RECLAIM_Presentation **pres)
Create a presentation from a credential and a lift of (selected) attributes in the credential...
static char * attr_name
The attribute.
struct GNUNET_RECLAIM_AttributeList * GNUNET_RECLAIM_presentation_get_attributes(const struct GNUNET_RECLAIM_Presentation *presentation)
uint32_t credential_type
Credential type.
const char * GNUNET_RECLAIM_presentation_number_to_typename(uint32_t type)
Convert an presentation type number to the corresponding presentation type string.
static int initialized
Init canary.
void GNUNET_RECLAIM_credential_list_destroy(struct GNUNET_RECLAIM_CredentialList *al)
Destroy credential list.
static int result
Global testing status.
size_t GNUNET_RECLAIM_presentation_list_serialize_get_size(const struct GNUNET_RECLAIM_PresentationList *presentations)
Get required size for serialization buffer.
struct GNUNET_RECLAIM_Identifier credential_id
The credential id of which this is a presentation.
const void * data
Binary value stored as presentation value.
int GNUNET_RECLAIM_presentation_string_to_value(uint32_t type, const char *s, void **data, size_t *data_size)
Convert human-readable version of a 'claim' of an presentation to the binary representation.
static void init()
Load plugins.
static char * plugin
Solver plugin name as string.
size_t GNUNET_RECLAIM_credential_serialize(const struct GNUNET_RECLAIM_Credential *credential, char *result)
Serialize an credential.
void __attribute__((destructor))
Dual function to init().
A credential presentation.
void GNUNET_RECLAIM_presentation_list_destroy(struct GNUNET_RECLAIM_PresentationList *al)
Destroy presentation list.
size_t data_size
Number of bytes in data.
struct GNUNET_RECLAIM_CredentialListEntry * list_head
List head.
const char * name
The name of the credential.
void GNUNET_PLUGIN_load_all(const char *basename, void *arg, GNUNET_PLUGIN_LoaderCallback cb, void *cb_cls)
Load all compatible plugins with the given base name.
static struct GNUNET_RECLAIM_Identifier credential
Credential ID.
struct GNUNET_RECLAIM_Presentation * GNUNET_RECLAIM_presentation_deserialize(const char *data, size_t data_size)
Deserialize an presentation.
Each plugin is required to return a pointer to a struct of this type as the return value from its ent...
uint32_t data_size
Data size.
struct GNUNET_RECLAIM_CredentialList * GNUNET_RECLAIM_credential_list_dup(const struct GNUNET_RECLAIM_CredentialList *al)
Make a (deep) copy of the credential list.
uint32_t presentation_type
Presentation type.
char * GNUNET_RECLAIM_presentation_value_to_string(uint32_t type, const void *data, size_t data_size)
Convert the 'claim' of an presentation to a string.
struct GNUNET_RECLAIM_Presentation * presentation
The credential.
A list of GNUNET_RECLAIM_Presentation structures.
struct GNUNET_RECLAIM_Identifier credential_id
Credential ID.
uint32_t GNUNET_RECLAIM_presentation_typename_to_number(const char *typename)
Convert an presentation type name to the corresponding number.
A list of GNUNET_RECLAIM_Credential structures.
struct GNUNET_RECLAIM_Presentation * GNUNET_RECLAIM_presentation_new(uint32_t type, const void *data, size_t data_size)
#define GNUNET_log(kind,...)
const struct GNUNET_OS_ProjectData * GNUNET_OS_project_data_get(void)
char * GNUNET_RECLAIM_presentation_get_issuer(const struct GNUNET_RECLAIM_Presentation *presentation)
struct GNUNET_RECLAIM_PresentationList * GNUNET_RECLAIM_presentation_list_dup(const struct GNUNET_RECLAIM_PresentationList *al)
Make a (deep) copy of the presentation list.
void GNUNET_OS_init(const struct GNUNET_OS_ProjectData *pd)
Setup OS subsystem with project data.
struct GNUNET_RECLAIM_PresentationListEntry * list_tail
List tail.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
size_t GNUNET_RECLAIM_presentation_serialize_get_size(const struct GNUNET_RECLAIM_Presentation *presentation)
Get required size for serialization buffer.
Time for absolute times used by GNUnet, in microseconds.
struct GNUNET_RECLAIM_Credential * GNUNET_RECLAIM_credential_new(const char *attr_name, uint32_t type, const void *data, size_t data_size)
Create a new credential.
char * GNUNET_RECLAIM_credential_value_to_string(uint32_t type, const void *data, size_t data_size)
Convert the 'claim' of an credential to a string.
void * cls
Closure for all of the callbacks.
size_t GNUNET_RECLAIM_presentation_list_serialize(const struct GNUNET_RECLAIM_PresentationList *presentations, char *result)
Serialize an attribute list.
uint32_t data
The data value.
uint32_t credential_flag
Credential flag.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
struct GNUNET_RECLAIM_PresentationList * GNUNET_RECLAIM_presentation_list_deserialize(const char *data, size_t data_size)
Deserialize an presentation list.
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...
void GNUNET_STRINGS_utf8_tolower(const char *input, char *output)
Convert the utf-8 input string to lower case.
struct GNUNET_RECLAIM_AttributeList * GNUNET_RECLAIM_credential_get_attributes(const struct GNUNET_RECLAIM_Credential *credential)
Convert an credential type name to the corresponding number.