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 <stddef.h> 00029 00030 00031 /// The magic bits to find out whether a field is a segment field or not 00032 #define D_SEGMENT (0xfe >> 1) 00033 /// The magic byte to find out whether a field is a padding field or not 00034 #define D_PADDING 0xe0 00035 00036 /// The magic bits to find out whether a ROHC packet is a Feedback packet or not 00037 #define D_FEEDBACK (0xf0 >> 3) 00038 /// The magic bits to find out whether a ROHC packet is an IR packet or not 00039 #define D_IR_PACKET (0xfc >> 1) 00040 /// The magic byte to find out whether a ROHC packet is an IR-DYN packet or not 00041 #define D_IR_DYN_PACKET 0xf8 00042 00043 /// @brief The magic bits to find out whether a ROHC packet starts with an 00044 /// add-CID byte or not 00045 #define D_ADD_CID 0xe 00046 00047 00048 /* 00049 * Function prototypes. 00050 */ 00051 00052 int d_is_segment(const unsigned char *); 00053 int d_is_padding(const unsigned char *); 00054 00055 int d_is_feedback(const unsigned char *); 00056 int d_feedback_size(const unsigned char *); 00057 int d_feedback_headersize(const unsigned char *); 00058 00059 int d_is_ir(const unsigned char *data, const size_t len); 00060 int d_is_irdyn(const unsigned char *data, const size_t len); 00061 00062 int d_is_add_cid(const unsigned char *); 00063 int d_decode_add_cid(const unsigned char *); 00064 00065 00066 #endif 00067