如何使用 pcapplusplus 库从数据包中获取 sctp 层?

问题描述 投票:0回答:0
// let's get the TCP layer
pcpp::TcpLayer* tcpLayer = parsedPacket.getLayerOfType<pcpp::TcpLayer>();
if (tcpLayer == NULL) {
    cout << "NO TCP LAYER" << endl;
}
else {
    // change source port
    tcpLayer->getTcpHeader()->portSrc = pcpp::hostToNet16(12345);
    // add URG flag
    tcpLayer->getTcpHeader()->urgFlag = 1;
}

这是从解析的数据包中获取 TCP 层的代码。我想知道如何从数据包中获取 sctp 层。

我想得到它的代码。

libpcap pcapplusplus pcap-ng
© www.soinside.com 2019 - 2024. All rights reserved.