diff options
Diffstat (limited to 'thirdparties/iphone/include/srtp/srtp_priv.h')
-rwxr-xr-x | thirdparties/iphone/include/srtp/srtp_priv.h | 170 |
1 files changed, 85 insertions, 85 deletions
diff --git a/thirdparties/iphone/include/srtp/srtp_priv.h b/thirdparties/iphone/include/srtp/srtp_priv.h index cf2274e..997a115 100755 --- a/thirdparties/iphone/include/srtp/srtp_priv.h +++ b/thirdparties/iphone/include/srtp/srtp_priv.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006 Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -54,56 +54,56 @@ * an srtp_hdr_t represents the srtp header * * in this implementation, an srtp_hdr_t is assumed to be 32-bit aligned - * + * * (note that this definition follows that of RFC 1889 Appendix A, but * is not identical) */ - + #ifndef WORDS_BIGENDIAN /* * srtp_hdr_t represents an RTP or SRTP header. The bit-fields in - * this structure should be declared "unsigned int" instead of + * this structure should be declared "unsigned int" instead of * "unsigned char", but doing so causes the MS compiler to not * fully pack the bit fields. */ typedef struct { - unsigned char cc:4; /* CSRC count */ - unsigned char x:1; /* header extension flag */ - unsigned char p:1; /* padding flag */ - unsigned char version:2; /* protocol version */ - unsigned char pt:7; /* payload type */ - unsigned char m:1; /* marker bit */ - uint16_t seq; /* sequence number */ - uint32_t ts; /* timestamp */ - uint32_t ssrc; /* synchronization source */ + unsigned char cc:4; /* CSRC count */ + unsigned char x:1; /* header extension flag */ + unsigned char p:1; /* padding flag */ + unsigned char version:2; /* protocol version */ + unsigned char pt:7; /* payload type */ + unsigned char m:1; /* marker bit */ + uint16_t seq; /* sequence number */ + uint32_t ts; /* timestamp */ + uint32_t ssrc; /* synchronization source */ } srtp_hdr_t; #else /* BIG_ENDIAN */ typedef struct { - unsigned char version:2; /* protocol version */ - unsigned char p:1; /* padding flag */ - unsigned char x:1; /* header extension flag */ - unsigned char cc:4; /* CSRC count */ - unsigned char m:1; /* marker bit */ - unsigned pt:7; /* payload type */ - uint16_t seq; /* sequence number */ - uint32_t ts; /* timestamp */ - uint32_t ssrc; /* synchronization source */ + unsigned char version:2; /* protocol version */ + unsigned char p:1; /* padding flag */ + unsigned char x:1; /* header extension flag */ + unsigned char cc:4; /* CSRC count */ + unsigned char m:1; /* marker bit */ + unsigned pt:7; /* payload type */ + uint16_t seq; /* sequence number */ + uint32_t ts; /* timestamp */ + uint32_t ssrc; /* synchronization source */ } srtp_hdr_t; #endif typedef struct { - uint16_t profile_specific; /* profile-specific info */ - uint16_t length; /* number of 32-bit words in extension */ + uint16_t profile_specific; /* profile-specific info */ + uint16_t length; /* number of 32-bit words in extension */ } srtp_hdr_xtnd_t; /* - * srtcp_hdr_t represents a secure rtcp header + * srtcp_hdr_t represents a secure rtcp header * * in this implementation, an srtcp header is assumed to be 32-bit * alinged @@ -112,53 +112,53 @@ typedef struct { #ifndef WORDS_BIGENDIAN typedef struct { - unsigned char rc:5; /* reception report count */ - unsigned char p:1; /* padding flag */ - unsigned char version:2; /* protocol version */ - unsigned char pt:8; /* payload type */ - uint16_t len; /* length */ - uint32_t ssrc; /* synchronization source */ + unsigned char rc:5; /* reception report count */ + unsigned char p:1; /* padding flag */ + unsigned char version:2; /* protocol version */ + unsigned char pt:8; /* payload type */ + uint16_t len; /* length */ + uint32_t ssrc; /* synchronization source */ } srtcp_hdr_t; typedef struct { - unsigned int index:31; /* srtcp packet index in network order! */ - unsigned int e:1; /* encrypted? 1=yes */ - /* optional mikey/etc go here */ - /* and then the variable-length auth tag */ + unsigned int index:31; /* srtcp packet index in network order! */ + unsigned int e:1; /* encrypted? 1=yes */ + /* optional mikey/etc go here */ + /* and then the variable-length auth tag */ } srtcp_trailer_t; #else /* BIG_ENDIAN */ typedef struct { - unsigned char version:2; /* protocol version */ - unsigned char p:1; /* padding flag */ - unsigned char rc:5; /* reception report count */ - unsigned char pt:8; /* payload type */ - uint16_t len; /* length */ - uint32_t ssrc; /* synchronization source */ + unsigned char version:2; /* protocol version */ + unsigned char p:1; /* padding flag */ + unsigned char rc:5; /* reception report count */ + unsigned char pt:8; /* payload type */ + uint16_t len; /* length */ + uint32_t ssrc; /* synchronization source */ } srtcp_hdr_t; typedef struct { - unsigned int version:2; /* protocol version */ - unsigned int p:1; /* padding flag */ - unsigned int count:5; /* varies by packet type */ - unsigned int pt:8; /* payload type */ - uint16_t length; /* len of uint32s of packet less header */ + unsigned int version:2; /* protocol version */ + unsigned int p:1; /* padding flag */ + unsigned int count:5; /* varies by packet type */ + unsigned int pt:8; /* payload type */ + uint16_t length; /* len of uint32s of packet less header */ } rtcp_common_t; typedef struct { - unsigned int e:1; /* encrypted? 1=yes */ - unsigned int index:31; /* srtcp packet index */ - /* optional mikey/etc go here */ - /* and then the variable-length auth tag */ + unsigned int e:1; /* encrypted? 1=yes */ + unsigned int index:31; /* srtcp packet index */ + /* optional mikey/etc go here */ + /* and then the variable-length auth tag */ } srtcp_trailer_t; #endif /* - * the following declarations are libSRTP internal functions + * the following declarations are libSRTP internal functions */ /* @@ -166,7 +166,7 @@ typedef struct { * to ssrc, or NULL if no stream exists for that ssrc */ -srtp_stream_t +srtp_stream_t srtp_get_stream(srtp_t srtp, uint32_t ssrc); @@ -180,47 +180,47 @@ err_status_t srtp_stream_init_keys(srtp_stream_t srtp, const void *key); /* - * srtp_stream_init(s, p) initializes the srtp_stream_t s to + * srtp_stream_init(s, p) initializes the srtp_stream_t s to * use the policy at the location p */ err_status_t -srtp_stream_init(srtp_stream_t srtp, - const srtp_policy_t *p); +srtp_stream_init(srtp_stream_t srtp, + const srtp_policy_t *p); /* - * libsrtp internal datatypes + * libsrtp internal datatypes */ -typedef enum direction_t { - dir_unknown = 0, - dir_srtp_sender = 1, - dir_srtp_receiver = 2 +typedef enum direction_t { + dir_unknown = 0, + dir_srtp_sender = 1, + dir_srtp_receiver = 2 } direction_t; -/* +/* * an srtp_stream_t has its own SSRC, encryption key, authentication * key, sequence number, and replay database - * + * * note that the keys might not actually be unique, in which case the * cipher_t and auth_t pointers will point to the same structures */ typedef struct srtp_stream_ctx_t { - uint32_t ssrc; - cipher_t *rtp_cipher; - auth_t *rtp_auth; - rdbx_t rtp_rdbx; - sec_serv_t rtp_services; - cipher_t *rtcp_cipher; - auth_t *rtcp_auth; - rdb_t rtcp_rdb; - sec_serv_t rtcp_services; - key_limit_ctx_t *limit; - direction_t direction; - int allow_repeat_tx; - ekt_stream_t ekt; - struct srtp_stream_ctx_t *next; /* linked list of streams */ + uint32_t ssrc; + cipher_t *rtp_cipher; + auth_t *rtp_auth; + rdbx_t rtp_rdbx; + sec_serv_t rtp_services; + cipher_t *rtcp_cipher; + auth_t *rtcp_auth; + rdb_t rtcp_rdb; + sec_serv_t rtcp_services; + key_limit_ctx_t *limit; + direction_t direction; + int allow_repeat_tx; + ekt_stream_t ekt; + struct srtp_stream_ctx_t *next; /* linked list of streams */ } srtp_stream_ctx_t; @@ -229,8 +229,8 @@ typedef struct srtp_stream_ctx_t { */ typedef struct srtp_ctx_t { - srtp_stream_ctx_t *stream_list; /* linked list of streams */ - srtp_stream_ctx_t *stream_template; /* act as template for other streams */ + srtp_stream_ctx_t *stream_list; /* linked list of streams */ + srtp_stream_ctx_t *stream_template; /* act as template for other streams */ } srtp_ctx_t; @@ -239,7 +239,7 @@ typedef struct srtp_ctx_t { * srtp_handle_event(srtp, srtm, evnt) calls the event handling * function, if there is one. * - * This macro is not included in the documentation as it is + * This macro is not included in the documentation as it is * an internal-only function. */ @@ -250,7 +250,7 @@ typedef struct srtp_ctx_t { data.stream = strm; \ data.event = evnt; \ srtp_event_handler(&data); \ -} +} #endif /* SRTP_PRIV_H */ |