SinisterSdpDescriptions - Routines to manipulate descriptions.
#include <SDP/SDP_Description.h> int main(void) { SDP_Description *description = SDP_NewDescription(); SDP_SetProtocolVersion(description, 1); SDP_SetSessionName(description, "Session Name"); ... }
This document describes how to use SDP_Description structs.
These structs are returned by the SinisterSdp parser functions and manpulated using a series of Get/Set, Add/Remove, and New/Destroy routines. You'll probably only end up using the Get routines and maybe a few of the Set routines, but the others are always there if you need them.
The functions that return "const char *" return pointers to internal string buffers. If you need to modify them, then use strdup() or something similar to copy them, then modify the copy.
The following routines are available:
These functions create and return new structs to encapsulate some portion of an SDP description.
SDP_Description *SDP_NewDescription(void);
This function creates a new SDP_Description struct.
If no error occurs, it returns a pointer to the newly created SDP_Description struct. If an error occurs, it returns a NULL pointer instead. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to create the SDP_Description struct.
None.
SDP_Owner *SDP_NewOwner(void);
This function creates a new SDP_Owner struct.
If no error occurs, it returns a pointer to the newly created SDP_Owner struct. If an error occurs, it returns a NULL pointer instead. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to create the SDP_Owner struct.
None.
SDP_EmailContact *SDP_NewEmailContact(void);
This function creates a new SDP_EmailContact struct.
If no error occurs, it returns a pointer to the newly created SDP_EmailContact struct. If an error occurs, it returns a NULL pointer instead. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to create the SDP_EmailContact struct.
None.
SDP_PhoneContact *SDP_NewPhoneContact(void);
This function creates a new SDP_PhoneContact struct.
If no error occurs, it returns a pointer to the newly created SDP_PhoneContact struct. If an error occurs, it returns a NULL pointer instead. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to create the SDP_PhoneContact struct.
None.
SDP_Connection *SDP_NewConnection(void);
This function creates a new SDP_Connection struct.
If no error occurs, it returns a pointer to the newly created SDP_Connection struct. If an error occurs, it returns a NULL pointer instead. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to create the SDP_Connection struct.
None.
SDP_Bandwidth *SDP_NewBandwidth(void);
This function creates a new SDP_Bandwidth struct.
If no error occurs, it returns a pointer to the newly created SDP_Bandwidth struct. If an error occurs, it returns a NULL pointer instead. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to create the SDP_Bandwidth struct.
None.
SDP_SessionPlayTime *SDP_NewSessionPlayTime(void);
This function creates a new SDP_SessionPlayTime struct.
If no error occurs, it returns a pointer to the newly created SDP_SessionPlayTime struct. If an error occurs, it returns a NULL pointer instead. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to create the SDP_SessionPlayTime struct.
None.
SDP_RepeatTime *SDP_NewRepeatTime(void);
This function creates a new SDP_RepeatTime struct.
If no error occurs, it returns a pointer to the newly created SDP_RepeatTime struct. If an error occurs, it returns a NULL pointer instead. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to create the SDP_RepeatTime struct.
None.
SDP_ZoneAdjustment *SDP_NewZoneAdjustment(void);
This function creates a new SDP_ZoneAdjustment struct.
If no error occurs, it returns a pointer to the newly created SDP_ZoneAdjustment struct. If an error occurs, it returns a NULL pointer instead. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to create the SDP_ZoneAdjustment struct.
None.
SDP_Encryption *SDP_NewEncryption(void);
This function creates a new SDP_Encryption struct.
If no error occurs, it returns a pointer to the newly created SDP_Encryption struct. If an error occurs, it returns a NULL pointer instead. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to create the SDP_Encryption struct.
None.
SDP_Attribute *SDP_NewAttribute(void);
This function creates a new SDP_Attribute struct.
If no error occurs, it returns a pointer to the newly created SDP_Attribute struct. If an error occurs, it returns a NULL pointer instead. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to create the SDP_Attribute struct.
None.
SDP_MediaDescription *SDP_NewMediaDescription(void);
This function creates a new SDP_MediaDescription struct.
If no error occurs, it returns a pointer to the newly created SDP_MediaDescription struct. If an error occurs, it returns a NULL pointer instead. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to create the SDP_MediaDescription struct.
None.
These functions enable you to set values within structs that encapsulates portions of an SDP description.
void SDP_SetProtocolVersion( SDP_Description * description, int version );
This function sets the protocol version within an SDP_Description struct.
int SDP_SetOwner( SDP_Description * description, const char * username, const char * session_id, const char * session_version, const char * network_type, const char * address_type, const char * address );
This function sets the owner within an SDP_Description struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the owner.
A pointer to the SDP_Description struct.
A pointer to a string containing the username.
A pointer to a string containing the session id.
A pointer to a string containing the session version.
A pointer to a string containing the network type.
A pointer to a string containing the address type.
A pointer to a string containing the address.
int SDP_SetUsername( SDP_Owner * owner, const char * username );
This function sets the username within an SDP_Owner struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the username.
int SDP_SetSessionID( SDP_Owner * owner, const char * session_id );
This function sets the session iD within an SDP_Owner struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the session iD.
A pointer to the SDP_Owner struct.
A pointer to a string containing the session id.
int SDP_SetSessionVersion( SDP_Owner * owner, const char * session_version );
This function sets the session version within an SDP_Owner struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the session version.
A pointer to the SDP_Owner struct.
A pointer to a string containing the session version.
int SDP_SetOwnerNetworkType( SDP_Owner * owner, const char * network_type );
This function sets the owner network type within an SDP_Owner struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the owner network type.
A pointer to the SDP_Owner struct.
A pointer to a string containing the network type.
int SDP_SetOwnerAddressType( SDP_Owner * owner, const char * address_type );
This function sets the owner address type within an SDP_Owner struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the owner address type.
A pointer to the SDP_Owner struct.
A pointer to a string containing the address type.
int SDP_SetOwnerAddress( SDP_Owner * owner, const char * address );
This function sets the owner address within an SDP_Owner struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the owner address.
int SDP_SetSessionName( SDP_Description * description, const char * session_name );
This function sets the session name within an SDP_Description struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the session name.
A pointer to the SDP_Description struct.
A pointer to a string containing the session name.
int SDP_SetSessionInformation( SDP_Description * description, const char * session_information );
This function sets the session information within an SDP_Description struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the session information.
A pointer to the SDP_Description struct.
A pointer to a string containing the session information.
int SDP_SetURI( SDP_Description * description, const char * uri );
This function sets the URI within an SDP_Description struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the URI.
void SDP_AddEmailContact( SDP_Description * description, SDP_EmailContact * email_contact );
This function adds an SDP_EmailContact struct to the email contact linked list.
int SDP_AddNewEmailContact( SDP_Description * description, const char * address, const char * name );
This function creates and adds a new email contact to the email contact linked list.
If no error occurs, it returns true. If an error occurs, it returns false. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to create and add the email contact.
A pointer to the SDP_Description struct containing the email contact linked list.
A pointer to a string containing the address.
A pointer to a string containing the name.
int SDP_SetEmailAddress( SDP_EmailContact * email_contact, const char * address );
This function sets the email address within an SDP_EmailContact struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the email address.
A pointer to the SDP_EmailContact struct.
A pointer to a string containing the address.
int SDP_SetEmailName( SDP_EmailContact * email_contact, const char * name );
This function sets the email name within an SDP_EmailContact struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the email name.
A pointer to the SDP_EmailContact struct.
A pointer to a string containing the name.
void SDP_AddPhoneContact( SDP_Description * description, SDP_PhoneContact * phone_contact );
This function adds an SDP_PhoneContact struct to the phone contact linked list.
int SDP_AddNewPhoneContact( SDP_Description * description, const char * number, const char * name );
This function creates and adds a new phone contact to the phone contact linked list.
If no error occurs, it returns true. If an error occurs, it returns false. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to create and add the phone contact.
A pointer to the SDP_Description struct containing the phone contact linked list.
A pointer to a string containing the number.
A pointer to a string containing the name.
int SDP_SetPhoneNumber( SDP_PhoneContact * phone_contact, const char * number );
This function sets the phone number within an SDP_PhoneContact struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the phone number.
A pointer to the SDP_PhoneContact struct.
A pointer to a string containing the number.
int SDP_SetPhoneName( SDP_PhoneContact * phone_contact, const char * name );
This function sets the phone name within an SDP_PhoneContact struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the phone name.
A pointer to the SDP_PhoneContact struct.
A pointer to a string containing the name.
int SDP_SetConnection( SDP_Description * description, const char * network_type, const char * address_type, const char * address, int ttl, int total_addresses );
This function sets the connection within an SDP_Description struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the connection.
A pointer to the SDP_Description struct.
A pointer to a string containing the network type.
A pointer to a string containing the address type.
A pointer to a string containing the address.
The ttl.
The total addresses.
int SDP_SetConnectionNetworkType( SDP_Connection * connection, const char * network_type );
This function sets the connection network type within an SDP_Connection struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the connection network type.
A pointer to the SDP_Connection struct.
A pointer to a string containing the network type.
int SDP_SetConnectionAddressType( SDP_Connection * connection, const char * address_type );
This function sets the connection address type within an SDP_Connection struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the connection address type.
A pointer to the SDP_Connection struct.
A pointer to a string containing the address type.
int SDP_SetConnectionAddress( SDP_Connection * connection, const char * address );
This function sets the connection address within an SDP_Connection struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the connection address.
A pointer to the SDP_Connection struct.
A pointer to a string containing the address.
void SDP_SetConnectionTTL( SDP_Connection * connection, int ttl );
This function sets the connection tTL within an SDP_Connection struct.
void SDP_SetTotalConnectionAddresses( SDP_Connection * connection, int total_addresses );
This function sets the total connection addresses within an SDP_Connection struct.
int SDP_SetBandwidth( SDP_Description * description, const char * modifier, long value );
This function sets the bandwidth within an SDP_Description struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the bandwidth.
A pointer to the SDP_Description struct.
A pointer to a string containing the modifier.
The value.
int SDP_SetBandwidthModifier( SDP_Bandwidth * bandwidth, const char * modifier );
This function sets the bandwidth modifier within an SDP_Bandwidth struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the bandwidth modifier.
A pointer to the SDP_Bandwidth struct.
A pointer to a string containing the modifier.
void SDP_SetBandwidthValue( SDP_Bandwidth * bandwidth, long value );
This function sets the bandwidth value within an SDP_Bandwidth struct.
void SDP_AddSessionPlayTime( SDP_Description * description, SDP_SessionPlayTime * session_play_time );
This function adds an SDP_SessionPlayTime struct to the session play time linked list.
int SDP_AddNewSessionPlayTime( SDP_Description * description, time_t start_time, time_t end_time );
This function creates and adds a new session play time to the session play time linked list.
If no error occurs, it returns true. If an error occurs, it returns false. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to create and add the session play time.
A pointer to the SDP_Description struct containing the session play time linked list.
The start time.
The end time.
void SDP_SetStartTime( SDP_SessionPlayTime * session_play_time, time_t start_time );
This function sets the start time within an SDP_SessionPlayTime struct.
void SDP_SetEndTime( SDP_SessionPlayTime * session_play_time, time_t end_time );
This function sets the end time within an SDP_SessionPlayTime struct.
void SDP_AddRepeatTime( SDP_SessionPlayTime * session_play_time, SDP_RepeatTime * repeat_time );
This function adds an SDP_RepeatTime struct to the repeat time linked list.
int SDP_AddNewRepeatTime( SDP_SessionPlayTime * session_play_time, unsigned long repeat_interval, unsigned long active_duration, const unsigned long repeat_offsets[], int total_offsets );
This function creates and adds a new repeat time to the repeat time linked list.
If no error occurs, it returns true. If an error occurs, it returns false. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to create and add the repeat time.
A pointer to the SDP_SessionPlayTime struct containing the repeat time linked list.
The repeat interval.
The active duration.
The repeat offsets.
The total offsets.
void SDP_SetRepeatInterval( SDP_RepeatTime * repeat_time, unsigned long repeat_interval );
This function sets the repeat interval within an SDP_RepeatTime struct.
void SDP_SetActiveDuration( SDP_RepeatTime * repeat_time, unsigned long active_duration );
This function sets the active duration within an SDP_RepeatTime struct.
int SDP_SetRepeatOffsets( SDP_RepeatTime * repeat_time, const unsigned long repeat_offsets[], int total_offsets );
This function sets the repeat offsets within an SDP_RepeatTime struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the repeat offsets.
A pointer to the SDP_RepeatTime struct.
The repeat offsets.
The total offsets.
void SDP_AddZoneAdjustment( SDP_Description * description, SDP_ZoneAdjustment * zone_adjustment );
This function adds an SDP_ZoneAdjustment struct to the zone adjustment linked list.
int SDP_AddNewZoneAdjustment( SDP_Description * description, time_t time, long offset );
This function creates and adds a new zone adjustment to the zone adjustment linked list.
If no error occurs, it returns true. If an error occurs, it returns false. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to create and add the zone adjustment.
A pointer to the SDP_Description struct containing the zone adjustment linked list.
The time.
The offset.
void SDP_SetZoneAdjustmentTime( SDP_ZoneAdjustment * zone_adjustment, time_t time );
This function sets the zone adjustment time within an SDP_ZoneAdjustment struct.
void SDP_SetZoneAdjustmentOffset( SDP_ZoneAdjustment * zone_adjustment, long offset );
This function sets the zone adjustment offset within an SDP_ZoneAdjustment struct.
int SDP_SetEncryption( SDP_Description * description, const char * method, const char * key );
This function sets the encryption within an SDP_Description struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the encryption.
A pointer to the SDP_Description struct.
A pointer to a string containing the method.
A pointer to a string containing the key.
int SDP_SetEncryptionMethod( SDP_Encryption * encryption, const char * method );
This function sets the encryption method within an SDP_Encryption struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the encryption method.
A pointer to the SDP_Encryption struct.
A pointer to a string containing the method.
int SDP_SetEncryptionKey( SDP_Encryption * encryption, const char * key );
This function sets the encryption key within an SDP_Encryption struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the encryption key.
void SDP_AddAttribute( SDP_Description * description, SDP_Attribute * attribute );
This function adds an SDP_Attribute struct to the attribute linked list.
int SDP_AddNewAttribute( SDP_Description * description, const char * name, const char * value );
This function creates and adds a new attribute to the attribute linked list.
If no error occurs, it returns true. If an error occurs, it returns false. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to create and add the attribute.
A pointer to the SDP_Description struct containing the attribute linked list.
A pointer to a string containing the name.
A pointer to a string containing the value.
int SDP_SetAttributeName( SDP_Attribute * attribute, const char * name );
This function sets the attribute name within an SDP_Attribute struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the attribute name.
int SDP_SetAttributeValue( SDP_Attribute * attribute, const char * value );
This function sets the attribute value within an SDP_Attribute struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the attribute value.
void SDP_AddMediaDescription( SDP_Description * description, SDP_MediaDescription * media_description );
This function adds an SDP_MediaDescription struct to the media description linked list.
int SDP_AddNewMediaDescription( SDP_Description * description, const char * media_type, unsigned short port, unsigned short total_ports, const char * transport_protocol, const char * formats, const char * media_information );
This function creates and adds a new media description to the media description linked list.
If no error occurs, it returns true. If an error occurs, it returns false. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to create and add the media description.
A pointer to the SDP_Description struct containing the media description linked list.
A pointer to a string containing the media type.
The port.
The total ports.
A pointer to a string containing the transport protocol.
A pointer to a string containing the formats.
A pointer to a string containing the media information.
int SDP_SetMediaType( SDP_MediaDescription * media_description, const char * media_type );
This function sets the media type within an SDP_MediaDescription struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the media type.
A pointer to the SDP_MediaDescription struct.
A pointer to a string containing the media type.
void SDP_SetMediaPort( SDP_MediaDescription * media_description, unsigned short port );
This function sets the media port within an SDP_MediaDescription struct.
void SDP_SetTotalMediaPorts( SDP_MediaDescription * media_description, unsigned short total_ports );
This function sets the total media ports within an SDP_MediaDescription struct.
int SDP_SetMediaTransportProtocol( SDP_MediaDescription * media_description, const char * transport_protocol );
This function sets the media transport protocol within an SDP_MediaDescription struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the media transport protocol.
A pointer to the SDP_MediaDescription struct.
A pointer to a string containing the transport protocol.
int SDP_SetMediaFormats( SDP_MediaDescription * media_description, const char * formats );
This function sets the media formats within an SDP_MediaDescription struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the media formats.
A pointer to the SDP_MediaDescription struct.
A pointer to a string containing the formats.
int SDP_SetMediaInformation( SDP_MediaDescription * media_description, const char * media_information );
This function sets the media information within an SDP_MediaDescription struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the media information.
A pointer to the SDP_MediaDescription struct.
A pointer to a string containing the media information.
int SDP_SetMediaConnection( SDP_MediaDescription * media_description, const char * network_type, const char * address_type, const char * address, int ttl, int total_addresses );
This function sets the media connection within an SDP_MediaDescription struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the media connection.
A pointer to the SDP_MediaDescription struct.
A pointer to a string containing the network type.
A pointer to a string containing the address type.
A pointer to a string containing the address.
The ttl.
The total addresses.
int SDP_SetMediaBandwidth( SDP_MediaDescription * media_description, const char * modifier, long value );
This function sets the media bandwidth within an SDP_MediaDescription struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the media bandwidth.
A pointer to the SDP_MediaDescription struct.
A pointer to a string containing the modifier.
The value.
int SDP_SetMediaEncryption( SDP_MediaDescription * media_description, const char * method, const char * key );
This function sets the media encryption within an SDP_MediaDescription struct.
It returns true if no error occurs, false otherwise. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to set the media encryption.
A pointer to the SDP_MediaDescription struct.
A pointer to a string containing the method.
A pointer to a string containing the key.
void SDP_AddMediaAttribute( SDP_MediaDescription * media_description, SDP_Attribute * attribute );
This function adds an SDP_Attribute struct to the media attribute linked list.
int SDP_AddNewMediaAttribute( SDP_MediaDescription * media_description, const char * name, const char * value );
This function creates and adds a new media attribute to the media attribute linked list.
If no error occurs, it returns true. If an error occurs, it returns false. For extended error information call SDP_GetLastError(). The possible error codes returned are:
SDP_ERR_OUT_OF_MEMORY - There's not enough memory available to to create and add the media attribute.
A pointer to the SDP_MediaDescription struct containing the media attribute linked list.
A pointer to a string containing the name.
A pointer to a string containing the value.
These functions enable you to retrieve values from structs that encapsulates portions of an SDP description.
#define SDP_GetNextDescription SDP_GetNext
Gets the next SDP_Description struct from the linked list.
A pointer to the next SDP_Description struct in the linked list or NULL if there is none.
#define SDP_GetPreviousDescription SDP_GetPrevious
Gets the previous SDP_Description struct from the linked list.
A pointer to the previous SDP_Description struct in the linked list, or NULL if there is none.
int SDP_GetProtocolVersion(SDP_Description *description);
This function retrieves the protocol version from an SDP_Description struct.
SDP_Owner *SDP_GetOwner(SDP_Description *description);
This function retrieves the owner from an SDP_Description struct.
const char *SDP_GetUsername(SDP_Owner *owner);
This function retrieves the username from an SDP_Owner struct.
const char *SDP_GetSessionID(SDP_Owner *owner);
This function retrieves the session iD from an SDP_Owner struct.
const char *SDP_GetSessionVersion(SDP_Owner *owner);
This function retrieves the session version from an SDP_Owner struct.
const char *SDP_GetOwnerNetworkType(SDP_Owner *owner);
This function retrieves the owner network type from an SDP_Owner struct.
const char *SDP_GetOwnerAddressType(SDP_Owner *owner);
This function retrieves the owner address type from an SDP_Owner struct.
const char *SDP_GetOwnerAddress(SDP_Owner *owner);
This function retrieves the owner address from an SDP_Owner struct.
const char *SDP_GetSessionName(SDP_Description *description);
This function retrieves the session name from an SDP_Description struct.
const char *SDP_GetSessionInformation(SDP_Description *description);
This function retrieves the session information from an SDP_Description struct.
const char *SDP_GetURI(SDP_Description *description);
This function retrieves the URI from an SDP_Description struct.
SDP_EmailContact *SDP_GetEmailContacts(SDP_Description *description);
This function retrieves the email contacts from an SDP_Description struct.
#define SDP_GetNextEmailContact SDP_GetNext
Gets the next SDP_EmailContact struct from the linked list.
A pointer to the next SDP_EmailContact struct in the linked list or NULL if there is none.
#define SDP_GetPreviousEmailContact SDP_GetPrevious
Gets the previous SDP_EmailContact struct from the linked list.
A pointer to the previous SDP_EmailContact struct in the linked list, or NULL if there is none.
const char *SDP_GetEmailAddress(SDP_EmailContact *email_contact);
This function retrieves the email address from an SDP_EmailContact struct.
const char *SDP_GetEmailName(SDP_EmailContact *email_contact);
This function retrieves the email name from an SDP_EmailContact struct.
void SDP_RemoveEmailContact( SDP_Description * description, SDP_EmailContact * email_contact );
This removes (but does not destroy) the specified SDP_EmailContact struct from the email contact list.
SDP_PhoneContact *SDP_GetPhoneContacts(SDP_Description *description);
This function retrieves the phone contacts from an SDP_Description struct.
#define SDP_GetNextPhoneContact SDP_GetNext
Gets the next SDP_PhoneContact struct from the linked list.
A pointer to the next SDP_PhoneContact struct in the linked list or NULL if there is none.
#define SDP_GetPreviousPhoneContact SDP_GetPrevious
Gets the previous SDP_PhoneContact struct from the linked list.
A pointer to the previous SDP_PhoneContact struct in the linked list, or NULL if there is none.
const char *SDP_GetPhoneNumber(SDP_PhoneContact *phone_contact);
This function retrieves the phone number from an SDP_PhoneContact struct.
const char *SDP_GetPhoneName(SDP_PhoneContact *phone_contact);
This function retrieves the phone name from an SDP_PhoneContact struct.
void SDP_RemovePhoneContact( SDP_Description * description, SDP_PhoneContact * phone_contact );
This removes (but does not destroy) the specified SDP_PhoneContact struct from the phone contact list.
SDP_Connection *SDP_GetConnection(SDP_Description *description);
This function retrieves the connection from an SDP_Description struct.
const char *SDP_GetConnectionNetworkType(SDP_Connection *connection);
This function retrieves the connection network type from an SDP_Connection struct.
const char *SDP_GetConnectionAddressType(SDP_Connection *connection);
This function retrieves the connection address type from an SDP_Connection struct.
const char *SDP_GetConnectionAddress(SDP_Connection *connection);
This function retrieves the connection address from an SDP_Connection struct.
int SDP_GetConnectionTTL(SDP_Connection *connection);
This function retrieves the connection tTL from an SDP_Connection struct.
int SDP_GetTotalConnectionAddresses(SDP_Connection *connection);
This function retrieves the total connection addresses from an SDP_Connection struct.
SDP_Bandwidth *SDP_GetBandwidth(SDP_Description *description);
This function retrieves the bandwidth from an SDP_Description struct.
const char *SDP_GetBandwidthModifier(SDP_Bandwidth *bandwidth);
This function retrieves the bandwidth modifier from an SDP_Bandwidth struct.
long SDP_GetBandwidthValue(SDP_Bandwidth *bandwidth);
This function retrieves the bandwidth value from an SDP_Bandwidth struct.
SDP_SessionPlayTime *SDP_GetSessionPlayTimes( SDP_Description *description );
This function retrieves the session play times from an SDP_Description struct.
#define SDP_GetNextSessionPlayTime SDP_GetNext
Gets the next SDP_SessionPlayTime struct from the linked list.
A pointer to the next SDP_SessionPlayTime struct in the linked list or NULL if there is none.
#define SDP_GetPreviousSessionPlayTime SDP_GetPrevious
Gets the previous SDP_SessionPlayTime struct from the linked list.
A pointer to the previous SDP_SessionPlayTime struct in the linked list, or NULL if there is none.
time_t SDP_GetStartTime(SDP_SessionPlayTime *session_play_time);
This function retrieves the start time from an SDP_SessionPlayTime struct.
time_t SDP_GetEndTime(SDP_SessionPlayTime *session_play_time);
This function retrieves the end time from an SDP_SessionPlayTime struct.
SDP_RepeatTime *SDP_GetRepeatTimes( SDP_SessionPlayTime *session_play_time );
This function retrieves the repeat times from an SDP_SessionPlayTime struct.
#define SDP_GetNextRepeatTime SDP_GetNext
Gets the next SDP_RepeatTime struct from the linked list.
A pointer to the next SDP_RepeatTime struct in the linked list or NULL if there is none.
#define SDP_GetPreviousRepeatTime SDP_GetPrevious
Gets the previous SDP_RepeatTime struct from the linked list.
A pointer to the previous SDP_RepeatTime struct in the linked list, or NULL if there is none.
unsigned long SDP_GetRepeatInterval(SDP_RepeatTime *repeat_time);
This function retrieves the repeat interval from an SDP_RepeatTime struct.
unsigned long SDP_GetActiveDuration(SDP_RepeatTime *repeat_time);
This function retrieves the active duration from an SDP_RepeatTime struct.
unsigned long *SDP_GetRepeatOffsets(SDP_RepeatTime *repeat_time);
This function retrieves the repeat offsets from an SDP_RepeatTime struct.
int SDP_GetTotalRepeatOffsets(SDP_RepeatTime *repeat_time);
This function retrieves the total repeat offsets from an SDP_RepeatTime struct.
void SDP_RemoveRepeatTime( SDP_SessionPlayTime * session_play_times, SDP_RepeatTime * repeat_time );
This removes (but does not destroy) the specified SDP_RepeatTime struct from the repeat time list.
void SDP_RemoveSessionPlayTime( SDP_Description * description, SDP_SessionPlayTime * session_play_time );
This removes (but does not destroy) the specified SDP_SessionPlayTime struct from the session play time list.
SDP_ZoneAdjustment *SDP_GetZoneAdjustments(SDP_Description *description);
This function retrieves the zone adjustments from an SDP_Description struct.
#define SDP_GetNextZoneAdjustment SDP_GetNext
Gets the next SDP_ZoneAdjustment struct from the linked list.
A pointer to the next SDP_ZoneAdjustment struct in the linked list or NULL if there is none.
#define SDP_GetPreviousZoneAdjustment SDP_GetPrevious
Gets the previous SDP_ZoneAdjustment struct from the linked list.
A pointer to the previous SDP_ZoneAdjustment struct in the linked list, or NULL if there is none.
time_t SDP_GetZoneAdjustmentTime(SDP_ZoneAdjustment *zone_adjustment);
This function retrieves the zone adjustment time from an SDP_ZoneAdjustment struct.
long SDP_GetZoneAdjustmentOffset(SDP_ZoneAdjustment *zone_adjustment);
This function retrieves the zone adjustment offset from an SDP_ZoneAdjustment struct.
void SDP_RemoveZoneAdjustment( SDP_Description * description, SDP_ZoneAdjustment * zone_adjustment );
This removes (but does not destroy) the specified SDP_ZoneAdjustment struct from the zone adjustment list.
SDP_Encryption *SDP_GetEncryption(SDP_Description *description);
This function retrieves the encryption from an SDP_Description struct.
const char *SDP_GetEncryptionMethod(SDP_Encryption *encryption);
This function retrieves the encryption method from an SDP_Encryption struct.
const char *SDP_GetEncryptionKey(SDP_Encryption *encryption);
This function retrieves the encryption key from an SDP_Encryption struct.
SDP_Attribute *SDP_GetAttributes(SDP_Description *description);
This function retrieves the attributes from an SDP_Description struct.
#define SDP_GetNextAttribute SDP_GetNext
Gets the next SDP_Attribute struct from the linked list.
A pointer to the next SDP_Attribute struct in the linked list or NULL if there is none.
#define SDP_GetPreviousAttribute SDP_GetPrevious
Gets the previous SDP_Attribute struct from the linked list.
A pointer to the previous SDP_Attribute struct in the linked list, or NULL if there is none.
const char *SDP_GetAttributeName(SDP_Attribute *attribute);
This function retrieves the attribute name from an SDP_Attribute struct.
const char *SDP_GetAttributeValue(SDP_Attribute *attribute);
This function retrieves the attribute value from an SDP_Attribute struct.
void SDP_RemoveAttribute( SDP_Description * description, SDP_Attribute * attribute );
This removes (but does not destroy) the specified SDP_Attribute struct from the attribute list.
SDP_MediaDescription *SDP_GetMediaDescriptions( SDP_Description *description );
This function retrieves the media descriptions from an SDP_Description struct.
#define SDP_GetNextMediaDescription SDP_GetNext
Gets the next SDP_MediaDescription struct from the linked list.
A pointer to the next SDP_MediaDescription struct in the linked list or NULL if there is none.
const char *SDP_GetMediaType(SDP_MediaDescription *media_description);
This function retrieves the media type from an SDP_MediaDescription struct.
unsigned short SDP_GetMediaPort(SDP_MediaDescription *media_description);
This function retrieves the media port from an SDP_MediaDescription struct.
unsigned short SDP_GetTotalMediaPorts( SDP_MediaDescription *media_description );
This function retrieves the total media ports from an SDP_MediaDescription struct.
const char *SDP_GetMediaTransportProtocol( SDP_MediaDescription *media_description );
This function retrieves the media transport protocol from an SDP_MediaDescription struct.
const char *SDP_GetMediaFormats(SDP_MediaDescription *media_description);
This function retrieves the media formats from an SDP_MediaDescription struct.
const char *SDP_GetMediaInformation( SDP_MediaDescription *media_description );
This function retrieves the media information from an SDP_MediaDescription struct.
SDP_Connection *SDP_GetMediaConnection( SDP_MediaDescription *media_description );
This function retrieves the media connection from an SDP_MediaDescription struct.
SDP_Bandwidth *SDP_GetMediaBandwidth( SDP_MediaDescription *media_description );
This function retrieves the media bandwidth from an SDP_MediaDescription struct.
SDP_Encryption *SDP_GetMediaEncryption( SDP_MediaDescription *media_description );
This function retrieves the media encryption from an SDP_MediaDescription struct.
SDP_Attribute *SDP_GetMediaAttributes( SDP_MediaDescription *media_description );
This function retrieves the media attributes from an SDP_MediaDescription struct.
void SDP_RemoveMediaDescription( SDP_Description * description, SDP_MediaDescription * media_description );
This removes (but does not destroy) the specified SDP_MediaDescription struct from the media description list.
These functions destroy dynamically allocated structures.
void SDP_DestroyDescriptions(SDP_Description *descriptions);
This function destroys a descriptions linked list from an SDP_Description struct, releasing its memory back to the operating system. Do not try to use any items from the descriptions linked list after destroying it.
void SDP_DestroyDescription(SDP_Description *description);
This function destroys a SDP_Description struct, releasing its memory back to the operating system. Do not try to use the struct or any part of it again after destroying it.
void SDP_DestroyOwner(SDP_Owner *owner);
This function destroys a SDP_Owner struct, releasing its memory back to the operating system. Do not try to use the struct or any part of it again after destroying it.
void SDP_DestroyEmailContacts(SDP_Description *description);
This function destroys a email contacts linked list from an SDP_Description struct, releasing its memory back to the operating system. Do not try to use any items from the email contacts linked list after destroying it.
void SDP_DestroyEmailContact(SDP_EmailContact *email_contact);
This function destroys a SDP_EmailContact struct, releasing its memory back to the operating system. Do not try to use the struct or any part of it again after destroying it.
void SDP_DestroyPhoneContacts(SDP_Description *description);
This function destroys a phone contacts linked list from an SDP_Description struct, releasing its memory back to the operating system. Do not try to use any items from the phone contacts linked list after destroying it.
void SDP_DestroyPhoneContact(SDP_PhoneContact *phone_contact);
This function destroys a SDP_PhoneContact struct, releasing its memory back to the operating system. Do not try to use the struct or any part of it again after destroying it.
void SDP_DestroyConnection(SDP_Connection *connection);
This function destroys a SDP_Connection struct, releasing its memory back to the operating system. Do not try to use the struct or any part of it again after destroying it.
void SDP_DestroyBandwidth(SDP_Bandwidth *bandwidth);
This function destroys a SDP_Bandwidth struct, releasing its memory back to the operating system. Do not try to use the struct or any part of it again after destroying it.
void SDP_DestroySessionPlayTimes(SDP_Description *description);
This function destroys a session play times linked list from an SDP_Description struct, releasing its memory back to the operating system. Do not try to use any items from the session play times linked list after destroying it.
void SDP_DestroySessionPlayTime(SDP_SessionPlayTime *session_play_time);
This function destroys a SDP_SessionPlayTime struct, releasing its memory back to the operating system. Do not try to use the struct or any part of it again after destroying it.
void SDP_DestroyRepeatTimes(SDP_SessionPlayTime *session_play_time);
This function destroys a repeat times linked list from an SDP_SessionPlayTime struct, releasing its memory back to the operating system. Do not try to use any items from the repeat times linked list after destroying it.
void SDP_DestroyRepeatTime(SDP_RepeatTime *repeat_time);
This function destroys a SDP_RepeatTime struct, releasing its memory back to the operating system. Do not try to use the struct or any part of it again after destroying it.
void SDP_DestroyZoneAdjustments(SDP_Description *description);
This function destroys a zone adjustments linked list from an SDP_Description struct, releasing its memory back to the operating system. Do not try to use any items from the zone adjustments linked list after destroying it.
void SDP_DestroyZoneAdjustment(SDP_ZoneAdjustment *zone_adjustment);
This function destroys a SDP_ZoneAdjustment struct, releasing its memory back to the operating system. Do not try to use the struct or any part of it again after destroying it.
void SDP_DestroyEncryption(SDP_Encryption *encryption);
This function destroys a SDP_Encryption struct, releasing its memory back to the operating system. Do not try to use the struct or any part of it again after destroying it.
void SDP_DestroyAttributes(SDP_Description *description);
This function destroys an attributes linked list from an SDP_Description struct, releasing its memory back to the operating system. Do not try to use any items from the attributes linked list after destroying it.
void SDP_DestroyAttribute(SDP_Attribute *attribute);
This function destroys a SDP_Attribute struct, releasing its memory back to the operating system. Do not try to use the struct or any part of it again after destroying it.
void SDP_DestroyMediaDescriptions(SDP_Description *description);
This function destroys a media descriptions linked list from an SDP_Description struct, releasing its memory back to the operating system. Do not try to use any items from the media descriptions linked list after destroying it.
void SDP_DestroyMediaDescription(SDP_MediaDescription *media_description);
This function destroys a SDP_MediaDescription struct, releasing its memory back to the operating system. Do not try to use the struct or any part of it again after destroying it.
void SDP_DestroyMediaAttributes(SDP_MediaDescription *media_description);
This function destroys a media attributes linked list from an SDP_MediaDescription struct, releasing its memory back to the operating system. Do not try to use any items from the media attributes linked list after destroying it.
Bugs in this package can be reported and monitored using sourceforge.net: http://sourceforge.net/tracker/?atid=644250&group_id=106387&func=browse
You can also email me directly: <william_g_davis at users dot sourceforge dot net>.
Copyright 2004 by William G. Davis.
This library is free software released under the terms of the GNU Lesser General Public License (LGPL), the full terms of which can be found in the "COPYING" file that comes with the distribution.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.