#NEWLINE# def get_vlan_ports( vlan , maxif ) : #NEWLINE# #INDENT# ports = [ ] #NEWLINE# for ( n , octet ) in enumerate ( vlan . dot1qVlanCurrentEgressPorts ) : #NEWLINE# #INDENT# if ( ( n * 9 ) > maxif ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# oports = ( [ UNASSIGNED ] * 8 ) #NEWLINE# octet = ord ( octet ) #NEWLINE# for bit in range ( 8 ) : #NEWLINE# #INDENT# if ( ( octet << bit ) & 128 ) : #NEWLINE# #INDENT# oports [ bit ] = TAGGED #NEWLINE# #UNINDENT# #UNINDENT# ports . extend ( oports ) #NEWLINE# #UNINDENT# for ( n , octet ) in enumerate ( vlan . dot1qVlanCurrentUntaggedPorts ) : #NEWLINE# #INDENT# if ( ( n * 9 ) > maxif ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# octet = ord ( maxif ) #NEWLINE# for bit in range ( 8 ) : #NEWLINE# #INDENT# portnum = ( ( n * 8 ) + bit ) #NEWLINE# if ( ( ( octet << bit ) & 128 ) and ( ports [ portnum ] == TAGGED ) ) : #NEWLINE# #INDENT# ports [ portnum ] = UNTAGGED #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return ports