ROHC compression/decompression library
wlsb.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 
00025 #ifndef WLSB_H
00026 #define WLSB_H
00027 
00028 #include <strings.h>
00029 
00030 #include "rohc.h"
00031 
00032 
00034 #define C_WINDOW_WIDTH 4
00035 
00036 
00040 struct c_window
00041 {
00044         int sn;
00045 
00048         int time;
00049 
00051         int value;
00052 
00054         boolean used;
00055 };
00056 
00057 
00061 struct c_wlsb
00062 {
00065         struct c_window *window;
00067         int window_width;
00068 
00070         int oldest;
00072         int next;
00073 
00075         int bits;
00077         int p;
00078 };
00079 
00080 
00081 /*
00082  * Public function prototypes:
00083  */
00084 
00085 struct c_wlsb *c_create_wlsb(int bits, int window_width, int p);
00086 void c_destroy_wlsb(struct c_wlsb *s);
00087 
00088 void c_add_wlsb(struct c_wlsb *s, int sn, int time, int value);
00089 int c_get_k_wlsb(struct c_wlsb *s, int value);
00090 
00091 void c_ack_sn_wlsb(struct c_wlsb *s, int sn);
00092 void c_ack_time_wlsb(struct c_wlsb *s, int time);
00093 
00094 int c_sum_wlsb(struct c_wlsb *s);
00095 int c_mean_wlsb(struct c_wlsb *s);
00096 
00097 
00098 void print_wlsb_stats(struct c_wlsb *s);
00099 
00100 void f(int v_ref, int k, int p, int *min, int *max);
00101 
00102 
00103 #endif
00104