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

31 lines
421 B
Plaintext
Raw Normal View History

2015-03-27 22:54:25 +00:00
=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'
}}}