source: trunk/packages/python-pydhcplib/examples/hwaddr_example.py @ 2151

Last change on this file since 2151 was 1191, checked in by broder, 16 years ago

Strip the sipb-xen prefix from packages we didn't write

File size: 699 bytes
RevLine 
[361]1#!/usr/bin/python
2
3from pydhcplib.type_hw_addr import hwmac
4
5
6address = hwmac()
7print "a0 : ",address
8
9address1 = hwmac("ff:11:22:33:44:55")
10print "a1 : ",address1
11
12address2 = hwmac("f6.16.26.36.46.56")
13print "a2 : ",address2
14
15address3 = hwmac("ff.11-22:33-44.55")
16print "a3 : ",address3
17
18
19
20if address1 == address2 : print "test 1 : ",address1, "==",address2
21else : print "test 1 : " ,address1, "!=",address2
22
23if address1 == address3 : print "test 2 : ", address1, "==",address3
24else : print "test 2 : ", address1, "!=",address3
25
26
27
28address4 = hwmac([186, 45, 67, 176, 6, 11])
29address5 = hwmac("ba:2d:43:b0:06:0c")
30   
31print "b0 : ", address4,address4.list()
32print "b1 : ", address5,address5.list()
Note: See TracBrowser for help on using the repository browser.