/** * @file dcep.ts * @description Data Channel Establishment Protocol (RFC 8832) message codec. * @module sctp/dcep * * DCEP runs on PPID 50 and negotiates a data channel on an SCTP stream: * DATA_CHANNEL_OPEN (0x03) -> DATA_CHANNEL_ACK (0x02) */ export declare const MESSAGE_TYPE: Readonly<{ DATA_CHANNEL_ACK: 2; DATA_CHANNEL_OPEN: 3; }>; export declare const CHANNEL_TYPE: Readonly<{ RELIABLE: 0; RELIABLE_UNORDERED: 128; PARTIAL_RELIABLE_REXMIT: 1; PARTIAL_RELIABLE_REXMIT_UNORDERED: 129; PARTIAL_RELIABLE_TIMED: 2; PARTIAL_RELIABLE_TIMED_UNORDERED: 130; }>; export interface OpenParams { channelType: number; priority?: number; reliabilityParameter?: number; label?: string; protocol?: string; } export interface DecodedOpen { channelType: number; priority: number; reliabilityParameter: number; label: string; protocol: string; unordered: boolean; } /** * Encode a DATA_CHANNEL_OPEN message. * @param {Object} p * @param {number} p.channelType * @param {number} p.priority * @param {number} p.reliabilityParameter * @param {string} p.label * @param {string} p.protocol * @returns {Buffer} */ export declare function encodeOpen({ channelType, priority, reliabilityParameter, label, protocol }: OpenParams): Buffer; /** * Decode a DATA_CHANNEL_OPEN message. * @param {Buffer} buf * @returns {Object} */ export declare function decodeOpen(buf: Buffer): DecodedOpen; /** Encode a DATA_CHANNEL_ACK message. */ export declare function encodeAck(): Buffer; /** Return the message type of a DCEP buffer. */ export declare function messageType(buf: Buffer): number;