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

# Internal Structures and Definitions
[Remote Capture]

## Data Structures
struct | activehosts
| Keeps a list of all the opened connections in the active mode. More...
struct | rpcap_auth
| Structure that keeps the data required for the authentication on the remote host. More...
struct | rpcap_filter
| General header used for the pcap_setfilter() command; keeps just the number of BPF instructions. More...
struct | rpcap_filterbpf_insn
| Structure that keeps a single BPF instuction; it is repeated 'ninsn' times according to the 'rpcap_filterbpf' header. More...
struct | rpcap_findalldevs_if
| Format of the message for the interface description (findalldevs command). More...
struct | rpcap_findalldevs_ifaddr
| Format of the message for the address listing (findalldevs command). More...
struct | rpcap_header
| Common header for all the RPCAP messages. More...
struct | rpcap_openreply
| Format of the message of the connection opening reply (open command). More...
struct | rpcap_pkthdr
| Format of the header which encapsulates captured packets when transmitted on the network. More...
struct | rpcap_startcapreply
| Format of the reply message that devoted to start a remote capture (startcap reply command). More...
struct | rpcap_startcapreq
| Format of the message that starts a remote capture (startcap command). More...
struct | rpcap_stats
| Structure that keeps the statistics about the number of packets captured, dropped, etc. More...
## Defines
#define | RPCAP_DEFAULT_NETPORT "2002"
#define | RPCAP_DEFAULT_NETPORT_ACTIVE "2003"
#define | RPCAP_DEFAULT_NETADDR ""
#define | RPCAP_VERSION 0
#define | RPCAP_TIMEOUT_INIT 90
#define | RPCAP_TIMEOUT_RUNTIME 180
#define | RPCAP_ACTIVE_WAIT 30
#define | RPCAP_SUSPEND_WRONGAUTH 1
#define | RPCAP_NETBUF_SIZE 64000
| Buffer used by socket functions to send-receive packets. In case you plan to have messages larger than this value, you have to increase it.
#define | RPCAP_HOSTLIST_SEP " ,;\n\r"
| Separators used for the host list.
#define | RPCAP_MSG_ERROR 1
#define | RPCAP_MSG_FINDALLIF_REQ 2
#define | RPCAP_MSG_OPEN_REQ 3
#define | RPCAP_MSG_STARTCAP_REQ 4
#define | RPCAP_MSG_UPDATEFILTER_REQ 5
#define | RPCAP_MSG_CLOSE 6
#define | RPCAP_MSG_PACKET 7
#define | RPCAP_MSG_AUTH_REQ 8
#define | RPCAP_MSG_STATS_REQ 9
#define | RPCAP_MSG_ENDCAP_REQ 10
#define | RPCAP_MSG_FINDALLIF_REPLY (128+RPCAP_MSG_FINDALLIF_REQ)
#define | RPCAP_MSG_OPEN_REPLY (128+RPCAP_MSG_OPEN_REQ)
#define | RPCAP_MSG_STARTCAP_REPLY (128+RPCAP_MSG_STARTCAP_REQ)
#define | RPCAP_MSG_UPDATEFILTER_REPLY (128+RPCAP_MSG_UPDATEFILTER_REQ)
#define | RPCAP_MSG_AUTH_REPLY (128+RPCAP_MSG_AUTH_REQ)
#define | RPCAP_MSG_STATS_REPLY (128+RPCAP_MSG_STATS_REQ)
#define | RPCAP_MSG_ENDCAP_REPLY (128+RPCAP_MSG_ENDCAP_REQ)
#define | RPCAP_STARTCAPREQ_FLAG_PROMISC 1
#define | RPCAP_STARTCAPREQ_FLAG_DGRAM 2
#define | RPCAP_STARTCAPREQ_FLAG_SERVEROPEN 4
#define | RPCAP_STARTCAPREQ_FLAG_INBOUND 8
#define | RPCAP_STARTCAPREQ_FLAG_OUTBOUND 16
#define | RPCAP_UPDATEFILTER_BPF 1
#define | PCAP_ERR_NETW 1
#define | PCAP_ERR_INITTIMEOUT 2
#define | PCAP_ERR_AUTH 3
#define | PCAP_ERR_FINDALLIF 4
#define | PCAP_ERR_NOREMOTEIF 5
#define | PCAP_ERR_OPEN 6
#define | PCAP_ERR_UPDATEFILTER 7
#define | PCAP_ERR_GETSTATS 8
#define | PCAP_ERR_READEX 9
#define | PCAP_ERR_HOSTNOAUTH 10
#define | PCAP_ERR_REMOTEACCEPT 11
#define | PCAP_ERR_STARTCAPTURE 12
#define | PCAP_ERR_ENDCAPTURE 13
#define | PCAP_ERR_RUNTIMETIMEOUT 14
#define | SOCK_ASSERT(msg, expr) { fprintf(stderr, "%s\n", msg); assert(expr); }
| DEBUG facility: it prints an error message on the screen (stderr).
#define | SOCKBUF_CHECKONLY 1
#define | SOCKBUF_BUFFERIZE 0
#define | SOCKOPEN_CLIENT 0
#define | SOCKOPEN_SERVER 1
#define | SOCK_ERRBUF_SIZE 256
## Typedefs
typedef unsigned char | uint8
| Provides an 8-bits unsigned integer.
typedef unsigned short | uint16
| Provides a 16-bits unsigned integer.
typedef unsigned int | uint32
| Provides a 32-bits unsigned integer.
typedef int | int32
| Provides a 32-bits integer.

