worker.h (249140) | worker.h (255579) |
---|---|
1/* 2 * daemon/worker.h - worker that handles a pending list of requests. 3 * 4 * Copyright (c) 2007, NLnet Labs. All rights reserved. 5 * 6 * This software is open source. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 144 unchanged lines hidden (view full) --- 153/** 154 * Send a command to a worker. Uses blocking writes. 155 * @param worker: worker to send command to. 156 * @param cmd: command to send. 157 */ 158void worker_send_cmd(struct worker* worker, enum worker_commands cmd); 159 160/** | 1/* 2 * daemon/worker.h - worker that handles a pending list of requests. 3 * 4 * Copyright (c) 2007, NLnet Labs. All rights reserved. 5 * 6 * This software is open source. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 144 unchanged lines hidden (view full) --- 153/** 154 * Send a command to a worker. Uses blocking writes. 155 * @param worker: worker to send command to. 156 * @param cmd: command to send. 157 */ 158void worker_send_cmd(struct worker* worker, enum worker_commands cmd); 159 160/** |
161 * Worker signal handler function. User argument is the worker itself. 162 * @param sig: signal number. 163 * @param arg: the worker (main worker) that handles signals. 164 */ 165void worker_sighandler(int sig, void* arg); 166 167/** 168 * Worker service routine to send serviced queries to authoritative servers. 169 * @param qname: query name. (host order) 170 * @param qnamelen: length in bytes of qname, including trailing 0. 171 * @param qtype: query type. (host order) 172 * @param qclass: query class. (host order) 173 * @param flags: host order flags word, with opcode and CD bit. 174 * @param dnssec: if set, EDNS record will have DO bit set. 175 * @param want_dnssec: signatures needed. 176 * @param addr: where to. 177 * @param addrlen: length of addr. 178 * @param zone: wireformat dname of the zone. 179 * @param zonelen: length of zone name. 180 * @param q: wich query state to reactivate upon return. 181 * @return: false on failure (memory or socket related). no query was 182 * sent. 183 */ 184struct outbound_entry* worker_send_query(uint8_t* qname, size_t qnamelen, 185 uint16_t qtype, uint16_t qclass, uint16_t flags, int dnssec, 186 int want_dnssec, struct sockaddr_storage* addr, socklen_t addrlen, 187 uint8_t* zone, size_t zonelen, struct module_qstate* q); 188 189/** 190 * process control messages from the main thread. Frees the control 191 * command message. 192 * @param tube: tube control message came on. 193 * @param msg: message contents. Is freed. 194 * @param len: length of message. 195 * @param error: if error (NETEVENT_*) happened. 196 * @param arg: user argument 197 */ 198void worker_handle_control_cmd(struct tube* tube, uint8_t* msg, size_t len, 199 int error, void* arg); 200 201/** handles callbacks from listening event interface */ 202int worker_handle_request(struct comm_point* c, void* arg, int error, 203 struct comm_reply* repinfo); 204 205/** process incoming replies from the network */ 206int worker_handle_reply(struct comm_point* c, void* arg, int error, 207 struct comm_reply* reply_info); 208 209/** process incoming serviced query replies from the network */ 210int worker_handle_service_reply(struct comm_point* c, void* arg, int error, 211 struct comm_reply* reply_info); 212 213/** cleanup the cache to remove all rrset IDs from it, arg is worker */ 214void worker_alloc_cleanup(void* arg); 215 216/** | |
217 * Init worker stats - includes server_stats_init, outside network and mesh. 218 * @param worker: the worker to init 219 */ 220void worker_stats_clear(struct worker* worker); 221 | 161 * Init worker stats - includes server_stats_init, outside network and mesh. 162 * @param worker: the worker to init 163 */ 164void worker_stats_clear(struct worker* worker); 165 |
222/** statistics timer callback handler */ 223void worker_stat_timer_cb(void* arg); 224 225/** probe timer callback handler */ 226void worker_probe_timer_cb(void* arg); 227 228/** start accept callback handler */ 229void worker_start_accept(void* arg); 230 231/** stop accept callback handler */ 232void worker_stop_accept(void* arg); 233 | |
234#endif /* DAEMON_WORKER_H */ | 166#endif /* DAEMON_WORKER_H */ |