ROHC compression/decompression library
rohc_fingerprint.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 Didier Barvaux
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 /**
20  * @file rohc_fingerprint.h
21  * @brief The unique fingerprint of one compression context or uncompressed packet
22  * @author Didier Barvaux <didier@barvaux.org>
23  */
24 
25 #ifndef ROHC_PROTOCOLS_FINGERPRINT_H
26 #define ROHC_PROTOCOLS_FINGERPRINT_H
27 
28 #include "protocols/ip.h"
29 #include "protocols/ipv6.h"
30 #include "rohc_profiles.h"
31 
32 #include <stdint.h>
33 
34 #ifdef __KERNEL__
35 # include <endian.h>
36 #else
37 # include "config.h" /* for WORDS_BIGENDIAN */
38 #endif
39 
40 
41 /**
42  * @brief The unique fingerprint of one IP header
43  */
45 {
46  uint32_t version:4;
47  uint32_t next_proto:8;
48  uint32_t flow_label:20;
49  struct ipv6_addr saddr;
50  struct ipv6_addr daddr;
51 } __attribute__((packed));
52 
53 
54 /**
55  * @brief The part of the unique fingerprint for Context Replication
56  */
58 {
60 
61  uint8_t ip_hdrs_nr; /**< The number of IP headers */
63 } __attribute__((packed));
64 
65 
66 /**
67  * @brief The unique fingerprint of one compression context or uncompressed packet
68  */
70 {
72 
73  union
74  {
75  struct
76  {
77  uint16_t src_port;
78  uint16_t dst_port;
79  } __attribute__((packed));
80  uint32_t esp_spi;
81  };
82 
83  uint32_t rtp_ssrc;
84 
85 } __attribute__((packed));
86 
87 #endif
88 
struct ipv6_addr saddr
Definition: rohc_fingerprint.h:49
uint32_t rtp_ssrc
Definition: rohc_fingerprint.h:83
rohc_profile_t profile_id
Definition: rohc_fingerprint.h:59
The part of the unique fingerprint for Context Replication.
Definition: rohc_fingerprint.h:57
uint16_t src_port
Definition: rohc_fingerprint.h:77
struct rohc_fingerprint_ip ip_hdrs[ROHC_MAX_IP_HDRS]
Definition: rohc_fingerprint.h:62
uint32_t version
Definition: rohc_fingerprint.h:46
Definition of ROHC profiles.
uint16_t dst_port
Definition: rohc_fingerprint.h:78
The unique fingerprint of one IP header.
Definition: rohc_fingerprint.h:44
struct rohc_fingerprint_base base
Definition: rohc_fingerprint.h:71
The IPv6 header.
uint32_t next_proto
Definition: rohc_fingerprint.h:47
struct ipv6_addr daddr
Definition: rohc_fingerprint.h:50
uint32_t flow_label
Definition: rohc_fingerprint.h:48
The IPv6 address.
Definition: ipv6.h:59
The unique fingerprint of one compression context or uncompressed packet.
Definition: rohc_fingerprint.h:69
uint32_t esp_spi
Definition: rohc_fingerprint.h:80
uint8_t ip_hdrs_nr
Definition: rohc_fingerprint.h:61
Defines the common IPv4/v6 header.
rohc_profile_t
The different ROHC compression/decompression profiles.
Definition: rohc_profiles.h:76
#define ROHC_MAX_IP_HDRS
The maximum number of IP headers supported.
Definition: protocols/ip.h:46