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