![]() |
GNUnet
0.11.x
|
Print information about messenger groups. More...
#include <stdio.h>
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_messenger_service.h"
Go to the source code of this file.
Macros | |
#define | MAX_BUFFER_SIZE 60000 |
Functions | |
void | on_message (void *cls, const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) |
Function called whenever a message is received or sent. More... | |
static void | shutdown_hook (void *cls) |
Task to shut down this application. More... | |
static void | listen_stdio (void *cls) |
Wait for input on STDIO and send it out over the ch. More... | |
static void | read_stdio (void *cls) |
Task run in stdio mode, after some data is available at stdin. More... | |
static void | idle (void *cls) |
Initial task to startup application. More... | |
static void | on_identity (void *cls, struct GNUNET_MESSENGER_Handle *handle) |
Function called when an identity is retrieved. More... | |
static void | run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Main function that will be run by the scheduler. More... | |
int | main (int argc, char **argv) |
The main function to obtain messenger information. More... | |
Variables | |
struct GNUNET_MESSENGER_Handle * | messenger |
struct GNUNET_SCHEDULER_Task * | read_task |
char * | door_id |
char * | ego_name |
char * | room_key |
struct GNUNET_SCHEDULER_Task * | shutdown_task |
Print information about messenger groups.
Definition in file gnunet-messenger.c.
#define MAX_BUFFER_SIZE 60000 |
Definition at line 109 of file gnunet-messenger.c.
Referenced by read_stdio().
void on_message | ( | void * | cls, |
const struct GNUNET_MESSENGER_Room * | room, | ||
const struct GNUNET_MESSENGER_Message * | message, | ||
const struct GNUNET_HashCode * | hash | ||
) |
Function called whenever a message is received or sent.
cls | Closure |
room | Room |
message | Message |
hash | Hash of message |
Definition at line 43 of file gnunet-messenger.c.
References GNUNET_MESSENGER_Message::body, GNUNET_IDENTITY_PublicKey::ecdsa_key, GNUNET_i2s_full(), GNUNET_MESSENGER_contact_get_name(), GNUNET_MESSENGER_get_member(), GNUNET_MESSENGER_KIND_JOIN, GNUNET_MESSENGER_KIND_LEAVE, GNUNET_MESSENGER_KIND_PEER, GNUNET_MESSENGER_KIND_TEXT, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageBody::join, GNUNET_MESSENGER_MessageJoin::key, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_MessagePeer::peer, GNUNET_MESSENGER_MessageBody::peer, GNUNET_CRYPTO_EcdsaPublicKey::q_y, GNUNET_MESSENGER_MessageHeader::sender_id, GNUNET_MESSENGER_MessageText::text, and GNUNET_MESSENGER_MessageBody::text.
Referenced by run().
|
static |
Task to shut down this application.
cls | Closure |
Definition at line 92 of file gnunet-messenger.c.
References GNUNET_MESSENGER_close_room(), GNUNET_MESSENGER_disconnect(), GNUNET_SCHEDULER_cancel(), and listen_stdio().
Referenced by on_identity(), and run().
|
static |
Wait for input on STDIO and send it out over the ch.
cls | Closure |
Definition at line 154 of file gnunet-messenger.c.
References GNUNET_NETWORK_fdset_create(), GNUNET_NETWORK_fdset_destroy(), GNUNET_NETWORK_fdset_set_native(), GNUNET_SCHEDULER_add_select(), GNUNET_SCHEDULER_PRIORITY_DEFAULT, GNUNET_TIME_UNIT_FOREVER_REL, and read_stdio().
Referenced by idle(), read_stdio(), and shutdown_hook().
|
static |
Task run in stdio mode, after some data is available at stdin.
cls | Closure |
Definition at line 117 of file gnunet-messenger.c.
References GNUNET_MESSENGER_Message::body, GNUNET_MESSENGER_KIND_TEXT, GNUNET_MESSENGER_send_message(), GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_shutdown(), GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageHeader::kind, listen_stdio(), MAX_BUFFER_SIZE, GNUNET_MESSENGER_MessageText::text, and GNUNET_MESSENGER_MessageBody::text.
Referenced by listen_stdio().
|
static |
Initial task to startup application.
cls | Closure |
Definition at line 177 of file gnunet-messenger.c.
References GNUNET_SCHEDULER_add_now(), and listen_stdio().
Referenced by on_identity(), and updateUsage().
|
static |
Function called when an identity is retrieved.
cls | Closure |
handle | Handle of messenger service |
Definition at line 199 of file gnunet-messenger.c.
References door_id, GNUNET_CRYPTO_eddsa_public_key_from_string(), GNUNET_CRYPTO_hash(), GNUNET_free, GNUNET_MESSENGER_entry_room(), GNUNET_MESSENGER_get_name(), GNUNET_MESSENGER_open_room(), GNUNET_new, GNUNET_OK, GNUNET_SCHEDULER_add_delayed_with_priority(), GNUNET_SCHEDULER_add_shutdown(), GNUNET_SCHEDULER_cancel(), GNUNET_SCHEDULER_PRIORITY_IDLE, GNUNET_SCHEDULER_shutdown(), GNUNET_TIME_relative_get_zero_(), idle(), name, GNUNET_PeerIdentity::public_key, room_key, and shutdown_hook().
Referenced by run().
|
static |
Main function that will be run by the scheduler.
cls | closure |
args | remaining command-line arguments |
cfgfile | name of the configuration file used (for saving, can be NULL!) |
cfg | configuration |
Definition at line 262 of file gnunet-messenger.c.
References ego_name, GNUNET_MESSENGER_connect(), GNUNET_SCHEDULER_add_shutdown(), on_identity(), on_message(), and shutdown_hook().
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
The main function to obtain messenger information.
argc | number of arguments from the command line |
argv | command line arguments |
Definition at line 277 of file gnunet-messenger.c.
References door_id, ego_name, gettext_noop, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_string(), GNUNET_OK, GNUNET_PROGRAM_run(), room_key, and run().
struct GNUNET_MESSENGER_Handle* messenger |
Definition at line 32 of file gnunet-messenger.c.
struct GNUNET_SCHEDULER_Task* read_task |
Definition at line 84 of file gnunet-messenger.c.
char* door_id |
Definition at line 186 of file gnunet-messenger.c.
Referenced by main(), and on_identity().
char* ego_name |
Definition at line 187 of file gnunet-messenger.c.
char* room_key |
Definition at line 188 of file gnunet-messenger.c.
Referenced by main(), and on_identity().
struct GNUNET_SCHEDULER_Task* shutdown_task |
Definition at line 190 of file gnunet-messenger.c.