ROHC compression/decompression library
rohc_comp.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2010,2012,2013,2014 Didier Barvaux
00003  * Copyright 2013 Friedrich
00004  * Copyright 2009,2010 Thales Communications
00005  * Copyright 2007,2009,2010,2012,2013,2014 Viveris Technologies
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020  */
00021 
00022 /**
00023  * @file rohc_comp.h
00024  * @brief ROHC compression routines
00025  * @author Didier Barvaux <didier.barvaux@toulouse.viveris.com>
00026  * @author Didier Barvaux <didier@barvaux.org>
00027  */
00028 
00029 #ifndef ROHC_COMP_H
00030 #define ROHC_COMP_H
00031 
00032 #ifdef __cplusplus
00033 extern "C"
00034 {
00035 #endif
00036 
00037 #include <rohc/rohc.h>
00038 #include <rohc/rohc_packets.h>
00039 #include <rohc/rohc_traces.h>
00040 #include <rohc/rohc_time.h>
00041 #include <rohc/rohc_buf.h>
00042 
00043 #include <stdlib.h>
00044 #include <stdint.h>
00045 #ifdef __KERNEL__
00046 #       include <linux/types.h>
00047 #else
00048 #       include <stdbool.h>
00049 #endif
00050 
00051 
00052 /** Macro that handles DLL export declarations gracefully */
00053 #ifdef DLL_EXPORT /* passed by autotools on command line */
00054         #define ROHC_EXPORT __declspec(dllexport)
00055 #else
00056         #define ROHC_EXPORT 
00057 #endif
00058 
00059 
00060 /*
00061  * Declare the private ROHC compressor structure that is defined inside the
00062  * library.
00063  */
00064 
00065 struct rohc_comp;
00066 
00067 
00068 /*
00069  * Public structures and types
00070  */
00071 
00072 
00073 #if !defined(ROHC_ENABLE_DEPRECATED_API) || ROHC_ENABLE_DEPRECATED_API == 1
00074 
00075 /**
00076  * @brief The different ROHC compressor states
00077  *
00078  * The different ROHC operation states at compressor as defined in section
00079  * 4.3.1 of RFC 3095.
00080  *
00081  * If you add a new compressor state, please also add the corresponding
00082  * textual description in \ref rohc_comp_get_state_descr.
00083  *
00084  * @deprecated do not use this type anymore, use \ref rohc_comp_state_t
00085  *             instead
00086  *
00087  * @ingroup rohc_comp
00088  *
00089  * @see rohc_comp_get_state_descr
00090  */
00091 typedef enum
00092 {
00093         /** The Initialization and Refresh (IR) compressor state */
00094         IR = 1,
00095         /** The First Order (FO) compressor state */
00096         FO = 2,
00097         /** The Second Order (SO) compressor state */
00098         SO = 3,
00099 } rohc_c_state
00100         ROHC_DEPRECATED("please do not use this type anymore, "
00101                         "use rohc_comp_state_t instead");
00102 
00103 #endif /* !ROHC_ENABLE_DEPRECATED_API) */
00104 
00105 /**
00106  * @brief The different ROHC compressor states
00107  *
00108  * The different ROHC operation states at compressor as defined in section
00109  * 4.3.1 of RFC 3095.
00110  *
00111  * If you add a new compressor state, please also add the corresponding
00112  * textual description in \ref rohc_comp_get_state_descr.
00113  *
00114  * @ingroup rohc_comp
00115  *
00116  * @see rohc_comp_get_state_descr
00117  */
00118 typedef enum
00119 {
00120         /** The Initialization and Refresh (IR) compressor state */
00121         ROHC_COMP_STATE_IR = 1,
00122         /** The First Order (FO) compressor state */
00123         ROHC_COMP_STATE_FO = 2,
00124         /** The Second Order (SO) compressor state */
00125         ROHC_COMP_STATE_SO = 3,
00126 
00127 } rohc_comp_state_t;
00128 
00129 
00130 #if !defined(ROHC_ENABLE_DEPRECATED_API) || ROHC_ENABLE_DEPRECATED_API == 1
00131 
00132 /**
00133  * @brief Some information about the last compressed packet
00134  *
00135  * Non-extensible version of \ref rohc_comp_last_packet_info2_t
00136  *
00137  * @deprecated do not use this struct anymore,
00138  *             use rohc_comp_last_packet_info2_t instead
00139  *
00140  * @ingroup rohc_comp
00141  */
00142 typedef struct
00143 {
00144         rohc_mode_t context_mode;              /**< Compression mode */
00145         rohc_comp_state_t context_state;       /**< Compression state */
00146         rohc_packet_t packet_type;             /**< Packet type */
00147         unsigned long total_last_uncomp_size;  /**< Uncompressed packet size (bytes) */
00148         unsigned long header_last_uncomp_size; /**< Uncompressed header size (bytes) */
00149         unsigned long total_last_comp_size;    /**< Compressed packet size (bytes) */
00150         unsigned long header_last_comp_size;   /**< Compressed header size (bytes) */
00151 
00152 } rohc_comp_last_packet_info_t;
00153 
00154 #endif /* !ROHC_ENABLE_DEPRECATED_API */
00155 
00156 
00157 /**
00158  * @brief Some information about the last compressed packet
00159  *
00160  * The structure is used by the \ref rohc_comp_get_last_packet_info2 function
00161  * to store some information about the last compressed packet.
00162  *
00163  * Versioning works as follow:
00164  *  - The \e version_major field defines the compatibility level. If the major
00165  *    number given by user does not match the one expected by the library,
00166  *    an error is returned.
00167  *  - The \e version_minor field defines the extension level. If the minor
00168  *    number given by user does not match the one expected by the library,
00169  *    only the fields supported in that minor version will be filled by
00170  *    \ref rohc_comp_get_last_packet_info2.
00171  *
00172  * Notes for developers:
00173  *  - Increase the major version if a field is removed.
00174  *  - Increase the major version if a field is added at the beginning or in
00175  *    the middle of the structure.
00176  *  - Increase the minor version if a field is added at the very end of the
00177  *    structure.
00178  *  - The version_major and version_minor fields must be located at the very
00179  *    beginning of the structure.
00180  *  - The structure must be packed.
00181  *
00182  * Supported versions:
00183  *  - Major 0 / Minor 0 contains: version_major, version_minor, context_id,
00184  *    is_context_init, context_mode, context_state, context_used, profile_id,
00185  *    packet_type, total_last_uncomp_size, header_last_uncomp_size,
00186  *    total_last_comp_size, and header_last_comp_size
00187  *
00188  * @ingroup rohc_comp
00189  *
00190  * @see rohc_comp_get_last_packet_info2
00191  */
00192 typedef struct
00193 {
00194         /** The major version of this structure */
00195         unsigned short version_major;
00196         /** The minor version of this structure */
00197         unsigned short version_minor;
00198         /** The Context ID (CID) */
00199         unsigned int context_id;
00200         /** Whether the context was initialized (created/re-used) by the packet */
00201         bool is_context_init;
00202         /** The mode of the last context used by the compressor */
00203         rohc_mode_t context_mode;
00204         /** The state of the last context used by the compressor */
00205         rohc_comp_state_t context_state;
00206         /** Whether the last context used by the compressor is still in use */
00207         bool context_used;
00208         /** The profile ID of the last context used by the compressor */
00209         int profile_id;
00210         /** The type of ROHC packet created for the last compressed packet */
00211         rohc_packet_t packet_type;
00212         /** The uncompressed size (in bytes) of the last compressed packet */
00213         unsigned long total_last_uncomp_size;
00214         /** The uncompressed size (in bytes) of the last compressed header */
00215         unsigned long header_last_uncomp_size;
00216         /** The compressed size (in bytes) of the last compressed packet */
00217         unsigned long total_last_comp_size;
00218         /** The compressed size (in bytes) of the last compressed header */
00219         unsigned long header_last_comp_size;
00220 } __attribute__((packed)) rohc_comp_last_packet_info2_t;
00221 
00222 
00223 /**
00224  * @brief Some general information about the compressor
00225  *
00226  * The structure is used by the \ref rohc_comp_get_general_info function
00227  * to store some general information about the compressor.
00228  *
00229  * Versioning works as follow:
00230  *  - The \e version_major field defines the compatibility level. If the major
00231  *    number given by user does not match the one expected by the library,
00232  *    an error is returned.
00233  *  - The \e version_minor field defines the extension level. If the minor
00234  *    number given by user does not match the one expected by the library,
00235  *    only the fields supported in that minor version will be filled by
00236  *    \ref rohc_comp_get_general_info.
00237  *
00238  * Notes for developers:
00239  *  - Increase the major version if a field is removed.
00240  *  - Increase the major version if a field is added at the beginning or in
00241  *    the middle of the structure.
00242  *  - Increase the minor version if a field is added at the very end of the
00243  *    structure.
00244  *  - The version_major and version_minor fields must be located at the very
00245  *    beginning of the structure.
00246  *  - The structure must be packed.
00247  *
00248  * Supported versions:
00249  *  - major 0 and minor = 0 contains: version_major, version_minor,
00250  *    contexts_nr, packets_nr, uncomp_bytes_nr, and comp_bytes_nr.
00251  *
00252  * @ingroup rohc_comp
00253  *
00254  * @see rohc_comp_get_general_info
00255  */
00256 typedef struct
00257 {
00258         /** The major version of this structure */
00259         unsigned short version_major;
00260         /** The minor version of this structure */
00261         unsigned short version_minor;
00262         /** The number of contexts used by the compressor */
00263         size_t contexts_nr;
00264         /** The number of packets processed by the compressor */
00265         unsigned long packets_nr;
00266         /** The number of uncompressed bytes received by the compressor */
00267         unsigned long uncomp_bytes_nr;
00268         /** The number of compressed bytes produced by the compressor */
00269         unsigned long comp_bytes_nr;
00270 } __attribute__((packed)) rohc_comp_general_info_t;
00271 
00272 
00273 /**
00274  * @brief The different features of the ROHC compressor
00275  *
00276  * Features for the ROHC compressor control whether mechanisms defined as
00277  * optional by RFCs are enabled or not. They can be set or unset with the
00278  * function \ref rohc_comp_set_features.
00279  *
00280  * @ingroup rohc_comp
00281  *
00282  * @see rohc_comp_set_features
00283  */
00284 typedef enum
00285 {
00286         /** No feature at all */
00287         ROHC_COMP_FEATURE_NONE            = 0,
00288         /** Be compatible with 1.6.x versions */
00289         ROHC_COMP_FEATURE_COMPAT_1_6_x    = (1 << 0),
00290         /** Do not check IP checksums at compressor */
00291         ROHC_COMP_FEATURE_NO_IP_CHECKSUMS = (1 << 2),
00292 
00293 } rohc_comp_features_t;
00294 
00295 
00296 /**
00297  * @brief The prototype of the RTP detection callback
00298  *
00299  * User-defined function that is called by the ROHC library for every UDP
00300  * packet to determine whether the UDP packet transports RTP data. If the
00301  * function returns true, the RTP profile is used to compress the packet.
00302  * Otherwise the UDP profile is used.
00303  *
00304  * The user-defined function is set by calling the function
00305  * \ref rohc_comp_set_rtp_detection_cb
00306  *
00307  * @param ip           The innermost IP packet
00308  * @param udp          The UDP header of the packet
00309  * @param payload      The UDP payload of the packet
00310  * @param payload_size The size of the UDP payload (in bytes)
00311  * @param rtp_private  A pointer to a memory area to be used by the callback
00312  *                     function, may be NULL.
00313  * @return             true if the packet is an RTP packet, false otherwise
00314  *
00315  * @see rohc_comp_set_rtp_detection_cb
00316  * @ingroup rohc_comp
00317  */
00318 typedef bool (*rohc_rtp_detection_callback_t)(const unsigned char *const ip,
00319                                               const unsigned char *const udp,
00320                                               const unsigned char *const payload,
00321                                               const unsigned int payload_size,
00322                                               void *const rtp_private)
00323         __attribute__((warn_unused_result));
00324 
00325 
00326 /**
00327  * @brief The prototype of the callback for random numbers
00328  *
00329  * User-defined function that is called when the ROHC library requires a random
00330  * number. Currently, the ROHC library uses it when initializing the Sequence
00331  * Number (SN) of contexts using the IP-only, IP/UDP, and IP/UDP-Lite profiles.
00332  *
00333  * The user-defined function is set by calling the function
00334  * \ref rohc_comp_set_random_cb
00335  *
00336  * @param comp          The ROHC compressor
00337  * @param user_context  The context given by the user when he/she called the
00338  *                      rohc_comp_set_random_cb function, may be NULL.
00339  *
00340  * @see rohc_comp_set_random_cb
00341  * @ingroup rohc_comp
00342  */
00343 typedef int (*rohc_comp_random_cb_t) (const struct rohc_comp *const comp,
00344                                       void *const user_context)
00345         __attribute__((warn_unused_result));
00346 
00347 
00348 /*
00349  * Prototypes of main public functions related to ROHC compression
00350  */
00351 
00352 #if !defined(ROHC_ENABLE_DEPRECATED_API) || ROHC_ENABLE_DEPRECATED_API == 1
00353 
00354 struct rohc_comp * ROHC_EXPORT rohc_alloc_compressor(int max_cid,
00355                                                      int jam_use,
00356                                                      int adapt_size,
00357                                                      int encap_size)
00358         ROHC_DEPRECATED("please do not use this function anymore, "
00359                         "use rohc_comp_new() instead");
00360 
00361 void ROHC_EXPORT rohc_free_compressor(struct rohc_comp *comp)
00362         ROHC_DEPRECATED("please do not use this function anymore, "
00363                         "use rohc_comp_free() instead");
00364 
00365 struct rohc_comp * ROHC_EXPORT rohc_comp_new(const rohc_cid_type_t cid_type,
00366                                              const rohc_cid_t max_cid)
00367         __attribute__((warn_unused_result))
00368         ROHC_DEPRECATED("do not use this function anymore, "
00369                         "use rohc_comp_new2() instead");
00370 
00371 #endif /* !ROHC_ENABLE_DEPRECATED_API */
00372 
00373 struct rohc_comp * ROHC_EXPORT rohc_comp_new2(const rohc_cid_type_t cid_type,
00374                                               const rohc_cid_t max_cid,
00375                                               const rohc_comp_random_cb_t rand_cb,
00376                                               void *const rand_priv)
00377         __attribute__((warn_unused_result));
00378 
00379 void ROHC_EXPORT rohc_comp_free(struct rohc_comp *const comp);
00380 
00381 #if !defined(ROHC_ENABLE_DEPRECATED_API) || ROHC_ENABLE_DEPRECATED_API == 1
00382 
00383 bool ROHC_EXPORT rohc_comp_set_traces_cb(struct rohc_comp *const comp,
00384                                          rohc_trace_callback_t callback)
00385         __attribute__((warn_unused_result))
00386         ROHC_DEPRECATED("do not use this function anymore, "
00387                         "use rohc_comp_set_traces_cb2() instead");
00388 
00389 #endif /* !ROHC_ENABLE_DEPRECATED_API */
00390 
00391 bool ROHC_EXPORT rohc_comp_set_traces_cb2(struct rohc_comp *const comp,
00392                                           rohc_trace_callback2_t callback,
00393                                           void *const priv_ctxt)
00394         __attribute__((warn_unused_result));
00395 
00396 #if !defined(ROHC_ENABLE_DEPRECATED_API) || ROHC_ENABLE_DEPRECATED_API == 1
00397 
00398 bool ROHC_EXPORT rohc_comp_set_random_cb(struct rohc_comp *const comp,
00399                                          rohc_comp_random_cb_t callback,
00400                                          void *const user_context)
00401         __attribute__((warn_unused_result))
00402         ROHC_DEPRECATED("do not use this function anymore, "
00403                         "use rohc_comp_new2() instead");
00404 
00405 int ROHC_EXPORT rohc_compress(struct rohc_comp *comp,
00406                               unsigned char *ibuf,
00407                               int isize,
00408                               unsigned char *obuf,
00409                               int osize)
00410         ROHC_DEPRECATED("please do not use this function anymore, "
00411                         "use rohc_compress4() instead");
00412 
00413 int ROHC_EXPORT rohc_compress2(struct rohc_comp *const comp,
00414                                const unsigned char *const uncomp_packet,
00415                                const size_t uncomp_packet_len,
00416                                unsigned char *const rohc_packet,
00417                                const size_t rohc_packet_max_len,
00418                                size_t *const rohc_packet_len)
00419         __attribute__((warn_unused_result))
00420         ROHC_DEPRECATED("please do not use this function anymore, "
00421                         "use rohc_compress4() instead");
00422 
00423 int ROHC_EXPORT rohc_compress3(struct rohc_comp *const comp,
00424                                const struct rohc_ts arrival_time,
00425                                const unsigned char *const uncomp_packet,
00426                                const size_t uncomp_packet_len,
00427                                unsigned char *const rohc_packet,
00428                                const size_t rohc_packet_max_len,
00429                                size_t *const rohc_packet_len)
00430         __attribute__((warn_unused_result))
00431         ROHC_DEPRECATED("please do not use this function anymore, "
00432                         "use rohc_compress4() instead");
00433 
00434 #endif /* !ROHC_ENABLE_DEPRECATED_API */
00435 
00436 rohc_status_t ROHC_EXPORT rohc_compress4(struct rohc_comp *const comp,
00437                                          const struct rohc_buf uncomp_packet,
00438                                          struct rohc_buf *const rohc_packet)
00439         __attribute__((warn_unused_result));
00440 
00441 #if !defined(ROHC_ENABLE_DEPRECATED_API) || ROHC_ENABLE_DEPRECATED_API == 1
00442 int ROHC_EXPORT rohc_comp_get_segment(struct rohc_comp *const comp,
00443                                       unsigned char *const segment,
00444                                       const size_t max_len,
00445                                       size_t *const len)
00446         __attribute__((warn_unused_result))
00447         ROHC_DEPRECATED("please do not use this function anymore, "
00448                         "use rohc_comp_get_segment2() instead");
00449 #endif /* !ROHC_ENABLE_DEPRECATED_API */
00450 
00451 rohc_status_t ROHC_EXPORT rohc_comp_get_segment2(struct rohc_comp *const comp,
00452                                                  struct rohc_buf *const segment)
00453         __attribute__((warn_unused_result));
00454 
00455 bool ROHC_EXPORT rohc_comp_force_contexts_reinit(struct rohc_comp *const comp)
00456         __attribute__((warn_unused_result));
00457 
00458 
00459 /*
00460  * Prototypes of public functions related to user interaction
00461  */
00462 
00463 #if !defined(ROHC_ENABLE_DEPRECATED_API) || ROHC_ENABLE_DEPRECATED_API == 1
00464 int ROHC_EXPORT rohc_c_is_enabled(struct rohc_comp *comp)
00465         ROHC_DEPRECATED("do not use this function anymore, the ROHC compressor "
00466                         "shall be considered always enabled now");
00467 int ROHC_EXPORT rohc_c_using_small_cid(struct rohc_comp *comp)
00468         ROHC_DEPRECATED("please do not use this function anymore, "
00469                         "use rohc_comp_get_cid_type() instead");
00470 #endif
00471 
00472 bool ROHC_EXPORT rohc_comp_profile_enabled(const struct rohc_comp *const comp,
00473                                            const rohc_profile_t profile)
00474         __attribute__((warn_unused_result));
00475 
00476 #if !defined(ROHC_ENABLE_DEPRECATED_API) || ROHC_ENABLE_DEPRECATED_API == 1
00477 void ROHC_EXPORT rohc_activate_profile(struct rohc_comp *comp, int profile)
00478         ROHC_DEPRECATED("please do not use this function anymore, "
00479                         "use rohc_comp_enable_profile() instead");
00480 #endif /* !ROHC_ENABLE_DEPRECATED_API */
00481 bool ROHC_EXPORT rohc_comp_enable_profile(struct rohc_comp *const comp,
00482                                           const rohc_profile_t profile)
00483         __attribute__((warn_unused_result));
00484 bool ROHC_EXPORT rohc_comp_disable_profile(struct rohc_comp *const comp,
00485                                            const rohc_profile_t profile)
00486         __attribute__((warn_unused_result));
00487 
00488 bool ROHC_EXPORT rohc_comp_enable_profiles(struct rohc_comp *const comp,
00489                                            ...)
00490         __attribute__((warn_unused_result));
00491 bool ROHC_EXPORT rohc_comp_disable_profiles(struct rohc_comp *const comp,
00492                                            ...)
00493         __attribute__((warn_unused_result));
00494 
00495 #if !defined(ROHC_ENABLE_DEPRECATED_API) || ROHC_ENABLE_DEPRECATED_API == 1
00496 void ROHC_EXPORT rohc_c_set_header(struct rohc_comp *compressor, int value)
00497         ROHC_DEPRECATED("do not use this function anymore, "
00498                         "simply remove it from your code");
00499 #endif
00500 
00501 #if !defined(ROHC_ENABLE_DEPRECATED_API) || ROHC_ENABLE_DEPRECATED_API == 1
00502 void ROHC_EXPORT rohc_c_set_mrru(struct rohc_comp *compressor, int value)
00503         ROHC_DEPRECATED("please do not use this function anymore, "
00504                         "use rohc_comp_set_mrru() instead");
00505 #endif /* !ROHC_ENABLE_DEPRECATED_API */
00506 bool ROHC_EXPORT rohc_comp_set_mrru(struct rohc_comp *const comp,
00507                                     const size_t mrru)
00508         __attribute__((warn_unused_result));
00509 bool ROHC_EXPORT rohc_comp_get_mrru(const struct rohc_comp *const comp,
00510                                     size_t *const mrru)
00511         __attribute__((warn_unused_result));
00512 
00513 #if !defined(ROHC_ENABLE_DEPRECATED_API) || ROHC_ENABLE_DEPRECATED_API == 1
00514 void ROHC_EXPORT rohc_c_set_max_cid(struct rohc_comp *compressor, int value)
00515         ROHC_DEPRECATED("please do not use this function anymore, use the "
00516                         "parameter max_cid of rohc_comp_new() instead");
00517 #endif
00518 bool ROHC_EXPORT rohc_comp_get_max_cid(const struct rohc_comp *const comp,
00519                                        size_t *const max_cid)
00520         __attribute__((warn_unused_result));
00521 
00522 #if !defined(ROHC_ENABLE_DEPRECATED_API) || ROHC_ENABLE_DEPRECATED_API == 1
00523 void ROHC_EXPORT rohc_c_set_large_cid(struct rohc_comp *compressor, int value)
00524         ROHC_DEPRECATED("please do not use this function anymore, use the "
00525                         "parameter cid_type of rohc_comp_new() instead");
00526 #endif
00527 bool ROHC_EXPORT rohc_comp_get_cid_type(const struct rohc_comp *const comp,
00528                                         rohc_cid_type_t *const cid_type)
00529         __attribute__((warn_unused_result));
00530 
00531 #if !defined(ROHC_ENABLE_DEPRECATED_API) || ROHC_ENABLE_DEPRECATED_API == 1
00532 void ROHC_EXPORT rohc_c_set_enable(struct rohc_comp *compressor, int value)
00533         ROHC_DEPRECATED("do not use this function anymore, the ROHC compressor "
00534                         "shall be considered always enabled now");
00535 #endif
00536 
00537 /* RTP stream detection through UDP ports */
00538 bool ROHC_EXPORT rohc_comp_add_rtp_port(struct rohc_comp *const comp,
00539                                         const unsigned int port)
00540         __attribute__((warn_unused_result))
00541         ROHC_DEPRECATED("do not use this function anymore, "
00542                         "use rohc_comp_set_rtp_detection_cb() instead");
00543 bool ROHC_EXPORT rohc_comp_remove_rtp_port(struct rohc_comp *const comp,
00544                                            const unsigned int port)
00545         __attribute__((warn_unused_result))
00546         ROHC_DEPRECATED("do not use this function anymore, "
00547                         "use rohc_comp_set_rtp_detection_cb() instead");
00548 bool ROHC_EXPORT rohc_comp_reset_rtp_ports(struct rohc_comp *const comp)
00549         __attribute__((warn_unused_result))
00550         ROHC_DEPRECATED("do not use this function anymore, "
00551                         "use rohc_comp_set_rtp_detection_cb() instead");
00552 
00553 /* RTP stream detection through callback */
00554 bool ROHC_EXPORT rohc_comp_set_rtp_detection_cb(struct rohc_comp *const comp,
00555                                                 rohc_rtp_detection_callback_t callback,
00556                                                 void *const rtp_private)
00557         __attribute__((warn_unused_result));
00558 
00559 bool ROHC_EXPORT rohc_comp_set_features(struct rohc_comp *const comp,
00560                                         const rohc_comp_features_t features)
00561         __attribute__((warn_unused_result));
00562 
00563 
00564 
00565 /*
00566  * Prototypes of public functions related to ROHC feedback
00567  */
00568 
00569 #if !defined(ROHC_ENABLE_DEPRECATED_API) || ROHC_ENABLE_DEPRECATED_API == 1
00570 void ROHC_EXPORT c_piggyback_feedback(struct rohc_comp *comp,
00571                                       unsigned char *packet,
00572                                       int size)
00573         ROHC_DEPRECATED("please do not use this function anymore, instead use "
00574                         "rohc_decompress3() and prepend feedback data yourself");
00575 bool ROHC_EXPORT __rohc_comp_piggyback_feedback(struct rohc_comp *const comp,
00576                                                 const unsigned char *const feedback,
00577                                                 const size_t size)
00578         __attribute__((warn_unused_result));
00579 bool ROHC_EXPORT rohc_comp_piggyback_feedback(struct rohc_comp *const comp,
00580                                               const unsigned char *const feedback,
00581                                               const size_t size)
00582         __attribute__((warn_unused_result))
00583         ROHC_DEPRECATED("please do not use this function anymore, instead use "
00584                         "rohc_decompress3() and prepend feedback data yourself");
00585 void ROHC_EXPORT c_deliver_feedback(struct rohc_comp *comp,
00586                                     unsigned char *feedback,
00587                                     int size)
00588         ROHC_DEPRECATED("please do not use this function anymore, "
00589                         "use rohc_comp_deliver_feedback2() instead");
00590 bool ROHC_EXPORT __rohc_comp_deliver_feedback(struct rohc_comp *const comp,
00591                                               const uint8_t *const feedback,
00592                                               const size_t size)
00593         __attribute__((warn_unused_result));
00594 bool ROHC_EXPORT rohc_comp_deliver_feedback(struct rohc_comp *const comp,
00595                                             const uint8_t *const feedback,
00596                                             const size_t size)
00597         __attribute__((warn_unused_result))
00598         ROHC_DEPRECATED("please do not use this function anymore, "
00599                         "use rohc_comp_deliver_feedback2() instead");
00600 #endif /* !ROHC_ENABLE_DEPRECATED_API */
00601 bool ROHC_EXPORT rohc_comp_deliver_feedback2(struct rohc_comp *const comp,
00602                                              const struct rohc_buf feedback)
00603         __attribute__((warn_unused_result));
00604 #if !defined(ROHC_ENABLE_DEPRECATED_API) || ROHC_ENABLE_DEPRECATED_API == 1
00605 int ROHC_EXPORT rohc_feedback_flush(struct rohc_comp *comp,
00606                                     unsigned char *obuf,
00607                                     int osize)
00608         ROHC_DEPRECATED("please do not use this function anymore, instead use "
00609                         "rohc_decompress3() and send feedback data yourself");
00610 size_t ROHC_EXPORT rohc_feedback_avail_bytes(const struct rohc_comp *const comp)
00611         __attribute__((warn_unused_result))
00612         ROHC_DEPRECATED("please do not use this function anymore, instead use "
00613                         "rohc_decompress3() and handle feedback data yourself");
00614 bool ROHC_EXPORT rohc_feedback_remove_locked(struct rohc_comp *const comp)
00615         __attribute__((warn_unused_result))
00616         ROHC_DEPRECATED("please do not use this function anymore, instead use "
00617                         "rohc_decompress3() and handle feedback data yourself");
00618 bool ROHC_EXPORT rohc_feedback_unlock(struct rohc_comp *const comp)
00619         __attribute__((warn_unused_result))
00620         ROHC_DEPRECATED("please do not use this function anymore, instead use "
00621                         "rohc_decompress3() and handle feedback data yourself");
00622 #endif /* !ROHC_ENABLE_DEPRECATED_API */
00623 
00624 
00625 /*
00626  * Prototypes of public functions that configure robustness to packet
00627  * loss/damage
00628  */
00629 
00630 bool ROHC_EXPORT rohc_comp_set_wlsb_window_width(struct rohc_comp *const comp,
00631                                                  const size_t width)
00632         __attribute__((warn_unused_result));
00633 
00634 bool ROHC_EXPORT rohc_comp_set_periodic_refreshes(struct rohc_comp *const comp,
00635                                                                                                                                   const size_t ir_timeout,
00636                                                                                                                                   const size_t fo_timeout)
00637         __attribute__((warn_unused_result));
00638 
00639 bool ROHC_EXPORT rohc_comp_set_list_trans_nr(struct rohc_comp *const comp,
00640                                              const size_t list_trans_nr)
00641         __attribute__((warn_unused_result));
00642 
00643 
00644 /*
00645  * Prototypes of public functions related to ROHC compression statistics
00646  */
00647 
00648 #if !defined(ROHC_ENABLE_DEPRECATED_API) || ROHC_ENABLE_DEPRECATED_API == 1
00649 int ROHC_EXPORT rohc_c_info(char *buffer)
00650         ROHC_DEPRECATED("please do not use this function anymore, "
00651                         "use rohc_comp_get_general_info() instead");
00652 int ROHC_EXPORT rohc_c_statistics(struct rohc_comp *comp,
00653                                   unsigned int indent,
00654                                   char *buffer)
00655         ROHC_DEPRECATED("please do not use this function anymore, "
00656                         "use rohc_comp_get_general_info() instead");
00657 int ROHC_EXPORT rohc_c_context(struct rohc_comp *comp,
00658                                int cid,
00659                                unsigned int indent,
00660                                char *buffer)
00661         ROHC_DEPRECATED("please do not use this function anymore, "
00662                         "use rohc_comp_get_general_info() instead");
00663 int ROHC_EXPORT rohc_comp_get_last_packet_info(const struct rohc_comp *const comp,
00664                                                rohc_comp_last_packet_info_t *const info)
00665         ROHC_DEPRECATED("please do not use this function anymore, "
00666                         "use rohc_comp_get_last_packet_info2() instead");
00667 #endif /* !ROHC_ENABLE_DEPRECATED_API */
00668 
00669 bool ROHC_EXPORT rohc_comp_get_general_info(const struct rohc_comp *const comp,
00670                                             rohc_comp_general_info_t *const info)
00671         __attribute__((warn_unused_result));
00672 
00673 bool ROHC_EXPORT rohc_comp_get_last_packet_info2(const struct rohc_comp *const comp,
00674                                                  rohc_comp_last_packet_info2_t *const info);
00675 
00676 const char * ROHC_EXPORT rohc_comp_get_state_descr(const rohc_comp_state_t state);
00677 
00678 
00679 #undef ROHC_EXPORT /* do not pollute outside this header */
00680 
00681 #ifdef __cplusplus
00682 }
00683 #endif
00684 
00685 #endif /* ROHC_COMP_H */
00686