From 17affdb858838997c425dd570884b78d95910c98 Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Thu, 18 Mar 2021 10:28:32 -0700 Subject: [PATCH] convenience functions for comparing IP addresses --- src/IPAddr.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/IPAddr.h b/src/IPAddr.h index f4b9d0693d..d2cfda09b1 100644 --- a/src/IPAddr.h +++ b/src/IPAddr.h @@ -39,7 +39,11 @@ struct ConnIDKey { } bool operator<(const ConnIDKey& rhs) const { return memcmp(this, &rhs, sizeof(ConnIDKey)) < 0; } + bool operator<=(const ConnIDKey& rhs) const { return memcmp(this, &rhs, sizeof(ConnIDKey)) <= 0; } bool operator==(const ConnIDKey& rhs) const { return memcmp(this, &rhs, sizeof(ConnIDKey)) == 0; } + bool operator!=(const ConnIDKey& rhs) const { return memcmp(this, &rhs, sizeof(ConnIDKey)) != 0; } + bool operator>=(const ConnIDKey& rhs) const { return memcmp(this, &rhs, sizeof(ConnIDKey)) >= 0; } + bool operator>(const ConnIDKey& rhs) const { return memcmp(this, &rhs, sizeof(ConnIDKey)) > 0; } ConnIDKey& operator=(const ConnIDKey& rhs) {