export interface MetaDiscovererType {
  id?: number;
  name?: string;
  key?: string;
  createDate?: Date;
}

export enum MetaDiscovererTypeEnum {
  UNKNOWN = 'UNKNOWN',
  ARP = 'ARP',
  ICMP = 'ICMP',
  MDNS = 'MDNS',
  NDP = 'NDP',
  SNMP = 'SNMP',
  TCPACK = 'TCPACK',
  TCPFIN = 'TCPFIN',
  TCPNULL = 'TCPNULL',
  TCPXmas = 'TCPXmas',
  TCPSyn = 'TCPSyn',
  TCPConnection = 'TCPConnection',
  TCPMatcher = 'TCPMatcher',
  UDPConnection = 'UDPConnection',
  UDPMatcher = 'UDPMatcher',
  UPnP = 'UPnP',
}

export const toMetaDiscovererTypeEnum = (v: MetaDiscovererType): MetaDiscovererTypeEnum => {
  return MetaDiscovererTypeEnum[v.key];
};

export const toMetaDiscovererType = (v: MetaDiscovererTypeEnum): MetaDiscovererType => {
  return {
    key: v,
  };
};
