mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 19:18:19 +00:00
Minor cleanup in IPAddr.h
This commit is contained in:
parent
36d5116628
commit
9eebbd1633
1 changed files with 14 additions and 14 deletions
18
src/IPAddr.h
18
src/IPAddr.h
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
#include "zeek/threading/SerialTypes.h"
|
#include "zeek/threading/SerialTypes.h"
|
||||||
|
|
||||||
typedef in_addr in4_addr;
|
using in4_addr = in_addr;
|
||||||
|
|
||||||
namespace zeek {
|
namespace zeek {
|
||||||
|
|
||||||
|
@ -31,10 +31,7 @@ struct ConnKey {
|
||||||
ConnKey(const IPAddr& src, const IPAddr& dst, uint16_t src_port,
|
ConnKey(const IPAddr& src, const IPAddr& dst, uint16_t src_port,
|
||||||
uint16_t dst_port, TransportProto t, bool one_way);
|
uint16_t dst_port, TransportProto t, bool one_way);
|
||||||
ConnKey(const ConnTuple& conn);
|
ConnKey(const ConnTuple& conn);
|
||||||
ConnKey(const ConnKey& rhs)
|
ConnKey(const ConnKey& rhs) { *this = rhs; }
|
||||||
{
|
|
||||||
*this = rhs;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator<(const ConnKey& rhs) const { return memcmp(this, &rhs, sizeof(ConnKey)) < 0; }
|
bool operator<(const ConnKey& rhs) const { return memcmp(this, &rhs, sizeof(ConnKey)) < 0; }
|
||||||
bool operator<=(const ConnKey& rhs) const { return memcmp(this, &rhs, sizeof(ConnKey)) <= 0; }
|
bool operator<=(const ConnKey& rhs) const { return memcmp(this, &rhs, sizeof(ConnKey)) <= 0; }
|
||||||
|
@ -58,7 +55,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Address family.
|
* Address family.
|
||||||
*/
|
*/
|
||||||
typedef IPFamily Family;
|
using Family = IPFamily;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Byte order.
|
* Byte order.
|
||||||
|
@ -381,7 +378,8 @@ public:
|
||||||
return ! ( addr1 <= addr2 );
|
return ! ( addr1 <= addr2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Converts the address into the type used internally by the
|
/**
|
||||||
|
* Converts the address into the type used internally by the
|
||||||
* inter-thread communication.
|
* inter-thread communication.
|
||||||
*/
|
*/
|
||||||
void ConvertToThreadingValue(threading::Value::addr_t* v) const;
|
void ConvertToThreadingValue(threading::Value::addr_t* v) const;
|
||||||
|
@ -601,7 +599,8 @@ public:
|
||||||
*/
|
*/
|
||||||
uint8_t LengthIPv6() const { return length; }
|
uint8_t LengthIPv6() const { return length; }
|
||||||
|
|
||||||
/** Returns true if the given address is part of the prefix.
|
/**
|
||||||
|
* Returns true if the given address is part of the prefix.
|
||||||
*
|
*
|
||||||
* @param addr The address to test.
|
* @param addr The address to test.
|
||||||
*/
|
*/
|
||||||
|
@ -637,7 +636,8 @@ public:
|
||||||
*/
|
*/
|
||||||
std::unique_ptr<detail::HashKey> MakeHashKey() const;
|
std::unique_ptr<detail::HashKey> MakeHashKey() const;
|
||||||
|
|
||||||
/** Converts the prefix into the type used internally by the
|
/**
|
||||||
|
* Converts the prefix into the type used internally by the
|
||||||
* inter-thread communication.
|
* inter-thread communication.
|
||||||
*/
|
*/
|
||||||
void ConvertToThreadingValue(threading::Value::subnet_t* v) const
|
void ConvertToThreadingValue(threading::Value::subnet_t* v) const
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue