---
name: "pcap_major_version"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/pcap_major_version"
---

# pcap\_major\_version(3)

get the version number of a savefile

## NAME

pcap\_major\_version, pcap\_minor\_version - get the version number of a savefile

## SYNOPSIS

```
#include <pcap/pcap.h>
```

**int pcap\_major\_version(pcap\_t \*p);** **int pcap\_minor\_version(pcap\_t \*p);**

## DESCRIPTION

If *p* refers to a \`\`savefile'', **pcap\_major\_version**() returns the major number of the file format of the \`\`savefile'' and **pcap\_minor\_version**() returns the minor number of the file format of the \`\`savefile''.  The version number is stored in the \`\`savefile''; note that the meaning of its values depends on the type of \`\`savefile'' (for example, pcap or pcapng).

If *p* refers to a live capture, the values returned by **pcap\_major\_version**() and **pcap\_minor\_version**() are not meaningful.

## SEE ALSO

[**pcap**(3)](/pcap/3.md)
