PcapPlusPlus  Next
PcapPlusPlusVersion.h File Reference
#include <string>

Go to the source code of this file.

Namespaces

 pcpp
 The main namespace for the PcapPlusPlus lib.
 

Macros

#define PCAPPLUSPLUS_VERSION_YEAR   26
 The year component of the PcapPlusPlus version (e.g., 26 for 2026)
 
#define PCAPPLUSPLUS_VERSION_MONTH   7
 The month component of the PcapPlusPlus version (e.g., 7 for July)
 
#define PCAPPLUSPLUS_VERSION_PATCH   0
 The patch number component of the PcapPlusPlus version.
 
#define PCAPPLUSPLUS_VERSION_DEV   1
 Development flag: non-zero for development/nightly builds, zero for official releases.
 
#define PCAPPLUSPLUS_VERSION   "26.07-dev"
 Short version string (e.g., "26.07" for official release or "26.07-dev" for development build)
 
#define PCAPPLUSPLUS_VERSION_OFFICIAL   "development build"
 String indicating whether this is an official or development build.
 
#define PCAPPLUSPLUS_MAKE_VERSION_FULL(year, month, patch, dev)   ((year) * 100000 + (month) * 1000 + (patch) * 10 + dev)
 Create a comparable numeric version from year, month, patch, and dev components. More...
 
#define PCAPPLUSPLUS_MAKE_VERSION(year, month, patch)   PCAPPLUSPLUS_MAKE_VERSION_FULL(year, month, patch, 0)
 Create a comparable numeric version for official releases (dev=0) More...
 
#define PCAPPLUSPLUS_VERSION_NUM
 The current PcapPlusPlus version as a comparable numeric value.
 
#define PCAPPLUSPLUS_VERSION_EQUALS(major, minor, patch)    PCAPPLUSPLUS_VERSION_NUM == PCAPPLUSPLUS_MAKE_VERSION(major, minor, patch)
 Check if the current version equals the specified version. More...
 
#define PCAPPLUSPLUS_VERSION_LOWER_THAN(year, month, patch)    PCAPPLUSPLUS_VERSION_NUM < PCAPPLUSPLUS_MAKE_VERSION(year, month, patch)
 Check if the current version is lower than the specified version. More...
 
#define PCAPPLUSPLUS_VERSION_LOWER_OR_EQUAL_THAN(year, month, patch)    PCAPPLUSPLUS_VERSION_NUM <= PCAPPLUSPLUS_MAKE_VERSION(year, month, patch)
 Check if the current version is lower than or equal to the specified version. More...
 
#define PCAPPLUSPLUS_VERSION_HIGHER_THAN(year, month, patch)    PCAPPLUSPLUS_VERSION_NUM > PCAPPLUSPLUS_MAKE_VERSION(year, month, patch)
 Check if the current version is higher than the specified version. More...
 
#define PCAPPLUSPLUS_VERSION_HIGHER_OR_EQUAL_THAN(year, month, patch)    PCAPPLUSPLUS_VERSION_NUM >= PCAPPLUSPLUS_MAKE_VERSION(year, month, patch)
 Check if the current version is higher than or equal to the specified version. More...
 
#define PCAPPLUSPLUS_VERSION_FULL   "v" PCAPPLUSPLUS_VERSION " (" PCAPPLUSPLUS_VERSION_OFFICIAL ")"
 Full version string including version and release type (e.g., "v26.07-dev (development build)")
 

Functions

std::string pcpp::getPcapPlusPlusVersion ()
 
std::string pcpp::getPcapPlusPlusVersionFull ()
 
std::string pcpp::getBuildDateTime ()
 
std::string pcpp::getGitCommit ()
 
std::string pcpp::getGitBranch ()
 
std::string pcpp::getGitInfo ()
 

Macro Definition Documentation

◆ PCAPPLUSPLUS_MAKE_VERSION

#define PCAPPLUSPLUS_MAKE_VERSION (   year,
  month,
  patch 
)    PCAPPLUSPLUS_MAKE_VERSION_FULL(year, month, patch, 0)

Create a comparable numeric version for official releases (dev=0)

Parameters
yearThe year component
monthThe month component
patchThe patch number

◆ PCAPPLUSPLUS_MAKE_VERSION_FULL

#define PCAPPLUSPLUS_MAKE_VERSION_FULL (   year,
  month,
  patch,
  dev 
)    ((year) * 100000 + (month) * 1000 + (patch) * 10 + dev)

Create a comparable numeric version from year, month, patch, and dev components.

Parameters
yearThe year component (e.g., 26 for 2026)
monthThe month component (1-12)
patchThe patch number
devThe development flag (0 for official, 1 for dev)

◆ PCAPPLUSPLUS_VERSION_EQUALS

#define PCAPPLUSPLUS_VERSION_EQUALS (   major,
  minor,
  patch 
)     PCAPPLUSPLUS_VERSION_NUM == PCAPPLUSPLUS_MAKE_VERSION(major, minor, patch)

Check if the current version equals the specified version.

Parameters
majorThe major (year) component to compare
minorThe minor (month) component to compare
patchThe patch number to compare

◆ PCAPPLUSPLUS_VERSION_HIGHER_OR_EQUAL_THAN

#define PCAPPLUSPLUS_VERSION_HIGHER_OR_EQUAL_THAN (   year,
  month,
  patch 
)     PCAPPLUSPLUS_VERSION_NUM >= PCAPPLUSPLUS_MAKE_VERSION(year, month, patch)

Check if the current version is higher than or equal to the specified version.

Parameters
yearThe year component to compare
monthThe month component to compare
patchThe patch number to compare

◆ PCAPPLUSPLUS_VERSION_HIGHER_THAN

#define PCAPPLUSPLUS_VERSION_HIGHER_THAN (   year,
  month,
  patch 
)     PCAPPLUSPLUS_VERSION_NUM > PCAPPLUSPLUS_MAKE_VERSION(year, month, patch)

Check if the current version is higher than the specified version.

Parameters
yearThe year component to compare
monthThe month component to compare
patchThe patch number to compare

◆ PCAPPLUSPLUS_VERSION_LOWER_OR_EQUAL_THAN

#define PCAPPLUSPLUS_VERSION_LOWER_OR_EQUAL_THAN (   year,
  month,
  patch 
)     PCAPPLUSPLUS_VERSION_NUM <= PCAPPLUSPLUS_MAKE_VERSION(year, month, patch)

Check if the current version is lower than or equal to the specified version.

Parameters
yearThe year component to compare
monthThe month component to compare
patchThe patch number to compare

◆ PCAPPLUSPLUS_VERSION_LOWER_THAN

#define PCAPPLUSPLUS_VERSION_LOWER_THAN (   year,
  month,
  patch 
)     PCAPPLUSPLUS_VERSION_NUM < PCAPPLUSPLUS_MAKE_VERSION(year, month, patch)

Check if the current version is lower than the specified version.

Parameters
yearThe year component to compare
monthThe month component to compare
patchThe patch number to compare