Closed eryx67 closed 4 years ago
Hi @eryx67 thanks. Thought about implementing sctp and diameter some time ago because you get it almost for free in gopacket but forgot it somehow ;) Thanks for this.
I did not test it so fingers crossed that you did the testing :D Btw things like
case 0: //DATA
pkt.Payload = sctp.Payload[16:]
case 64: //IDATA
pkt.Payload = sctp.Payload[20:]
can go crash quite easily so maybe you could check the length too ;)
I did not test it so fingers crossed that you did the testing :D Btw things like
Yes, I've done tests with pcap files and on wire.
If I understand gopacket
code correctly it makes packet checking but doesn't expose results as layers:
https://github.com/google/gopacket/blob/0ad7f2610e344e58c1c95e2adda5c3258da8e97b/layers/sctp.go#L38
Ok nice! It depends on the layer implementation, some make the Packet length check some don't. The newer ones makes them normally. I did not look into the gopacket sctp layer implementation but when a sctp packet for case 0 is always at least 16bytes long and in case 64 20 bytes your code should be safe and no length check is needed.
added SCTP transport layer for decoding