Go to the source code of this file.
Macros | |
#define | MAX_RECORDS_PER_NAME 50 |
#define | MAX_ZONEFILE_LINE_LEN 4096 |
Maximum length of a zonefile line. More... | |
#define | MAX_ZONEFILE_RECORD_DATA_LEN 2048 |
FIXME: Soft limit this? More... | |
Enumerations | |
enum | ZonefileImportState { ZS_READY , ZS_ORIGIN_SET , ZS_ORIGIN_CHANGED , ZS_NAME_CHANGED } |
Functions | |
static void | do_shutdown (void *cls) |
Task run on shutdown. More... | |
static void | tx_end (void *cls, enum GNUNET_ErrorCode ec) |
static void | parse (void *cls) |
Main function that will be run. More... | |
static char * | trim (char *line) |
static char * | next_token (char *token) |
static int | parse_ttl (char *token, struct GNUNET_TIME_Relative *ttl) |
static int | parse_origin (char *token, char *origin) |
static void | origin_create_cb (void *cls, const struct GNUNET_IDENTITY_PrivateKey *pk, enum GNUNET_ErrorCode ec) |
static void | origin_lookup_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) |
static void | add_continuation (void *cls, enum GNUNET_ErrorCode ec) |
static void | tx_start (void *cls, enum GNUNET_ErrorCode ec) |
static void | identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) |
static void | run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *_cfg) |
int | main (int argc, char *const *argv) |
The main function for gnunet-namestore-dbtool. More... | |
Variables | |
static struct GNUNET_GNSRECORD_Data | rd [50] |
The record data under a single label. More... | |
static struct GNUNET_TIME_Relative | ttl |
Current record $TTL to use. More... | |
static char | origin [GNUNET_DNSPARSER_MAX_NAME_LENGTH] |
Current origin. More... | |
static unsigned int | rd_count = 0 |
Number of records for currently parsed set. More... | |
static int | ret = 0 |
Return code. More... | |
static char * | ego_name = NULL |
Name of the ego. More... | |
static char * | res |
Currently read line or NULL on EOF. More... | |
static unsigned int | published_sets = 0 |
Statistics, how many published record sets. More... | |
static unsigned int | published_records = 0 |
Statistics, how many records published in aggregate. More... | |
static struct GNUNET_IDENTITY_EgoLookup * | el |
Handle to identity lookup. More... | |
static struct GNUNET_IDENTITY_PrivateKey | zone_pkey |
Private key for the our zone. More... | |
static struct GNUNET_NAMESTORE_QueueEntry * | ns_qe |
Queue entry for the 'add' operation. More... | |
static struct GNUNET_NAMESTORE_Handle * | ns |
Handle to the namestore. More... | |
static struct GNUNET_IDENTITY_Operation * | id_op |
Origin create operations. More... | |
static struct GNUNET_IDENTITY_Handle * | id |
Handle to IDENTITY. More... | |
static const struct GNUNET_CONFIGURATION_Handle * | cfg |
Current configurataion. More... | |
static struct GNUNET_SCHEDULER_Task * | parse_task |
Scheduled parse task. More... | |
static int | state |
The current state of the parser. More... | |
#define MAX_RECORDS_PER_NAME 50 |
Definition at line 30 of file gnunet-namestore-zonefile.c.
#define MAX_ZONEFILE_LINE_LEN 4096 |
Maximum length of a zonefile line.
Definition at line 35 of file gnunet-namestore-zonefile.c.
#define MAX_ZONEFILE_RECORD_DATA_LEN 2048 |
FIXME: Soft limit this?
Definition at line 40 of file gnunet-namestore-zonefile.c.
enum ZonefileImportState |
Enumerator | |
---|---|
ZS_READY | |
ZS_ORIGIN_SET | |
ZS_ORIGIN_CHANGED | |
ZS_NAME_CHANGED |
Definition at line 134 of file gnunet-namestore-zonefile.c.
|
static |
Task run on shutdown.
Cleans up everything.
cls | unused |
Definition at line 159 of file gnunet-namestore-zonefile.c.
References data, ego_name, el, GNUNET_free, GNUNET_IDENTITY_cancel(), GNUNET_IDENTITY_disconnect(), GNUNET_IDENTITY_ego_lookup_cancel(), GNUNET_NAMESTORE_cancel(), GNUNET_NAMESTORE_disconnect(), GNUNET_SCHEDULER_cancel(), id_op, ns, ns_qe, parse_task, rd, and rd_count.
Referenced by run().
|
static |
Definition at line 187 of file gnunet-namestore-zonefile.c.
References _, ego_name, GNUNET_EC_NONE, GNUNET_SCHEDULER_shutdown(), ns_qe, and ret.
Referenced by parse().
|
static |
Main function that will be run.
TODO:
cls | closure |
args | remaining command-line arguments |
cfgfile | name of the configuration file used (for saving, can be NULL!) |
cfg | configuration |
Definition at line 368 of file gnunet-namestore-zonefile.c.
References _, add_continuation(), buf, cfg, GNUNET_GNSRECORD_Data::data, data, data_size, GNUNET_GNSRECORD_Data::data_size, ego_name, el, GNUNET_GNSRECORD_Data::expiration_time, GNUNET_GNSRECORD_Data::flags, GNUNET_DNSPARSER_MAX_LABEL_LENGTH, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION, GNUNET_GNSRECORD_string_to_value(), GNUNET_GNSRECORD_typename_to_number(), GNUNET_IDENTITY_ego_lookup(), GNUNET_log, GNUNET_NAMESTORE_records_store(), GNUNET_NAMESTORE_transaction_commit(), GNUNET_OK, GNUNET_SCHEDULER_shutdown(), GNUNET_strdup, GNUNET_SYSERR, MAX_RECORDS_PER_NAME, MAX_ZONEFILE_LINE_LEN, MAX_ZONEFILE_RECORD_DATA_LEN, GNUNET_SCHEDULER_Task::next, next_token(), ns, ns_qe, origin, origin_lookup_cb(), parse_origin(), parse_task, parse_ttl(), payload, published_records, published_sets, rd, rd_count, GNUNET_GNSRECORD_Data::record_type, GNUNET_TIME_Relative::rel_value_us, res, ret, state, trim(), ttl, tx_end(), type, zone_pkey, ZS_NAME_CHANGED, ZS_ORIGIN_CHANGED, ZS_ORIGIN_SET, and ZS_READY.
Referenced by add_continuation(), origin_create_cb(), origin_lookup_cb(), run(), and tx_start().
|
static |
Definition at line 205 of file gnunet-namestore-zonefile.c.
References line.
Referenced by parse().
|
static |
Definition at line 239 of file gnunet-namestore-zonefile.c.
References GNUNET_SCHEDULER_Task::next.
Referenced by parse().
|
static |
Definition at line 248 of file gnunet-namestore-zonefile.c.
References GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_OK, GNUNET_SYSERR, GNUNET_SCHEDULER_Task::next, GNUNET_TIME_Relative::rel_value_us, and ttl.
Referenced by parse().
|
static |
Definition at line 270 of file gnunet-namestore-zonefile.c.
References GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_OK, GNUNET_SCHEDULER_Task::next, and origin.
Referenced by parse().
|
static |
Definition at line 285 of file gnunet-namestore-zonefile.c.
References GNUNET_EC_NONE, GNUNET_ErrorCode_get_hint(), GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_shutdown(), id_op, parse(), parse_task, pk, ret, state, zone_pkey, and ZS_ORIGIN_SET.
Referenced by origin_lookup_cb().
|
static |
Definition at line 302 of file gnunet-namestore-zonefile.c.
References ego_name, el, GNUNET_ERROR_TYPE_DEBUG, GNUNET_IDENTITY_create(), GNUNET_IDENTITY_ego_get_private_key(), GNUNET_IDENTITY_TYPE_ECDSA, GNUNET_log, GNUNET_SCHEDULER_add_now(), id_op, origin_create_cb(), parse(), parse_task, state, zone_pkey, and ZS_ORIGIN_SET.
Referenced by add_continuation(), and parse().
|
static |
Definition at line 323 of file gnunet-namestore-zonefile.c.
References _, cfg, ego_name, el, GNUNET_EC_NONE, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_IDENTITY_ego_lookup(), GNUNET_log, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_shutdown(), GNUNET_strdup, ns_qe, origin, origin_lookup_cb(), parse(), parse_task, ret, state, and ZS_ORIGIN_CHANGED.
Referenced by parse().
|
static |
Definition at line 651 of file gnunet-namestore-zonefile.c.
References _, ego_name, GNUNET_EC_NONE, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_shutdown(), ns_qe, parse(), parse_task, and ret.
Referenced by identity_cb().
|
static |
Definition at line 667 of file gnunet-namestore-zonefile.c.
References _, ego_name, el, GNUNET_IDENTITY_ego_get_private_key(), GNUNET_NAMESTORE_transaction_begin(), GNUNET_SCHEDULER_shutdown(), ns, ns_qe, origin, ret, state, tx_start(), zone_pkey, and ZS_ORIGIN_SET.
Referenced by run().
|
static |
Definition at line 694 of file gnunet-namestore-zonefile.c.
References _, cfg, do_shutdown(), ego_name, el, GNUNET_IDENTITY_connect(), GNUNET_IDENTITY_ego_lookup(), GNUNET_NAMESTORE_connect(), GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_add_shutdown(), identity_cb(), ns, parse(), parse_task, state, and ZS_READY.
Referenced by main().
int main | ( | int | argc, |
char *const * | argv | ||
) |
The main function for gnunet-namestore-dbtool.
argc | number of arguments from the command line |
argv | command line arguments |
Definition at line 731 of file gnunet-namestore-zonefile.c.
References _, ego_name, gettext_noop, GNUNET_free_nz, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_string(), GNUNET_log_setup(), GNUNET_OK, GNUNET_PROGRAM_run(), GNUNET_STRINGS_get_utf8_args(), options, ret, and run().
|
static |
The record data under a single label.
Reused. Hard limit.
Definition at line 1 of file gnunet-namestore-zonefile.c.
Referenced by attr_iter_cb(), attr_store_task(), backward_resolution(), block_create2(), block_create_ecdsa(), block_create_eddsa(), bulk_tx_start(), check_credential_iteration_start(), check_monitor_start(), check_pkey(), check_rd(), check_result(), check_zone_to_name(), clean_rsa_public_key(), clean_rsa_signature(), clean_string(), clean_varsize_blob(), collect_tickets_cb(), completed_cb(), consistency_iter(), continue_store_activity(), create_response(), del_monitor(), DID_resolve(), dispatch_job(), dispatch_job_monitor(), display_record(), display_record_iterator(), display_record_lookup(), display_record_monitor(), display_records_from_block(), dns_result_parser(), do_shutdown(), filter_tickets_cb(), forward_resolution(), get_existing_rd_exp(), get_existing_record(), GNUNET_CONVERSATION_phone_get_record(), GNUNET_GNSRECORD_is_expired(), GNUNET_GNSRECORD_JSON_from_gnsrecord(), GNUNET_GNSRECORD_records_get_size(), GNUNET_GNSRECORD_records_serialize(), GNUNET_NAMESTORE_records_store(), GNUNET_NAMESTORE_records_store2(), handle_delegate_collection_cb(), handle_gns2dns_result(), handle_gns_namecache_resolution_result(), handle_gns_resolution_result(), handle_gns_response(), handle_gns_result(), handle_lookup_result(), handle_monitor_event(), handle_record(), handle_record_result(), handle_result(), handle_reverse_lookup(), handle_zone_to_name_response(), iterate_do_cb(), iterate_done_cb(), iterate_error_cb(), lookup_authz_cb(), lookup_it(), lookup_nick_it(), lookup_records(), lookup_redirect_uri_result(), namestore_flat_store_records(), namestore_list_iteration(), ns_get_lookup_cb(), ns_lookup_cb(), ns_lookup_result_cb(), parse(), parse_record(), print_record(), process_lookup_result(), process_parallel_lookup_result(), process_result(), process_tickets(), purge_orphans_iterator(), purge_zone_iterator(), recursive_cname_resolution(), recursive_gns2dns_resolution(), recursive_pkey_resolution(), recursive_redirect_resolution(), register_do_cb(), register_done_cb(), register_error_cb(), reply_to_dns(), result_processor(), revoke_attrs_cb(), run(), run_edkey(), run_pkey(), run_with_zone_pkey(), rvk_move_attr_cb(), rvk_ticket_update(), search_done_cb(), search_error_cb(), send_lookup_response(), send_lookup_response_with_filter(), start_phone(), start_resolver_lookup(), transmit_lookup_dns_result(), update_tickets(), vpn_allocation_cb(), zone_iterate_proc(), and zone_iterator().
|
static |
Current record $TTL to use.
Definition at line 1 of file gnunet-namestore-zonefile.c.
Referenced by GNUNET_REVOCATION_pow_start(), GSF_pending_request_create_(), GSF_pending_request_get_message_(), merge_pr(), parse(), and parse_ttl().
|
static |
Current origin.
Definition at line 56 of file gnunet-namestore-zonefile.c.
Referenced by add_continuation(), copy_list_messages(), create_response(), handle_connection_create(), handle_core_message(), handle_p2p_estimate(), identity_cb(), parse(), and parse_origin().
|
static |
Number of records for currently parsed set.
Definition at line 61 of file gnunet-namestore-zonefile.c.
Referenced by attr_iter_cb(), backward_resolution(), block_create2(), block_create_ecdsa(), block_create_eddsa(), check_credential_iteration_start(), check_monitor_start(), check_rd(), check_result(), check_zone_to_name(), collect_tickets_cb(), consistency_iter(), continue_store_activity(), del_monitor(), DID_create(), DID_resolve(), dispatch_job(), dispatch_job_monitor(), dns_result_parser(), do_shutdown(), filter_tickets_cb(), forward_resolution(), get_existing_rd_exp(), get_existing_record(), GNUNET_GNSRECORD_JSON_from_gnsrecord(), GNUNET_GNSRECORD_records_deserialize(), GNUNET_GNSRECORD_records_deserialize_get_size(), GNUNET_GNSRECORD_records_get_size(), GNUNET_GNSRECORD_records_serialize(), GNUNET_NAMESTORE_records_store(), GNUNET_NAMESTORE_records_store2(), handle_delegate_collection_cb(), handle_gns2dns_result(), handle_gns_namecache_resolution_result(), handle_gns_resolution_result(), handle_gns_response(), handle_gns_result(), handle_lookup_result(), handle_monitor_event(), handle_record(), handle_record_result(), handle_result(), handle_reverse_lookup(), handle_zone_to_name_response(), lookup_authz_cb(), lookup_it(), lookup_nick_it(), lookup_redirect_uri_result(), namestore_flat_store_records(), ns_lookup_cb(), ns_lookup_result_cb(), parse(), process_lookup_result(), process_parallel_lookup_result(), process_result(), process_tickets(), recursive_gns2dns_resolution(), reply_to_dns(), result_processor(), revoke_attrs_cb(), run_edkey(), run_pkey(), run_with_zone_pkey(), rvk_move_attr_cb(), rvk_ticket_update(), send_lookup_response(), send_lookup_response_with_filter(), update_tickets(), vpn_allocation_cb(), and zone_iterate_proc().
|
static |
Return code.
Definition at line 66 of file gnunet-namestore-zonefile.c.
Referenced by add_continuation(), identity_cb(), main(), origin_create_cb(), parse(), tx_end(), and tx_start().
|
static |
Name of the ego.
Definition at line 71 of file gnunet-namestore-zonefile.c.
Referenced by add_continuation(), do_shutdown(), identity_cb(), main(), origin_lookup_cb(), parse(), run(), tx_end(), and tx_start().
|
static |
Currently read line or NULL on EOF.
Definition at line 76 of file gnunet-namestore-zonefile.c.
Referenced by parse().
|
static |
Statistics, how many published record sets.
Definition at line 81 of file gnunet-namestore-zonefile.c.
Referenced by parse().
|
static |
Statistics, how many records published in aggregate.
Definition at line 86 of file gnunet-namestore-zonefile.c.
Referenced by parse().
|
static |
Handle to identity lookup.
Definition at line 92 of file gnunet-namestore-zonefile.c.
Referenced by add_continuation(), do_shutdown(), identity_cb(), origin_lookup_cb(), parse(), and run().
|
static |
Private key for the our zone.
Definition at line 92 of file gnunet-namestore-zonefile.c.
Referenced by identity_cb(), origin_create_cb(), origin_lookup_cb(), and parse().
|
static |
Queue entry for the 'add' operation.
Definition at line 102 of file gnunet-namestore-zonefile.c.
Referenced by add_continuation(), do_shutdown(), identity_cb(), parse(), tx_end(), and tx_start().
|
static |
Handle to the namestore.
Definition at line 107 of file gnunet-namestore-zonefile.c.
Referenced by do_shutdown(), identity_cb(), parse(), and run().
|
static |
Origin create operations.
Definition at line 112 of file gnunet-namestore-zonefile.c.
Referenced by do_shutdown(), origin_create_cb(), and origin_lookup_cb().
|
static |
Handle to IDENTITY.
Definition at line 117 of file gnunet-namestore-zonefile.c.
|
static |
Current configurataion.
Definition at line 122 of file gnunet-namestore-zonefile.c.
Referenced by add_continuation(), parse(), and run().
|
static |
Scheduled parse task.
Definition at line 127 of file gnunet-namestore-zonefile.c.
Referenced by add_continuation(), do_shutdown(), origin_create_cb(), origin_lookup_cb(), parse(), run(), and tx_start().
|
static |
The current state of the parser.
Definition at line 132 of file gnunet-namestore-zonefile.c.
Referenced by add_continuation(), identity_cb(), origin_create_cb(), origin_lookup_cb(), parse(), and run().