Skip to content

Commit ec147b4

Browse files
authored
Merge pull request #167 from CESNET/ovpn_fix
Improvment of OVPN plugin
2 parents 75bcec9 + 897cd87 commit ec147b4

File tree

4 files changed

+319
-250
lines changed

4 files changed

+319
-250
lines changed

Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ ipfixprobe_headers_src=\
182182
include/ipfixprobe/packet.hpp \
183183
include/ipfixprobe/ring.h \
184184
include/ipfixprobe/byte-utils.hpp \
185-
include/ipfixprobe/ipfix-elements.hpp
185+
include/ipfixprobe/ipfix-elements.hpp \
186+
include/ipfixprobe/rtp.hpp
186187

187188
ipfixprobe_src=\
188189
$(ipfixprobe_input_src) \

include/ipfixprobe/rtp.hpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include <inttypes.h>
2+
#include <limits>
3+
4+
struct __attribute__((packed)) rtp_header {
5+
union {
6+
struct {
7+
#if defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN
8+
uint16_t csrc_count : 4;
9+
uint16_t extension : 1;
10+
uint16_t padding : 1;
11+
uint16_t version : 2;
12+
// next byte
13+
uint16_t payload_type : 7;
14+
uint16_t marker : 1;
15+
#elif defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN
16+
uint16_t version : 2;
17+
uint16_t padding : 1;
18+
uint16_t extension : 1;
19+
uint16_t csrc_count : 4;
20+
// next byte
21+
uint16_t marker : 1;
22+
uint16_t payload_type : 7;
23+
24+
#else // if defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN
25+
#error "Please fix <endian.h>"
26+
#endif // if defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN
27+
};
28+
uint16_t flags;
29+
};
30+
uint16_t sequence_number;
31+
uint32_t timestamp;
32+
uint32_t ssrc;
33+
};

0 commit comments

Comments
 (0)