26 #ifdef CCXX_NAMESPACES
38 case (
'0'):
return 0x0;
39 case (
'1'):
return 0x1;
40 case (
'2'):
return 0x2;
41 case (
'3'):
return 0x3;
42 case (
'4'):
return 0x4;
43 case (
'5'):
return 0x5;
44 case (
'6'):
return 0x6;
45 case (
'7'):
return 0x7;
46 case (
'8'):
return 0x8;
47 case (
'9'):
return 0x9;
48 case (
'a'):
return 0xa;
49 case (
'A'):
return 0xa;
50 case (
'b'):
return 0xb;
51 case (
'B'):
return 0xb;
52 case (
'c'):
return 0xc;
53 case (
'C'):
return 0xc;
54 case (
'd'):
return 0xd;
55 case (
'D'):
return 0xd;
56 case (
'e'):
return 0xe;
57 case (
'E'):
return 0xe;
58 case (
'f'):
return 0xf;
59 case (
'F'):
return 0xf;
78 while (hex_len < len) {
99 {
return destinationAddress; }
102 {
return destinationPort; }
105 {
return packetsNumber; }
108 {
return 0xdeadbeef; }
114 {
return packetsSize; }
117 static const InetHostAddress destinationAddress;
118 static const uint16 destinationPort = 5002;
119 static const uint32 packetsNumber = 10;
120 static const uint32 packetsSize = 12;
121 static unsigned char data[];
125 InetHostAddress(
"localhost");
133 static char* fixKey = (
char *)
"c2479f224b21c2008deea6ef0e5dbd4a761aef98e7ebf8eed405986c4687";
138 uint8
masterKey[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
139 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f };
141 uint8
masterSalt[] = { 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
142 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d };
144 static uint8 binKeys[60];
158 tx.setSchedulingTimeout(10000);
159 tx.setExpireTimeout(1000000);
177 tx.setOutQueueCryptoContext(txCryptoCtx);
181 SrtpAuthenticationSha1Hmac,
190 tx.setOutQueueCryptoContextCtrl(txCryptoCtxCtrl);
201 uint16 inc = tx.getCurrentRTPClockRate()/50;
202 TimerPort::setTimer(period);
205 cout <<
"Sent some data: " << i << endl;
206 Thread::sleep(TimerPort::getTimer());
207 TimerPort::incTimer(period);
226 rx.setSchedulingTimeout(10000);
227 rx.setExpireTimeout(1000000);
243 rx.setInQueueCryptoContext(rxCryptoCtx);
257 rx.setInQueueCryptoContextCtrl(rxCryptoCtxCtrl);
262 for (
int i = 0; i < 500 ; i++ ) {
264 while ( (adu = rx.
getData(rx.getFirstTimestamp())) ) {
265 cerr <<
"got some data: " << adu->
getData() << endl;
274 int main(
int argc,
char *argv[])
281 char* inputKey = NULL;
282 char *args = *argv++;
284 while(NULL != (args = *argv++)) {
287 if(!strcmp(args,
"r") || !strcmp(args,
"recv"))
289 else if(!strcmp(args,
"s") || !strcmp(args,
"send"))
291 else if(!strcmp(args,
"8") || !strcmp(args,
"8test"))
293 else if(!strcmp(args,
"k") || !strcmp(args,
"key"))
296 fprintf(stderr,
"*** ccsrtptest: %s: unknown option\n", args);
299 if (inputKey == NULL) {
306 cout <<
"Running as sender" << endl;
309 cout <<
"Running as receiver" << endl;
313 cout <<
"Running F8 test: ";
const size_t getPacketSize(uint32 i)
The implementation for a SRTCP cryptographic context.
ITU-T G.711. mu-law audio 8 Khz (RFC 1890)
Interface (envelope) to data received over RTP packets.
The implementation for a SRTP cryptographic context.
uint32 getPacketsNumber() const
int hex_string_to_octet_string(char *raw, char *hex, int len)
const InetHostAddress & getDestinationAddress() const
int main(int argc, char *argv[])
const tpport_t getDestinationPort() const
const unsigned char * getPacketData(uint32 i)
This template class adds the threading aspect to the RTPSessionBase template in one of the many possi...
const int SrtpAuthenticationSha1Hmac
static const InetHostAddress destinationAddress
int hex_char_to_nibble(uint8_t c)
Class which implements SRTP AES cryptographic functions.
void deriveSrtpKeys(uint64 index)
Perform key derivation according to SRTP specification.
const uint8 *const getData() const
Get data as it is received in RTP packets (i.e.
Generic and audio/video profile specific RTP interface of ccRTP.
static unsigned char data[65535]
const int SrtpEncryptionAESCM