100 return member->
store;
131 "Check session history (%s) for completion.\n",
154 for (element = level.
head; element; element = element->
next)
173 for (element =
list.head; element; element = element->
next)
240 if ((! session) || (! message) || (! hash))
256 "Failed to switch member session to ID: %s\n",
373 if (contact == session->
contact)
383 session->
next = NULL;
428 return session->start;
559 "Updating sessions history (%s) += (%s)\n",
635 if (len !=
sizeof(entry.
hash))
656 const char *directory)
672 "Load session configuration of member: %s\n",
config_file);
683 unsigned long long numeric_value;
756 if (check == session)
768 const char *directory)
782 "Load next session configuration of member: %s\n",
config_file);
841 unsigned char ownership;
891 const char *directory)
902 "Save session configuration of member: %s\n",
config_file);
static int start
Set if we are to start default services (including ARM).
static int list
Set if we should print a list of currently running services.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
static int end
Set if we are to shutdown all services (including ARM).
static char * config_file
Set to the name of the config file used.
struct GNUNET_HashCode key
The key used in the DHT.
static struct GNUNET_CRYPTO_PublicKey pubkey
Public key of the zone to look in.
static char * value
Value of the record to add/remove.
static int status
The program status; 0 for success.
static char * next_id
Command-line option for namespace publishing: identifier for updates to this publication.
void clear_list_messages(struct GNUNET_MESSENGER_ListMessages *messages)
Clears the list of message hashes.
void load_list_messages(struct GNUNET_MESSENGER_ListMessages *messages, const char *path)
Loads the list of message hashes from a file under a given path.
void init_list_messages(struct GNUNET_MESSENGER_ListMessages *messages)
Initializes list of message hashes as empty list.
void copy_list_messages(struct GNUNET_MESSENGER_ListMessages *messages, const struct GNUNET_MESSENGER_ListMessages *origin)
Copies all message hashes from an origin to another list.
void save_list_messages(const struct GNUNET_MESSENGER_ListMessages *messages, const char *path)
Saves the list of message hashes to a file under a given path.
void add_to_list_messages(struct GNUNET_MESSENGER_ListMessages *messages, const struct GNUNET_HashCode *hash)
Adds a specific hash from a message to the end of the list.
const struct GNUNET_ShortHashCode * get_member_id(const struct GNUNET_MESSENGER_Member *member)
Returns the current id of a given member.
struct GNUNET_MESSENGER_MemberSession * get_member_session(const struct GNUNET_MESSENGER_Member *member, const struct GNUNET_CRYPTO_PublicKey *public_key)
Returns the member session of a member identified by a given public key.
void add_member_session(struct GNUNET_MESSENGER_Member *member, struct GNUNET_MESSENGER_MemberSession *session)
Adds a given member session to its member.
void clear_member_session_history(struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_HashCode *hash)
Removes a message from the history of a session using the messages hash.
void destroy_member_session(struct GNUNET_MESSENGER_MemberSession *session)
Destroys a member session and frees its memory fully.
const struct GNUNET_CRYPTO_PublicKey * get_member_session_public_key(const struct GNUNET_MESSENGER_MemberSession *session)
Returns the public key of a given member session.
static void clear_member_chain_history(struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_HashCode *hash)
void load_member_session_next(struct GNUNET_MESSENGER_MemberSession *session, const char *directory)
Loads the connection from one session to another through the next attribute.
void close_member_session(struct GNUNET_MESSENGER_MemberSession *session)
Closes a given member session which opens the request for completion of the given member session.
struct GNUNET_TIME_Absolute get_member_session_start(const struct GNUNET_MESSENGER_MemberSession *session)
Returns the timestamp of the member session's start.
static void update_member_chain_history(struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue ownership)
static void load_member_session_history(struct GNUNET_MESSENGER_MemberSession *session, const char *path)
static enum GNUNET_GenericReturnValue iterate_save_member_session_history_hentries(void *cls, const struct GNUNET_HashCode *key, void *value)
void update_member_session_history(struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Adds a given message to the history of a session using the messages hash.
static struct GNUNET_MESSENGER_MemberStore * get_session_member_store(const struct GNUNET_MESSENGER_MemberSession *session)
const struct GNUNET_ShortHashCode * get_member_session_id(const struct GNUNET_MESSENGER_MemberSession *session)
Returns the member id of a given member session.
enum GNUNET_GenericReturnValue check_member_session_history(const struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue ownership)
Checks the history of a session for a specific message which is identified by its hash and if the own...
enum GNUNET_GenericReturnValue reset_member_session(struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_HashCode *hash)
Resets a given member session which re-opens a member session for new usage.
static void check_member_session_completion(struct GNUNET_MESSENGER_MemberSession *session)
const struct GNUNET_HashCode * get_member_session_key(const struct GNUNET_MESSENGER_MemberSession *session)
Returns the key of the room a given member session belongs to.
static enum GNUNET_GenericReturnValue iterate_copy_history(void *cls, const struct GNUNET_HashCode *key, void *value)
struct GNUNET_MESSENGER_Contact * get_member_session_contact(struct GNUNET_MESSENGER_MemberSession *session)
Returns the contact which is connected to a given member session.
struct GNUNET_MESSENGER_MemberSession * switch_member_session(struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Creates and allocates a new member session closing and replacing a given other session of the same me...
void load_member_session(struct GNUNET_MESSENGER_Member *member, const char *directory)
Loads data from a directory into a new allocated and created member session of a member if the requir...
void save_member_session(struct GNUNET_MESSENGER_MemberSession *session, const char *directory)
Saves data from a member session into a directory which can be load to restore the member session com...
struct GNUNET_MESSENGER_MemberSession * create_member_session(struct GNUNET_MESSENGER_Member *member, const struct GNUNET_CRYPTO_PublicKey *pubkey)
Creates and allocates a new member session of a member with a given public key.
enum GNUNET_GenericReturnValue verify_member_session_as_sender(const struct GNUNET_MESSENGER_MemberSession *session, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Verifies a given member session as sender of a selected message and its hash.
static void save_member_session_history(struct GNUNET_MESSENGER_MemberSession *session, const char *path)
enum GNUNET_GenericReturnValue is_member_session_completed(const struct GNUNET_MESSENGER_MemberSession *session)
Returns if the given member session has been completed.
enum GNUNET_GenericReturnValue is_member_session_closed(const struct GNUNET_MESSENGER_MemberSession *session)
Returns if the given member session has been closed.
static struct GNUNET_MESSENGER_MemberSession * get_cycle_safe_next_session(struct GNUNET_MESSENGER_MemberSession *session, struct GNUNET_MESSENGER_MemberSession *next)
static struct GNUNET_MESSENGER_SrvRoom * get_session_room(const struct GNUNET_MESSENGER_MemberSession *session)
const struct GNUNET_HashCode * get_member_session_context(const struct GNUNET_MESSENGER_MemberSession *session)
Returns the member context of a given member session.
struct GNUNET_MESSENGER_ContactStore * get_member_contact_store(struct GNUNET_MESSENGER_MemberStore *store)
Returns the used contact store of a given member store.
const struct GNUNET_HashCode * get_member_store_key(const struct GNUNET_MESSENGER_MemberStore *store)
Returns the shared secret you need to access a room of the store.
struct GNUNET_MESSENGER_Member * add_store_member(struct GNUNET_MESSENGER_MemberStore *store, const struct GNUNET_ShortHashCode *id)
Adds a member to a store under a specific id and returns it on success.
struct GNUNET_MESSENGER_Member * get_store_member(const struct GNUNET_MESSENGER_MemberStore *store, const struct GNUNET_ShortHashCode *id)
Returns the member in a store identified by a given id.
const struct GNUNET_MESSENGER_MessageLink * get_store_message_link(struct GNUNET_MESSENGER_MessageStore *store, const struct GNUNET_HashCode *hash, enum GNUNET_GenericReturnValue deleted_only)
Returns the message link from a message store matching a given hash.
struct GNUNET_MESSENGER_MessageStore * get_srv_room_message_store(struct GNUNET_MESSENGER_SrvRoom *room)
Returns the used message store of a given room.
static struct GNUNET_VPN_Handle * handle
Handle to vpn service.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_data(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, void *buf, size_t buf_size)
Get Crockford32-encoded fixed-size binary data from a configuration.
struct GNUNET_CONFIGURATION_Handle * GNUNET_CONFIGURATION_create(const struct GNUNET_OS_ProjectData *pd)
Create a new configuration object.
void GNUNET_CONFIGURATION_set_value_string(struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, const char *value)
Set a configuration value that should be a string.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_number(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long *number)
Get a configuration value that should be a number.
void GNUNET_CONFIGURATION_destroy(struct GNUNET_CONFIGURATION_Handle *cfg)
Destroy configuration object.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_string(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be a string.
void GNUNET_CONFIGURATION_set_value_number(struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long number)
Set a configuration value that should be a number.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_parse(struct GNUNET_CONFIGURATION_Handle *cfg, const char *filename)
Parse a configuration file, add all of the options in the file to the configuration environment.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_write(struct GNUNET_CONFIGURATION_Handle *cfg, const char *filename)
Write configuration file.
struct GNUNET_DISK_FileHandle * GNUNET_DISK_file_open(const char *fn, enum GNUNET_DISK_OpenFlags flags, enum GNUNET_DISK_AccessPermissions perm)
Open a file.
enum GNUNET_GenericReturnValue GNUNET_DISK_file_test(const char *fil)
Check that fil corresponds to a filename (of a file that exists and that is not a directory).
ssize_t GNUNET_DISK_file_write(const struct GNUNET_DISK_FileHandle *h, const void *buffer, size_t n)
Write a buffer to a file.
off_t GNUNET_DISK_file_seek(const struct GNUNET_DISK_FileHandle *h, off_t offset, enum GNUNET_DISK_Seek whence)
Move the read/write pointer in a file.
GNUNET_DISK_AccessPermissions
File access permissions, UNIX-style.
enum GNUNET_GenericReturnValue GNUNET_DISK_file_sync(const struct GNUNET_DISK_FileHandle *h)
Write file changes to disk.
enum GNUNET_GenericReturnValue GNUNET_DISK_file_close(struct GNUNET_DISK_FileHandle *h)
Close an open file.
ssize_t GNUNET_DISK_file_read(const struct GNUNET_DISK_FileHandle *h, void *result, size_t len)
Read the contents of a binary file into a buffer.
@ GNUNET_DISK_OPEN_READ
Open the file for reading.
@ GNUNET_DISK_OPEN_WRITE
Open the file for writing.
@ GNUNET_DISK_OPEN_CREATE
Create file if it doesn't exist.
@ GNUNET_DISK_PERM_USER_READ
Owner can read.
@ GNUNET_DISK_PERM_USER_WRITE
Owner can write.
@ GNUNET_DISK_SEEK_SET
Seek an absolute position (from the start of the file).
int GNUNET_CRYPTO_hash_cmp(const struct GNUNET_HashCode *h1, const struct GNUNET_HashCode *h2)
Compare function for HashCodes, producing a total ordering of all hashcodes.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_contains(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Check if the map contains any value under the given key (including values that are NULL).
int GNUNET_CONTAINER_multihashmap_remove_all(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Remove all entries for the given key from the map.
int GNUNET_CONTAINER_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
void * GNUNET_CONTAINER_multihashmap_get(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Given a key find a value in the map matching the key.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_put(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
unsigned int GNUNET_CONTAINER_multihashmap_size(const struct GNUNET_CONTAINER_MultiHashMap *map)
Get the number of key-value pairs in the map.
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST
, ' bother checking if a value already exists (faster than GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE...
#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.
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
GNUNET_GenericReturnValue
Named constants for return values.
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.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
const char * GNUNET_sh2s(const struct GNUNET_ShortHashCode *shc)
Convert a short hash value to a string (for printing debug messages).
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
@ GNUNET_MESSENGER_KIND_KEY
The key kind.
@ GNUNET_MESSENGER_KIND_ID
The id kind.
const struct GNUNET_OS_ProjectData * GNUNET_OS_project_data_gnunet(void)
Return default project data used by 'libgnunetutil' for GNUnet.
char * GNUNET_STRINGS_data_to_string_alloc(const void *buf, size_t size)
Return the base32crockford encoding of the given buffer.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
enum GNUNET_GenericReturnValue verify_message(const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, const struct GNUNET_CRYPTO_PublicKey *key)
Verifies the signature of a given message and its hash with a specific public key.
enum GNUNET_GenericReturnValue is_message_session_bound(const struct GNUNET_MESSENGER_Message *message)
Returns if the message should be bound to a member session.
An identity key as per LSD0001.
Handle used to access files (and pipes).
struct GNUNET_MESSENGER_ListMessage * next
struct GNUNET_HashCode hash
struct GNUNET_MESSENGER_ListMessage * head
struct GNUNET_MESSENGER_ListMessage * tail
struct GNUNET_HashCode hash
struct GNUNET_HashCode context
struct GNUNET_CRYPTO_PublicKey public_key
enum GNUNET_GenericReturnValue completed
struct GNUNET_CONTAINER_MultiHashMap * history
struct GNUNET_MESSENGER_Contact * contact
struct GNUNET_MESSENGER_Member * member
struct GNUNET_MESSENGER_MemberSession * prev
struct GNUNET_MESSENGER_MemberSession * next
struct GNUNET_TIME_Absolute start
struct GNUNET_MESSENGER_ListMessages messages
enum GNUNET_GenericReturnValue closed
struct GNUNET_MESSENGER_SrvRoom * room
struct GNUNET_MESSENGER_MemberStore * store
struct GNUNET_MESSENGER_MessageId id
struct GNUNET_MESSENGER_MessageKey key
struct GNUNET_ShortHashCode id
The new id which will replace the senders id in a room.
struct GNUNET_CRYPTO_PublicKey key
The new public key which replaces the current senders public key.
struct GNUNET_HashCode second
struct GNUNET_HashCode first
struct GNUNET_MESSENGER_MessageHeader header
Header.
struct GNUNET_MESSENGER_MessageBody body
Body.
Time for absolute times used by GNUnet, in microseconds.
uint64_t abs_value_us
The actual value.