style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-7505528228218001"
data-ad-slot="1225241371">

SctpData header does not decode multiple SCTP data chunks from bundled SCTP packet.

No replies
wgroleau
Offline
Joined: 11/14/2016

My application is receiving an SCTP packet with multiple data chunks and I am wondering why the following logic is not decoding the multiple data chunks properly:

PcapPacketHandler jpacketHandler = new PcapPacketHandler() {

@Override
public void nextPacket(PcapPacket packet, String user) {
//user defined headers that are registered properly
GREHeader greHeader = new GREHeader();
ERSPANHeader erspanHeader = new ERSPANHeader();
try {
if (packet.hasHeader(greHeader)) {
packet.getHeader(greHeader);
if (packet.hasHeader(erspanHeader)) {

JPacket jpacket = new JMemoryPacket(Ethernet.ID, erspanHeader.getPayload());
Iterator sctpData = jpacket.iterator(SctpData.class);
//only loops once even though there are 4 data chunks
while (sctpData.hasNext()) {

SctpData current = sctpData.next();
//returns a payload length of all the data chunks
current.getPayloadLength();
}
}
}
} catch (Throwable ex) {
}
}
};