RTI Connext Traditional C++ API  Version 6.1.0
NDDSUtilityNetworkCapture Class Reference

Network Capture APIs. More...

Static Public Member Functions

static DDS_Boolean enable ()
 Enable Network Capture. More...
 
static DDS_Boolean disable ()
 Disable Network Capture. More...
 
static DDS_Boolean set_default_params (const NDDS_Utility_NetworkCaptureParams_t &params)
 Set the default Network Capture parameters. More...
 
static DDS_Boolean start (const char *filename)
 Start capturing traffic for all DomainParticipants, with the default parameters. More...
 
static DDS_Boolean start (DDSDomainParticipant *participant, const char *filename)
 Start capturing traffic for a DomainParticipant, with the default parameters. More...
 
static DDS_Boolean start (const char *filename, const NDDS_Utility_NetworkCaptureParams_t &params)
 Start capturing traffic for all DomainParticipants, with the provided parameters. More...
 
static DDS_Boolean start (DDSDomainParticipant *participant, const char *filename, const NDDS_Utility_NetworkCaptureParams_t &params)
 Start capturing traffic for a DomainParticipant, with the provided parameters. More...
 
static DDS_Boolean stop ()
 Stop capturing traffic for all participants. More...
 
static DDS_Boolean stop (DDSDomainParticipant *participant)
 Stop capturing traffic for a DomainParticipant. More...
 
static DDS_Boolean pause ()
 Pause capturing traffic for all DomainParticipants. More...
 
static DDS_Boolean pause (DDSDomainParticipant *participant)
 Pause capturing traffic for a DomainParticipant. More...
 
static DDS_Boolean resume ()
 Resume capturing traffic for all DomainParticipants. More...
 
static DDS_Boolean resume (DDSDomainParticipant *participant)
 Resume capturing traffic for a DomainParticipant. More...
 

Detailed Description

Network Capture APIs.

Member Function Documentation

◆ enable()

static DDS_Boolean NDDSUtilityNetworkCapture::enable ( )
static

Enable Network Capture.

This method must be called before any other Network Capture method. It must also be called before creating the participants for which we want to capture traffic.

Use this method only for debugging purposes, since it may introduce a significant performance impact.

Returns
DDS_BOOLEAN_TRUE if success. Otherwise, DDS_BOOLEAN_FALSE
MT Safety:
UNSAFE. It is not safe to call this method while another thread may be simultaneously calling another Network Caputre related method, including this one.
See also
NDDSUtilityNetworkCapture::disable

◆ disable()

static DDS_Boolean NDDSUtilityNetworkCapture::disable ( )
static

Disable Network Capture.

This method must be the last Network Capture method to be called. It must also be called after deleting the participants for which we captured traffic. Disabling Network Capture without stopping it first is not ok!

Returns
DDS_BOOLEAN_TRUE if success. Otherwise, DDS_BOOLEAN_FALSE
MT Safety:
UNSAFE. It is not safe to call this method while another thread may be simultaneously calling another Network Capture related method, including this one.
See also
NDDSUtilityNetworkCapture::enable

◆ set_default_params()

static DDS_Boolean NDDSUtilityNetworkCapture::set_default_params ( const NDDS_Utility_NetworkCaptureParams_t params)
static

Set the default Network Capture parameters.

The default parameters are used when Network Capture is started without parameters, i.e., NDDSUtilityNetworkCapture::start.

Precondition
This method requires first enabling Network Capture. See NDDSUtilityNetworkCapture::enable.
Parameters
params<<in>>. Configuration parameters that we want to set as defaults.
Returns
DDS_BOOLEAN_TRUE if success. Otherwise, DDS_BOOLEAN_FALSE
See also
NDDSUtilityNetworkCapture::start
NDDSUtilityNetworkCapture::start(DDSDomainParticipant *, const char *)

◆ start() [1/4]

static DDS_Boolean NDDSUtilityNetworkCapture::start ( const char *  filename)
static

