pcap_is_swapped Subroutine

Purpose

Reports if the byte order of the previously saved packet capture data file, known as the savefile was swapped.

Library

pcap Library (libpcap.a)

Syntax

#include <pcap.h>

int pcap_is_swapped(pcap_t * p);

Description

The pcap_is_swapped subroutine returns 1 (True) if the current savefile uses a different byte order than the current system. This subroutine should be called after a successful call to the pcap_open_offline subroutine and before any calls to the pcap_close subroutine.

Parameters

Item Description
p Points to a packet capture descriptor as returned from the pcap_open_offline subroutine.

Return Values

Item Description
1 If the byte order of the savefile is different from that of the current system.
0 If the byte order of the savefile is the same as that of the current system.