ROHC compression/decompression library
|
00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 2 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * This program is distributed in the hope that it will be useful, 00008 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00010 * GNU General Public License for more details. 00011 * 00012 * You should have received a copy of the GNU General Public License 00013 * along with this program; if not, write to the Free Software 00014 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00015 */ 00016 00017 /** 00018 * @file decode.h 00019 * @brief ROHC packet related routines 00020 * @author Didier Barvaux <didier.barvaux@toulouse.viveris.com> 00021 * @author Didier Barvaux <didier@barvaux.org> 00022 * @author The hackers from ROHC for Linux 00023 */ 00024 00025 #ifndef DECODE_H 00026 #define DECODE_H 00027 00028 #include "dllexport.h" 00029 00030 #include <stddef.h> 00031 #include <stdbool.h> 00032 00033 00034 /// The magic bits to find out whether a field is a segment field or not 00035 #define D_SEGMENT (0xfe >> 1) 00036 /// The magic byte to find out whether a field is a padding field or not 00037 #define D_PADDING 0xe0 00038 00039 /// The magic bits to find out whether a ROHC packet is a Feedback packet or not 00040 #define D_FEEDBACK (0xf0 >> 3) 00041 /// The magic bits to find out whether a ROHC packet is an IR packet or not 00042 #define D_IR_PACKET (0xfc >> 1) 00043 /// The magic byte to find out whether a ROHC packet is an IR-DYN packet or not 00044 #define D_IR_DYN_PACKET 0xf8 00045 00046 /// @brief The magic bits to find out whether a ROHC packet starts with an 00047 /// add-CID byte or not 00048 #define D_ADD_CID 0xe 00049 00050 00051 /* 00052 * Function prototypes. 00053 */ 00054 00055 int ROHC_EXPORT d_is_segment(const unsigned char *); 00056 int ROHC_EXPORT d_is_padding(const unsigned char *); 00057 00058 int ROHC_EXPORT d_is_feedback(const unsigned char *); 00059 int ROHC_EXPORT d_feedback_size(const unsigned char *); 00060 int ROHC_EXPORT d_feedback_headersize(const unsigned char *); 00061 00062 bool ROHC_EXPORT d_is_ir(const unsigned char *data, const size_t len); 00063 bool ROHC_EXPORT d_is_irdyn(const unsigned char *data, const size_t len); 00064 bool ROHC_EXPORT d_is_uo0(const unsigned char *data, const size_t len); 00065 bool ROHC_EXPORT d_is_uo1(const unsigned char *data, const size_t len); 00066 bool ROHC_EXPORT d_is_uor2(const unsigned char *data, const size_t len); 00067 bool ROHC_EXPORT d_is_uor2_ts(const unsigned char *const data, 00068 const size_t data_len, 00069 const size_t large_cid_len); 00070 bool ROHC_EXPORT d_is_uor2_rtp(const unsigned char *const data, 00071 const size_t data_len, 00072 const size_t large_cid_len); 00073 00074 int ROHC_EXPORT d_is_add_cid(const unsigned char *); 00075 int ROHC_EXPORT d_decode_add_cid(const unsigned char *); 00076 00077 00078 #endif 00079