Add a simple function that acts as an encryption callback to just update
the ext_seq (index) of the egress SSRC context. The kernel module
already does this, but the daemon only did it when SRTP was involved.
This now tracks egress packet indexes in all cases.
Change-Id: I9460744de55ead4b05aceb322fd8482442ff2b41
(cherry picked from commit 0da49000ba)
We use int or unsigned int everywhere, except in a few leftover places.
Unify to (unsigned) int.
Change-Id: I0896b2f177957c17b30a3d0cb6b3fb2beb4bd684
(cherry picked from commit f60ee917c9)
Use the already existing ext_seq (in shm) in place of srtp_index as
these carry duplicate information.
Kernel still tracks its own index in the crypto context at this point.
Change data type from 64-bit to (unsigned) int as we don't need that
many bits.
Change-Id: I2468c6a814964eb64a19d84c918d3a37c2494b66
In the file implementations follow the rules:
1. Firstly goes the correlated header file, then one empty row.
2. Secondly go system headers, so in angle-brackets, then one empty row.
3. Thirdly, go custom header files, so in double quotes,
then one empty row.
4. If there is "xt_RTPENGINE.h", it's mentioned next, but separately,
then one empty row.
5. If there are pre-processor definitions, they are added.
6. And eventually at least one empty row before the code.
In some situations it's allowed to step aside from the rules,
when inclusions are dependent on each other, so on the sequence,
and also possibly on some inline objects definitions, but if possible
to follow the rules, it's being done.
Change-Id: Ie512a970e230fe202398656d1942e8874bb14cd9
All crypto suites except AEAD have an explicit packet authentication
stage. If authentication fails for a packet, we take some guesses about
a ROC mismatch and see if authentication can succeed with a different
ROC. If a working ROC is found, our tracked ROC is updated and
decryption proceeds.
AEAD doesn't have an explicit authentication stage and authentication is
performed implicitly by the decryption engine, which simply returns a
decryption error if the authentication fails. We must therefore add the
same ROC guessing logic at this step for AEAD.
Change-Id: Ic1a70daa667e23976b74d2303c823b8d8c7bcb2b
Complete overhaul of the codec handling code:
*) obsolete flags `asymmetric codecs`, `symmetric codecs`, `reorder
codecs`
*) support proper codec offer/answer
*) split codec manipulation (strip/offer/accept/etc) into separate
functions for clarity and better code maintenance
*) fully update codec handlers in both directions after an answer
*) explicit allocation and handling of codecs and payload types in a
codec_store object
*) improve codec matchup logic during answer
*) more explicit handling of supplemental codecs (CN/DTMF)
*) remove now obsolete hacks for handling certain use cases
Change-Id: I996705ba8fe339524c2f70e6bb0fd854f9a1f4fb
This became necessary because of the way Asterisk handles Sequence
numbers when changing SSRC. They continue to increment a single
sequence number even though the SSRC is different, on switching back
this causes the packet_index function to interpret this as many lost
packets. The previous function had dead-spots that would not adjust
the packet_index at all if the difference fell in these ranges. These
gaps always resulted in behavior contra what would happen in webrtc
clients.
Squashed commit of the following:
commit cca40e8e311e6884204289687ba2a05d0855720b
Author: Richard Fuchs <rfuchs@sipwise.com>
Date: Thu Feb 12 10:17:51 2015 -0500
support per-payload-type stats in kernel module
commit dcc0dc0002bd552ae7c99aa58311af2f81336a8f
Author: Richard Fuchs <rfuchs@sipwise.com>
Date: Wed Feb 11 12:14:44 2015 -0500
count unknown rtp type as error
commit 941bde0df59720d1d3ef6660096cf2532a5c7e1c
Author: Richard Fuchs <rfuchs@sipwise.com>
Date: Wed Feb 11 12:01:55 2015 -0500
use the list of rtp formats from the m= line
This avoids dynamically altering the rtpstats hash table and makes
keeping packet stats lock free.
commit 9150fed671d8490f4c09fb3050002c7c558391df
Author: Richard Fuchs <rfuchs@sipwise.com>
Date: Fri Feb 6 15:06:04 2015 -0500
fix and simplify rtpmap hash table
commit 1f73741cbf2ac7d6b8d0a54d9562e9a550678e7c
Author: Richard Fuchs <rfuchs@sipwise.com>
Date: Fri Feb 6 13:56:07 2015 -0500
MT#9935 understand, learn, remember and report RTP payload types (codecs)
commit b0d690837c02989485cf73927a89ed860a299807
Author: Richard Fuchs <rfuchs@sipwise.com>
Date: Thu Nov 20 13:36:25 2014 -0500
parse a=rtpmap attribute