Changeset 549
- Timestamp:
- 03/12/01 23:35:24 (12 years ago)
- Location:
- common/trunk
- Files:
-
- 4 modified
-
doc/tmpl/rtp.sgml (modified) (9 diffs)
-
doc/uclmmbase-sections.txt (modified) (2 diffs)
-
src/rtp.c (modified) (11 diffs)
-
src/rtp.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
common/trunk/doc/tmpl/rtp.sgml
r548 r549 31 31 32 32 <!-- ##### MACRO RTP_VERSION ##### --> 33 <para>34 35 </para>36 37 38 39 <!-- ##### MACRO RTP_PACKET_HEADER_SIZE ##### -->40 33 <para> 41 34 … … 62 55 @rtcp_bw: 63 56 @callback: 64 @user _data:57 @userdata: 65 58 @Returns: 66 59 … … 78 71 @rtcp_bw: 79 72 @callback: 80 @user _data:73 @userdata: 81 74 @Returns: 82 75 … … 84 77 <!-- ##### TYPEDEF rtp_packet ##### --> 85 78 <para> 86 87 </para> 79 The struct begins with pointers to the data in the packet as 80 it came off the wire. The packet is read in such that the 81 header maps onto the latter part of this struct, and the 82 fields in this first part of the struct point into it. The 83 entire packet can be freed by freeing this struct, without 84 having to free the csrc, data and extn blocks separately. 85 WARNING: Don't change the size of the first portion of the 86 struct without changing RTP_PACKET_HEADER_SIZE to match. 87 </para> 88 89 90 <!-- ##### MACRO RTP_PACKET_HEADER_SIZE ##### --> 91 <para> 92 This macro MUST resolve to the offset of the first packet 93 field in the #rtp_packet struct, including all padding. 94 If you change rtp_packet, make sure to change this too. 95 </para> 96 88 97 89 98 … … 99 108 </para> 100 109 110 111 <!-- ##### ENUM rtcp_sdes_type ##### --> 112 <para> 113 114 </para> 115 116 @RTCP_SDES_END: 117 @RTCP_SDES_CNAME: 118 @RTCP_SDES_NAME: 119 @RTCP_SDES_EMAIL: 120 @RTCP_SDES_PHONE: 121 @RTCP_SDES_LOC: 122 @RTCP_SDES_TOOL: 123 @RTCP_SDES_NOTE: 124 @RTCP_SDES_PRIV: 101 125 102 126 <!-- ##### TYPEDEF rtcp_sdes_item ##### --> … … 133 157 @RX_RTP: An RTP data packet was received. 134 158 The ssrc field contains the RTP data packet's SSRC. 135 The data field points to the RTP data packet (full header?)136 The callback must free the datapacket when it's done with it.159 The data field points to a #rtp_packet containing the RTP data packet. 160 The callback must free the rtp_packet when it's done with it. 137 161 @RX_SR: An RTCP SR packet was received. 138 162 The ssrc field contains the SR packet's SSRC. … … 188 212 189 213 214 <!-- ##### FUNCTION rtp_send_bye ##### --> 215 <para> 216 217 </para> 218 219 @session: 220 221 222 <!-- ##### FUNCTION rtp_done ##### --> 223 <para> 224 225 </para> 226 227 @session: 228 229 190 230 <!-- ##### ENUM rtp_option ##### --> 191 231 <para> … … 196 236 @RTP_OPT_WEAK_VALIDATION: 197 237 @RTP_OPT_FILTER_MY_PACKETS: 198 199 <!-- ##### ENUM rtcp_sdes_type ##### -->200 <para>201 202 </para>203 204 @RTCP_SDES_END:205 @RTCP_SDES_CNAME:206 @RTCP_SDES_NAME:207 @RTCP_SDES_EMAIL:208 @RTCP_SDES_PHONE:209 @RTCP_SDES_LOC:210 @RTCP_SDES_TOOL:211 @RTCP_SDES_NOTE:212 @RTCP_SDES_PRIV:213 214 <!-- ##### FUNCTION rtp_send_bye ##### -->215 <para>216 217 </para>218 219 @session:220 221 222 <!-- ##### FUNCTION rtp_done ##### -->223 <para>224 225 </para>226 227 @session:228 229 238 230 239 <!-- ##### FUNCTION rtp_set_option ##### --> … … 288 297 @rtp_ts: 289 298 @appcallback: 290 <!-- # Unused Parameters # -->291 @callback:292 299 293 300 -
common/trunk/doc/uclmmbase-sections.txt
r547 r549 341 341 <INCLUDE>rtp.h</INCLUDE> 342 342 RTP_VERSION 343 RTP_PACKET_HEADER_SIZE344 343 RTP_MAX_PACKET_LEN 345 344 rtp_init 346 345 rtp_init_if 347 346 rtp_packet 347 RTP_PACKET_HEADER_SIZE 348 348 rtcp_sr 349 349 rtcp_rr 350 rtcp_sdes_type 350 351 rtcp_sdes_item 351 352 rtcp_app … … 354 355 rtp_event 355 356 rtp_callback 356 rtp_option357 rtcp_sdes_type358 357 rtp_send_bye 359 358 rtp_done 359 rtp_option 360 360 rtp_set_option 361 361 rtp_get_option -
common/trunk/src/rtp.c
r548 r549 900 900 * allocated to RTCP. 901 901 * @callback: See section on #rtp_callback. 902 * @user_data: Opaque data passed to the callback function. 902 * @userdata: Opaque data associated with the session. See 903 * rtp_get_userdata(). 903 904 * 904 905 * See rtp_init_if(); calling rtp_init() is just like calling … … 932 933 * allocated to RTCP. 933 934 * @callback: See section on #rtp_callback. 934 * @user_data: Opaque data passed to the callback function. 935 * @userdata: Opaque data associated with the session. See 936 * rtp_get_userdata(). 935 937 * 936 938 * Creates and initializes an RTP session. … … 1065 1067 } 1066 1068 1069 /** 1070 * rtp_set_option: 1071 * @session: The RTP session. 1072 * @optname: The option name, see #rtp_option. 1073 * @optval: The value to set. 1074 * 1075 * Sets the value of a session option. See #rtp_option for 1076 * documentation on the options and their legal values. 1077 * 1078 * Returns: TRUE on success, else FALSE. 1079 */ 1067 1080 int rtp_set_option(struct rtp *session, rtp_option optname, int optval) 1068 1081 { … … 1086 1099 } 1087 1100 1101 /** 1102 * rtp_get_option: 1103 * @session: The RTP session. 1104 * @optname: The option name, see #rtp_option. 1105 * @optval: The return value. 1106 * 1107 * Retrieves the value of a session option. See #rtp_option for 1108 * documentation on the options and their legal values. 1109 * 1110 * Returns: TRUE and the value of the option in optval on success, else FALSE. 1111 */ 1088 1112 int rtp_get_option(struct rtp *session, rtp_option optname, int *optval) 1089 1113 { … … 1106 1130 } 1107 1131 1132 /** 1133 * rtp_get_userdata: 1134 * @session: The RTP session. 1135 * 1136 * This function returns the userdata pointer that was passed to the 1137 * rtp_init() or rtp_init_if() function when creating this session. 1138 * XXX (Note that gtkdoc thinks that it returns void, not void*, so 1139 * ignores the "Returns:" block here) 1140 * Returns: The userdata pointer that was passed to the rtp_init() or 1141 * rtp_init_if() function when creating this session. 1142 */ 1108 1143 void *rtp_get_userdata(struct rtp *session) 1109 1144 { … … 2512 2547 * @session: the RTP session to finish 2513 2548 * 2514 * Frees state associated with given RTP session 2549 * Frees state associated with given RTP session. Does not send 2550 * any packets (e.g. BYE). 2515 2551 */ 2516 2552 void rtp_done(struct rtp *session) … … 2546 2582 } 2547 2583 2584 /** 2585 * rtp_set_encryption_key: 2586 * @session: The RTP session. 2587 * @passphrase: The user-provided "pass phrase" to map to an encryption key. 2588 * 2589 * Converts the user supplied key into a form suitable for use with RTP 2590 * and install it as the active key. Passing in NULL as the passphrase 2591 * disables encryption. The passphrase is converted into a DES key as 2592 * specified in RFC1890, that is: 2593 * 2594 * - convert to canonical form 2595 * 2596 * - derive an MD5 hash of the canonical form 2597 * 2598 * - take the first 56 bits of the MD5 hash 2599 * 2600 * - add parity bits to form a 64 bit key 2601 * 2602 * Note that versions of rat prior to 4.1.2 do not convert the passphrase 2603 * to canonical form before taking the MD5 hash, and so will 2604 * not be compatible for keys which are non-invarient under this step. 2605 * 2606 * Returns: TRUE on success, FALSE on failure. 2607 */ 2548 2608 int rtp_set_encryption_key(struct rtp* session, const char *passphrase) 2549 2609 { 2550 /* Convert the user supplied key into a form suitable for use with RTP */2551 /* and install it as the active key. Passing in NULL as the passphrase */2552 /* disables encryption. The passphrase is converted into a DES key as */2553 /* specified in RFC1890, that is: */2554 /* - convert to canonical form */2555 /* - derive an MD5 hash of the canonical form */2556 /* - take the first 56 bits of the MD5 hash */2557 /* - add parity bits to form a 64 bit key */2558 /* Note that versions of rat prior to 4.1.2 do not convert the pass- */2559 /* phrase to canonical form before taking the MD5 hash, and so will */2560 /* not be compatible for keys which are non-invarient under this step. */2561 2610 char *canonical_passphrase; 2562 2611 u_char hash[16]; … … 2622 2671 } 2623 2672 2673 /** 2674 * rtp_get_addr: 2675 * @session: The RTP Session. 2676 * 2677 * Returns: The session's destination address, as set when creating the 2678 * session with rtp_init() or rtp_init_if(). 2679 */ 2624 2680 char *rtp_get_addr(struct rtp *session) 2625 2681 { … … 2628 2684 } 2629 2685 2686 /** 2687 * rtp_get_rx_port: 2688 * @session: The RTP Session. 2689 * 2690 * Returns: The UDP port to which this session is bound, as set when 2691 * creating the session with rtp_init() or rtp_init_if(). 2692 */ 2630 2693 uint16_t rtp_get_rx_port(struct rtp *session) 2631 2694 { … … 2634 2697 } 2635 2698 2699 /** 2700 * rtp_get_tx_port: 2701 * @session: The RTP Session. 2702 * 2703 * Returns: The UDP port to which RTP packets are transmitted, as set 2704 * when creating the session with rtp_init() or rtp_init_if(). 2705 */ 2636 2706 uint16_t rtp_get_tx_port(struct rtp *session) 2637 2707 { … … 2640 2710 } 2641 2711 2712 /** 2713 * rtp_get_ttl: 2714 * @session: The RTP Session. 2715 * 2716 * Returns: The session's TTL, as set when creating the session with 2717 * rtp_init() or rtp_init_if(). 2718 */ 2642 2719 int rtp_get_ttl(struct rtp *session) 2643 2720 { -
common/trunk/src/rtp.h
r547 r549 190 190 int ttl, double rtcp_bw, 191 191 rtp_callback callback, 192 void *user _data);192 void *userdata); 193 193 rtp_t rtp_init_if(const char *addr, char *iface, 194 194 uint16_t rx_port, uint16_t tx_port, 195 195 int ttl, double rtcp_bw, 196 196 rtp_callback callback, 197 void *user _data);197 void *userdata); 198 198 199 199 void rtp_send_bye(struct rtp *session);