Start capturing traffic for all DomainParticipants, with the default parameters.

Precondition
This method requires first enabling Network Capture. See NDDSUtilityNetworkCapture::enable.
Parameters
filename<<in>>. The name of the output capture file will be based on this input parameter.

In particular, the name for the capture file is the concatenation of the filename input parameter, the "_GUID-" string followed by the decimal representation of the DomainParticipant's instance identifier (last four bytes of the DDS_RTPS_GuidPrefix_t), and the file extension (".pcap").

Returns
DDS_BOOLEAN_TRUE if success. Otherwise, DDS_BOOLEAN_FALSE
See also
NDDSUtilityNetworkCapture::stop
NDDSUtilityNetworkCapture::start(DDSDomainParticipant *, const char *)

◆ start() [2/4]

static DDS_Boolean NDDSUtilityNetworkCapture::start ( DDSDomainParticipant participant,
const char *  filename 
)
static

Start capturing traffic for a DomainParticipant, with the default parameters.

Precondition
This method requires first enabling Network Capture. See NDDSUtilityNetworkCapture::enable.
Parameters
participant<<in>>. DomainParticipant for which we want to capture traffic.
filename<<in>>. The name of the output capture file will be based on this input parameter.

In particular, the name for the capture file is the concatenation of the filename input parameter, and the file extension (".pcap").

Returns
DDS_BOOLEAN_TRUE if success. Otherwise, DDS_BOOLEAN_FALSE
See also
NDDSUtilityNetworkCapture::stop(DDSDomainParticipant *)
NDDSUtilityNetworkCapture::start(DDSDomainParticipant *, const char *, const NDDS_Utility_NetworkCaptureParams_t&)
NDDSUtilityNetworkCapture::enable

◆ start() [3/4]

static DDS_Boolean NDDSUtilityNetworkCapture::start ( const char *  filename,
const NDDS_Utility_NetworkCaptureParams_t params 
)
static

Start capturing traffic for all DomainParticipants, with the provided parameters.

Precondition
This method requires first enabling Network Capture. See NDDSUtilityNetworkCapture::enable.

Perfoms the same function as NDDSUtilityNetworkCapture::start except that it uses the provided parameters, instead of the default ones.

Parameters
filename<<in>>. The name of the output capture file will be based on this input parameter.

In particular, the name for the capture file is the concatenation of the filename input parameter, the "_GUID-" string followed by the decimal representation of the DomainParticipant's instance identifier (last four bytes of the DDS_RTPS_GuidPrefix_t), and the file extension (".pcap").

Parameters
params<<in>>. Configuration parameters for the capture.
Returns
DDS_BOOLEAN_TRUE if success. Otherwise, DDS_BOOLEAN_FALSE
See also
NDDSUtilityNetworkCapture::stop
NDDSUtilityNetworkCapture::start(DDSDomainParticipant *, const char *, const NDDS_Utility_NetworkCaptureParams_t&)

◆ start() [4/4]

static DDS_Boolean NDDSUtilityNetworkCapture::start ( DDSDomainParticipant participant,
const char *  filename,
const NDDS_Utility_NetworkCaptureParams_t params 
)
static

Start capturing traffic for a DomainParticipant, with the provided parameters.

Precondition
This method requires enabling first Network Capture. See NDDSUtilityNetworkCapture::enable.
Parameters
participant<<in>>. DomainParticipant for which we want to capture traffic.
filename<<in>>. The name of the output capture file will be based on this input parameter.

In particular, the name for the capture file is the concatenation of the filename input parameter, and the file extension (".pcap").

Parameters
params<<in>>. Parameters for configuring the capture.
Returns
DDS_BOOLEAN_TRUE if success. Otherwise, DDS_BOOLEAN_FALSE
See also
NDDSUtilityNetworkCapture::stop(DDSDomainParticipant *)
NDDSUtilityNetworkCapture::start(DDSDomainParticipant *, const char *)

