def _class_for_nxm_header(raw):
 (t, has_mask, length) = nxm_entry.unpack_header(raw, 0)
 c = _nxm_type_to_class.get(t)
 if c:
  return c
 vendor = ((t >> 7) & 65535)
 field = (t & 127)
 typename = 'NXM_UNKNOWN_'
 typename += ('%04x_%02x' % (vendor, field))
 if has_mask:
  typename += '_MASKABLE'
 types = [_nxm_raw]
 if has_mask:
  types.append(_nxm_maskable)
 return _make_nxm(typename, vendor, field, length, types)

def _class_for_nxm_header ( raw ) : ( t , has_mask , length ) = nxm_entry . unpack_header ( raw , 0 ) c = _nxm_type_to_class . get ( t ) if c : return c vendor = ( ( t >> 7 ) & 65535 ) field = ( t & 127 ) typename = 'NXM_UNKNOWN_' typename += ( '%04x_%02x' % ( vendor , field ) ) if has_mask : typename += '_MASKABLE' types = [ _nxm_raw ] if has_mask : types . append ( _nxm_maskable ) return _make_nxm ( typename , vendor , field , length , types )
given a raw nxm_entry header .