~didier-barvaux/+junk/rohc-tcp

« back to all changes in this revision

Viewing changes to src/comp/c_rtp.c

  • Committer: Didier Barvaux
  • Date: 2013-03-17 22:28:37 UTC
  • mfrom: (535.1.165 rohc-main)
  • Revision ID: didier@barvaux.org-20130317222837-i0bj1drr62octy8m
Sync with main branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
static bool c_rtp_check_profile(const struct rohc_comp *const comp,
50
50
                                const struct ip_packet *const outer_ip,
51
51
                                const struct ip_packet *const inner_ip,
52
 
                                const uint8_t protocol);
 
52
                                const uint8_t protocol,
 
53
                                rohc_ctxt_key_t *const ctxt_key);
53
54
static bool rtp_is_udp_port_for_rtp(const struct rohc_comp *const comp,
54
55
                                    const uint16_t port);
55
56
static bool c_rtp_use_udp_port(const struct c_context *const context,
274
275
 *                        is only one IP header,
275
276
 *                    \li the protocol carried by the inner IP header if there
276
277
 *                        are at least two IP headers.
 
278
 * @param ctxt_key  The key to help finding the context associated with packet
277
279
 * @return          Whether the IP packet corresponds to the profile:
278
280
 *                    \li true if the IP packet corresponds to the profile,
279
281
 *                    \li false if the IP packet does not correspond to
282
284
static bool c_rtp_check_profile(const struct rohc_comp *const comp,
283
285
                                const struct ip_packet *const outer_ip,
284
286
                                const struct ip_packet *const inner_ip,
285
 
                                const uint8_t protocol)
 
287
                                const uint8_t protocol,
 
288
                                rohc_ctxt_key_t *const ctxt_key)
286
289
{
287
290
        const struct ip_packet *last_ip_header;
288
291
        const unsigned char *udp_payload;
297
300
         *  - the IP payload is at least 8-byte long for UDP header,
298
301
         *  - the UDP Length field and the UDP payload match.
299
302
         */
300
 
        udp_check = c_udp_check_profile(comp, outer_ip, inner_ip, protocol);
 
303
        udp_check = c_udp_check_profile(comp, outer_ip, inner_ip, protocol,
 
304
                                        ctxt_key);
301
305
        if(!udp_check)
302
306
        {
303
307
                goto bad_profile;
377
381
                goto bad_profile;
378
382
        }
379
383
 
 
384
        /* add SSRC to the context key */
 
385
        *ctxt_key ^= ((struct rtphdr *) udp_payload)->ssrc;
 
386
 
380
387
        return true;
381
388
 
382
389
bad_profile: