#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <pcap.h>
#include <signal.h>
#include <pthread.h>
#include "rpcapd.h"
#include "fileconf.h"
#include "pcap-remote.h"
#include "daemon.h"
#include "utils.h"
#include "sockutils.h"
#include "win32-svc.h"
Go to the source code of this file.
Functions | |
void | main_passive (void *ptr) |
'true' main of the program. | |
void | main_active (void *ptr) |
'true' main of the program in case the active mode is turned on. | |
void | printusage () |
Prints the usage screen if it is launched in console mode. | |
int | main (int argc, char *argv[], char *envp[]) |
Program main. | |
void | main_startup (void) |
void | main_cleanup (int sign) |
Variables | |
char | hostlist [MAX_HOST_LIST+1] |
Keeps the list of the hosts that are allowed to connect to this server. | |
active_pars | activelist [MAX_ACTIVE_LIST] |
Keeps the list of the hosts (host, port) on which I want to connect to (active mode). | |
int | nullAuthAllowed |
'1' if we permit NULL authentication, '0' otherwise | |
SOCKET | sockmain |
keeps the main socket identifier | |
char | loadfile [MAX_LINE+1] |
Name of the file from which we have to load the configuration. | |
int | passivemode = 1 |
'1' if we want to run in passive mode as well | |
addrinfo | mainhints |
temporary struct to keep settings needed to open the new socket | |
char | address [MAX_LINE+1] |
keeps the network address (either numeric or literal) to bind to | |
char | port [MAX_LINE+1] |
keeps the network port to bind to | |
char * | optarg |
|
Program main.
Definition at line 119 of file rpcapd.c. References errbuf, fileconf_read(), fileconf_save(), getopt(), hostlist, loadfile, main_startup(), mainhints, MAX_ACTIVE_LIST, MAX_LINE, nullAuthAllowed, passivemode, PCAP_ERRBUF_SIZE, printusage(), snprintf, SOCK_ASSERT, sock_init(), and svc_start(). |
|
'true' main of the program in case the active mode is turned on. It does not have any return value nor parameters. This function loops forever trying to connect to the remote host, until the daemon is turned down.
Definition at line 604 of file rpcapd.c. References daemon_slpars::activeclose, daemon_serviceloop(), errbuf, daemon_slpars::isactive, nullAuthAllowed, daemon_slpars::nullAuthAllowed, PCAP_ERRBUF_SIZE, pcap_strerror(), pthread_suspend(), snprintf, SOCK_ASSERT, sock_initaddress(), sock_open(), daemon_slpars::sockctrl, and SOCKET. Referenced by main_startup(). |
|
Definition at line 413 of file rpcapd.c. References SOCK_ASSERT, and sock_cleanup(). |
|
'true' main of the program. It must be in a separate function because:
Definition at line 483 of file rpcapd.c. References daemon_slpars::activeclose, daemon_serviceloop(), errbuf, fakeerrbuf, daemon_slpars::isactive, nullAuthAllowed, daemon_slpars::nullAuthAllowed, PCAP_ERRBUF_SIZE, pcap_strerror(), rpcap_senderror(), snprintf, SOCK_ASSERT, sock_check_hostlist(), sock_close(), sock_geterror(), daemon_slpars::sockctrl, SOCKET, and sockmain. Referenced by main_startup(). |
|
Definition at line 302 of file rpcapd.c. References activelist, active_pars::address, active_pars::ai_family, errbuf, main_active(), main_passive(), mainhints, MAX_ACTIVE_LIST, PCAP_ERRBUF_SIZE, pthread_suspend(), SOCK_ASSERT, sock_initaddress(), sock_open(), and sockmain. Referenced by main(), and svc_main(). |
|
Prints the usage screen if it is launched in console mode.
Definition at line 86 of file rpcapd.c. References PROGRAM_NAME, and RPCAP_DEFAULT_NETPORT. Referenced by main(). |
|
Keeps the list of the hosts (host, port) on which I want to connect to (active mode).
Definition at line 60 of file rpcapd.c. Referenced by fileconf_read(), fileconf_save(), and main_startup(). |
|
keeps the network address (either numeric or literal) to bind to
Definition at line 66 of file rpcapd.c. Referenced by daemon_findalldevs(), fileconf_read(), and sock_getascii_addrport(). |
|
Keeps the list of the hosts that are allowed to connect to this server.
Definition at line 59 of file rpcapd.c. Referenced by fileconf_read(), main(), pcap_remoteact_list(), and sock_check_hostlist(). |
|
Name of the file from which we have to load the configuration.
Definition at line 63 of file rpcapd.c. Referenced by main(). |
|
temporary struct to keep settings needed to open the new socket
Definition at line 65 of file rpcapd.c. Referenced by main(), and main_startup(). |
|
'1' if we permit NULL authentication, '0' otherwise
Definition at line 61 of file rpcapd.c. Referenced by daemon_checkauth(), fileconf_read(), main(), main_active(), and main_passive(). |
|
|
|
'1' if we want to run in passive mode as well
Definition at line 64 of file rpcapd.c. Referenced by main(). |
|
keeps the network port to bind to
Definition at line 67 of file rpcapd.c. Referenced by fileconf_read(), pcap_findalldevs_ex(), pcap_open(), pcap_open_live(), pcap_parsesrcstr(), pcap_remoteact_accept(), and sock_getascii_addrport(). |
|
keeps the main socket identifier
|
documentation. Copyright (c) 2002-2003 Politecnico di Torino. All rights reserved.