Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

daemon.h File Reference

Go to the source code of this file.

Data Structures

struct  daemon_slpars
 Structure that keeps the parameters needed by the daemon_serviceloop() function. More...


Functions

void daemon_serviceloop (void *ptr)
 Main serving funtion This function is the one which does the job. It is the main() of the child thread, which is created as soon as a new connection is accepted.

void pthread_suspend (int msec)
 Suspends a pthread for msec milliseconds.


Function Documentation

void daemon_serviceloop void *    ptr
 

Main serving funtion This function is the one which does the job. It is the main() of the child thread, which is created as soon as a new connection is accepted.

Parameters:
ptr: a void pointer that keeps the reference of the 'pthread_chain' value corrisponding to this thread. This variable is casted into a 'pthread_chain' value in order to retrieve the socket we're currently using, the therad ID, and some pointers to the previous and next elements into this struct.
Returns:
None.

Definition at line 109 of file daemon.c.

References daemon_slpars::activeclose, daemon_checkauth(), daemon_endcapture(), daemon_findalldevs(), daemon_getstats(), daemon_getstatsnopcap(), daemon_opensource(), daemon_setsampling(), daemon_startcapture(), daemon_updatefilter(), errbuf, daemon_slpars::isactive, daemon_slpars::nullAuthAllowed, PCAP_BUF_SIZE, pcap_close(), PCAP_ERRBUF_SIZE, pcap_stats(), pcap_t, pcap_stat::ps_drop, pcap_stat::ps_ifdrop, pcap_stat::ps_recv, pthread_suspend(), rpcap_checkmsg(), RPCAP_MSG_CLOSE, RPCAP_MSG_ENDCAP_REQ, RPCAP_MSG_ERROR, RPCAP_MSG_FINDALLIF_REQ, RPCAP_MSG_OPEN_REQ, RPCAP_MSG_SETSAMPLING_REQ, RPCAP_MSG_STARTCAP_REQ, RPCAP_MSG_STATS_REQ, RPCAP_MSG_UPDATEFILTER_REQ, rpcap_senderror(), RPCAP_TIMEOUT_INIT, RPCAP_TIMEOUT_RUNTIME, SOCK_ASSERT, sock_close(), sock_discard(), sock_geterror(), sock_recv(), and daemon_slpars::sockctrl.

Referenced by main_active(), and main_passive().

void pthread_suspend int    msec
 

Suspends a pthread for msec milliseconds.

This function is provided since pthreads do not have a suspend() call.

Definition at line 1597 of file daemon.c.

Referenced by daemon_serviceloop(), main_active(), and main_startup().


documentation. Copyright (c) 2002-2003 Politecnico di Torino. All rights reserved.