set 'don't fragment flag" in PcapPlusPlus lib

86 views Asked by At

I create IP packets using PcapPlusPlus lib. On IP Level I want to set a “Don't fragment” flag. There is a define PCPP_IP_DONT_FRAGMENT in IPv4Layer.h in the lib, but I don't see any ways to use it.

Does anyone know how to set "don't fragment flag" (using the PcapPlusPlus library)? I use release v20.08.

1

There are 1 answers

0
seladb On

There is currently no way to set a "don't fragment flag". As a workaround you can set it through fragmentOffset:

pcpp::IPv4Layer ip4Layer(ipSrc, ipDst);
ip4Layer.getIPv4Header()->fragmentOffset = PCPP_IP_DONT_FRAGMENT

It'd be great if you can open an issue to add this functionality or even better - suggest a PR with this feature