home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.protocols.tcp-ip      TCP and IP network protocols.      14,669 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 14,281 of 14,669   
   Jorgen Grahn to ElChino   
   Re: IPv6 prefix-length struggle   
   27 Nov 16 19:10:52   
   
   From: grahn+nntp@snipabacken.se   
      
   On Sun, 2016-11-27, ElChino wrote:   
   > I'm having some troubles figuring out the CIDR "prefix length"   
   > of a IPv6 addresses range.   
   >   
   > Specifically, in some code that reads MaxMind's GeoIPv6.dat records,   
   > the low and high IP-numbers of IPv6-blocks are given like:   
   >   IP-num low:  76:96:42:219::   
   >   IP-num high: 76:96:42:219:ffff:ffff:ffff:ffff   
   >   (belonging to 'United States')   
   >   
   > I need to figure out how to print this using CIDR notation.   
   > E.g. if I have the 2 above addresses in   
   >   struct in6_addr a, b;   
   >   
   > I've cooked up this function after much head-scratching:   
   ...   
   > The above code (+inet_ntop(&a..)) will print "76:96:42:219::/64".   
   > Does this make sense for you experts?   
      
   I'm no expert and I've not read your code.  However, at least the   
   /result/ is correct.  76:96:42:219:: and 76:96:42:219:ffff:ffff:ffff:ffff   
   differ after 4 identical words, i.e. 64 bits.   
      
   The best thing would be if people stopped using any notation but   
   addr/len.  Is there any reason to use first--last or address, mask   
   today?  For IPv6?   
      
   /Jorgen   
      
   --   
     // Jorgen Grahn    O  o   .   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca