Revision 28f46c8d mininet/util.py

View differences:

mininet/util.py
136 136

  
137 137
# IP and Mac address formatting and parsing
138 138

  
139
def _colonHex( val, bytes ):
139
def _colonHex( val, count ):
140 140
    """Generate colon-hex string.
141 141
       val: input as unsigned int
142
       bytes: number of bytes to convert
142
       count: number of bytes to convert
143 143
       returns: chStr colon-hex string"""
144 144
    pieces = []
145
    for i in range( bytes - 1, -1, -1 ):
145
    for i in range( count - 1, -1, -1 ):
146 146
        piece = ( ( 0xff << ( i * 8 ) ) & val ) >> ( i * 8 )
147 147
        pieces.append( '%02x' % piece )
148 148
    chStr = ':'.join( pieces )

Also available in: Unified diff