Skip to content

Commit

Permalink
Clarify the version numbers and compatibility guarantees.
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinFinck committed Oct 19, 2020
1 parent 8f39c7d commit 4b2aaac
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
19 changes: 15 additions & 4 deletions src/tool/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,16 +492,27 @@ HandleVersionParameter(void)
goto Cleanup;
}

// Compare with our tool version and print the results.
// Print driver and tool versions.
printf("PortSniffer Driver Version %u.%u\n", response.MajorVersion, response.MinorVersion);
printf("PortSniffer Tool Version %u.%u\n", PORTSNIFFER_MAJOR_VERSION, PORTSNIFFER_MINOR_VERSION);
printf("\n");

if (response.MajorVersion == PORTSNIFFER_MAJOR_VERSION && response.MinorVersion == PORTSNIFFER_MINOR_VERSION)
// Compare them.
if (response.MajorVersion == PORTSNIFFER_MAJOR_VERSION)
{
printf("Driver Version equals Tool Version.\n");
if (response.MinorVersion == PORTSNIFFER_MINOR_VERSION)
{
printf("Setup is COMPATIBLE: The full version numbers match.\n");
}
else
{
printf("Setup is COMPATIBLE: The major version numbers match.\n");
}
}
else
{
printf("Driver Version does not equal Tool Version!\n");
printf("Setup is INCOMPATIBLE: The major version numbers differ!\n");
printf("Please install the PortSniffer Driver that comes with this tool.\n");
}

iReturnValue = 0;
Expand Down
18 changes: 2 additions & 16 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

#pragma once

// Make sure to change at least the minor version with every incompatible change!
// We use Semantic Versioning (https://semver.org) without a patch version here.
// Increase the major version on API-incompatible changes, increase the minor version on API-compatible changes.
#define PORTSNIFFER_MAJOR_VERSION 1
#define PORTSNIFFER_MINOR_VERSION 0

Expand All @@ -17,18 +18,3 @@

#define PORTSNIFFER_REVISION_STRING "unknown revision"
#define PORTSNIFFER_VERSION_COMBINED STRINGIFY(PORTSNIFFER_MAJOR_VERSION) "." STRINGIFY(PORTSNIFFER_MINOR_VERSION) " (" PORTSNIFFER_REVISION_STRING ")"















0 comments on commit 4b2aaac

Please sign in to comment.