7.2. Packet Capture

7.2.1. emOpenPacketCapture

EC_T_DWORD emOpenPacketCapture(EC_T_DWORD dwInstanceID, EC_T_PACKETCAPTURE_PARMS *pParms)

Open packet capture file (PCAP).

Opens a PCAP trace for further processing within the JobTask. No LinkLayer must have been loaded.

Parameters
  • dwInstanceID – [in] Instance ID

  • pParms – [in] Packet capture parameter

Returns

struct EC_T_PACKETCAPTURE_PARMS

Public Members

EC_T_CHAR szFileName[EC_PACKETCAPTURE_FILE_NAME_SIZE]

[in] File name

EC_T_BOOL bReadMultipleFiles

[in] Read multiple contiguous files. File name format must be “fileName.nnnnn.pcap[ng]”, e.g. wireshark.00000.pcap

7.2.2. emClosePacketCapture

EC_T_DWORD emClosePacketCapture(EC_T_DWORD dwInstanceID)

Close packet capture file (PCAP).

Parameters

dwInstanceID – [in] Instance ID

Returns

7.2.3. emGetPacketCaptureInfo

EC_T_DWORD emGetPacketCaptureInfo(EC_T_DWORD dwInstanceID, EC_T_PACKETCAPTURE_INFO *pInfo)

Get packet capture file processing status information.

Parameters
  • dwInstanceID – [in] Instance ID

  • pInfo – [out] Packet capture info descriptor

Returns

struct EC_T_PACKETCAPTURE_INFO

Public Members

EC_T_PACKETCAPTURE_STATUS eStatus

[out] Status of packet capture processing

EC_T_UINT64 qwFrameNumber

[out] Last processed frame number

EC_T_UINT64 qwBytesProcessed

[out] Number of processed bytes from the packet capture file

EC_T_UINT64 qwFileSize

[out] Packet capture file size

enum EC_T_PACKETCAPTURE_STATUS

Values:

enumerator ePcapStatus_Unknown

Unknown packet capture status

enumerator ePcapStatus_NotLoaded

No packet capture loaded

enumerator ePcapStatus_Running

Packet capture processing running

enumerator ePcapStatus_Finished

Packet capture processing finished

enumerator ePcapStatus_Dummy

7.2.4. emStartLivePacketCapture

EC_T_DWORD emStartLivePacketCapture(EC_T_DWORD dwInstanceID, EC_T_PACKETCAPTURE_PARMS *pParms)

Start live packet capture (PCAP).

Starts a live recording of the EtherCAT frames in a specified PCAP file.

Note

Only the PCAP file format is currently supported.

Parameters
  • dwInstanceID – [in] Instance ID

  • pParms – [in] Packet capture parameter

Returns

7.2.5. emStopLivePacketCapture

EC_T_DWORD emStopLivePacketCapture(EC_T_DWORD dwInstanceID)

Stop live packet capture (PCAP).

Stops a previously started live recording of the EtherCAT frames.

Parameters

dwInstanceID – [in] Instance ID

Returns

7.2.6. emBacktracePacketCapture

EC_T_DWORD emBacktracePacketCapture(EC_T_DWORD dwInstanceID, EC_T_PACKETCAPTURE_PARMS *pParms)

Dump packet capture (PCAP) from backtrace buffer.

Writes a backtrace of the received frames in a specified PCAP file. The number of frames in the backtrace buffer is parameterized via EC_T_MONITOR_INIT_PARMS::dwBacktraceFrames.

Note

Only the PCAP file format is currently supported.

Parameters
  • dwInstanceID – [in] Instance ID

  • pParms – [in] Packet capture parameter

Returns

See also

emInitMonitor()