# Strings related to the new source syntax
[Exported Structures and Definitions]

## Defines

#define | PCAP_SRC_FILE_STRING "file://"
| String that will be used to determine the type of source in use (file, remote/local interface).
#define | PCAP_SRC_IF_STRING "rpcap://"
| String that will be used to determine the type of source in use (file, remote/local interface).

## Detailed Description

The formats allowed by the pcap_open() are the following:

- file://path_and_filename [opens a local file]
- rpcap://devicename [opens the selected device devices available on the local host, without using the RPCAP protocol]
- rpcap://host/devicename [opens the selected device available on a remote host]
- rpcap://host:port/devicename [opens the selected device available on a remote host, using a non-standard port for RPCAP]
- adaptername [to open a local adapter; kept for compability, but it is strongly discouraged]
- (NULL) [to open the first local adapter; kept for compability, but it is strongly discouraged]

The formats allowed by the pcap_findalldevs_ex() are the following:

- file://folder/ [lists all the files in the given folder]
- rpcap:// [lists all local adapters]
- rpcap://host:port/ [lists the devices available on a remote host]

Referring to the 'host' and 'port' paramters, they can be either numeric or literal. Since IPv6 is fully supported, these are the allowed formats:

- host (literal): e.g. host.foo.bar
- host (numeric IPv4): e.g. 10.11.12.13
- host (numeric IPv4, IPv6 style): e.g. [10.11.12.13]
- host (numeric IPv6): e.g. [1:2:3::4]
- port: can be either numeric (e.g. '80') or literal (e.g. 'http')

Here you find some allowed examples:

- rpcap://host.foo.bar/devicename [everything literal, no port number]
- rpcap://host.foo.bar:1234/devicename [everything literal, with port number]
- rpcap://10.11.12.13/devicename [IPv4 numeric, no port number]
- rpcap://10.11.12.13:1234/devicename [IPv4 numeric, with port number]
- rpcap://[10.11.12.13]:1234/devicename [IPv4 numeric with IPv6 format, with port number]
- rpcap://[1:2:3::4]/devicename [IPv6 numeric, no port number]
- rpcap://[1:2:3::4]:1234/devicename [IPv6 numeric, with port number]
- rpcap://[1:2:3::4]:http/devicename [IPv6 numeric, with literal port number]

## Define Documentation

#define PCAP_SRC_FILE_STRING "file://"

String that will be used to determine the type of source in use (file, remote/local interface).

This string will be prepended to the interface name in order to create a string that contains all the information required to open the source.

This string indicates that the user wants to open a capture from a local file.

Definition at line 164 of file remote-ext.h.

#define PCAP_SRC_IF_STRING "rpcap://"

String that will be used to determine the type of source in use (file, remote/local interface).

This string will be prepended to the interface name in order to create a string that contains all the information required to open the source.

This string indicates that the user wants to open a capture from a network interface. This string does not necessarily involve the use of the RPCAP protocol. If the interface required resides on the local host, the RPCAP protocol is not involved and the local functions are used.

Definition at line 177 of file remote-ext.h.

documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 CACE Technologies. All rights reserved.