#NEWLINE# @ classmethod #NEWLINE# def parser( cls , buf ) : #NEWLINE# #INDENT# ( mask , hello_interval , options , priority , dead_interval , designated_router , backup_router ) = struct . unpack_from ( cls . _PACK_STR , six . binary_type ( buf ) ) #NEWLINE# mask = addrconv . ipv4 . bin_to_text ( mask ) #NEWLINE# designated_router = addrconv . ipv4 . bin_to_text ( designated_router ) #NEWLINE# backup_router = addrconv . ipv4 . bin_to_text ( backup_router ) #NEWLINE# neighbors = [ ] #NEWLINE# binneighbors = buf [ cls . _PACK_LEN : len ( buf ) ] #NEWLINE# while binneighbors : #NEWLINE# #INDENT# n = binneighbors [ : 4 ] #NEWLINE# n = addrconv . ipv4 . bin_to_text ( six . binary_type ( n ) ) #NEWLINE# binneighbors = binneighbors [ 4 : ] #NEWLINE# neighbors . append ( n ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'mask' : mask , #NEWLINE# 'hello_interval' : hello_interval , #NEWLINE# 'options' : options , #NEWLINE# 'priority' : priority , #NEWLINE# 'dead_interval' : dead_interval , #NEWLINE# 'designated_router' : designated_router , #NEWLINE# 'backup_router' : backup_router , #NEWLINE# 'neighbors' : neighbors , #NEWLINE# #UNINDENT# }