sdp_message.h

Go to the documentation of this file.
00001 
00023 #ifndef _SDP_H_
00024 #define _SDP_H_
00025 
00026 #ifdef ENABLE_MPATROL
00027 #include <mpatrol.h>
00028 #endif
00029 
00030 #include "osip_list.h"
00031 
00032 #ifndef BODY_MESSAGE_MAX_SIZE
00033 
00036 #define BODY_MESSAGE_MAX_SIZE  4000
00037 #endif
00038 
00039 #ifdef __cplusplus
00040 extern "C"
00041 {
00042 #endif
00043 
00048   typedef struct sdp_bandwidth sdp_bandwidth_t;
00049 
00054   struct sdp_bandwidth
00055   {
00056     char *b_bwtype;             
00057     char *b_bandwidth;          
00058   };
00059 
00064   int sdp_bandwidth_init (sdp_bandwidth_t ** elem);
00069   void sdp_bandwidth_free (sdp_bandwidth_t * elem);
00070 
00075   typedef struct sdp_time_descr sdp_time_descr_t;
00076 
00081   struct sdp_time_descr
00082   {
00083     char *t_start_time;            
00084     char *t_stop_time;             
00085     osip_list_t *r_repeats;        
00086   };
00087 
00092   int sdp_time_descr_init (sdp_time_descr_t ** elem);
00097   void sdp_time_descr_free (sdp_time_descr_t * elem);
00098 
00103   typedef struct sdp_key sdp_key_t;
00104 
00109   struct sdp_key
00110   {
00111     char *k_keytype;    
00112     char *k_keydata;    
00113   };
00114 
00119   int sdp_key_init (sdp_key_t ** elem);
00124   void sdp_key_free (sdp_key_t * elem);
00125 
00130   typedef struct sdp_attribute sdp_attribute_t;
00131 
00136   struct sdp_attribute
00137   {
00138     char *a_att_field;          
00139     char *a_att_value;          
00140   };
00141 
00146   int sdp_attribute_init (sdp_attribute_t ** elem);
00151   void sdp_attribute_free (sdp_attribute_t * elem);
00152 
00153 
00158   typedef struct sdp_connection sdp_connection_t;
00159 
00164   struct sdp_connection
00165   {
00166     char *c_nettype;             
00167     char *c_addrtype;            
00168     char *c_addr;                
00169     char *c_addr_multicast_ttl;  
00170     char *c_addr_multicast_int;  
00171   };
00172 
00177   int sdp_connection_init (sdp_connection_t ** elem);
00182   void sdp_connection_free (sdp_connection_t * elem);
00183 
00188   typedef struct sdp_media sdp_media_t;
00189 
00194   struct sdp_media
00195   {
00196     char *m_media;              
00197     char *m_port;               
00198     char *m_number_of_port;     
00199     char *m_proto;              
00200     osip_list_t *m_payloads;    
00202     char *i_info;               
00203     osip_list_t *c_connections; 
00204     osip_list_t *b_bandwidths;  
00205     osip_list_t *a_attributes;  
00206     sdp_key_t *k_key;           
00207   };
00208 
00213   int sdp_media_init (sdp_media_t ** elem);
00218   void sdp_media_free (sdp_media_t * elem);
00219 
00224   typedef struct sdp_message sdp_message_t;
00225 
00230   struct sdp_message
00231   {
00232     char *v_version;            
00233     char *o_username;           
00234     char *o_sess_id;            
00235     char *o_sess_version;       
00236     char *o_nettype;            
00237     char *o_addrtype;           
00238     char *o_addr;               
00239     char *s_name;               
00240     char *i_info;               
00241     char *u_uri;                
00242     osip_list_t *e_emails;      
00243     osip_list_t *p_phones;      
00244     sdp_connection_t *c_connection;   
00245     osip_list_t *b_bandwidths;  
00246     osip_list_t *t_descrs;      
00247     char *z_adjustments;        
00248     sdp_key_t *k_key;           
00249     osip_list_t *a_attributes;  
00250     osip_list_t *m_medias;      
00251   };
00252 
00253 
00254 
00259   int sdp_message_init (sdp_message_t ** sdp);
00265   int sdp_message_parse (sdp_message_t * sdp, const char *buf);
00271   int sdp_message_to_str (sdp_message_t * sdp, char **dest);
00276   void sdp_message_free (sdp_message_t * sdp);
00282   int sdp_message_clone (sdp_message_t * sdp, sdp_message_t ** dest);
00283 
00289   int sdp_message_v_version_set (sdp_message_t * sdp, char *value);
00294   char *sdp_message_v_version_get (sdp_message_t * sdp);
00305   int sdp_message_o_origin_set (sdp_message_t * sdp, char *username,
00306                                 char *sess_id, char *sess_version,
00307                                 char *nettype, char *addrtype, char *addr);
00312   char *sdp_message_o_username_get (sdp_message_t * sdp);
00317   char *sdp_message_o_sess_id_get (sdp_message_t * sdp);
00322   char *sdp_message_o_sess_version_get (sdp_message_t * sdp);
00327   char *sdp_message_o_nettype_get (sdp_message_t * sdp);
00332   char *sdp_message_o_addrtype_get (sdp_message_t * sdp);
00337   char *sdp_message_o_addr_get (sdp_message_t * sdp);
00343   int sdp_message_s_name_set (sdp_message_t * sdp, char *value);
00348   char *sdp_message_s_name_get (sdp_message_t * sdp);
00355   int sdp_message_i_info_set (sdp_message_t * sdp, int pos_media, char *value);
00361   char *sdp_message_i_info_get (sdp_message_t * sdp, int pos_media);
00367   int sdp_message_u_uri_set (sdp_message_t * sdp, char *value);
00372   char *sdp_message_u_uri_get (sdp_message_t * sdp);
00378   int sdp_message_e_email_add (sdp_message_t * sdp, char *value);
00383 #define sdp_e_email_get sdp_message_e_email_get
00384 
00389   char *sdp_message_e_email_get (sdp_message_t * sdp, int pos);
00395   int sdp_message_p_phone_add (sdp_message_t * sdp, char *value);
00401   char *sdp_message_p_phone_get (sdp_message_t * sdp, int pos);
00412   int sdp_message_c_connection_add (sdp_message_t * sdp, int pos_media,
00413                                     char *nettype, char *addrtype,
00414                                     char *addr, char *addr_multicast_ttl,
00415                                     char *addr_multicast_int);
00416 #ifndef DOXYGEN
00417 /* this method should be internal only... */
00418   sdp_connection_t *sdp_message_connection_get (sdp_message_t * sdp,
00419                                                 int pos_media, int pos);
00420 #endif
00421 
00427   char *sdp_message_c_nettype_get (sdp_message_t * sdp, int pos_media, int pos);
00434   char *sdp_message_c_addrtype_get (sdp_message_t * sdp, int pos_media, int pos);
00441   char *sdp_message_c_addr_get (sdp_message_t * sdp, int pos_media, int pos);
00448   char *sdp_message_c_addr_multicast_ttl_get (sdp_message_t * sdp,
00449                                               int pos_media, int pos);
00456   char *sdp_message_c_addr_multicast_int_get (sdp_message_t * sdp,
00457                                               int pos_media, int pos);
00465   int sdp_message_b_bandwidth_add (sdp_message_t * sdp, int pos_media,
00466                                    char *bwtype, char *bandwidth);
00473   sdp_bandwidth_t *sdp_message_bandwidth_get (sdp_message_t * sdp,
00474                                               int pos_media, int pos);
00481   char *sdp_message_b_bwtype_get (sdp_message_t * sdp, int pos_media, int pos);
00488   char *sdp_message_b_bandwidth_get (sdp_message_t * sdp, int pos_media, int pos);
00495   int sdp_message_t_time_descr_add (sdp_message_t * sdp, char *start, char *stop);
00501   char *sdp_message_t_start_time_get (sdp_message_t * sdp, int pos_td);
00507   char *sdp_message_t_stop_time_get (sdp_message_t * sdp, int pos_td);
00514   int sdp_message_r_repeat_add (sdp_message_t * sdp, int pos_time_descr,
00515                                 char *value);
00522   char *sdp_message_r_repeat_get (sdp_message_t * sdp, int pos_time_descr,
00523                                   int pos_repeat);
00529   int sdp_message_z_adjustments_set (sdp_message_t * sdp, char *value);
00534   char *sdp_message_z_adjustments_get (sdp_message_t * sdp);
00542   int sdp_message_k_key_set (sdp_message_t * sdp, int pos_media,
00543                              char *keytype, char *keydata);
00549   char *sdp_message_k_keytype_get (sdp_message_t * sdp, int pos_media);
00555   char *sdp_message_k_keydata_get (sdp_message_t * sdp, int pos_media);
00563   int sdp_message_a_attribute_add (sdp_message_t * sdp, int pos_media,
00564                                    char *att_field, char *att_value);
00571   int sdp_message_a_attribute_del (sdp_message_t * sdp, int pos_media,
00572                                    char *att_field);
00580   int sdp_message_a_attribute_del_at_index (sdp_message_t * sdp,
00581                                             int pos_media, char *att_field,
00582                                             int pos_attr);
00589   sdp_attribute_t *sdp_message_attribute_get (sdp_message_t * sdp,
00590                                               int pos_media, int pos);
00597   char *sdp_message_a_att_field_get (sdp_message_t * sdp, int pos_media, int pos);
00604   char *sdp_message_a_att_value_get (sdp_message_t * sdp, int pos_media, int pos);
00610   int sdp_message_endof_media (sdp_message_t * sdp, int pos);
00619   int sdp_message_m_media_add (sdp_message_t * sdp, char *media,
00620                                char *port, char *number_of_port, char *proto);
00626   char *sdp_message_m_media_get (sdp_message_t * sdp, int pos_media);
00632   char *sdp_message_m_port_get (sdp_message_t * sdp, int pos_media);
00639   int sdp_message_m_port_set (sdp_message_t * sdp, int pos_media, char *port);
00645   char *sdp_message_m_number_of_port_get (sdp_message_t * sdp, int pos_media);
00651   char *sdp_message_m_proto_get (sdp_message_t * sdp, int pos_media);
00658   int sdp_message_m_payload_add (sdp_message_t * sdp, int pos_media,
00659                                  char *payload);
00666   char *sdp_message_m_payload_get (sdp_message_t * sdp, int pos_media, int pos);
00673   int sdp_message_m_payload_del (sdp_message_t * sdp, int pos_media, int pos);
00674 
00675 #ifdef __cplusplus
00676 }
00677 #endif
00678 
00679 
00680 #endif

Generated on Fri Mar 9 19:59:55 2007 for MAD-FCL by  doxygen 1.5.0