diff --git a/daemon/layer/query.c b/daemon/layer/query.c index 82c41dda748f86fedd24ba2112c80cc4ad9c1ac6..be0f83636a6f84aabc1ebac8bb55d0b4ee626aae 100644 --- a/daemon/layer/query.c +++ b/daemon/layer/query.c @@ -75,7 +75,7 @@ static int output_error(knot_layer_t *ctx, knot_pkt_t *pkt) return KNOT_STATE_DONE; } -/*! \brief Module implementation. */ +/** Module implementation. */ static const knot_layer_api_t LAYER_QUERY_MODULE = { &begin, NULL, diff --git a/daemon/worker.h b/daemon/worker.h index d30bc5b2f290b27ff43f93a37f0b05ab23ed79af..8114bbb1dd3649d2506a89d0ed43ab0d558a5e9e 100644 --- a/daemon/worker.h +++ b/daemon/worker.h @@ -21,33 +21,33 @@ #include "lib/resolve.h" -/*! - * \brief Query resolution worker. +/** + * Query resolution worker. */ struct worker_ctx { struct kr_context resolve; mm_ctx_t *pool; }; -/*! - * \brief Initialize worker context. - * \param worker - * \param mm +/** + * Initialize worker context. + * @param worker + * @param mm * \return KNOT_E* */ int worker_init(struct worker_ctx *worker, mm_ctx_t *mm); -/*! - * \brief Clear worker context. - * \param worker +/** + * Clear worker context. + * @param worker */ void worker_deinit(struct worker_ctx *worker); -/*! - * \brief Resolve query. - * \param worker - * \param answer - * \param query +/** + * Resolve query. + * @param worker + * @param answer + * @param query * \return KNOT_E* */ int worker_exec(struct worker_ctx *worker, knot_pkt_t *answer, knot_pkt_t *query); diff --git a/include/kgetdns.h b/include/kgetdns.h index bbe4fabc5b00f669ef8788211ab1a6b347e08979..5b3cd26e4d57dbb00d7ccde532ec7b96ead33f13 100644 --- a/include/kgetdns.h +++ b/include/kgetdns.h @@ -25,20 +25,20 @@ enum getdns_return { typedef enum getdns_return getdns_return_t; enum { - /*! At least one response was retuned. */ + /** At least one response was retuned. */ GETDNS_RESPSTATUS_GOOD, - /*! Query for the name yielded a negative response. */ + /** Query for the name yielded a negative response. */ GETDNS_RESPSTATUS_NO_NAME, - /*! All queries timed out. */ + /** All queries timed out. */ GETDNS_RESPSTATUS_ALL_TIMEOUT, - /*! At least one response was retuned, but not secured by DNSSEC. */ + /** At least one response was retuned, but not secured by DNSSEC. */ GETDNS_RESPSTATUS_NO_SECURE_ANSWERS, }; enum { - /*! DNS name service. */ + /** DNS name service. */ GETDNS_NAMETYPE_DNS, - /*! WINS name service. */ + /** WINS name service. */ GETDNS_NAMETYPE_WINS, }; @@ -63,25 +63,25 @@ typedef struct getdns_bindata getdns_bindata; struct getdns_context; typedef struct getdns_context getdns_context; -/*! +/** * Create a new resolution context with default values. * - * \param[out] context Newly created context. - * \param[in] set_from_os Set some defaults from the operating system. + * @param[out] context Newly created context. + * @param[in] set_from_os Set some defaults from the operating system. */ getdns_return_t getdns_context_create( getdns_context **context, int set_from_os ); -/*! +/** * Create a new resolution context using custom memory allocator with a global context. * * \see getdns_context_create * - * \param malloc Callback for \c malloc. - * \param realloc Callback for \c realloc (not actually used, can be NULL). - * \param free Callback fro \c free. + * @param malloc Callback for \c malloc. + * @param realloc Callback for \c realloc (not actually used, can be NULL). + * @param free Callback fro \c free. */ getdns_return_t getdns_context_create_with_memory_functions( getdns_context **context, @@ -91,12 +91,12 @@ getdns_return_t getdns_context_create_with_memory_functions( void (*free)(void *) ); -/*! +/** * Create a new resolution context using custom memory allocator with a local context. * * \see getdns_context_create_with_memory_functions * - * \param userarg Memory allocation context passed to allocation functions. + * @param userarg Memory allocation context passed to allocation functions. */ getdns_return_t getdns_context_create_with_extended_memory_functions( getdns_context **context, @@ -107,13 +107,13 @@ getdns_return_t getdns_context_create_with_extended_memory_functions( void (*free)(void *userarg, void *) ); -/*! +/** * Destroy resolution context including all running transactions. * * Callbacks for unprocessed transactions will be called with the * \c callback_type parameter set to \c GETDNS_CALLBACK_CANCEL. * - * \param context Context to be destroyed. + * @param context Context to be destroyed. */ void getdns_context_destroy(getdns_context *context); @@ -139,11 +139,11 @@ enum getdns_context_code { typedef enum getdns_context_code getdns_context_code_t; -/*! +/** * Set callback to notify the application when the resolution context changes. * - * \param context Resolution context. - * \param value Callback to be used when the context changes (use NULL to clear). + * @param context Resolution context. + * @param value Callback to be used when the context changes (use NULL to clear). * * \retval GETDNS_RETURN_GOOD * \retval GETDNS_RETURN_CONTEXT_UPDATE_FAIL @@ -160,7 +160,7 @@ enum getdns_resolution { typedef enum getdns_resolution getdns_resolution_t; -/*! +/** * Set resolution type. * * \retval GETDNS_RETURN_GOOD @@ -181,10 +181,10 @@ enum getdns_namespace { typedef enum getdns_namespace getdns_namespace_t; -/*! +/** * Set ordered list of namespaces that will be queried. * - * \note Ignored by \c getdns_general and \c getdns_general_sync. + * @note Ignored by \c getdns_general and \c getdns_general_sync. */ getdns_return_t getdns_context_set_namespaces( getdns_context *context, @@ -201,7 +201,7 @@ enum getdns_transport { typedef enum getdns_transport getdns_transport_t; -/*! +/** * Set a transport to be used for the resolutions. */ getdns_return_t getdns_context_set_dns_transport( @@ -209,10 +209,10 @@ getdns_return_t getdns_context_set_dns_transport( getdns_transport_t value ); -/*! +/** * Set maximum number of queries being processed. * - * \param limit Limit of outstanding queries. Zero indicates no limit. + * @param limit Limit of outstanding queries. Zero indicates no limit. */ getdns_return_t getdns_context_set_limit_outstanding_queries( getdns_context *context, @@ -226,7 +226,7 @@ enum getdns_redirects { typedef enum getdns_redirects getdns_redirects_t; -/*! +/** * Set if the CNAME and DNAME redirects should be followed. */ getdns_return_t getdns_context_set_follow_redirects( @@ -234,7 +234,7 @@ getdns_return_t getdns_context_set_follow_redirects( getdns_redirects_t value ); -/*! +/** * Set the servers for top-level domain lookup. * * [ @@ -258,7 +258,7 @@ enum getdns_append_name { typedef enum getdns_append_name getdns_append_name_t; -/*! +/** * Set a mode of appending a suffix to queried names. * * \see getdns_context_set_suffix @@ -268,7 +268,7 @@ getdns_return_t getdns_context_set_append_name( getdns_append_name_t value ); -/*! +/** * Set a list of strings to be appended to queries. * * \see getdns_context_set_append_mode @@ -278,18 +278,18 @@ getdns_return_t getdns_context_set_suffix( getdns_list *value ); -/*! +/** * Set DNSSEC trust anchors for queries with DNSSEC extension. * - * \param context Resolution context. - * \param value List of RDATA (bindata) of trusted DNSKEYs. + * @param context Resolution context. + * @param value List of RDATA (bindata) of trusted DNSKEYs. */ getdns_return_t getdns_context_set_dnssec_trust_anchors( getdns_context *context, getdns_list *value ); -/*! +/** * Set number of seconds of skew to allow when checking DNSSEC signatures. */ getdns_return_t getdns_context_set_dnssec_allowed_skew( @@ -297,7 +297,7 @@ getdns_return_t getdns_context_set_dnssec_allowed_skew( uint32_t value ); -/*! +/** * Set upstream recursive server for stub resolution mode. * * \see getdns_context_set_resolution_type @@ -314,47 +314,47 @@ getdns_return_t getdns_context_set_upstream_recursive_servers( getdns_list *upstream_list ); -/*! +/** * Set EDNS maximum UDP payload size. * - * \param value Maximum payload size (512-65535, default 512). + * @param value Maximum payload size (512-65535, default 512). */ getdns_return_t getdns_context_set_edns_maximum_udp_payload_size( getdns_context *context, uint16_t value ); -/*! +/** * Set EDNS extended RCODE. * - * \param value Extended RCODE (default 0). + * @param value Extended RCODE (default 0). */ getdns_return_t getdns_context_set_edns_extended_rcode( getdns_context *context, uint8_t value ); -/*! +/** * Set EDNS version. * - * \param value EDNS version (default 0). + * @param value EDNS version (default 0). */ getdns_return_t getdns_context_set_edns_version( getdns_context *context, uint8_t value ); -/*! +/** * Set EDNS DO (DNSSEC OK) bit. * - * \param value EDNS DO bit (0 or 1, default 0). + * @param value EDNS DO bit (0 or 1, default 0). */ getdns_return_t getdns_context_set_edns_do_bit( getdns_context *context, uint8_t value ); -/*! +/** * Set memory allocation functions with a global context. */ getdns_return_t getdns_context_set_memory_functions( @@ -364,7 +364,7 @@ getdns_return_t getdns_context_set_memory_functions( void (*free) (void *) ); -/*! +/** * Set memory allocation functions with a local context. */ getdns_return_t getdns_context_set_extended_memory_functions( @@ -375,7 +375,7 @@ getdns_return_t getdns_context_set_extended_memory_functions( void (*free)(void *userarg, void *ptr) ); -/*! +/** * Get information about the implementation. */ getdns_dict *getdns_context_get_api_information(getdns_context *context); @@ -574,7 +574,7 @@ getdns_return_t getdns_dict_get_int( // helper functions -/*! +/** * Get textual representation of a dictionary. * * \return Dictionary in printable format. Deallocate with \c free. @@ -588,23 +588,23 @@ char *getdns_pretty_print_dict(const getdns_dict *some_dict); typedef uint64_t getdns_transaction_t; enum getdns_callback_type { - GETDNS_CALLBACK_COMPLETE, /*!< The response contains requested data. */ - GETDNS_CALLBACK_CANCEL, /*!< The resolution was cancelled, response is NULL. */ - GETDNS_CALLBACK_TIMEOUT, /*!< The resolution timed out. */ - GETDNS_CALLBACK_ERROR, /*!< The resolutiion failed with an error. */ + GETDNS_CALLBACK_COMPLETE, /**< The response contains requested data. */ + GETDNS_CALLBACK_CANCEL, /**< The resolution was cancelled, response is NULL. */ + GETDNS_CALLBACK_TIMEOUT, /**< The resolution timed out. */ + GETDNS_CALLBACK_ERROR, /**< The resolutiion failed with an error. */ }; typedef enum getdns_callback_type getdns_callback_type_t; -/*! +/** * Callback function definition. * - * \param context Resolution context. - * \param callback_type Reason for the callback. - * \param response An object with a response data. The object must be + * @param context Resolution context. + * @param callback_type Reason for the callback. + * @param response An object with a response data. The object must be * destroyed by the application (\ref getdns_dict_destroy). - * \param userarg User defined argument. - * \param tranasction_id Identifier of the transaction. + * @param userarg User defined argument. + * @param tranasction_id Identifier of the transaction. * */ typedef void (*getdns_callback_t)( @@ -615,14 +615,14 @@ typedef void (*getdns_callback_t)( getdns_transaction_t transaction_id ); -/*! +/** * Cancel outstanding callback. * * The cancelation will cause the resolution callback to be called with the * \c callback_type parameter set to \c GETDNS_CALLBACK_CANCEL. * - * \param context Resolution context. - * \param transaction_id Identifier of the transaction. + * @param context Resolution context. + * @param transaction_id Identifier of the transaction. * * \retval GETDNS_RETURN_GOOD The transaction was cancelled. * \retval GETDNS_RETURN_UNKNOWN_TRANSACTION The transaction is invalid or @@ -637,17 +637,17 @@ getdns_return_t getdns_cancel_callback( * Async Functions */ -/*! +/** * Perform an asynchronous DNS resolution. * - * \param[in] context Resolution context. - * \param[in] name ASCII domain name or IP address. - * \param[in] request_type RR type for the query. - * \param[in] extensions Extensions for the request (can be NULL). - * \param[in] userarg User data passed to callback function. - * \param[out] transaction_id Non-zero identifier of the transaction (can be + * @param[in] context Resolution context. + * @param[in] name ASCII domain name or IP address. + * @param[in] request_type RR type for the query. + * @param[in] extensions Extensions for the request (can be NULL). + * @param[in] userarg User data passed to callback function. + * @param[out] transaction_id Non-zero identifier of the transaction (can be * NULL, set to zero on error). - * \param[in] callbackfn Callback function to process the result. + * @param[in] callbackfn Callback function to process the result. * * \return Error code. * \retval GETDNS_RETURN_GOOD The call was properly formatted. @@ -666,7 +666,7 @@ getdns_return_t getdns_general( getdns_callback_t callbackfn ); -/*! +/** * Perform an asynchronous hostname-to-address resolution. * * \see getdns_general @@ -684,7 +684,7 @@ getdns_return_t getdns_address( getdns_callback_t callbackfn ); -/*! +/** * Perform an asynchronous address-to-hostname resolution. * * \see getdns_general @@ -702,7 +702,7 @@ getdns_return_t getdns_hostname( getdns_callback_t callbackfn ); -/*! +/** * Perform an asynchronous SRV lookup. * * \see getdns_general @@ -722,12 +722,12 @@ getdns_return_t getdns_service( * Synchronous API. */ -/*! +/** * Perform a synchronous DNS resolution. * * \see getdns_general * - * \param[out] response Result of the resolution. + * @param[out] response Result of the resolution. */ getdns_return_t getdns_general_sync( getdns_context *context, @@ -737,7 +737,7 @@ getdns_return_t getdns_general_sync( getdns_dict **response ); -/*! +/** * Perform a synchronous hostname-to-address resolution. * * \see getdns_general_sync @@ -750,7 +750,7 @@ getdns_return_t getdns_address_sync( getdns_dict **response ); -/*! +/** * Perform a synchronous address-to-hostname resolution. * * \see getdns_general_sync @@ -763,7 +763,7 @@ getdns_return_t getdns_hostname_sync( getdns_dict **response ); -/*! +/** * Perform an asynchronous SRV lookup. * * \see getdns_general_sync @@ -804,11 +804,11 @@ enum { * Domain name conversions. */ -/*! +/** * Convert domain name from wire to presentation format. * - * \param[in] dns_name_wire_fmt Domain name in wire format. - * \param[out] fqdn_as_string Domain name in presentation format (with + * @param[in] dns_name_wire_fmt Domain name in wire format. + * @param[out] fqdn_as_string Domain name in presentation format (with * interior dots only, deallocate with \c free). */ getdns_return_t getdns_convert_dns_name_to_fqdn( @@ -816,11 +816,11 @@ getdns_return_t getdns_convert_dns_name_to_fqdn( char **fqdn_as_string ); -/*! +/** * Convert domain name from presentation to wire format. * - * \param[in] fqdn_as_string Domain name in presentation format. - * \param[out] dns_name_wire_fmt Domain name in wire format (deallocate with + * @param[in] fqdn_as_string Domain name in presentation format. + * @param[out] dns_name_wire_fmt Domain name in wire format (deallocate with * \c free). */ getdns_return_t getdns_convert_fqdn_to_dns_name( @@ -828,18 +828,18 @@ getdns_return_t getdns_convert_fqdn_to_dns_name( getdns_bindata **dns_name_wire_fmt ); -/*! +/** * Convert IDN label from Unicode to ASCII. */ char *getdns_convert_ulabel_to_alabel(const char *ulabel); -/*! +/** * Convert IDN label from ASCII to Unicode. */ char *getdns_convert_alabel_to_ulabel(const char *alabel); -/*! +/** * Convert binary IP address to nicely-formatted text representation. * * \return IP address in presentation format (deallocate with \c free). @@ -859,7 +859,7 @@ enum { GETDNS_DNSSEC_INSECURE, }; -/*! +/** * Perform DNSSEC validation of given records. */ getdns_return_t getdns_validate_dnssec( @@ -868,10 +868,10 @@ getdns_return_t getdns_validate_dnssec( getdns_list *trust_anchor_records ); -/*! +/** * Get default root trust anchor. * - * \param[out] utc_data_of_anchor Time of obtaining the trust anchor. + * @param[out] utc_data_of_anchor Time of obtaining the trust anchor. * * \return Root trust anchor, NULL if no default trust anchor exists. */ diff --git a/lib/cache.h b/lib/cache.h index 6054b503e8dea1b15c4dbfc74e6d9dc85119014a..33304ac8843c3c942646deca4679f9c2810ceb25 100644 --- a/lib/cache.h +++ b/lib/cache.h @@ -19,8 +19,8 @@ #include <libknot/rrset.h> #include <libknot/internal/namedb/namedb.h> -/*! - * \brief Serialized form of the RRSet with inception timestamp. +/** + * Serialized form of the RRSet with inception timestamp. */ struct kr_cache_rrset { @@ -29,93 +29,93 @@ struct kr_cache_rrset uint8_t data[]; }; -/*! - * \brief Open/create persistent cache in given path. - * \param handle Path to existing directory where the DB should be created. - * \param mm Memory context. - * \param maxsize Maximum database size (bytes) +/** + * Open/create persistent cache in given path. + * @param handle Path to existing directory where the DB should be created. + * @param mm Memory context. + * @param maxsize Maximum database size (bytes) * \return database instance or NULL */ namedb_t *kr_cache_open(const char *handle, mm_ctx_t *mm, size_t maxsize); -/*! - * \brief Close persistent cache. - * \note This doesn't clear the data, just closes the connection to the database. - * \param cache database instance +/** + * Close persistent cache. + * @note This doesn't clear the data, just closes the connection to the database. + * @param cache database instance */ void kr_cache_close(namedb_t *cache); -/*! - * \brief Begin cache transaction (read-only or write). +/** + * Begin cache transaction (read-only or write). * - * \param cache database instance - * \param txn transaction instance to be initialized (output) - * \param flags transaction flags (see namedb.h in libknot) + * @param cache database instance + * @param txn transaction instance to be initialized (output) + * @param flags transaction flags (see namedb.h in libknot) * \return KNOT_E* */ int kr_cache_txn_begin(namedb_t *cache, namedb_txn_t *txn, unsigned flags); -/*! - * \brief Commit existing transaction. - * \param txn transaction instance +/** + * Commit existing transaction. + * @param txn transaction instance * \return KNOT_E* */ int kr_cache_txn_commit(namedb_txn_t *txn); -/*! - * \brief Abort existing transaction instance. - * \param txn transaction instance +/** + * Abort existing transaction instance. + * @param txn transaction instance */ void kr_cache_txn_abort(namedb_txn_t *txn); -/*! - * \brief Peek the cache for given RRSet (name, type, class) - * \note The 'drift' is the time passed between the cache time of the RRSet and now (in seconds). - * \param txn transaction instance - * \param rr query RRSet (its rdataset may be changed depending on the result) - * \param timestamp current time (will be replaced with drift if successful) +/** + * Peek the cache for given RRSet (name, type, class) + * @note The 'drift' is the time passed between the cache time of the RRSet and now (in seconds). + * @param txn transaction instance + * @param rr query RRSet (its rdataset may be changed depending on the result) + * @param timestamp current time (will be replaced with drift if successful) * \return KNOT_E* */ int kr_cache_peek(namedb_txn_t *txn, knot_rrset_t *rr, uint32_t *timestamp); -/*! - * \brief Clone read-only RRSet and adjust TTLs. - * \param src read-only RRSet (its rdataset may be changed depending on the result) - * \param drift time passed between cache time and now - * \param mm memory context +/** + * Clone read-only RRSet and adjust TTLs. + * @param src read-only RRSet (its rdataset may be changed depending on the result) + * @param drift time passed between cache time and now + * @param mm memory context * \return materialized (or empty) RRSet */ knot_rrset_t kr_cache_materialize(const knot_rrset_t *src, uint32_t drift, mm_ctx_t *mm); -/*! - * \brief Insert RRSet into cache, replacing any existing data. - * \param txn transaction instance - * \param rr inserted RRSet - * \param timestamp current time +/** + * Insert RRSet into cache, replacing any existing data. + * @param txn transaction instance + * @param rr inserted RRSet + * @param timestamp current time * \return KNOT_E* */ int kr_cache_insert(namedb_txn_t *txn, const knot_rrset_t *rr, uint32_t timestamp); -/*! - * \brief Remove RRSet from cache. - * \param txn transaction instance - * \param rr removed RRSet +/** + * Remove RRSet from cache. + * @param txn transaction instance + * @param rr removed RRSet * \return KNOT_E* */ int kr_cache_remove(namedb_txn_t *txn, const knot_rrset_t *rr); -/*! - * \brief Clear all items from the cache. - * \param txn transaction instance +/** + * Clear all items from the cache. + * @param txn transaction instance * \return KNOT_E* */ int kr_cache_clear(namedb_txn_t *txn); -/*! - * \brief Clear aged items from the database. - * \param txn transaction instance - * \param timestamp current time +/** + * Clear aged items from the database. + * @param txn transaction instance + * @param timestamp current time * \return KNOT_E* */ int kr_cache_prune(namedb_txn_t *txn, uint32_t timestamp); diff --git a/lib/context.h b/lib/context.h index 08d9209b67918bd8b449e7d43a2e00477a5b7846..e24b752dbe223463a57e623c887dd4b6fa3b00eb 100644 --- a/lib/context.h +++ b/lib/context.h @@ -22,12 +22,12 @@ #include "lib/module.h" #include "lib/cache.h" -/*! - * \brief Name resolution context. +/** + * Name resolution context. * * Resolution context provides basic services like cache, configuration and options. * - * \note This structure is persistent between name resolutions and may + * @note This structure is persistent between name resolutions and may * be shared between threads. */ struct kr_context @@ -40,25 +40,25 @@ struct kr_context uint32_t options; }; -/*! - * \brief Initialize query resolution context. - * \param ctx context to be initialized - * \param mm memory context +/** + * Initialize query resolution context. + * @param ctx context to be initialized + * @param mm memory context * \return KNOT_E* */ int kr_context_init(struct kr_context *ctx, mm_ctx_t *mm); -/*! - * \brief Deinitialize query resolution context. - * \param ctx context to be deinitialized +/** + * Deinitialize query resolution context. + * @param ctx context to be deinitialized * \return KNOT_E* */ int kr_context_deinit(struct kr_context *ctx); -/*! - * \brief Register module to context. - * \param ctx context - * \param module_name +/** + * Register module to context. + * @param ctx context + * @param module_name * \return KNOT_E* */ int kr_context_register(struct kr_context *ctx, const char *module_name); diff --git a/lib/layer.h b/lib/layer.h index e3fa7b7c0f7179157dcf84cad3a6acde1167286e..d7d7301489466a227f9edfc826f9f04762be6bce 100644 --- a/lib/layer.h +++ b/lib/layer.h @@ -22,10 +22,10 @@ #include "lib/context.h" #include "lib/rplan.h" -/*! - * \brief Processing module parameters. +/** + * Processing module parameters. * - * \note These parameters are passed to each processing layer. + * @note These parameters are passed to each processing layer. */ struct kr_layer_param { struct kr_context *ctx; @@ -33,7 +33,7 @@ struct kr_layer_param { knot_pkt_t *answer; }; -/*! \internal Print a debug message related to resolution. */ +/** \internal Print a debug message related to resolution. */ #ifndef NDEBUG #define QRDEBUG(query, cls, fmt, ...) do { \ unsigned _ind = 0; \ diff --git a/lib/layer/iterate.c b/lib/layer/iterate.c index ee16f3caa751c059d6d14ba1ea80a827dcad862f..2eb9962c441a8d911b7478ba89eb02c40bdce1ec 100644 --- a/lib/layer/iterate.c +++ b/lib/layer/iterate.c @@ -41,7 +41,7 @@ enum { /* Iterator often walks through packet section, this is an abstraction. */ typedef int (*rr_callback_t)(const knot_rrset_t *, unsigned, struct kr_layer_param *); -/*! \brief Return minimized QNAME/QTYPE for current zone cut. */ +/** Return minimized QNAME/QTYPE for current zone cut. */ static const knot_dname_t *minimized_qname(struct kr_query *query, uint16_t *qtype) { /* Minimization disabled. */ @@ -66,7 +66,7 @@ static const knot_dname_t *minimized_qname(struct kr_query *query, uint16_t *qty return qname; } -/*! \brief Answer is paired to query. */ +/** Answer is paired to query. */ static bool is_paired_to_query(const knot_pkt_t *answer, struct kr_query *query) { uint16_t qtype = query->stype; @@ -78,7 +78,7 @@ static bool is_paired_to_query(const knot_pkt_t *answer, struct kr_query *query) knot_dname_is_equal(qname, knot_pkt_qname(answer)); } -/*! \brief Relaxed rule for AA, either AA=1 or SOA matching zone cut is required. */ +/** Relaxed rule for AA, either AA=1 or SOA matching zone cut is required. */ static bool is_authoritative(const knot_pkt_t *answer, struct kr_query *query) { if (knot_wire_get_aa(answer->wire)) { @@ -96,7 +96,7 @@ static bool is_authoritative(const knot_pkt_t *answer, struct kr_query *query) return false; } -/*! \brief Return response class. */ +/** Return response class. */ static int response_classify(knot_pkt_t *pkt) { const knot_pktsection_t *an = knot_pkt_section(pkt, KNOT_ANSWER); @@ -333,7 +333,7 @@ static int process_answer(knot_pkt_t *pkt, struct kr_layer_param *param) return KNOT_STATE_DONE; } -/*! \brief Error handling, RFC1034 5.3.3, 4d. */ +/** Error handling, RFC1034 5.3.3, 4d. */ static int resolve_error(knot_pkt_t *pkt, struct kr_layer_param *param) { return KNOT_STATE_FAIL; @@ -399,7 +399,7 @@ static int prepare_query(knot_layer_t *ctx, knot_pkt_t *pkt) return KNOT_STATE_CONSUME; } -/*! \brief Resolve input query or continue resolution with followups. +/** Resolve input query or continue resolution with followups. * * This roughly corresponds to RFC1034, 5.3.3 4a-d. */ @@ -463,7 +463,7 @@ static int resolve(knot_layer_t *ctx, knot_pkt_t *pkt) return state; } -/*! \brief Module implementation. */ +/** Module implementation. */ const knot_layer_api_t *iterate_layer(void) { static const knot_layer_api_t _layer = { diff --git a/lib/layer/iterate.h b/lib/layer/iterate.h index 758f7d39ea3c7403f866fcfac26405c6de85be1c..67decc0174c92ca251b4211040e688fc513eed1b 100644 --- a/lib/layer/iterate.h +++ b/lib/layer/iterate.h @@ -21,14 +21,14 @@ /* Processing module implementation. */ extern const knot_layer_api_t *iterate_layer(void); -/*! - * \brief Result updates the query parent. - * \note Hint is an index of chosen RR in the set. +/** + * Result updates the query parent. + * @note Hint is an index of chosen RR in the set. */ int rr_update_parent(const knot_rrset_t *rr, unsigned hint, struct kr_layer_param *param); -/*! - * \brief Result updates the original query response. - * \note When \a hint is KNOT_PF_FREE, RR is treated as a copy and answer takes its ownership. +/** + * Result updates the original query response. + * @note When \a hint is KNOT_PF_FREE, RR is treated as a copy and answer takes its ownership. */ int rr_update_answer(const knot_rrset_t *rr, unsigned hint, struct kr_layer_param *param); diff --git a/lib/layer/itercache.c b/lib/layer/itercache.c index cb19343d05e87a8732ce2b9bbb1b864a59e0e7c9..91181c0c9ae541d869f6e6f862ceedae23083d82 100644 --- a/lib/layer/itercache.c +++ b/lib/layer/itercache.c @@ -118,7 +118,7 @@ static int read_cache(knot_layer_t *ctx, knot_pkt_t *pkt) return KNOT_STATE_CONSUME; } -/*! \brief Merge-in record if same type and owner. */ +/** Merge-in record if same type and owner. */ static int merge_cache_rr(knot_rrset_t *cache_rr, const knot_rrset_t *rr, mm_ctx_t *pool) { if (rr->type != cache_rr->type || !knot_dname_is_equal(rr->owner, cache_rr->owner)) { @@ -128,7 +128,7 @@ static int merge_cache_rr(knot_rrset_t *cache_rr, const knot_rrset_t *rr, mm_ctx return knot_rdataset_merge(&cache_rr->rrs, &rr->rrs, pool); } -/*! \brief Merge-in records from the same section. */ +/** Merge-in records from the same section. */ static int merge_in_section(knot_rrset_t *cache_rr, const knot_pktsection_t *section, unsigned from, mm_ctx_t *pool) { int ret = KNOT_EOK; @@ -145,7 +145,7 @@ static int merge_in_section(knot_rrset_t *cache_rr, const knot_pktsection_t *sec return ret; } -/*! \brief Cache direct answer. */ +/** Cache direct answer. */ static int write_cache_rr(const knot_pktsection_t *section, knot_rrset_t *rr, namedb_txn_t *txn, mm_ctx_t *pool, uint32_t timestamp) { /* Check if already cached. */ @@ -182,7 +182,7 @@ static int write_cache_rr(const knot_pktsection_t *section, knot_rrset_t *rr, na return ret; } -/*! \brief Cache direct answer. */ +/** Cache direct answer. */ static int write_cache_answer(knot_pkt_t *pkt, namedb_txn_t *txn, mm_ctx_t *pool, uint32_t timestamp) { knot_rrset_t cache_rr; @@ -192,7 +192,7 @@ static int write_cache_answer(knot_pkt_t *pkt, namedb_txn_t *txn, mm_ctx_t *pool return write_cache_rr(an, &cache_rr, txn, pool, timestamp); } -/*! \brief Cache stub nameservers. */ +/** Cache stub nameservers. */ static int write_cache_authority(knot_pkt_t *pkt, namedb_txn_t *txn, mm_ctx_t *pool, uint32_t timestamp) { knot_rrset_t glue_rr = { NULL, 0, 0 }; @@ -245,7 +245,7 @@ static int write_cache(knot_layer_t *ctx, knot_pkt_t *pkt) } /* Cache only positive answers. */ - /*! \todo Negative answers cache support */ + /** \todo Negative answers cache support */ if (knot_wire_get_rcode(pkt->wire) != KNOT_RCODE_NOERROR) { return ctx->state; } @@ -266,7 +266,7 @@ static int write_cache(knot_layer_t *ctx, knot_pkt_t *pkt) return ctx->state; } -/*! \brief Module implementation. */ +/** Module implementation. */ const knot_layer_api_t *itercache_layer(void) { static const knot_layer_api_t _layer = { diff --git a/lib/nsrep.h b/lib/nsrep.h index 3c1c566862965e9f49753cc5307ff06ece1f5a32..5b72f51119f21ba42553064474e5712ce865680e 100644 --- a/lib/nsrep.h +++ b/lib/nsrep.h @@ -23,9 +23,9 @@ enum kr_ns_score { KR_NS_VALID = 0 }; -/*! \brief Return name server score (KR_NS_VALID is baseline, the higher the better). - * \param ns evaluated NS name - * \param param layer parameters +/** Return name server score (KR_NS_VALID is baseline, the higher the better). + * @param ns evaluated NS name + * @param param layer parameters * \return enum kr_ns_score or higher positive value */ int kr_nsrep_score(const knot_dname_t *ns, struct kr_layer_param *param); \ No newline at end of file diff --git a/lib/resolve.c b/lib/resolve.c index fdbab518e0702c716eeef7e9fbd72684f8eb6e8e..7720018130e495ff6f62b16523828f625fbd8794 100755 --- a/lib/resolve.c +++ b/lib/resolve.c @@ -32,7 +32,7 @@ /* Defines */ #define ITER_LIMIT 50 -/*! \brief Invalidate current NS in cache. */ +/** Invalidate current NS in cache. */ static int invalidate_ns(struct kr_rplan *rplan, struct kr_query *qry) { namedb_txn_t *txn = kr_rplan_txn_acquire(rplan, 0); diff --git a/lib/resolve.h b/lib/resolve.h index 7829707b15a04b9b6f3162850cdc54be93bcf51a..11da659d1492bfcf665c4b1c8187dd72530e7ebf 100644 --- a/lib/resolve.h +++ b/lib/resolve.h @@ -19,14 +19,14 @@ #include <libknot/packet/pkt.h> #include "context.h" -/*! - * \brief Resolve an input query and produce a packet with an answer. - * \note The function doesn't change the packet question or message ID. - * \param ctx resolution context - * \param answer answer packet to be written - * \param qname resolved query name - * \param qclass resolved query class - * \param qtype resolved query type +/** + * Resolve an input query and produce a packet with an answer. + * @note The function doesn't change the packet question or message ID. + * @param ctx resolution context + * @param answer answer packet to be written + * @param qname resolved query name + * @param qclass resolved query class + * @param qtype resolved query type * \return KNOT_E* */ int kr_resolve(struct kr_context* ctx, knot_pkt_t *answer, diff --git a/lib/rplan.h b/lib/rplan.h index adceee5d1ccdb3d2fbfa7ffd4422c12e087486d9..cfa2f37a52c12ed6c5e80d275ecba31890e780a1 100644 --- a/lib/rplan.h +++ b/lib/rplan.h @@ -28,12 +28,12 @@ /* Query flags */ enum kr_query_flag { - QUERY_NO_MINIMIZE = 1 << 0, /*!< Don't minimize QNAME. */ - QUERY_TCP = 1 << 1 /*!< Use TCP for this query. */ + QUERY_NO_MINIMIZE = 1 << 0, /**< Don't minimize QNAME. */ + QUERY_TCP = 1 << 1 /**< Use TCP for this query. */ }; -/*! - * \brief Single query representation. +/** + * Single query representation. */ struct kr_query { node_t node; @@ -48,90 +48,90 @@ struct kr_query { uint16_t flags; }; -/*! - * \brief Query resolution plan structure. +/** + * Query resolution plan structure. * * The structure most importantly holds the original query, answer and the * list of pending queries required to resolve the original query. * It also keeps a notion of current zone cut. */ struct kr_rplan { - unsigned txn_flags; /*!< Current transaction flags. */ - namedb_txn_t txn; /*!< Current transaction (may be r/o). */ - list_t pending; /*!< List of pending queries. */ - list_t resolved; /*!< List of resolved queries. */ - struct kr_context *context; /*!< Parent resolution context. */ - mm_ctx_t *pool; /*!< Temporary memory pool. */ + unsigned txn_flags; /**< Current transaction flags. */ + namedb_txn_t txn; /**< Current transaction (may be r/o). */ + list_t pending; /**< List of pending queries. */ + list_t resolved; /**< List of resolved queries. */ + struct kr_context *context; /**< Parent resolution context. */ + mm_ctx_t *pool; /**< Temporary memory pool. */ }; -/*! - * \brief Initialize resolution plan (empty). - * \param rplan plan instance - * \param context resolution context - * \param pool ephemeral memory pool for whole resolution +/** + * Initialize resolution plan (empty). + * @param rplan plan instance + * @param context resolution context + * @param pool ephemeral memory pool for whole resolution */ int kr_rplan_init(struct kr_rplan *rplan, struct kr_context *context, mm_ctx_t *pool); -/*! - * \brief Deinitialize resolution plan, aborting any uncommited transactions. - * \param rplan plan instance +/** + * Deinitialize resolution plan, aborting any uncommited transactions. + * @param rplan plan instance */ void kr_rplan_deinit(struct kr_rplan *rplan); -/*! - * \brief Return true if the resolution plan is empty (i.e. finished or initialized) - * \param rplan plan instance +/** + * Return true if the resolution plan is empty (i.e. finished or initialized) + * @param rplan plan instance * \return true or false */ bool kr_rplan_empty(struct kr_rplan *rplan); -/*! - * \brief Acquire rplan transaction (read or write only). - * \note The transaction is shared during the whole resolution, read only transactions +/** + * Acquire rplan transaction (read or write only). + * @note The transaction is shared during the whole resolution, read only transactions * may be promoted to write-enabled transactions if requested, but never demoted. - * \param rplan plan instance - * \param flags transaction flags + * @param rplan plan instance + * @param flags transaction flags * \return transaction instance or NULL */ namedb_txn_t *kr_rplan_txn_acquire(struct kr_rplan *rplan, unsigned flags); -/*! - * \brief Commit any existing transaction, read-only transactions may be just aborted. - * \param rplan plan instance +/** + * Commit any existing transaction, read-only transactions may be just aborted. + * @param rplan plan instance * \return KNOT_E* */ int kr_rplan_txn_commit(struct kr_rplan *rplan); -/*! - * \brief Push a query to the top of the resolution plan. - * \note This means that this query takes precedence before all pending queries. - * \param rplan plan instance - * \param parent query parent (or NULL) - * \param name resolved name - * \param cls resolved class - * \param type resolved type +/** + * Push a query to the top of the resolution plan. + * @note This means that this query takes precedence before all pending queries. + * @param rplan plan instance + * @param parent query parent (or NULL) + * @param name resolved name + * @param cls resolved class + * @param type resolved type * \return query instance or NULL */ struct kr_query *kr_rplan_push(struct kr_rplan *rplan, struct kr_query *parent, const knot_dname_t *name, uint16_t cls, uint16_t type); -/*! - * \brief Pop existing query from the resolution plan. - * \note Popped queries are not discarded, but moved to the resolved list. - * \param rplan plan instance - * \param qry resolved query +/** + * Pop existing query from the resolution plan. + * @note Popped queries are not discarded, but moved to the resolved list. + * @param rplan plan instance + * @param qry resolved query * \return KNOT_E* */ int kr_rplan_pop(struct kr_rplan *rplan, struct kr_query *qry); -/*! - * \brief Currently resolved query (at the top). - * \param rplan plan instance +/** + * Currently resolved query (at the top). + * @param rplan plan instance * \return query instance or NULL if empty */ struct kr_query *kr_rplan_current(struct kr_rplan *rplan); -/*! - * \brief Return true if resolution chain satisfies given query. +/** + * Return true if resolution chain satisfies given query. */ bool kr_rplan_satisfies(struct kr_query *closure, const knot_dname_t *name, uint16_t cls, uint16_t type); diff --git a/lib/utils.h b/lib/utils.h index 1feaa1dc3267509f2cba9867b8f1c88a0b8f2d25..187e5424870786a9f41300748bc9eb246c8ac7ea 100644 --- a/lib/utils.h +++ b/lib/utils.h @@ -33,5 +33,5 @@ extern void _cleanup_fclose(FILE **p); */ #define ARRAY_SIZE(x) (sizeof(x)/sizeof(*(x))) -/*! \brief Concatenate N strings. */ +/** Concatenate N strings. */ char* kr_strcatdup(unsigned n, ...); diff --git a/lib/zonecut.c b/lib/zonecut.c index df1b76feec10e70ea0cdc2f5b3e6c17a83cfa75d..939c993c73a7e32d86b6f67a41ff32440807f19e 100644 --- a/lib/zonecut.c +++ b/lib/zonecut.c @@ -26,7 +26,7 @@ #include "lib/defines.h" #include "lib/layer.h" -/* \brief Root hint descriptor. */ +/* Root hint descriptor. */ struct hint_info { const knot_dname_t *name; const char *addr; @@ -102,7 +102,7 @@ int kr_set_zone_cut_addr(struct kr_zonecut *cut, const knot_rrset_t *rr, uint16_ return ret; } -/*! \brief Fetch address for zone cut. */ +/** Fetch address for zone cut. */ static int fetch_addr(struct kr_zonecut *cut, namedb_txn_t *txn, uint32_t timestamp) { /* Fetch nameserver address from cache. */ @@ -127,7 +127,7 @@ static int fetch_addr(struct kr_zonecut *cut, namedb_txn_t *txn, uint32_t timest return kr_set_zone_cut_addr(cut, &cached_rr, i); } -/*! \brief Fetch best NS for zone cut. */ +/** Fetch best NS for zone cut. */ static int fetch_ns(struct kr_zonecut *cut, const knot_dname_t *name, namedb_txn_t *txn, uint32_t timestamp) { uint32_t drift = timestamp; diff --git a/lib/zonecut.h b/lib/zonecut.h index 9284798a47de99191d3d307c0e13896fcb7658d8..0035da2104a0776cca86e76f95c47e70e78eadc1 100644 --- a/lib/zonecut.h +++ b/lib/zonecut.h @@ -23,48 +23,48 @@ struct kr_rplan; -/*! - * \brief Current zone cut representation. +/** + * Current zone cut representation. */ struct kr_zonecut { - knot_dname_t name[KNOT_DNAME_MAXLEN]; /*!< Current zone cut */ - knot_dname_t ns[KNOT_DNAME_MAXLEN]; /*!< Authoritative NS */ - struct sockaddr_storage addr; /*!< Authoritative NS address. */ + knot_dname_t name[KNOT_DNAME_MAXLEN]; /**< Current zone cut */ + knot_dname_t ns[KNOT_DNAME_MAXLEN]; /**< Authoritative NS */ + struct sockaddr_storage addr; /**< Authoritative NS address. */ }; -/*! - * \brief Initialize zone cut with SBELT. - * \param cut zone cut to be set - * \return KNOT_E* +/** + * Initialize zone cut with SBELT. + * @param cut zone cut to be set + * @return KNOT_E* */ int kr_init_zone_cut(struct kr_zonecut *cut); -/*! - * \brief Set zone cut to given name and name server. - * \note Name server address is blanked. - * \param cut zone cut to be set - * \param name zone cut name - * \param ns zone cut nameserver - * \return KNOT_E* +/** + * Set zone cut to given name and name server. + * @note Name server address is blanked. + * @param cut zone cut to be set + * @param name zone cut name + * @param ns zone cut nameserver + * @return KNOT_E* */ int kr_set_zone_cut(struct kr_zonecut *cut, const knot_dname_t *name, const knot_dname_t *ns); -/*! - * \brief Convert A/AAAA RRs to address with DNS port. - * \param cut zone cut to be set - * \param rr resource record - * \param i index of the set address in the rr - * \return KNOT_E* +/** + * Convert A/AAAA RRs to address with DNS port. + * @param cut zone cut to be set + * @param rr resource record + * @param i index of the set address in the rr + * @return KNOT_E* */ int kr_set_zone_cut_addr(struct kr_zonecut *cut, const knot_rrset_t *rr, uint16_t i); -/*! - * \brief Find the closest enclosing zone cut/nameserver from the cache. - * \param cut zone cut to be set - * \param name zone cut name - * \param txn cache transaction - * \param timestamp transaction timestamp - * \return KNOT_E* +/** + * Find the closest enclosing zone cut/nameserver from the cache. + * @param cut zone cut to be set + * @param name zone cut name + * @param txn cache transaction + * @param timestamp transaction timestamp + * @return KNOT_E* */ int kr_find_zone_cut(struct kr_zonecut *cut, const knot_dname_t *name, namedb_txn_t *txn, uint32_t timestamp); diff --git a/modules/hints/hints.c b/modules/hints/hints.c index 61c420ee95310b75d376b8a9caa38a1e61654382..fbcfd87ba795a2aa242b9a7413e77904c890523b 100644 --- a/modules/hints/hints.c +++ b/modules/hints/hints.c @@ -189,4 +189,4 @@ int hints_deinit(struct kr_module *module) return kr_ok(); } -KR_MODULE_EXPORT(hints) +KR_MODULE_EXPORT(hints); diff --git a/tests/mock_gomodule.c b/tests/mock_gomodule.c index 6d01ebf6f4c72139e4ffb432181b21909326512d..c77ea93a16285eaa45544bd42e3205a6d5eded28 100644 --- a/tests/mock_gomodule.c +++ b/tests/mock_gomodule.c @@ -28,7 +28,7 @@ void __go_init_main() {} * No module implementation. */ -/* \note Renamed to mimick Go module. */ +/* @note Renamed to mimick Go module. */ #if defined(__APPLE__) extern uint32_t Api(void) __asm__ ("_main.Api"); /* Mach-O */ #elif _WIN32 diff --git a/tests/test.h b/tests/test.h index 6e165381c9c2edfe98063d9e741d161d73192e33..d3cb3349962302608dff5fac373202d37b822a7d 100644 --- a/tests/test.h +++ b/tests/test.h @@ -38,14 +38,14 @@ static inline void *mm_test_malloc(void *ctx, size_t n) static inline void mm_test_free(void *p) { return test_free(p); } -/*! \brief Memory context using CMocka allocator. */ +/** Memory context using CMocka allocator. */ static inline void test_mm_ctx_init(mm_ctx_t *mm) { mm->alloc = &mm_test_malloc; mm->free = &mm_test_free; } -/*! \brief Recursively delete directory. */ +/** Recursively delete directory. */ static inline int test_tmpdir_remove(const char *path) { char buf[512]; @@ -66,7 +66,7 @@ static inline int test_tmpdir_remove(const char *path) return 0; } -/*! \brief Create temporary directory. */ +/** Create temporary directory. */ static inline const char* test_tmpdir_create(void) { static char env_path[64]; @@ -74,7 +74,7 @@ static inline const char* test_tmpdir_create(void) return mkdtemp(env_path); } -/*! \brief Generate random string with given length. */ +/** Generate random string with given length. */ static inline void test_randstr(char* dst, size_t len) { if (len == 0) { @@ -88,8 +88,8 @@ static inline void test_randstr(char* dst, size_t len) return; } -/*! \brief Init RRSet with type TXT, random owner and random payload. - * \note Static memory reused, copy it if you need persistence. +/** Init RRSet with type TXT, random owner and random payload. + * @note Static memory reused, copy it if you need persistence. */ static inline void test_random_rr(knot_rrset_t *rr, uint32_t ttl) {