Review cleanup

- Add constructors for ConnIDKey, remove BuildConnIDKey()
- Rename protocol stats classes and move to implementation file
- Rename "num" field of protocol stats to "active"
- Explicitly delete copy operations for SessionKey
- Change argument for ProtocolStats methods to const-reference
- Make key validity methods in Session not be virtual
- Rename Session::ClearKey and Session::IsKeyValid
This commit is contained in:
Tim Wojtulewicz 2021-04-23 14:27:16 -07:00
parent ca553fda27
commit c8844677f1
9 changed files with 142 additions and 140 deletions

View file

@ -28,12 +28,9 @@ struct ConnIDKey {
uint16_t port2;
TransportProto transport;
ConnIDKey() : port1(0), port2(0), transport(TRANSPORT_UNKNOWN)
{
memset(&ip1, 0, sizeof(in6_addr));
memset(&ip2, 0, sizeof(in6_addr));
}
ConnIDKey(const IPAddr& src, const IPAddr& dst, uint16_t src_port,
uint16_t dst_port, TransportProto t, bool one_way);
ConnIDKey(const ConnID& conn);
ConnIDKey(const ConnIDKey& rhs)
{
*this = rhs;
@ -55,11 +52,6 @@ struct ConnIDKey {
}
};
/**
* Returns a map key for a given ConnID.
*/
ConnIDKey BuildConnIDKey(const ConnID& id);
} // namespace detail
/**
@ -398,8 +390,6 @@ public:
*/
void ConvertToThreadingValue(threading::Value::addr_t* v) const;
friend detail::ConnIDKey detail::BuildConnIDKey(const ConnID& id);
unsigned int MemoryAllocation() const { return padded_sizeof(*this); }
/**
@ -451,6 +441,7 @@ public:
static const IPAddr v6_unspecified;
private:
friend struct detail::ConnIDKey;
friend class IPPrefix;
/**