IPV6ADDR(3)

✨ IPV6ADDR(3) ✨

okay bestie, welcome to the ipv6addr manual, version 1.1 β€” yes it's a real section 3 page, yes we're doing this, and yes it's gonna be cute πŸ’…


πŸŽ€ NAME πŸŽ€

packet.internet.ipv6addr β€” the IPv6Addr module, no cap 🌈


πŸ¦‹ DESCRIPTION πŸ¦‹

So the whole vibe here? You make an object that represents an IPv6 address. You can hand it the address either as a series of hexadecimal numbers or using the : notation β€” both are valid, pick your fighter πŸ’–

It also gives you a way to compare this object against a regular string. And because it's a generous icon, it handles the :: notation and leading zeroes for you, so you don't have to sit there counting zeros like it's a math final 😭


πŸ‘‘ CLASSES πŸ‘‘

🌸 class IPv6Addr(builtins.str) 🌸

Your actual IPv6Addr address object. It's giving str energy, because it literally is one πŸ’œ

Usage:

from packet.internet.ipv6addr import IPv6Addr

ip = IPv6Addr('fe80000000000000020c29fffe5409ef')

And now the part that genuinely ate β€” all of these expressions are equivalent, like every single one of them hits the same 🎯

ip == 0xFE80000000000000020C29FFFE5409EF
ip == 0xfe80000000000000020c29fffe5409ef
ip == '0xFE80000000000000020C29FFFE5409EF'
ip == '0xfe80000000000000020c29fffe5409ef'
ip == 'FE80000000000000020C29FFFE5409EF'
ip == 'fe80000000000000020c29fffe5409ef'
ip == 'FE80:0000:0000:0000:020C:29FF:FE54:09EF'
ip == 'fe80:0000:0000:0000:020c:29ff:fe54:09ef'
ip == 'FE80::020C:29FF:FE54:09EF'
ip == 'fe80::020c:29ff:fe54:09ef'
ip == 'FE80::20C:29FF:FE54:9EF'
ip == 'fe80::20c:29ff:fe54:9ef'

Uppercase? lowercase? 0x prefix? full form? compressed :: form? leading zeroes or nah? it does not care bestie, it treats them all the same 🫢

πŸ’« Methods defined here:

  • __eq__(self, other) β€” compares two IPv6 addresses and returns True if both are equal πŸ’š
  • __ne__(self, other) β€” compares two IPv6 addresses and returns False if both are equal. yes it's the little mirror gremlin of __eq__, that's just how it is πŸ™ˆ

⭐ Static methods defined here:

  • __new__(cls, ip) β€” creates a new instance by converting the input int/string into a persistent representation of an IPv6 address. this is the ✨main character✨ of the whole operation ngl

πŸ’€ BUGS πŸ’€

No known bugs. periodt. we love a clean record πŸ‘‘


🫢 AUTHOR 🫢

Jorge Mora (mora@netapp.com) β€” thank you for your service, king πŸŽ€


and that's the whole page bestie!! brought to you by NFStest 3.2, dated 21 March 2023 β€” iykyk, now go compare some addresses πŸ’–βœ¨πŸ¦‹