## Define Documentation

#define PCAP_ERR_AUTH 3

| Generic authentication error Definition at line 299 of file pcap-remote.h.

#define PCAP_ERR_ENDCAPTURE 13

| Generic pcap_endcapture error Definition at line 309 of file pcap-remote.h.

#define PCAP_ERR_FINDALLIF 4

| Generic findalldevs error Definition at line 300 of file pcap-remote.h.

#define PCAP_ERR_GETSTATS 8

| Generic pcap_stats error Definition at line 304 of file pcap-remote.h.

#define PCAP_ERR_HOSTNOAUTH 10

| The host is not authorized to connect to this server Definition at line 306 of file pcap-remote.h.

#define PCAP_ERR_INITTIMEOUT 2

| The RPCAP initial timeout has expired Definition at line 298 of file pcap-remote.h.

#define PCAP_ERR_NETW 1

| Network error Definition at line 297 of file pcap-remote.h.

#define PCAP_ERR_NOREMOTEIF 5

| The findalldevs was ok, but the remote end had no interfaces to list Definition at line 301 of file pcap-remote.h.

#define PCAP_ERR_OPEN 6

| Generic pcap_open error Definition at line 302 of file pcap-remote.h.

#define PCAP_ERR_READEX 9

| Generic pcap_next_ex error Definition at line 305 of file pcap-remote.h.

#define PCAP_ERR_REMOTEACCEPT 11

| Generic pcap_remoteaccept error Definition at line 307 of file pcap-remote.h.

#define PCAP_ERR_RUNTIMETIMEOUT 14

| The RPCAP run-time timeout has expired Definition at line 310 of file pcap-remote.h.

#define PCAP_ERR_STARTCAPTURE 12

| Generic pcap_startcapture error Definition at line 308 of file pcap-remote.h.

#define PCAP_ERR_UPDATEFILTER 7

| Generic updatefilter error Definition at line 303 of file pcap-remote.h.

#define RPCAP_ACTIVE_WAIT 30

| Waiting time betweek two attempts to open a connection, in active mode (default: 30 sec) Definition at line 89 of file pcap-remote.h.

#define RPCAP_DEFAULT_NETADDR ""

| Default network address on which the RPCAP daemon binds to. Definition at line 85 of file pcap-remote.h.

#define RPCAP_DEFAULT_NETPORT "2002"

| Default port on which the RPCAP daemon is waiting for connections. Definition at line 82 of file pcap-remote.h. Referenced by printusage().

#define RPCAP_DEFAULT_NETPORT_ACTIVE "2003"

| Default port on which the client workstation is waiting for connections in case of active mode. Definition at line 84 of file pcap-remote.h.

#define RPCAP_HOSTLIST_SEP " ,;\n\r"

| Separators used for the host list. It is used: by the rpcapd daemon, when you types a list of allowed connecting hosts by the rpcap in active mode, when the client waits for incoming connections from other hosts Definition at line 106 of file pcap-remote.h.

#define RPCAP_MSG_AUTH_REPLY (128+RPCAP_MSG_AUTH_REQ)

| Sends a message that says 'ok, authorization successful' Definition at line 282 of file pcap-remote.h. Referenced by rpcap_sendauth().

#define RPCAP_MSG_AUTH_REQ 8

