ROHC compression/decompression library
ip_id_offset_decode.h
Go to the documentation of this file.
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   ip_id_offset_decode.h
00019  * @brief  Offset IP-ID decoding
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 ROHC_IP_ID_OFFSET_H
00026 #define ROHC_IP_ID_OFFSET_H
00027 
00028 #include "lsb_decode.h"
00029 #include "dllexport.h"
00030 
00031 #include <stdint.h>
00032 
00033 
00034 /* The definition of the Offset IP-ID decoding object is private */
00035 struct ip_id_offset_decode;
00036 
00037 
00038 /*
00039  * Function prototypes.
00040  */
00041 
00042 struct ip_id_offset_decode * ROHC_EXPORT ip_id_offset_new(void);
00043 
00044 void ROHC_EXPORT ip_id_offset_free(struct ip_id_offset_decode *const ipid)
00045         __attribute__((nonnull(1)));
00046 
00047 bool ROHC_EXPORT ip_id_offset_decode(const struct ip_id_offset_decode *const ipid,
00048                                      const uint16_t m,
00049                                      const size_t k,
00050                                      const uint32_t sn,
00051                                      uint16_t *const decoded)
00052         __attribute__((nonnull(1, 5), warn_unused_result));
00053 
00054 void ROHC_EXPORT ip_id_offset_set_ref(struct ip_id_offset_decode *const ipid,
00055                                       const uint16_t id_ref,
00056                                       const uint32_t sn_ref)
00057         __attribute__((nonnull(1)));
00058 
00059 #endif
00060