import { NftExecutor } from './nft.executor.js'; import { NatManager } from './nft.manager.nat.js'; import { FirewallManager } from './nft.manager.firewall.js'; import { RateLimitManager } from './nft.manager.ratelimit.js'; import type { TNftFamily, INftCleanupOptions, INftRuleGroup, INftStatus, ISmartNftablesOptions } from './nft.types.js'; /** * SmartNftables — high-level facade for managing nftables rules. * * Provides sub-managers for NAT, firewall, and rate limiting. * All rules are tracked in logical groups and can be removed individually or cleaned up entirely. */ export declare class SmartNftables { readonly nat: NatManager; readonly firewall: FirewallManager; readonly rateLimit: RateLimitManager; readonly tableName: string; readonly family: TNftFamily; readonly executor: NftExecutor; private initialized; private hasFilterChains; private warnedNonRoot; private ruleGroups; constructor(options?: ISmartNftablesOptions); /** * Initialize the nftables table and NAT chains. Idempotent. */ initialize(): Promise; /** * Ensure filter chains (input/forward/output) are created. * Called automatically when firewall or rate-limit rules are added. */ ensureFilterChains(): Promise; /** * Ensure the table is initialized before applying rules. */ ensureInitialized(): Promise; /** * Apply a group of nft commands and track them under the given ID. */ applyRuleGroup(groupId: string, commands: string[]): Promise; /** * Remove a tracked rule group. Removes from tracking. * Note: full kernel cleanup requires cleanup() — individual rule removal * would require handle-based tracking. */ removeRuleGroup(groupId: string): Promise; /** * Get a tracked rule group by ID. */ getRuleGroup(groupId: string): INftRuleGroup | undefined; /** * Delete the entire nftables table and clear all tracking. */ cleanup(options?: INftCleanupOptions): Promise; /** * Check if the managed nftables table exists in the kernel. * Returns false if not root, not initialized, or the table was removed externally. */ tableExists(): Promise; /** * Get status report of the managed nftables state. */ status(): INftStatus; }