def _bgp_capability_dispatcher(payload):
 cls = _capabilities_registry['BGPCapGeneric']
 if (payload is None):
  cls = _capabilities_registry['BGPCapGeneric']
 else:
  length = len(payload)
  if (length >= _BGP_CAPABILITY_MIN_SIZE):
   code = struct.unpack('!B', payload[0])[0]
   cls = _get_cls(_capabilities_objects.get(code, 'BGPCapGeneric'))
 return cls

def _bgp_capability_dispatcher ( payload ) : cls = _capabilities_registry [ 'BGPCapGeneric' ] if ( payload is None ) : cls = _capabilities_registry [ 'BGPCapGeneric' ] else : length = len ( payload ) if ( length >= _BGP_CAPABILITY_MIN_SIZE ) : code = struct . unpack ( '!B' , payload [ 0 ] ) [ 0 ] cls = _get_cls ( _capabilities_objects . get ( code , 'BGPCapGeneric' ) ) return cls
returns the right class for a given bgp capability .