Add IPv4 range optimization for IP to AS lookups
- Add v4_ip_start and v4_ip_end columns to live_routes table - Calculate IPv4 CIDR ranges as 32-bit integers for fast lookups - Update PrefixHandler to populate IPv4 range fields - Add GetASInfoForIP method with optimized IPv4 queries - Add comprehensive tests for IP conversion functions
This commit is contained in:
@@ -10,11 +10,6 @@ func generateUUID() uuid.UUID {
|
||||
return uuid.New()
|
||||
}
|
||||
|
||||
const (
|
||||
ipVersionV4 = 4
|
||||
ipVersionV6 = 6
|
||||
)
|
||||
|
||||
// detectIPVersion determines if a prefix is IPv4 (returns 4) or IPv6 (returns 6)
|
||||
func detectIPVersion(prefix string) int {
|
||||
if strings.Contains(prefix, ":") {
|
||||
|
||||
Reference in New Issue
Block a user