/** * @module node-opcua-transport */ import { type UAString } from "node-opcua-basic-types"; import { BinaryStream, type OutputBinaryStream } from "node-opcua-binary-stream"; import { BaseUAObject } from "node-opcua-factory"; /** * The maximum encoded length (in bytes) of the ServerUri and EndpointUrl fields. * * OPC UA Part 6 §7.1.2.6 (Table 77) mandates that a Client shall reject a * ReverseHello whose ServerUri or EndpointUrl exceeds 4096 bytes. */ export declare const MAXIMUM_REVERSE_HELLO_FIELD_LENGTH = 4096; export interface ReverseHelloMessageOptions { serverUri?: UAString; endpointUrl?: UAString; } export declare class ReverseHelloMessage extends BaseUAObject { static possibleFields: string[]; serverUri: UAString; endpointUrl: UAString; constructor(options?: ReverseHelloMessageOptions); encode(stream: OutputBinaryStream): void; decode(stream: BinaryStream): void; toString(): string; } /** * Decode a ReverseHello ("RHE") message from a raw TCP message chunk. * * The chunk MUST be a single, final ("F") RHE frame: * [ 'R' 'H' 'E' ] [ 'F' ] [ UInt32 messageSize ] [ ServerUri ] [ EndpointUrl ] * * This deliberately does NOT go through `tools.ts#decodeMessage`, whose * `is_valid_msg_type` allowlist / ERR special-casing does not apply to RHE, and * because the inbound `readMessageHeader` does not itself validate the 3-char * message type — so we assert it here. * * @throws an Error tagged with `.statusCode = BadTcp*` when the message is not a * well-formed RHE or when either field exceeds the 4096-byte spec limit. */ export declare function decodeReverseHello(messageChunk: Buffer): ReverseHelloMessage; /** * Validate that ServerUri / EndpointUrl are present and within the 4096-byte limit. * Used both on decode (client side) and before packing (server side) so we never * emit or accept an out-of-spec ReverseHello. * * @throws an Error tagged with `.statusCode = BadTcpEndpointUrlInvalid` */ export declare function validateReverseHelloFields(reverseHello: ReverseHelloMessage): void; //# sourceMappingURL=ReverseHelloMessage.d.ts.map