Tool to monitor DNS queries. More...
Go to the source code of this file.
Functions | |
static const char * | get_type (uint16_t type) |
Convert numeric DNS record type to a string. More... | |
static const char * | get_class (uint16_t class) |
Convert numeric DNS record class to a string. More... | |
static void | display_query (const struct GNUNET_DNSPARSER_Query *query) |
Output the given DNS query to stdout. More... | |
static void | display_record (const struct GNUNET_DNSPARSER_Record *record) |
Output the given DNS record to stdout. More... | |
static void | display_request (void *cls, struct GNUNET_DNS_RequestHandle *rh, size_t request_length, const char *request) |
Signature of a function that is called whenever the DNS service encounters a DNS request and needs to do something with it. More... | |
static void | do_disconnect (void *cls) |
Shutdown. 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 *const *argv) |
Variables | |
static struct GNUNET_DNS_Handle * | handle |
Handle to transport service. More... | |
static int | inbound_only |
Option -i. More... | |
static int | outbound_only |
Option -o. More... | |
static int | ret |
Global return value (0 success). More... | |
static unsigned int | verbosity |
Selected level of verbosity. More... | |
Tool to monitor DNS queries.
Definition in file gnunet-dns-monitor.c.
|
static |
Convert numeric DNS record type to a string.
type | type to convert |
Definition at line 64 of file gnunet-dns-monitor.c.
References buf, GNUNET_DNSPARSER_TYPE_A, GNUNET_DNSPARSER_TYPE_AAAA, GNUNET_DNSPARSER_TYPE_CNAME, GNUNET_DNSPARSER_TYPE_MX, GNUNET_DNSPARSER_TYPE_NS, GNUNET_DNSPARSER_TYPE_PTR, GNUNET_DNSPARSER_TYPE_SOA, GNUNET_DNSPARSER_TYPE_SRV, GNUNET_DNSPARSER_TYPE_TXT, GNUNET_snprintf(), and type.
Referenced by display_query(), and display_record().
|
static |
Convert numeric DNS record class to a string.
class | class to convert |
Definition at line 100 of file gnunet-dns-monitor.c.
References buf, GNUNET_snprintf(), GNUNET_TUN_DNS_CLASS_CHAOS, GNUNET_TUN_DNS_CLASS_HESIOD, and GNUNET_TUN_DNS_CLASS_INTERNET.
Referenced by display_query(), and display_record().
|
static |
Output the given DNS query to stdout.
query | query to display. |
Definition at line 123 of file gnunet-dns-monitor.c.
References GNUNET_DNSPARSER_Query::dns_traffic_class, get_class(), get_type(), GNUNET_DNSPARSER_Query::name, and GNUNET_DNSPARSER_Query::type.
Referenced by display_request().
|
static |
Output the given DNS record to stdout.
record | record to display. |
Definition at line 139 of file gnunet-dns-monitor.c.
References buf, get_class(), get_type(), GNUNET_asprintf(), GNUNET_DNSPARSER_TYPE_A, GNUNET_DNSPARSER_TYPE_AAAA, GNUNET_DNSPARSER_TYPE_CNAME, GNUNET_DNSPARSER_TYPE_MX, GNUNET_DNSPARSER_TYPE_NS, GNUNET_DNSPARSER_TYPE_PTR, GNUNET_DNSPARSER_TYPE_SOA, GNUNET_DNSPARSER_TYPE_SRV, GNUNET_DNSPARSER_TYPE_TXT, GNUNET_free, GNUNET_TIME_absolute_get_remaining(), record(), and GNUNET_TIME_Relative::rel_value_us.
Referenced by display_request().
|
static |
Signature of a function that is called whenever the DNS service encounters a DNS request and needs to do something with it.
The function has then the chance to generate or modify the response by calling one of the three "GNUNET_DNS_request_*" continuations.
When a request is intercepted, this function is called first to give the client a chance to do the complete address resolution; "rdata" will be NULL for this first call for a DNS request, unless some other client has already filled in a response.
If multiple clients exist, all of them are called before the global DNS. The global DNS is only called if all of the clients' functions call GNUNET_DNS_request_forward. Functions that call GNUNET_DNS_request_forward will be called again before a final response is returned to the application. If any of the clients' functions call GNUNET_DNS_request_drop, the response is dropped.
cls | closure |
rh | request handle to user for reply |
request_length | number of bytes in request |
request | udp payload of the DNS request |
Definition at line 263 of file gnunet-dns-monitor.c.
References display_query(), display_record(), GNUNET_DNS_request_forward(), GNUNET_DNSPARSER_free_packet(), GNUNET_DNSPARSER_parse(), p, and request.
Referenced by run().
|
static |
Shutdown.
Definition at line 324 of file gnunet-dns-monitor.c.
References GNUNET_DNS_disconnect(), and handle.
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 343 of file gnunet-dns-monitor.c.
References cfg, display_request(), do_disconnect(), GNUNET_DNSPARSER_Packet::flags, GNUNET_DNS_connect(), GNUNET_DNS_FLAG_REQUEST_MONITOR, GNUNET_DNS_FLAG_RESPONSE_MONITOR, GNUNET_SCHEDULER_add_shutdown(), handle, inbound_only, and outbound_only.
Referenced by main().
int main | ( | int | argc, |
char *const * | argv | ||
) |
Definition at line 365 of file gnunet-dns-monitor.c.
References gettext_noop, GNUNET_free_nz, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_verbose(), GNUNET_OK, GNUNET_PROGRAM_run(), GNUNET_STRINGS_get_utf8_args(), inbound_only, options, outbound_only, ret, run(), and verbosity.
|
static |
Handle to transport service.
Definition at line 34 of file gnunet-dns-monitor.c.
Referenced by add_attribute_cont(), add_credential_cont(), add_list_handle(), add_service_handle(), attr_collect(), attr_in_claims_request(), attr_in_idtoken_request(), attr_in_userinfo_request(), authorize_endpoint(), bind_store_ego(), build_authz_response(), build_redirect(), bulk_tx_commit_cb(), bulk_tx_start(), callback_mq_error(), callback_reconnect(), callback_scan_for_rooms(), callback_set_handle_name(), callback_setup_handle_name(), callback_update_handle(), change_handle_ego(), change_handle_name(), change_srv_handle_member_id(), check_authorization(), check_client_hello(), check_client_result(), check_monitor_get_resp(), check_monitor_put(), cleanup_handle(), cleanup_issue_handle(), client_redirect(), close_handle_room(), close_service_room(), close_srv_handle_room(), code_redirect(), collect_finished_cb(), consume_cont(), consume_fail(), consume_ticket(), consume_ticket_cont(), cookie_identity_interpretation(), cr_cont(), create_finished(), create_handle(), create_handle_member_id(), create_room(), create_srv_handle(), create_srv_room(), cred_collect(), del_finished(), delete_attribute_cont(), delete_credential_cont(), delete_finished_cb(), destroy_handle(), destroy_srv_handle(), do_disconnect(), do_error(), do_finished(), do_finished_create(), do_redirect_error(), do_timeout(), do_userinfo_error(), dump_pc(), ecdsa_symmetric_decrypt(), ecdsa_symmetric_encrypt(), ego_create(), ego_delete_name(), ego_delete_pubkey(), ego_edit(), ego_edit_name(), ego_edit_pubkey(), ego_get_all(), ego_get_name(), ego_get_pubkey(), ego_get_response(), ego_sign_data(), ego_sign_data_cb(), enter_srv_room_at(), entry_handle_room_at(), entry_service_room(), entry_srv_handle_room(), finished_cont(), force_reconnect(), get_cont(), get_gns_cont(), get_handle_contact(), get_handle_contact_store(), get_handle_key(), get_handle_member_session(), get_handle_name(), get_oidc_dir_path(), get_srv_handle_data_subdir(), get_srv_handle_ego(), get_srv_handle_member_id(), get_url_parameter_copy(), GNUNET_ABD_collect(), GNUNET_ABD_connect(), GNUNET_ABD_disconnect(), GNUNET_ABD_request_cancel(), GNUNET_ABD_verify(), GNUNET_CADET_disconnect(), GNUNET_CORE_disconnect(), GNUNET_CRYPTO_symmetric_decrypt(), GNUNET_CRYPTO_symmetric_encrypt(), GNUNET_DHT_connect(), GNUNET_DHT_disconnect(), GNUNET_DHT_get_start(), GNUNET_DHT_get_stop(), GNUNET_DHT_monitor_start(), GNUNET_DHT_monitor_stop(), GNUNET_DHT_put(), GNUNET_DHT_put_cancel(), GNUNET_GNS_connect(), GNUNET_GNS_disconnect(), GNUNET_GNS_lookup(), GNUNET_GNS_lookup_cancel(), GNUNET_GNS_lookup_limited(), GNUNET_GNS_lookup_with_tld(), GNUNET_MESSENGER_connect(), GNUNET_MESSENGER_disconnect(), GNUNET_MESSENGER_enter_room(), GNUNET_MESSENGER_find_rooms(), GNUNET_MESSENGER_get_key(), GNUNET_MESSENGER_get_name(), GNUNET_MESSENGER_open_room(), GNUNET_MESSENGER_set_name(), GNUNET_MESSENGER_update(), GNUNET_STATISTICS_get(), GNUNET_STATISTICS_set(), GNUNET_STATISTICS_update(), GNUNET_STATISTICS_watch(), GNUNET_STATISTICS_watch_cancel(), GNUNET_TESTBED_cancel_registration(), GNUNET_TESTBED_is_host_habitable_cancel(), GNUNET_TRANSPORT_core_disconnect(), GNUNET_TRANSPORT_core_get_mq(), GNUNET_TRANSPORT_manipulation_disconnect(), GNUNET_TRANSPORT_manipulation_set(), GST_connection_pool_get_handle(), handle_client_hello(), handle_get_key(), handle_get_message(), handle_get_name(), handle_gns_response(), handle_intermediate(), handle_member_id(), handle_recv_message(), handle_result(), handle_room_close(), handle_room_entry(), handle_room_open(), handle_ticket_result(), header_iterator(), import_next_cb(), iterate_close_room(), iterate_create_ego(), iterate_reset_room(), iterate_save_member_session_history_hentries(), iterate_save_rooms(), join_room(), join_room_locally(), jwks_endpoint(), list_attribute_cont(), list_credential_cont(), list_tickets_cont(), load_list_messages(), load_list_tunnels(), load_member_session_history(), load_srv_handle_configuration(), login_cont(), login_redirect(), lookup_redirect_uri_result(), main_task(), merge_srv_room_last_messages(), mq_error_handler(), namestore_add(), namestore_add_or_update(), namestore_delete(), namestore_get(), namestore_import(), namestore_iteration_error(), namestore_list_finished(), namestore_list_iteration(), namestore_update(), neighbour_delete(), notify_srv_handle_message(), ns_get_lookup_cb(), ns_lookup_cb(), ns_lookup_error_cb(), oidc_attr_collect(), oidc_attr_collect_finished_cb(), oidc_config_cors(), oidc_config_endpoint(), oidc_cred_collect(), oidc_cred_collect_finished_cb(), oidc_iteration_error(), oidc_ticket_issue_cb(), on_identity(), open_handle_room(), open_service_room(), open_srv_handle_room(), open_srv_room(), options_cont(), pack_srv_room_message(), parse_credentials_basic_auth(), parse_credentials_post_body(), peerinfo_get(), peerinfo_list_finished(), peerinfo_list_iteration(), plugin_callback(), post_data_iter(), reconnect(), reconnect_task(), remove_list_handle(), remove_service_handle(), return_response(), revoke_ticket_cont(), run(), save_list_messages(), save_list_tunnels(), save_member_session_history(), save_srv_handle_configuration(), send_close_room(), send_enter_room(), send_message_id(), send_open_room(), send_room_info(), send_srv_handle_message(), send_srv_room_message(), send_tunnel_message(), set_cont(), set_handle_key(), set_handle_name(), set_srv_handle_ego(), set_srv_handle_name(), setup_cipher_aes(), setup_cipher_twofish(), setup_srv_handle_name(), store_ticket_issue_cont(), ticket_collect(), tld_iter(), token_endpoint(), transmit_get(), transmit_set(), transmit_watch(), unbind_store_ego(), update_srv_handle(), url_iterator(), and userinfo_endpoint().
|
static |
|
static |
|
static |
Global return value (0 success).
Definition at line 49 of file gnunet-dns-monitor.c.
Referenced by main().
|
static |
Selected level of verbosity.
Definition at line 54 of file gnunet-dns-monitor.c.
Referenced by main().