netwatch.py/netaddr-0.7.10/netaddr/tests/2.x/ip/multicast.txt

31 lines
420 B
Plaintext

=IP Multicast Tests=
Copyright (c) 2008-2012, David P. D. Moss. All rights reserved.
{{{
>>> from netaddr import *
>>> ip = IPAddress('239.192.0.1')
>>> ip.is_multicast()
True
>>> ip = IPAddress(3221225984)
>>> ip = IPAddress('224.0.1.173')
>>> ip.info.IPv4[0].designation
'Multicast'
>>> ip.info.IPv4[0].prefix
'224/8'
>>> ip.info.IPv4[0].status
'Reserved'
>>> ip.info.Multicast[0].address
'224.0.1.173'
}}