◆ stop() [1/2]

static DDS_Boolean NDDSUtilityNetworkCapture::stop ( )
static

Stop capturing traffic for all participants.

Precondition
This method requires enabling first Network Capture. See NDDSUtilityNetworkCapture::enable.

This method can (and must) be called after NDDSUtilityNetworkCapture::start, not NDDSUtilityNetworkCapture::start(DDSDomainParticipant *, const char *). That is, if we start capturing traffic globally (for all DomainParticipants), we must stop capturing traffic also globally. It is not possible to start capturing traffic for a participant but stop it globally.

It is possible to start capturing globally and then stop capturing for a participant, as long as we eventually stop capturing traffic globally.

We must stop capturing for a participant before deleting it.

Returns
DDS_BOOLEAN_TRUE if success. Otherwise, DDS_BOOLEAN_FALSE
See also
NDDSUtilityNetworkCapture::start
NDDSUtilityNetworkCapture::stop(DDSDomainParticipant *)

◆ stop() [2/2]

static DDS_Boolean NDDSUtilityNetworkCapture::stop ( DDSDomainParticipant participant)
static

Stop capturing traffic for a DomainParticipant.

Precondition
This method requires first enabling Network Capture. See NDDSUtilityNetworkCapture::enable.
Parameters
participant<<in>>. DomainParticipant for which we want to stop capturing traffic.
Returns
DDS_BOOLEAN_TRUE if success. Otherwise, DDS_BOOLEAN_FALSE
See also
NDDSUtilityNetworkCapture::start(DDSDomainParticipant *, const char *)
NDDSUtilityNetworkCapture::stop

◆ pause() [1/2]

static DDS_Boolean NDDSUtilityNetworkCapture::pause ( )
static

Pause capturing traffic for all DomainParticipants.

Precondition
This method requires first enabling Network Capture. See NDDSUtilityNetworkCapture::enable.
Returns
DDS_BOOLEAN_TRUE if success. Otherwise, DDS_BOOLEAN_FALSE
See also
NDDSUtilityNetworkCapture::resume
NDDSUtilityNetworkCapture::pause(DDSDomainParticipant *)

◆ pause() [2/2]

static DDS_Boolean NDDSUtilityNetworkCapture::pause ( DDSDomainParticipant participant)
static

Pause capturing traffic for a DomainParticipant.

Precondition
This method requires first enabling Network Capture. See NDDSUtilityNetworkCapture::enable.
Parameters
participant<<in>>. DomainParticipant for which we want to pause capturing traffic.
Returns
DDS_BOOLEAN_TRUE if success. Otherwise, DDS_BOOLEAN_FALSE
See also
NDDSUtilityNetworkCapture::resume(DDSDomainParticipant *)
NDDSUtilityNetworkCapture::pause

◆ resume() [1/2]

static DDS_Boolean NDDSUtilityNetworkCapture::resume ( )
static

Resume capturing traffic for all DomainParticipants.

Precondition
This method requires first enabling Network Capture. See NDDSUtilityNetworkCapture::enable.
Returns
DDS_BOOLEAN_TRUE if success. Otherwise, DDS_BOOLEAN_FALSE
See also
NDDSUtilityNetworkCapture::pause
NDDSUtilityNetworkCapture::resume(DDSDomainParticipant *)

◆ resume() [2/2]

static DDS_Boolean NDDSUtilityNetworkCapture::resume ( DDSDomainParticipant participant)
static

Resume capturing traffic for a DomainParticipant.

Precondition
This method requires first enabling Network Capture. See NDDSUtilityNetworkCapture::enable.
Parameters
participant<<in>>. DomainParticipant for which we want to resume capturing traffic.
Returns
DDS_BOOLEAN_TRUE if success. Otherwise, DDS_BOOLEAN_FALSE
See also
NDDSUtilityNetworkCapture::pause(DDSDomainParticipant *)
NDDSUtilityNetworkCapture::resume