ROHC compression/decompression library
c_udp.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 
00024 #ifndef C_UDP_H
00025 #define C_UDP_H
00026 
00027 #include <netinet/ip.h>
00028 #include <netinet/udp.h>
00029 
00030 #include "c_generic.h"
00031 
00032 
00041 struct udp_tmp_variables
00042 {
00044         int send_udp_dynamic;
00045 };
00046 
00047 
00056 struct sc_udp_context
00057 {
00059         int udp_checksum_change_count;
00060 
00062         struct udphdr old_udp;
00063 
00066         struct udp_tmp_variables tmp_variables;
00067 };
00068 
00069 
00070 /*
00071  * Function prototypes.
00072  */
00073 
00074 int c_udp_create(struct c_context *context, const struct ip_packet ip);
00075 
00076 int c_udp_check_context(struct c_context *context, const struct ip_packet ip);
00077 
00078 int c_udp_encode(struct c_context *context,
00079                  const struct ip_packet ip,
00080                  int packet_size,
00081                  unsigned char *dest,
00082                  int dest_size,
00083                  int *payload_offset);
00084 
00085 void udp_decide_state(struct c_context *context);
00086 
00087 int udp_code_UO_packet_tail(struct c_context *context,
00088                             const unsigned char *next_header,
00089                             unsigned char *dest,
00090                             int counter);
00091 
00092 int udp_code_static_udp_part(struct c_context *context,
00093                              const unsigned char *next_header,
00094                              unsigned char *dest,
00095                              int counter);
00096 
00097 
00098 #endif
00099