ROHC compression/decompression library
ip_id_offset.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2012,2013 Didier Barvaux
00003  * Copyright 2007,2009,2010 Viveris Technologies
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Lesser General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2.1 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00018  */
00019 
00020 /**
00021  * @file   ip_id_offset.h
00022  * @brief  Offset IP-ID decoding
00023  * @author Didier Barvaux <didier.barvaux@toulouse.viveris.com>
00024  * @author Didier Barvaux <didier@barvaux.org>
00025  */
00026 
00027 #ifndef ROHC_DECOMP_IP_ID_OFFSET_H
00028 #define ROHC_DECOMP_IP_ID_OFFSET_H
00029 
00030 #include <stdint.h>
00031 #include <stdlib.h>
00032 #ifdef __KERNEL__
00033 #       include <linux/types.h>
00034 #else
00035 #       include <stdbool.h>
00036 #endif
00037 
00038 #include "dllexport.h"
00039 
00040 
00041 /* The definition of the Offset IP-ID decoding object is private */
00042 struct ip_id_offset_decode;
00043 
00044 
00045 /*
00046  * Function prototypes.
00047  */
00048 
00049 struct ip_id_offset_decode * ROHC_EXPORT ip_id_offset_new(void);
00050 
00051 void ROHC_EXPORT ip_id_offset_free(struct ip_id_offset_decode *const ipid)
00052         __attribute__((nonnull(1)));
00053 
00054 bool ROHC_EXPORT ip_id_offset_decode(const struct ip_id_offset_decode *const ipid,
00055                                      const uint16_t m,
00056                                      const size_t k,
00057                                      const uint32_t sn,
00058                                      uint16_t *const decoded)
00059         __attribute__((nonnull(1, 5), warn_unused_result));
00060 
00061 void ROHC_EXPORT ip_id_offset_set_ref(struct ip_id_offset_decode *const ipid,
00062                                       const uint16_t id_ref,
00063                                       const uint32_t sn_ref)
00064         __attribute__((nonnull(1)));
00065 
00066 #endif
00067