TrafficAnalyser.prototype.add = function (data) {

    const stream = new BinaryStream(data);
    if (argv.block) {
        console.log(hexDump(data));
        return;
    }
    const messageHeader = opcua.readMessageHeader(stream);

    if (messageHeader.msgType === "ERR") {

        var err = new s.TCPErrorMessage();
        err.decode(stream);
        console.log(" Error 0x" + err.statusCode.toString() + " reason:" + err.reason);
        console.log(hexDump(data));
    }

    const messageBuild = new MessageBuilder();
    messageBuild.on("full_message_body", function (full_message_body) {

        console.log(hexDump(full_message_body));

        try {
            analyseExtensionObject(full_message_body);
        }
        catch (err) {
            console.log(chalk.red("ERROR : "), err);
        }
    });


    switch (messageHeader.msgType) {

        case "HEL":
        case "ACK":
            if (this.id % 2) {
                console.log(chalk.red.bold(JSON.stringify(messageHeader, null, "")));
            } else {
                console.log(chalk.yellow.bold(JSON.stringify(messageHeader, null, "")));
            }
            break;

        case "OPN": // open secure channel
        case "CLO": // close secure channel
        case "MSG": // message
                    // decode secure message
            if (this.id % 2) {
                console.log(chalk.red.bold(messageHeaderToString(data)));
            } else {
                console.log(chalk.yellow.bold(messageHeaderToString(data)));
            }

            messageBuild.feed(data);
            break;
        case "ERR":
            console.log(hexDump(data));
            break;
        default:
            break;

    }

};
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.