| Message that keeps the authentication parameters Definition at line 274 of file pcap-remote.h. Referenced by daemon_checkauth().

#define RPCAP_MSG_CLOSE 6

| Close the connection with the remote peer Definition at line 272 of file pcap-remote.h. Referenced by daemon_checkauth(), and daemon_serviceloop().

#define RPCAP_MSG_ENDCAP_REPLY (128+RPCAP_MSG_ENDCAP_REQ)

| Confirms that the capture stopped succesfully Definition at line 284 of file pcap-remote.h.

#define RPCAP_MSG_ENDCAP_REQ 10

| Stops the current capture, keeping the device open Definition at line 276 of file pcap-remote.h. Referenced by daemon_serviceloop().

#define RPCAP_MSG_ERROR 1

| Message that keeps an error notification Definition at line 267 of file pcap-remote.h. Referenced by daemon_checkauth(), daemon_serviceloop(), pcap_findalldevs_ex(), pcap_opensource_remote(), pcap_startcapture_remote(), rpcap_checkmsg(), rpcap_sendauth(), and rpcap_stats_remote().

#define RPCAP_MSG_FINDALLIF_REPLY (128+RPCAP_MSG_FINDALLIF_REQ)

| Keeps the list of all the remote interfaces Definition at line 278 of file pcap-remote.h. Referenced by pcap_findalldevs_ex().

#define RPCAP_MSG_FINDALLIF_REQ 2

| Request to list all the remote interfaces Definition at line 268 of file pcap-remote.h. Referenced by daemon_serviceloop().

#define RPCAP_MSG_OPEN_REPLY (128+RPCAP_MSG_OPEN_REQ)

| The remote device has been opened correctly Definition at line 279 of file pcap-remote.h. Referenced by pcap_opensource_remote().

#define RPCAP_MSG_OPEN_REQ 3

| Request to open a remote device Definition at line 269 of file pcap-remote.h. Referenced by daemon_serviceloop().

#define RPCAP_MSG_PACKET 7

| This is a 'data' message, which carries a network packet Definition at line 273 of file pcap-remote.h. Referenced by rpcap_thrdatamain_dgram(), and rpcap_thrdatamain_stream().

#define RPCAP_MSG_STARTCAP_REPLY (128+RPCAP_MSG_STARTCAP_REQ)

| The capture is staarting correctly Definition at line 280 of file pcap-remote.h. Referenced by pcap_startcapture_remote().

#define RPCAP_MSG_STARTCAP_REQ 4

| Request to start a capture on a remote device Definition at line 270 of file pcap-remote.h. Referenced by daemon_serviceloop().

#define RPCAP_MSG_STATS_REPLY (128+RPCAP_MSG_STATS_REQ)

| Message that keeps the network statistics Definition at line 283 of file pcap-remote.h. Referenced by rpcap_stats_remote().

#define RPCAP_MSG_STATS_REQ 9

| It requires to have network statistics Definition at line 275 of file pcap-remote.h. Referenced by daemon_serviceloop().

#define RPCAP_MSG_UPDATEFILTER_REPLY (128+RPCAP_MSG_UPDATEFILTER_REQ)

| The filter has been applied correctly on the remote device Definition at line 281 of file pcap-remote.h. Referenced by pcap_updatefilter_remote().

#define RPCAP_MSG_UPDATEFILTER_REQ 5

| Send a compiled filter into the remote device Definition at line 271 of file pcap-remote.h. Referenced by daemon_serviceloop().

#define RPCAP_NETBUF_SIZE 64000

| Buffer used by socket functions to send-receive packets. In case you plan to have messages larger than this value, you have to increase it. Definition at line 96 of file pcap-remote.h. Referenced by daemon_findalldevs(), daemon_getstats(), daemon_getstatsnopcap(), daemon_opensource(), daemon_startcapture(), daemon_thrdatamain(), pcap_opensource_remote(), pcap_startcapture_remote(), pcap_updatefilter_remote(), rpcap_sendauth(), rpcap_senderror(), and rpcap_thrdatamain_dgram().

#define RPCAP_STARTCAPREQ_FLAG_DGRAM 2

| Use a datagram (i.e. UDP) connection for the data stream (default: use TCP) Definition at line 287 of file pcap-remote.h. Referenced by daemon_startcapture(), and pcap_startcapture_remote().

#define RPCAP_STARTCAPREQ_FLAG_INBOUND 8

| Capture only inbound packets (take care: the flag has no effects with promiscuous enabled) Definition at line 289 of file pcap-remote.h.

#define RPCAP_STARTCAPREQ_FLAG_OUTBOUND 16

| Capture only outbound packets (take care: the flag has no effects with promiscuous enabled) Definition at line 290 of file pcap-remote.h.

#define RPCAP_STARTCAPREQ_FLAG_PROMISC 1

| Enables promiscuous mode (default: disabled) Definition at line 286 of file pcap-remote.h. Referenced by pcap_startcapture_remote().

#define RPCAP_STARTCAPREQ_FLAG_SERVEROPEN 4

| The server has to open the data connection toward the client Definition at line 288 of file pcap-remote.h. Referenced by daemon_startcapture(), and pcap_startcapture_remote().

#define RPCAP_SUSPEND_WRONGAUTH 1

| If the authentication is wrong, stops 1 sec before accepting a new auth message Definition at line 90 of file pcap-remote.h.

#define RPCAP_TIMEOUT_INIT 90

| Initial timeout for RPCAP connections (default: 90 sec) Definition at line 87 of file pcap-remote.h. Referenced by daemon_serviceloop().

#define RPCAP_TIMEOUT_RUNTIME 180

| Run-time timeout for RPCAP connections (default: 3 min) Definition at line 88 of file pcap-remote.h. Referenced by daemon_serviceloop().

#define RPCAP_UPDATEFILTER_BPF 1

| This code tells us that the filter is encoded with the BPF/NPF syntax Definition at line 293 of file pcap-remote.h. Referenced by daemon_unpackapplyfilter().

#define RPCAP_VERSION 0

| Present version of the RPCAP protocol (0 = Experimental). Definition at line 86 of file pcap-remote.h. Referenced by rpcap_checkver(), and rpcap_createhdr().

#define SOCK_ASSERT | ( | msg,
|  | expr |  | ) | { fprintf(stderr, "%s\n", msg); assert(expr); }

  | DEBUG facility: it prints an error message on the screen (stderr). This macro prints the error on the standard error stream (stderr); if we are working in debug mode (i.e. there is no NDEBUG defined) and we are in Microsoft Visual C++, the error message will appear on the MSVC console as well. When NDEBUG is defined, this macro is empty. Parameters:
  msg: | the message you want to print.
  expr: | 'false' if you want to abort the program, 'true' it you want to print the message and continue.
Returns: No return values. Definition at line 117 of file sockutils.h. Referenced by daemon_checkauth(), daemon_serviceloop(), daemon_thrdatamain(), fileconf_read(), main(), main_active(), main_cleanup(), main_passive(), main_startup(), pcap_remoteact_accept(), pcap_updatefilter_remote(), rpcap_checkmsg(), rpcap_sendauth(), rpcap_thrdatamain_dgram(), rpcap_thrdatamain_stream(), sock_check_hostlist(), sock_discard(), sock_recv(), and svc_geterr().

#define SOCK_ERRBUF_SIZE 256

| Size of the buffer that has to keep error messages Definition at line 136 of file sockutils.h. Referenced by sock_geterror().

#define SOCKBUF_BUFFERIZE 0

| no 'checkonly' flag, into the rpsock_bufferize() Definition at line 131 of file sockutils.h.

#define SOCKBUF_CHECKONLY 1

| 'checkonly' flag, into the rpsock_bufferize() Definition at line 130 of file sockutils.h.

#define SOCKOPEN_CLIENT 0

| no 'server' flag; it opens a client socket Definition at line 133 of file sockutils.h.

#define SOCKOPEN_SERVER 1

| 'server' flag; it opens a server socket Definition at line 134 of file sockutils.h.

## Typedef Documentation

typedef int int32

| Provides a 32-bits integer. Definition at line 115 of file pcap-remote.h. Referenced by rpcap_checkmsg().

typedef unsigned short uint16

| Provides a 16-bits unsigned integer. Definition at line 113 of file pcap-remote.h. Referenced by daemon_findalldevs(), rpcap_sendauth(), and rpcap_senderror().

typedef unsigned int uint32

| Provides a 32-bits unsigned integer. Definition at line 114 of file pcap-remote.h.

typedef unsigned char uint8

| Provides an 8-bits unsigned integer. Definition at line 112 of file pcap-remote.h. Referenced by rpcap_checkmsg().

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