/**
 * Type definitions for SNMP module
 */

/**
 * UPS status interface
 */
export interface IUpsStatus {
  /** Current power status */
  powerStatus: 'online' | 'onBattery' | 'unknown';
  /** Battery capacity percentage */
  batteryCapacity: number;
  /** Remaining runtime in minutes */
  batteryRuntime: number;
  /** Raw values from SNMP responses */
  raw: Record<string, any>;
}

/**
 * SNMP OID Sets for different UPS brands
 */
export interface IOidSet {
  /** OID for power status */
  POWER_STATUS: string;
  /** OID for battery capacity */
  BATTERY_CAPACITY: string;
  /** OID for battery runtime */
  BATTERY_RUNTIME: string;
}

/**
 * Supported UPS model types
 */
export type TUpsModel = 'cyberpower' | 'apc' | 'eaton' | 'tripplite' | 'liebert' | 'custom';

/**
 * SNMP Configuration interface
 */
export interface ISnmpConfig {
  /** SNMP server host */
  host: string;
  /** SNMP server port (default 161) */
  port: number;
  /** SNMP version (1, 2, or 3) */
  version: number;
  /** Timeout in milliseconds */
  timeout: number;

  context?: string;
  
  // SNMPv1/v2c
  /** Community string for SNMPv1/v2c */
  community?: string;
  
  // SNMPv3
  /** Security level for SNMPv3 */
  securityLevel?: 'noAuthNoPriv' | 'authNoPriv' | 'authPriv';
  /** Username for SNMPv3 authentication */
  username?: string;
  /** Authentication protocol for SNMPv3 */
  authProtocol?: 'MD5' | 'SHA';
  /** Authentication key for SNMPv3 */
  authKey?: string;
  /** Privacy protocol for SNMPv3 */
  privProtocol?: 'DES' | 'AES';
  /** Privacy key for SNMPv3 */
  privKey?: string;
  
  // UPS model and custom OIDs
  /** UPS model for OID selection */
  upsModel?: TUpsModel;
  /** Custom OIDs when using custom UPS model */
  customOIDs?: IOidSet;
}

/**
 * SNMPv3 security parameters
 */
export interface ISnmpV3SecurityParams {
  /** Engine ID for the SNMP server */
  msgAuthoritativeEngineID: Buffer;
  /** Engine boots counter */
  msgAuthoritativeEngineBoots: number;
  /** Engine time counter */
  msgAuthoritativeEngineTime: number;
  /** Username for authentication */
  msgUserName: string;
  /** Authentication parameters */
  msgAuthenticationParameters: Buffer;
  /** Privacy parameters */
  msgPrivacyParameters: Buffer;
}