ROHC compression/decompression library
c_udp_lite.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 c_udp_lite.c
00019  * @brief ROHC compression context for the UDP-Lite profile.
00020  * @author Didier Barvaux <didier.barvaux@toulouse.viveris.com>
00021  * @author The hackers from ROHC for Linux
00022  */
00023 
00024 #ifndef C_UDP_LITE_H
00025 #define C_UDP_LITE_H
00026 
00027 #include <netinet/udp.h>
00028 
00029 #include "c_generic.h"
00030 #include "udp_lite.h"
00031 
00032 
00033 /// @brief The maximal number of times the checksum coverage dit not change
00034 ///        or may be inferred
00035 #define MAX_LITE_COUNT 2
00036 
00037 
00038 /**
00039  * @brief Define the UDP-Lite-specific temporary variables in the profile
00040  *        compression context.
00041  *
00042  * This object must be used by the UDP-specific compression context
00043  * sc_udp_lite_context.
00044  *
00045  * @see sc_udp_lite_context
00046  */
00047 struct udp_lite_tmp_vars
00048 {
00049         /// The size of the UDP-Lite packet (header + payload)
00050         int udp_size;
00051 };
00052 
00053 
00054 /**
00055  * @brief Define the UDP-Lite part of the profile compression context.
00056  *
00057  * This object must be used with the generic part of the compression
00058  * context c_generic_context.
00059  *
00060  * @see c_generic_context
00061  */
00062 struct sc_udp_lite_context
00063 {
00064         /// Whether the Coverage Field is Present or not
00065         int cfp;
00066         /// Whether the Coverage Field is Inferred or not
00067         int cfi;
00068 
00069         /// The F and K bits in the CCE packet (see appendix B in the RFC 4019)
00070         unsigned char FK;
00071 
00072         /// The number of times the checksum coverage field did not change
00073         int coverage_equal_count;
00074         /// The number of times the checksum coverage field may be inferred
00075         int coverage_inferred_count;
00076         /// Temporary variables related to the checksum coverage field
00077         int tmp_coverage;
00078 
00079         /// The number of CCE() packets sent by the compressor
00080         int sent_cce_only_count;
00081         /// The number of CCE(ON) packets sent by the compressor
00082         int sent_cce_on_count;
00083         /// The number of CCE(OFF) packets sent by the compressor
00084         int sent_cce_off_count;
00085 
00086         /// The previous UDP-Lite header
00087         struct udphdr old_udp_lite;
00088 
00089         /// @brief UDP-Lite-specific temporary variables that are used during one
00090         ///        single compression of packet
00091         struct udp_lite_tmp_vars tmp;
00092 };
00093 
00094 
00095 #endif
00096