UNPKG

@timo972/ufw

Version:

ufw <-> nodejs app communication

71 lines (70 loc) 1.49 kB
import { Protocol } from "./enum/proto.enum"; export interface ExistingRule { id: number; } /** * @class Rule * @author @Timo972 */ export declare class Rule { private _id?; private _from?; private _to?; private _port?; private _proto?; /** * @param {number} _id WARNING: Do not pass something here!!! Only used internally. */ constructor(_id?: number); /** * * @param {string} ip ipv4 or ipv6 address * @returns {Rule} */ to(ip: string): Rule; /** * * @param {string} ip ipv4 or ipv6 address * @returns {Rule} */ from(ip: string): Rule; /** * * @param {Protocol} protocol can be any, tcp, udp * @returns {Rule} */ proto(proto: Protocol): Rule; /** * * @param {number} port from 0-65535 * @returns {Rule} */ port(port: number): Rule; /** * * @returns {number} */ getPort(): number | undefined; /** * * @returns {Protocol} */ getProtocol(): Protocol; /** * * @returns {string} */ getFrom(): string | undefined; /** * * @returns {string} */ getTo(): string | undefined; /** * function returns undefined if you have created this rule * @returns {number} rule id */ getId(): number | undefined; toJSON(): string; buildUfwCommand(): string; }