From: Victor Julien Date: Tue, 9 Jan 2024 20:53:35 +0000 (+0100) Subject: detect/address: constify ipv6 cmp funcs X-Git-Tag: suricata-8.0.0-beta1~1091 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=114fc37294cbbceb6b72e5ccb72171ad8b98edc6;p=thirdparty%2Fsuricata.git detect/address: constify ipv6 cmp funcs --- diff --git a/src/detect-engine-address-ipv6.c b/src/detect-engine-address-ipv6.c index 4728662e0a..489bf99925 100644 --- a/src/detect-engine-address-ipv6.c +++ b/src/detect-engine-address-ipv6.c @@ -49,7 +49,7 @@ * \retval 1 If a < b. * \retval 0 Otherwise, i.e. a >= b. */ -int AddressIPv6Lt(Address *a, Address *b) +int AddressIPv6Lt(const Address *a, const Address *b) { int i = 0; @@ -87,7 +87,7 @@ int AddressIPv6LtU32(uint32_t *a, uint32_t *b) * \retval 1 If a > b. * \retval 0 Otherwise, i.e. a <= b. */ -int AddressIPv6Gt(Address *a, Address *b) +int AddressIPv6Gt(const Address *a, const Address *b) { int i = 0; @@ -125,7 +125,7 @@ int AddressIPv6GtU32(uint32_t *a, uint32_t *b) * \retval 1 If a == b. * \retval 0 Otherwise. */ -int AddressIPv6Eq(Address *a, Address *b) +int AddressIPv6Eq(const Address *a, const Address *b) { int i = 0; @@ -159,7 +159,7 @@ int AddressIPv6EqU32(uint32_t *a, uint32_t *b) * \retval 1 If a <= b. * \retval 0 Otherwise, i.e. a > b. */ -int AddressIPv6Le(Address *a, Address *b) +int AddressIPv6Le(const Address *a, const Address *b) { if (AddressIPv6Eq(a, b) == 1) @@ -191,7 +191,7 @@ int AddressIPv6LeU32(uint32_t *a, uint32_t *b) * \retval 1 If a >= b. * \retval 0 Otherwise, i.e. a < b. */ -int AddressIPv6Ge(Address *a, Address *b) +int AddressIPv6Ge(const Address *a, const Address *b) { if (AddressIPv6Eq(a, b) == 1) diff --git a/src/detect-engine-address-ipv6.h b/src/detect-engine-address-ipv6.h index 96727ee276..19fcb0d527 100644 --- a/src/detect-engine-address-ipv6.h +++ b/src/detect-engine-address-ipv6.h @@ -24,11 +24,11 @@ #ifndef SURICATA_DETECT_ENGINE_ADDRESS_IPV6_H #define SURICATA_DETECT_ENGINE_ADDRESS_IPV6_H -int AddressIPv6Lt(Address *, Address *); -int AddressIPv6Gt(Address *, Address *); -int AddressIPv6Eq(Address *, Address *); -int AddressIPv6Le(Address *, Address *); -int AddressIPv6Ge(Address *, Address *); +int AddressIPv6Lt(const Address *, const Address *); +int AddressIPv6Gt(const Address *, const Address *); +int AddressIPv6Eq(const Address *, const Address *); +int AddressIPv6Le(const Address *, const Address *); +int AddressIPv6Ge(const Address *, const Address *); int AddressIPv6LeU32(uint32_t *a, uint32_t *b); int AddressIPv6LtU32(uint32_t *a, uint32_t *b);