AddString('Name'); $Desc->AddString('Target'); $Desc->AddString('Comment'); $Desc->AddReference('Domain', 'NetworkDomain'); return $Desc; } } class NetworkDevice extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddString('Name'); $Desc->AddReference('Type', NetworkDeviceType::GetClassName()); $Desc->AddReference('Location', Member::GetClassName()); $Desc->AddReference('Service', ServiceCustomerRel::GetClassName()); $Desc->AddBoolean('Used'); $Desc->AddBoolean('Online'); $Desc->AddDateTime('LastOnline'); $Desc->AddBoolean('PermanentOnline'); $Desc->AddReference('MapPosition', MapPosition::GetClassName()); $Desc->AddReference('Product', Product::GetClassName()); $Desc->AddString('LoginName'); $Desc->AddString('LoginPassword'); $Desc->AddReference('API', DeviceAPIType::GetClassName()); $Desc->AddInteger('InboundNATPriority'); return $Desc; } } class NetworkDeviceType extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddString('Name'); $Desc->AddBoolean('ShowOnline'); $Desc->AddString('IconName'); return $Desc; } } class NetworkDeviceLog extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddDateTime('Time'); $Desc->AddReference('Device', NetworkDevice::GetClassName()); $Desc->AddString('Message'); $Desc->AddString('Tags'); return $Desc; } } class NetworkInterface extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddString('Name'); $Desc->AddReference('Type', NetworkInterfaceType::GetClassName()); $Desc->AddString('MAC'); $Desc->AddString('LocalIP'); $Desc->AddString('IPv6'); $Desc->AddString('ExternalIP'); $Desc->AddReference('Device', NetworkDevice::GetClassName()); $Desc->AddBoolean('Enabled'); $Desc->AddBoolean('Online'); $Desc->AddDateTime('LastOnline'); return $Desc; } } class NetworkInterfaceType extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddString('Name'); $Desc->AddInteger('MaxSpeed'); $Desc->AddBoolean('FullDuplex'); $Desc->AddString('Color'); return $Desc; } } class NetworkSubnet extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddString('Name'); $Desc->AddString('AddressRange'); $Desc->AddInteger('Mask'); $Desc->AddString('DHCP'); $Desc->AddString('Gateway'); $Desc->AddString('WINS'); $Desc->AddString('DNS'); $Desc->AddString('Domain'); $Desc->AddString('NTP'); $Desc->AddReference('Member', Member::GetClassName()); $Desc->AddReference('Service', ServiceCustomerRel::GetClassName()); $Desc->AddString('ExtAddressRange'); $Desc->AddString('ExtMask'); $Desc->AddString('AddressRangeIPv6'); $Desc->AddInteger('MaskIPv6'); $Desc->AddInteger('Configure'); return $Desc; } } class NetworkPort extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddString('Name'); $Desc->AddInteger('Protocol'); $Desc->AddInteger('Number'); $Desc->AddReference('Interface', NetworkInterface::GetClassName()); $Desc->AddBoolean('Enabled'); $Desc->AddBoolean('Online'); $Desc->AddDateTime('LastOnline'); return $Desc; } } class NetworkSpeedLimit extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddString('Name'); $Desc->AddInteger('SpeedMaxOut'); $Desc->AddInteger('SpeedMaxIn'); $Desc->AddReference('Parent', NetworkSpeedLimit::GetClassName()); return $Desc; } } class NetworkInterfaceLatency extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddDateTime('Time'); $Desc->AddReference('Interface', NetworkInterface::GetClassName()); $Desc->AddFloat('Value'); return $Desc; } } class NetworkLink extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddReference('Type', NetworkLinkType::GetClassName()); $Desc->AddReference('Interface1', NetworkInterface::GetClassName()); $Desc->AddReference('Interface2', NetworkInterface::GetClassName()); return $Desc; } } class NetworkLinkType extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddString('Name'); $Desc->AddInteger('MaxLinkSpeed'); $Desc->AddInteger('MaxRealSpeed'); $Desc->AddBoolean('FullDuplex'); $Desc->AddString('Color'); return $Desc; } } class NetworkSignal extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddDateTime('Time'); $Desc->AddReference('MAC', NetworkMac::GetClassName()); $Desc->AddReference('Interface', NetworkInterface::GetClassName()); $Desc->AddInteger('Value'); $Desc->AddInteger('Remote'); $Desc->AddInteger('RateRx'); $Desc->AddInteger('RateTx'); $Desc->AddReference('Device', NetworkDevice::GetClassName()); return $Desc; } } class NetworkAddressCategory extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddString('Name'); return $Desc; } } class NetworkDomain extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddString('Name'); $Desc->AddReference('Parent', NetworkDomain::GetClassName()); $Desc->AddString('Description'); $Desc->AddInteger('Serial'); $Desc->AddInteger('Minimum'); $Desc->AddInteger('Retry'); $Desc->AddInteger('Expire'); $Desc->AddInteger('Refresh'); $Desc->AddInteger('TTL'); return $Desc; } } class NetworkDomainServer extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddString('Address'); $Desc->AddReference('Domain', NetworkDomain::GetClassName()); $Desc->AddInteger('Sequence'); return $Desc; } } class NetworkDomainView extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddString('Name'); $Desc->AddString('SysName'); $Desc->AddReference('Device', NetworkDevice::GetClassName()); $Desc->AddString('AddressRange'); return $Desc; } } class NetworkDomainItemFilter extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddString('Name'); $Desc->AddReference('Device', NetworkDevice::GetClassName()); $Desc->AddReference('AddressCategory', NetworkAddressCategory::GetClassName()); $Desc->AddString('Suffix'); $Desc->AddReference('View', NetworkDomainView::GetClassName()); $Desc->AddString('AddressRange'); return $Desc; } } class DeviceAPIType extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddString('Name'); return $Desc; } } class NetworkInterfaceWireless extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddString('SSID'); $Desc->AddString('MAC'); $Desc->AddReference('NetworkInterface', NetworkInterface::GetClassName()); $Desc->AddInteger('TxPower'); $Desc->AddInteger('CableAttenuation'); $Desc->AddReference('Antenna', Product::GetClassName()); $Desc->AddInteger('AntennaGain'); $Desc->AddInteger('AntennaPolarity'); $Desc->AddFloat('Frequency'); $Desc->AddInteger('ChannelWidthLower'); $Desc->AddInteger('ChannelWidth'); $Desc->AddInteger('ChannelWidthUpper'); $Desc->AddInteger('Mode'); $Desc->AddString('Description'); return $Desc; } } class NetworkDeviceConfig extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddReference('Device', NetworkDevice::GetClassName()); $Desc->AddDate('Time'); $Desc->AddText('ConfigFull'); $Desc->AddText('ConfigCompact'); return $Desc; } } class NetworkInterfaceUpDown extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddDateTime('Time'); $Desc->AddReference('Interface', NetworkInterface::GetClassName()); $Desc->AddInteger('State'); $Desc->AddInteger('Duration'); return $Desc; } } class NetworkPortUpDown extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Desc->AddDateTime('Time'); $Desc->AddReference('Port', NetworkPort::GetClassName()); $Desc->AddInteger('State'); $Desc->AddInteger('Duration'); return $Desc; } } class NetworkMac extends Model { static function GetModelDesc(): ModelDesc { $Desc = new ModelDesc(self::GetClassName()); $Column = $Desc->AddString('MAC'); $Column->MaxLength = 17; return $Desc; } function GetIndex(string $MAC) { $DbResult = $this->Database->select('NetworkMac', 'Id', 'MAC="'.$MAC.'"'); if ($DbResult->num_rows > 0) { $DbRow = $DbResult->fetch_assoc(); return $DbRow['Id']; } else { return $this->Database->insert('NetworkMac', array('MAC' => $MAC)); } } }