static int sig_record_reload = 0;
/** used when no other sighandling happens, so we don't die
- * when multiple signals in quick succession are sent to us. */
+ * when multiple signals in quick succession are sent to us.
+ * @param sig: signal number.
+ * @return signal handler return type (void or int).
+ */
static RETSIGTYPE record_sigh(int sig)
{
#ifdef LIBEVENT_SIGNAL_PROBLEM
checkrlimits(cfg);
}
-/** Read existing pid from pidfile. */
+/** Read existing pid from pidfile.
+ * @param file: file name of pid file.
+ * @return: the pid from the file or -1 if none.
+ */
static pid_t
readpid (const char* file)
{
return pid;
}
-/** write pid to file. */
+/** write pid to file.
+ * @param pidfile: file name of pid file.
+ * @param pid: pid to write to file.
+ */
static void
writepid (const char* pidfile, pid_t pid)
{
return 0;
}
-/** process control messages from the main thread. */
+/** process control messages from the main thread.
+ * @param c: comm point to read from.
+ * @param arg: worker.
+ * @param error: error status of comm point.
+ * @param reply_info: not used.
+ */
static int
worker_handle_control_cmd(struct comm_point* c, void* arg, int error,
struct comm_reply* ATTR_UNUSED(reply_info))
- synthesize CNAME and DNAME responses from the cache.
- Updated doxygen config for doxygen 1.5.
- aclocal newer version.
+ - doxygen 1.5 fixes for comments (for the strict check on docs).
11 June 2007: Wouter
- replies on TCP queries have the address field set in replyinfo,
#include "util/net_help.h"
#include "util/region-allocator.h"
-/** store rrsets in the rrset cache. */
+/** store rrsets in the rrset cache.
+ * @param env: module environment with caches.
+ * @param rep: contains list of rrsets to store.
+ * @param now: current time(NULL).
+ */
static void
store_rrsets(struct module_env* env, struct reply_info* rep, uint32_t now)
{
/** number of retries on outgoing UDP queries */
#define OUTBOUND_UDP_RETRY 4
-/** callback for serviced query UDP answers. */
+/** callback for serviced query UDP answers */
static int serviced_udp_callback(struct comm_point* c, void* arg, int error,
struct comm_reply* rep);
/** initiate TCP transaction for serviced query */
return 1;
}
-/** see if buffers can be used to service TCP queries. */
+/** see if buffers can be used to service TCP queries */
static void
use_free_buffer(struct outside_network* outnet)
{
return 0;
}
-/** callback for incoming udp answers from the network. */
+/** callback for incoming udp answers from the network */
static int
outnet_udp_cb(struct comm_point* c, void* arg, int error,
struct comm_reply *reply_info)
return done;
}
-/** calculate number of ip4 and ip6 interfaces, times multiplier. */
+/** calculate number of ip4 and ip6 interfaces, times multiplier */
static void
calc_num46(char** ifs, int num_ifs, int do_ip4, int do_ip6,
size_t multiplier, size_t* num_ip4, size_t* num_ip6)
return w;
}
-/** create query for serviced queries. */
+/** create query for serviced queries */
static void
serviced_gen_query(ldns_buffer* buff, uint8_t* qname, size_t qnamelen,
uint16_t qtype, uint16_t qclass, uint16_t flags)
}
}
-/** Copy protected memory region. */
+/** Copy protected memory region */
static void
prot_store(struct checked_lock* lock)
{
}
}
-/** write lock trace info to file, while you hold those locks. */
+/** write lock trace info to file, while you hold those locks */
static void
ordercheck_locklock(struct thr_check* thr, struct checked_lock* lock)
{
log_err("fwrite: %s", strerror(errno));
}
-/** write ordercheck lock creation details to file. */
+/** write ordercheck lock creation details to file */
static void
ordercheck_lockcreate(struct thr_check* thr, struct checked_lock* lock)
{
free(e);
}
-/** finish acquiring lock, shared between _(rd|wr||)lock() routines. */
+/** finish acquiring lock, shared between _(rd|wr||)lock() routines */
static void
finish_acquire_lock(struct thr_check* thr, struct checked_lock* lock,
const char* func, const char* file, int line)
}
}
-/** open order info debug file, thr->num must be valid. */
+/** open order info debug file, thr->num must be valid */
static void
open_lockorder(struct thr_check* thr)
{
log_err("fwrite: %s", strerror(errno));
}
-/** checklock thread main, Inits thread structure. */
+/** checklock thread main, Inits thread structure */
static void* checklock_main(void* arg)
{
struct thr_check* thr = (struct thr_check*)arg;
}
}
-/** signal handler for join timeout, Exits. */
+/** signal handler for join timeout, Exits */
static RETSIGTYPE joinalarm(int ATTR_UNUSED(sig))
{
log_err("join thread timeout. hangup or deadlock. Info follows.");
fatal_exit("join thread timeout. hangup or deadlock.");
}
-/** wait for thread with a timeout. */
+/** wait for thread with a timeout */
void
checklock_thrjoin(pthread_t thread)
{
saved_scenario = NULL;
}
-/** helper function that logs a ldns_pkt packet to logfile. */
+/** helper function that logs a ldns_pkt packet to logfile */
static void
log_pkt(const char* desc, ldns_pkt* pkt)
{
/** string to show in warnings and errors */
static const char* prog_name = "ldns-testpkts";
-/** logging routine, provided by caller. */
+/** logging routine, provided by caller */
void verbose(int lvl, const char* msg, ...);
/** print error and exit */
}
}
-/** Detect cycle by comparing visited now with all (unvisited) bigger nodes. */
+/** Detect cycle by comparing visited now with all (unvisited) bigger nodes */
static int detect_cycle(struct lock_ref* visit, struct lock_ref* from)
{
struct lock_ref* p = from;
hex_to_buf(pkt, buf);
}
-/** analyze domain name in packet, possibly compressed. */
+/** analyze domain name in packet, possibly compressed */
void analyze_dname(ldns_buffer* pkt)
{
size_t oldpos = ldns_buffer_position(pkt);
ldns_buffer_skip(pkt, (ssize_t)rdlen);
}
-/** analyze rr in packet. */
+/** analyze rr in packet */
void analyze_rr(ldns_buffer* pkt, int q)
{
uint16_t type, dclass, len;
return mom;
}
-/** makes scenario with title on rest of line. */
+/** makes scenario with title on rest of line */
static struct replay_scenario*
make_scenario(char* line)
{
}
}
-/** pretty print commandline for unbound in this test. */
+/** pretty print commandline for unbound in this test */
static void
echo_cmdline(int argc, char* argv[])
{
static void test_deldata(void*, void*);
/* --- end test representation --- */
-/** hash func, very bad to improve collisions. */
+/** hash func, very bad to improve collisions */
static hashvalue_t myhash(int id) {return (hashvalue_t)id & 0x0f;}
-/** allocate new key, fill in hash. */
+/** allocate new key, fill in hash */
static struct testkey* newkey(int id) {
struct testkey* k = (struct testkey*)calloc(1, sizeof(struct testkey));
if(!k) fatal_exit("out of memory");
return NULL;
}
-/** test hash table access by multiple threads. */
+/** test hash table access by multiple threads */
static void
test_threaded_table(struct lruhash* table)
{
return 0;
}
-/** check if unbound formerr equals ldns formerr. */
+/** check if unbound formerr equals ldns formerr */
static void
checkformerr(ldns_buffer* pkt)
{
region_destroy(region);
}
-/** simple test of parsing. */
+/** simple test of parsing */
static void
simpletest(ldns_buffer* pkt, struct alloc_cache* alloc, ldns_buffer* out)
{
" 64 b9 00 04 c0 3a 80 1e ");
}
-/** simple test of parsing, pcat file. */
+/** simple test of parsing, pcat file */
static void
testfromfile(ldns_buffer* pkt, struct alloc_cache* alloc, ldns_buffer* out,
const char* fname)
fclose(in);
}
-/** simple test of parsing, drill file. */
+/** simple test of parsing, drill file */
static void
testfromdrillfile(ldns_buffer* pkt, struct alloc_cache* alloc,
ldns_buffer* out, const char* fname)
static void test_deldata(void*, void*);
/* --- end test representation --- */
-/** hash func, very bad to improve collisions, both high and low bits. */
+/** hash func, very bad to improve collisions, both high and low bits */
static hashvalue_t myhash(int id) {
hashvalue_t h = (hashvalue_t)id & 0x0f;
h |= (h << 28);
return h;
}
-/** allocate new key, fill in hash. */
+/** allocate new key, fill in hash */
static struct slabtestkey* newkey(int id) {
struct slabtestkey* k = (struct slabtestkey*)calloc(1, sizeof(struct slabtestkey));
if(!k) fatal_exit("out of memory");
return NULL;
}
-/** test hash table access by multiple threads. */
+/** test hash table access by multiple threads */
static void
test_threaded_table(struct slabhash* table)
{
return NULL;
}
-/** initialize the global cfg_parser object. */
+/** initialize the global cfg_parser object */
static void
create_cfg_parser(struct config_file* cfg, char* filename)
{
/** global config parser object used during config parsing */
extern struct config_parser_state* cfg_parser;
-/** parsing helpers: print error with file and line numbers. */
+/** parsing helpers: print error with file and line numbers */
void ub_c_error(const char* msg);
-/** parsing helpers: print error with file and line numbers. */
+/** parsing helpers: print error with file and line numbers */
void ub_c_error_msg(const char* fmt, ...) ATTR_FORMAT(printf, 1, 2);
#endif /* UTIL_CONFIG_FILE_H */
#include "util/log.h"
#include "util/storage/lookup3.h"
-/** determine length of a dname in buffer, no compression pointers allowed. */
+/** determine length of a dname in buffer, no compression pointers allowed */
size_t
query_dname_len(ldns_buffer* query)
{
#include "util/storage/lookup3.h"
#include "util/region-allocator.h"
-/** smart comparison of (compressed, valid) dnames from packet. */
+/** smart comparison of (compressed, valid) dnames from packet */
static int
smart_compare(ldns_buffer* pkt, uint8_t* dnow,
uint8_t* dprfirst, uint8_t* dprlast)
return p;
}
-/** See if next rrset is nsec at zone apex. */
+/** See if next rrset is nsec at zone apex */
static int
nsec_at_apex(ldns_buffer* pkt)
{
return h;
}
-/** compare rrset_parse with data. */
+/** compare rrset_parse with data */
static int
rrset_parse_equals(struct rrset_parse* p, ldns_buffer* pkt, hashvalue_t h,
uint32_t rrset_flags, uint8_t* dname, size_t dnamelen,
#include "util/data/msgparse.h"
#include "util/data/msgencode.h"
-/** allocate qinfo, return 0 on error. */
+/** allocate qinfo, return 0 on error */
static int
parse_create_qinfo(ldns_buffer* pkt, struct msg_parse* msg,
struct query_info* qinf, struct region* region)
return rep;
}
-/** allocate replyinfo, return 0 on error. */
+/** allocate replyinfo, return 0 on error */
static int
parse_create_repinfo(struct msg_parse* msg, struct reply_info** rep,
struct region* region)
return 1;
}
-/** allocate (special) rrset keys, return 0 on error. */
+/** allocate (special) rrset keys, return 0 on error */
static int
repinfo_alloc_rrset_keys(struct reply_info* rep, struct alloc_cache* alloc,
struct region* region)
*/
int query_info_compare(void* m1, void* m2);
-/** clear out query info structure. */
+/** clear out query info structure */
void query_info_clear(struct query_info* m);
/** calculate size of struct query_info + reply_info */
/** delete reply_info data structure */
void reply_info_delete(void* d, void* arg);
-/** calculate hash value of query_info, lowercases the qname. */
+/** calculate hash value of query_info, lowercases the qname */
hashvalue_t query_info_hash(struct query_info *q);
/**
#endif /* HAVE_PTHREAD */
}
-/** unblock one signal, so we can catch it. */
+/** unblock one signal, so we can catch it */
void ub_thread_sig_unblock(int sig)
{
int err;
#include "util/data/dname.h"
#include <fcntl.h>
-/** returns true is string addr is an ip6 specced address. */
+/** returns true is string addr is an ip6 specced address */
int
str_is_ip6(const char* str)
{
*/
static void comm_signal_callback(int fd, short event, void* arg);
-/** libevent callback for AF_UNIX fds. */
+/** libevent callback for AF_UNIX fds */
static void comm_point_local_handle_callback(int fd, short event, void* arg);
/** create a tcp handler with a parent */
}
}
-/** Use a new tcp handler for new query fd, set to read query. */
+/** Use a new tcp handler for new query fd, set to read query */
static void
setup_tcp_handler(struct comm_point* c, int fd)
{
setup_tcp_handler(c_hdl, new_fd);
}
-/** Make tcp handler free for next assignment. */
+/** Make tcp handler free for next assignment */
static void
reclaim_tcp_handler(struct comm_point* c)
{
BLACK /* Color. */
};
-/** rotate subtree left (to preserve redblack property). */
+/** rotate subtree left (to preserve redblack property) */
static void rbtree_rotate_left(rbtree_t *rbtree, rbnode_t *node);
-/** rotate subtree right (to preserve redblack property). */
+/** rotate subtree right (to preserve redblack property) */
static void rbtree_rotate_right(rbtree_t *rbtree, rbnode_t *node);
/** Fixup node colours when insert happened */
static void rbtree_insert_fixup(rbtree_t *rbtree, rbnode_t *node);
rbnode_t* t = *x; *x = *y; *y = t;
}
-/** Update parent pointers of child trees of 'parent'. */
+/** Update parent pointers of child trees of 'parent' */
static void change_parent_ptr(rbtree_t* rbtree, rbnode_t* parent, rbnode_t* old, rbnode_t* new)
{
if(parent == RBTREE_NULL)
if(parent->left == old) parent->left = new;
if(parent->right == old) parent->right = new;
}
-/** Update parent pointer of a node 'child'. */
+/** Update parent pointer of a node 'child' */
static void change_child_ptr(rbnode_t* child, rbnode_t* old, rbnode_t* new)
{
if(child == RBTREE_NULL) return;
return node;
}
-/** recursive descent traverse. */
+/** recursive descent traverse */
static void
traverse_post(void (*func)(rbnode_t*, void*), void* arg, rbnode_t* node)
{
void region_recycle(region_type *region, void *block, size_t size);
/**
- * Print some REGION statistics to OUT.
+ * Print some REGION statistics to OUT
*/
void region_dump_stats(region_type *region, FILE *out);
/** get size of recyclebin */
size_t region_get_recycle_size(region_type* region);
-/** Debug print REGION statistics to LOG. */
+/** Debug print REGION statistics to LOG */
void region_log_stats(region_type *region);
#endif /* _REGION_ALLOCATOR_H_ */
*/
void lruhash_remove(struct lruhash* table, hashvalue_t hash, void* key);
-/** init the hash bins for the table. */
+/** init the hash bins for the table */
void bin_init(struct lruhash_bin* array, size_t size);
/** delete the hash bin and entries inside it */