ROHC compression/decompression library
|
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_RTP_H 00025 #define C_RTP_H 00026 00027 #include <netinet/ip.h> 00028 #include <netinet/udp.h> 00029 00030 #include "c_generic.h" 00031 #include "c_udp.h" 00032 #include "ts_sc_comp.h" 00033 00034 00044 struct rtp_tmp_variables 00045 { 00047 int send_rtp_dynamic; 00048 00050 int nr_ts_bits; 00051 00053 int nr_ts_bits_ext3; 00054 00056 unsigned int timestamp; 00057 00059 int ts_send; 00060 00062 int m_set; 00063 00065 int rtp_pt_changed; 00066 00067 }; 00068 00069 00081 struct sc_rtp_context 00082 { 00085 int udp_checksum_change_count; 00086 00088 struct udphdr old_udp; 00089 00092 int rtp_pt_change_count; 00093 00095 struct rtphdr old_rtp; 00096 00099 struct rtp_tmp_variables tmp_variables; 00100 00102 struct c_wlsb *ts_window; 00103 00105 int tss; 00106 00108 int tis; 00109 00111 struct ts_sc_comp ts_sc; 00112 }; 00113 00114 00115 /* 00116 * Function prototypes. 00117 */ 00118 00119 int c_rtp_create(struct c_context *context, const struct ip_packet ip); 00120 void c_rtp_destroy(struct c_context *context); 00121 00122 int c_rtp_check_context(struct c_context *context, const struct ip_packet ip); 00123 00124 int c_rtp_encode(struct c_context *context, 00125 const struct ip_packet ip, 00126 int packet_size, 00127 unsigned char *dest, 00128 int dest_size, 00129 int *payload_offset); 00130 00131 void rtp_decide_state(struct c_context *context); 00132 00133 int rtp_code_UO_packet_tail(struct c_context *context, 00134 const unsigned char *next_header, 00135 unsigned char *dest, 00136 int counter); 00137 00138 int rtp_code_static_rtp_part(struct c_context *context, 00139 const unsigned char *next_header, 00140 unsigned char *dest, 00141 int counter); 00142 00143 int rtp_code_dynamic_rtp_part(struct c_context *context, 00144 const unsigned char *next_header, 00145 unsigned char *dest, 00146 int counter); 00147 00148 int rtp_changed_rtp_dynamic(struct c_context *context, 00149 const struct udphdr *udp); 00150 00151 00152 #endif 00153