Main Content

writeCustomBlock

Write custom block to PCAPNG file

    Description

    example

    writeCustomBlock(pcapngObj,customData) writes the custom block data, customData, to a PCAPNG file specified in the PCAPNG file writer object.

    Examples

    collapse all

    Create a default PCAPNG file writer object.

    pcapngObj = pcapngWriter('FileName','writeWLANcustom');

    Write the interface block for WLAN.

    interfaceName = 'WLAN';
    wlanLinkType = 105;
    interfaceId = writeInterfaceDescriptionBlock(pcapngObj,wlanLinkType, ...
        interfaceName);

    Write the custom block to specify user-defined data.

    writeCustomBlock(pcapngObj,"This block writes user-defined data");

    Input Arguments

    collapse all

    Note

    The pcapngWriter object does not overwrite the existing PCAPNG file. During each call of this object, specify a unique PCAPNG file name.

    PCAPNG file writer object, specified as a pcapngWriter object.

    User-defined data, specified as a character vector or a string scalar.

    Data Types: char | string

    References

    [1] Tuexen, M. “PCAP Next Generation (Pcapng) Capture File Format.” 2020. https://www.ietf.org/.

    [2] “Radiotap - Introduction.” Accessed May 20, 2020. https://www.radiotap.org/.

    [3] Group, The Tcpdump. “Tcpdump/Libpcap Public Repository.” Accessed May 20, 2020. https://www.tcpdump.org.

    [4] “Development/LibpcapFileFormat - The Wireshark Wiki.” Accessed May 20, 2020. https://www.wireshark.org.

    Extended Capabilities

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Introduced in R2020b