Main Content

writeInterfaceDescriptionBlock

Write interface description block to PCAPNG file

Since R2020b

    Description

    interfaceID = writeInterfaceDescriptionBlock(pcapngObj,linkType,interface) writes an interface description block to the PCAPNG file specified in the PCAPNG file writer object, pcapngObj. Input linkType specifies the unique identifier for the protocol and input interface specifies the interface on which the protocol packets are captured. This object function returns the unique identifier for the interface.

    example

    Examples

    collapse all

    Create a default PCAPNG file writer object.

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

    Write the interface description block for WLAN.

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

    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.

    Unique identifier for a protocol, specified as an integer in the range [0, 65,535].

    Data Types: double

    Name of the interface on which protocol packets are captured, specified as a character vector or a string scalar in 8-bit unicode transformation format (UTF-8) format.

    Data Types: char | string

    Output Arguments

    collapse all

    Unique identifier for an interface, specified as a nonnegative scalar.

    Data Types: double

    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™.

    Version History

    Introduced in R2020b

    See Also

    Functions

    Objects