From 1b978a7e8c71dcc1501705022e66f6779c8c4528 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Wed, 1 Sep 2021 15:55:32 +0100 Subject: [netgroupman] Move GetMappedAS() and GetGroup() logic to NetGroupManager Reviewer hint: use: `git diff --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space` --- src/netgroup.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/netgroup.h') diff --git a/src/netgroup.h b/src/netgroup.h index 46afc6e3c5..4e4edb8a88 100644 --- a/src/netgroup.h +++ b/src/netgroup.h @@ -22,8 +22,23 @@ public: * exists, since the data is const. */ const std::vector& GetAsmap() const { return m_asmap; } + /** + * Get the canonical identifier of the network group for address. + * + * The groups are assigned in a way where it should be costly for an attacker to + * obtain addresses with many different group identifiers, even if it is cheap + * to obtain addresses with the same identifier. + * + * @note No two connections will be attempted to addresses with the same network + * group. + */ std::vector GetGroup(const CNetAddr& address) const; + /** + * Get the autonomous system on the BGP path to address. + * + * The ip->AS mapping depends on how asmap is constructed. + */ uint32_t GetMappedAS(const CNetAddr& address) const; private: -- cgit v1.2.3