← Back to team overview

rohc team mailing list archive

Re: [Question #249394]: Packets cannot be compressed while using RAW socket packets

 

Question #249394 on rohc changed:
https://answers.launchpad.net/rohc/+question/249394

    Status: Needs information => Answered

Didier Barvaux proposed the following answer:
Hello,

The Uncompressed profile is selected instead of the UDP profile because
the packet you compress is not an UDP packet. It is not an IPv4 either.

>	ip_packet_len = Size - sizeof udph - iph->ihl * 4;
>	ret=rohc_compress2(compressor,Buffer,ip_packet_len,
>                        rohc_packet, BUFFER_SIZE, &rohc_packet_len);

You skip the IPv4 and UDP headers before compression. Replace
'ip_packet_len' by 'Size' in the call to rohc_compress2() and it should
work.

Note 1: you should not create a new compressor for every new packet
Note 2: you use the old API of the ROHC library, what version of the library to you use? 

Regards,
Didier

-- 
You received this question notification because you are a member of ROHC
Team, which is an answer contact for rohc.