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

pcap-new.c File Reference

#include <pcap-int.h>
#include <pcap-remote.h>
#include <sockutils.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Defines

#define PCAP_TEXT_SOURCE_FILE   "File"
 String identifier to be used in the pcap_findalldevs_ex().

#define PCAP_TEXT_SOURCE_ADAPTER   "Network adapter"
 String identifier to be used in the pcap_findalldevs_ex().

#define PCAP_TEXT_SOURCE_ON_LOCAL_HOST   "on local host"
 String identifier to be used in the pcap_findalldevs_ex().

#define PCAP_TEXT_SOURCE_ON_REMOTE_HOST   "on remote node"
 String identifier to be used in the pcap_findalldevs_ex().

#define ENDING_CHAR   '\\'

Functions

int pcap_findalldevs_ex (char *source, struct pcap_rmtauth *auth, pcap_if_t **alldevs, char *errbuf)
 It creates a list of network devices that can be opened with pcap_open().

int pcap_createsrcstr (char *source, int type, const char *host, const char *port, const char *name, char *errbuf)
 Accepts a set of strings (host name, port, ...), and it returns the complete source string according to the new format (e.g. 'rpcap://1.2.3.4/eth0').

int pcap_parsesrcstr (const char *source, int *type, char *host, char *port, char *name, char *errbuf)
 Parses the source string and returns the pieces in which the source can be split.

pcap_tpcap_open (const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *errbuf)
 It opens a generic source in order to capture / send (WinPcap only) traffic.

pcap_samppcap_setsampling (pcap_t *p)
 It defines a sampling method for packet capture.

SOCKET pcap_remoteact_accept (const char *address, const char *port, const char *hostlist, char *connectinghost, struct pcap_rmtauth *auth, char *errbuf)
 It blocks until a network connection is accepted (active mode only).

int pcap_remoteact_close (const char *host, char *errbuf)
 It drops an active connection (active mode only).

void pcap_remoteact_cleanup ()
 Cleans the socket that is currently used in waiting active connections.

int pcap_remoteact_list (char *hostlist, char sep, int size, char *errbuf)
 Returns the hostname of the host that have an active connection with us (active mode only).


Variables

activehostsactiveHosts
 Keeps a list of all the opened connections in the active mode.

SOCKET sockmain
 Keeps the main socket identifier when we want to accept a new remote connection (active mode only).


Define Documentation

#define ENDING_CHAR   '\\'
 

Referenced by pcap_findalldevs_ex().

#define PCAP_TEXT_SOURCE_ADAPTER   "Network adapter"
 

String identifier to be used in the pcap_findalldevs_ex().

Definition at line 61 of file pcap-new.c.

Referenced by pcap_findalldevs_ex().

#define PCAP_TEXT_SOURCE_FILE   "File"
 

String identifier to be used in the pcap_findalldevs_ex().

Definition at line 59 of file pcap-new.c.

Referenced by pcap_findalldevs_ex().

#define PCAP_TEXT_SOURCE_ON_LOCAL_HOST   "on local host"
 

String identifier to be used in the pcap_findalldevs_ex().

Definition at line 64 of file pcap-new.c.

Referenced by pcap_findalldevs_ex().

#define PCAP_TEXT_SOURCE_ON_REMOTE_HOST   "on remote node"
 

String identifier to be used in the pcap_findalldevs_ex().

Definition at line 66 of file pcap-new.c.

Referenced by pcap_findalldevs_ex().


Variable Documentation

struct activehosts* activeHosts
 

Keeps a list of all the opened connections in the active mode.

Definition at line 47 of file pcap-new.c.

Referenced by pcap_close_remote(), pcap_remoteact_accept(), pcap_remoteact_close(), pcap_remoteact_list(), pcap_startcapture_remote(), and rpcap_remoteact_getsock().

SOCKET sockmain
 

Keeps the main socket identifier when we want to accept a new remote connection (active mode only).

See the documentation of pcap_remoteact_accept() and pcap_remoteact_cleanup() for more details.

Definition at line 55 of file pcap-new.c.

Referenced by main_cleanup(), main_passive(), main_startup(), pcap_remoteact_accept(), and pcap_remoteact_cleanup().


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