Use regex service from terminal. More...
#include <stdio.h>#include <string.h>#include <unistd.h>#include "gnunet_common.h"#include "gnunet_regex_service.h"#include "gnunet_scheduler_lib.h"#include "gnunet_time_lib.h"#include "gnunet_util_lib.h"Go to the source code of this file.
Functions | |
| static void | shutdown_hook (void *cls) |
| static void | regex_found (void *cls, const struct GNUNET_PeerIdentity *id, const struct GNUNET_PeerIdentity *get_path, unsigned int get_path_length, const struct GNUNET_PeerIdentity *put_path, unsigned int put_path_length) |
| Search callback function, invoked for every result that was found. | |
| static void | print_announcement (void *cls) |
| static void | drop_announcement (void *cls) |
| 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. | |
| int | main (int argc, char **argv) |
| The main function to announce regular expressions or observe announcing peers. | |
Variables | |
| struct GNUNET_REGEX_Announcement * | announcement |
| struct GNUNET_REGEX_Search * | search |
| int | announcing |
| struct GNUNET_TIME_Relative | refresh_delay |
| uint16_t | compression |
| struct GNUNET_CONTAINER_MultiHashMap * | matches |
| struct GNUNET_SCHEDULER_Task * | shutdown_task |
| struct GNUNET_SCHEDULER_Task * | delay_task |
| char * | expression |
Use regex service from terminal.
Definition in file gnunet-regex.c.
|
static |
Definition at line 52 of file gnunet-regex.c.
References announcement, delay_task, expression, GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_free, GNUNET_REGEX_announce_cancel(), GNUNET_REGEX_search_cancel(), GNUNET_SCHEDULER_cancel(), matches, search, and shutdown_task.
Referenced by run().
|
static |
Search callback function, invoked for every result that was found.
| cls | Closure provided in GNUNET_REGEX_search. |
| id | Peer providing a regex that matches the string. |
| get_path | Path of the get request. |
| get_path_length | Length of get_path. |
| put_path | Path of the put request. |
| put_path_length | Length of the put_path. |
Definition at line 84 of file gnunet-regex.c.
References GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_CRYPTO_hkdf_gnunet, GNUNET_CRYPTO_kdf_arg, GNUNET_i2s_full(), GNUNET_YES, and matches.
Referenced by run().
|
static |
Definition at line 125 of file gnunet-regex.c.
References delay_task, expression, GNUNET_SCHEDULER_add_delayed(), print_announcement(), and refresh_delay.
Referenced by drop_announcement(), print_announcement(), and run().
|
static |
Definition at line 139 of file gnunet-regex.c.
References announcement, delay_task, GNUNET_REGEX_announce_cancel(), GNUNET_SCHEDULER_shutdown(), and print_announcement().
Referenced by run().
|
static |
Main function that will be run by the scheduler.
| [in/out] | cls closure | |
| [in] | args | remaining command-line arguments |
| [in] | cfgfile | name of the configuration file used (for saving, can be NULL!) |
| [in] | cfg | configuration |
Definition at line 164 of file gnunet-regex.c.
References announcement, announcing, cfg, compression, delay_task, drop_announcement(), expression, GNUNET_assert, GNUNET_CONTAINER_multihashmap_create(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_malloc, GNUNET_memcpy, GNUNET_NO, GNUNET_REGEX_announce(), GNUNET_REGEX_search(), GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_add_shutdown(), GNUNET_TIME_relative_is_zero(), matches, print_announcement(), refresh_delay, regex_found(), search, shutdown_hook(), and shutdown_task.
Referenced by main().
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
The main function to announce regular expressions or observe announcing peers.
| [in] | argc | number of arguments from the command line |
| [in] | argv | command line arguments |
Definition at line 237 of file gnunet-regex.c.
References announcing, compression, GNUNET_GETOPT_CommandLineOption::description, gettext_noop, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_relative_time(), GNUNET_GETOPT_option_uint16(), GNUNET_OK, GNUNET_OS_project_data_gnunet(), GNUNET_PROGRAM_run(), options, refresh_delay, and run().
| struct GNUNET_REGEX_Announcement* announcement |
Definition at line 36 of file gnunet-regex.c.
Referenced by confirm_epoch_announcement_member(), cont_write_epoch_announcement_record(), create_epoch_announcement(), derive_epoch_announcement_key(), destroy_epoch_announcement(), drop_announcement(), generate_room_epoch_announcement(), get_epoch_announcement(), get_epoch_announcement_key(), get_epoch_announcement_member_hash(), get_epoch_announcement_members_count(), get_epoch_announcement_size(), get_epoch_membership_member_hash(), get_epoch_previous_announcement(), handle_access_message(), handle_announcement_message(), handle_appeal_message(), handle_authorization_message(), handle_epoch_announcement(), handle_epoch_announcement_access(), handle_epoch_announcement_delay(), handle_epoch_announcement_message(), handle_revolution_message(), handle_room_delayed_announcement(), handle_room_delayed_appeal(), handle_room_delayed_deletion(), handle_secret_message(), handle_secret_message_with_key(), handle_secret_messages_with_key(), invalidate_epoch_announcement(), is_epoch_announcement_announced(), is_epoch_announcement_appealed(), is_epoch_announcement_completed(), is_epoch_announcement_key_derived_from(), is_epoch_announcement_member(), is_epoch_group_missing_announcement(), is_other_epoch_announcement_better(), it_announcement_store_key(), it_find_announcement_with_most_members(), it_find_valid_announcement_with_most_members(), it_handle_secret_message(), iterate_destroy_announcement(), iterate_epoch_announcement_invalidation(), read_handle_epoch_key(), revoke_epoch_announcement_member(), run(), send_epoch_announcement(), send_epoch_announcement_access(), send_epoch_announcement_appeal(), send_epoch_announcement_authorization(), send_epoch_announcement_revolution(), send_message_to_room(), set_epoch_announcement_appeal(), set_epoch_announcement_key(), shutdown_hook(), task_epoch_announcement_appeal(), update_epoch_announcement(), and write_epoch_announcement_record().
| struct GNUNET_REGEX_Search* search |
Definition at line 37 of file gnunet-regex.c.
Referenced by deserialize_download(), get_member_session_of(), is_epoch_membership_member(), it_search_epoch_member(), iterate_search_session(), run(), and shutdown_hook().
| int announcing |
Definition at line 39 of file gnunet-regex.c.
| struct GNUNET_TIME_Relative refresh_delay |
Definition at line 41 of file gnunet-regex.c.
Referenced by GNUNET_REGEX_announce(), main(), print_announcement(), and run().
| uint16_t compression |
Definition at line 42 of file gnunet-regex.c.
Referenced by GNUNET_REGEX_announce(), main(), main(), REGEX_INTERNAL_announce(), and run().
| struct GNUNET_CONTAINER_MultiHashMap* matches |
Definition at line 44 of file gnunet-regex.c.
Referenced by abd_string_to_value(), regex_found(), run(), and shutdown_hook().
| struct GNUNET_SCHEDULER_Task* shutdown_task |
Definition at line 45 of file gnunet-regex.c.
Referenced by run(), and shutdown_hook().
| struct GNUNET_SCHEDULER_Task* delay_task |
Definition at line 46 of file gnunet-regex.c.
Referenced by drop_announcement(), print_announcement(), run(), and shutdown_hook().
| char* expression |
Definition at line 48 of file gnunet-regex.c.
Referenced by print_announcement(), run(), and shutdown_hook().