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 97 of file daemon.c.

References daemon_checkauth(), daemon_endcapture(), daemon_findalldevs(), daemon_getstats(), daemon_getstatsnopcap(), daemon_opensource(), daemon_setsampling(), daemon_startcapture(), daemon_updatefilter(), PCAP_BUF_SIZE, pcap_close(), PCAP_ERR_AUTH, PCAP_ERR_ENDCAPTURE, PCAP_ERR_INITTIMEOUT, PCAP_ERR_NETW, PCAP_ERR_RUNTIMETIMEOUT, PCAP_ERR_UPDATEFILTER, PCAP_ERR_WRONGMSG, PCAP_ERR_WRONGVER, 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_SUSPEND_WRONGAUTH, RPCAP_TIMEOUT_INIT, RPCAP_TIMEOUT_RUNTIME, SOCK_ASSERT, sock_close(), sock_discard(), sock_geterror(), SOCK_RECEIVEALL_YES, and sock_recv().

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 1573 of file daemon.c.

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


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