#NEWLINE# def _id_to_cookie( self , id_type , rest_id ) : #NEWLINE# #INDENT# vid = ( self . vlan_id << COOKIE_SHIFT_VLANID ) #NEWLINE# if ( id_type == REST_VLANID ) : #NEWLINE# #INDENT# cookie = ( rest_id << COOKIE_SHIFT_VLANID ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( id_type == REST_ADDRESSID ) : #NEWLINE# #INDENT# cookie = ( vid + rest_id ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert ( self == REST_ROUTEID ) #NEWLINE# cookie = ( vid + ( rest_id << COOKIE_SHIFT_ROUTEID ) ) #NEWLINE# #UNINDENT# #UNINDENT# return cookie