NAME

SinisterSdpGenerator - The SDP generator routines

SYNOPSIS

 #include <SDP/SDP_Generator.h>
 
 int main(void)
 {
 	SDP_Generator *generator = SDP_NewGenerator();
 
 	SDP_GenProtocolVersionField(generator, 1);
 	SDP_GenOwnerField(
 		generator, "username", "session_id", "IN", "IP4", "127.0.0.1"
 	);
 	SDP_GenSessionNameField(generator, "Some session");
 	SDP_GenInformationField(generator, "This is short description");
 
 	...
 
 	SDP_SaveGeneratedOutput(generator, "description.sdp");
 }

DESCRIPTION

This document describes the SinisterSdp generator routines. These routines enable you programmatically generate SDP session descriptions, as well as spit out descriptions encapsulated by an SDP_Description struct into a string or file.

SDP_OutputDescriptionsToString(descriptions)

 char *SDP_OutputDescriptionsToString(SDP_Description *descriptions);

This function outputs every single SDP_Description struct in the linked list to a dynamically allocated string.

SDP_OutputDescriptionToString(description)

 char *SDP_OutputDescriptionToString(SDP_Description *description);

This function outputs a single SDP_Description struct to a dynamically allocated string and returns a pointer to it.

SDP_OutputDescriptionsToFile(descriptions, filename)

 int SDP_OutputDescriptionsToFile(
 	SDP_Description *   descriptions,
 	const char *        filename
 );

This function outputs every SDP_Description struct in the link list to a file. If the file specified does not exist, it will be created. If it does exist, then anything in it will be overwritten.

SDP_OutputDescriptionToFile(description, filename)

 int SDP_OutputDescriptionToFile(
 	SDP_Description *   description,
 	const char *        filename
 );

This function outputs a single SDP_Description struct to a file. If the file specified does not exist, it will be created. If it does exist, then anything in it will be overwritten.

SDP_NewGenerator()

 SDP_Generator *SDP_NewGenerator(void);

This function creates a new SDP generator.

SDP_GenProtocolVersionField(generator, protocol_version)

 int SDP_GenProtocolVersionField(
 	SDP_Generator *   generator,
 	int               protocol_version
 );

This function generates a "v" field.

SDP_GenOwnerField(generator, username, session_id, session_version, network_type, address_type, address)

 int SDP_GenOwnerField(
 	SDP_Generator *   generator,
 	const char *      username,
 	const char *      session_id,
 	const char *      session_version,
 	const char *      network_type,
 	const char *      address_type,
 	const char *      address
 );

This function generates an "o" field.

SDP_GenFromOwner(generator, owner)

 int SDP_GenFromOwner(
 	SDP_Generator *   generator,
 	SDP_Owner *       owner
 );

This function generates an "o" field from an SDP_Owner struct.

SDP_GenSessionNameField(generator, session_name)

 int SDP_GenSessionNameField(
 	SDP_Generator *   generator,
 	const char *      session_name
 );

This function generates an "s" field.

SDP_GenInformationField(generator, information)

 int SDP_GenInformationField(
 	SDP_Generator *   generator,
 	const char *      information
 );

This fucntion generates an "i" field.

SDP_GenURIField(generator, uri)

 int SDP_GenURIField(
 	SDP_Generator *   generator,
 	const char *      uri
 );

This function generates a "u" field.

SDP_GenEmailContactField(generator, address, name)

 int SDP_GenEmailContactField(
 	SDP_Generator *   generator,
 	const char *      address,
 	const char *      name
 );

This function generates an "e" field.

SDP_GenFromEmailContacts(generator, email_contacts)

 int SDP_GenFromEmailContacts(
 	SDP_Generator *      generator,
 	SDP_EmailContact *   email_contacts
 );

This function generates "e" fields from each SDP_EmailContact struct in the linked list.

SDP_GenFromEmailContact(generator, email_contact)

 int SDP_GenFromEmailContact(
 	SDP_Generator *      generator,
 	SDP_EmailContact *   email_contact
 );

This function generates a single "e" field from a single SDP_EmailContact struct.

SDP_GenPhoneContactField(generator, number, name)

 int SDP_GenPhoneContactField(
 	SDP_Generator *   generator,
 	const char *      number,
 	const char *      name
 );

This function generates a "p" field.

SDP_GenFromPhoneContacts(generator, phone_contacts)

 int SDP_GenFromPhoneContacts(
 	SDP_Generator *      generator,
 	SDP_PhoneContact *   phone_contacts
 );

This function generates "p" fields from every SDP_PhoneContact struct in the linked list.

SDP_GenFromPhoneContact(generator, phone_contact)

 int SDP_GenFromPhoneContact(
 	SDP_Generator *      generator,
 	SDP_PhoneContact *   phone_contact
 );

This function generates a "p" field from a single SDP_PhoneContact struct.

SDP_GenConnectionField(generator, network_type, address_type, address, ttl, total_addresses)

 int SDP_GenConnectionField(
 	SDP_Generator *   generator,
 	const char *      network_type,
 	const char *      address_type,
 	const char *      address,
 	int               ttl,
 	int               total_addresses
 );

This function generates a "c" field.

SDP_GenFromConnection(generator, connection)

 int SDP_GenFromConnection(
 	SDP_Generator *    generator,
 	SDP_Connection *   connection
 );

This function generates a "c" field from an SDP_Connection struct.

SDP_GenBandwidthField(generator, modifier, value)

 int SDP_GenBandwidthField(
 	SDP_Generator *   generator,
 	const char *      modifier,
 	long              value
 );

This function generates a "b" field.

SDP_GenFromBandwidth(generator, bandwidth)

 int SDP_GenFromBandwidth(
 	SDP_Generator *   generator,
 	SDP_Bandwidth *   bandwidth
 );

This function generates a "b" field from an SDP_Bandwidth struct.

SDP_GenSessionPlayTimeField(generator, start_time, end_time)

 int SDP_GenSessionPlayTimeField(
 	SDP_Generator *   generator,
 	time_t            start_time,
 	time_t            end_time
 );

This function generates a "t" field.

SDP_GenFromSessionPlayTimes(generator, session_play_times)

 int SDP_GenFromSessionPlayTimes(
 	SDP_Generator *         generator,
 	SDP_SessionPlayTime *   session_play_times
 );

This function generates a "t" field and any requisite "r" feilds for each SDP_SessionPlayTime struct in the linked list.

SDP_GenFromSessionPlayTime(generator, session_play_time)

 int SDP_GenFromSessionPlayTime(
 	SDP_Generator *         generator,
 	SDP_SessionPlayTime *   session_play_time
 );

This function generates a single "t" field and any requisite "r" fields from a SDP_SessionPlayTime struct.

SDP_GenRepeatTimeField(generator, repeat_interval, active_duration, repeat_offsets)

 int SDP_GenRepeatTimeField(
 	SDP_Generator *   generator,
 	const char *      repeat_interval,
 	const char *      active_duration,
 	const char *      repeat_offsets
 );

This function generates an "r" field.

SDP_GenFromRepeatTimes(generator, repeat_times)

 int SDP_GenFromRepeatTimes(
 	SDP_Generator *    generator,
 	SDP_RepeatTime *   repeat_times
 );

This function generates "r" fields from each SDP_RepeatTime struct in the linked list.

SDP_GenFromRepeatTime(generator, repeat_time)

 int SDP_GenFromRepeatTime(
 	SDP_Generator *    generator,
 	SDP_RepeatTime *   repeat_time
 );

This function generates an "r" field from an SDP_RepeatTime struct.

SDP_GenZoneAdjustmentsField(generator, total_adjustments, ...)

 int SDP_GenZoneAdjustmentsField(
 	SDP_Generator *   generator,
 	int               total_adjustments,
 	...
 );

This function generates a "z" field.

SDP_GenFromZoneAdjustments(generator, zone_adjustments)

 int SDP_GenFromZoneAdjustments(
 	SDP_Generator *        generator,
 	SDP_ZoneAdjustment *   zone_adjustments
 );

Stub description documentation.

SDP_GenEncryptionField(generator, method, key)

 int SDP_GenEncryptionField(
 	SDP_Generator *   generator,
 	const char *      method,
 	const char *      key
 );

This function generates a "k" field.

SDP_GenFromEncryption(generator, encryption)

 int SDP_GenFromEncryption(
 	SDP_Generator *    generator,
 	SDP_Encryption *   encryption
 );

This function generates a "k" field from an SDP_Encryption struct.

SDP_GenAttributeField(generator, name, value)

 int SDP_GenAttributeField(
 	SDP_Generator *   generator,
 	const char *      name,
 	const char *      value
 );

This function generates an "a" field.

SDP_GenFromAttributes(generator, attributes)

 int SDP_GenFromAttributes(
 	SDP_Generator *   generator,
 	SDP_Attribute *   attributes
 );

This function generates "a" fields from every SDP_Attribute struct in the linked list.

SDP_GenFromAttribute(generator, attribute)

 int SDP_GenFromAttribute(
 	SDP_Generator *   generator,
 	SDP_Attribute *   attribute
 );

This function generates an "a" field.

SDP_GenMediaDescriptionField(generator, media_type, port, total_ports, transport_protocol, formats)

 int SDP_GenMediaDescriptionField(
 	SDP_Generator *   generator,
 	const char *      media_type,
 	const char *      port,
 	const char *      transport_protocol,
 	const char *      formats
 );

This function generates an "m" field.

SDP_GenFromMediaDescriptions(generator, media_descriptions)

 int SDP_GenFromMediaDescriptions(
 	SDP_Generator *          generator,
 	SDP_MediaDescription *   media_descriptions
 );

This function generates "m" fields and any other requisite fields from each SDP_MediaDescription in the linked list.

SDP_GenFromMediaDescription(generator, media_description)

 int SDP_GenFromMediaDescription(
 	SDP_Generator *          generator,
 	SDP_MediaDescription *   media_description
 );

This function generates an "m" field and any related fields from an SDP_MediaDescription struct.

SDP_GetGeneratedOutput(generator)

 char *SDP_GetGeneratedOutput(SDP_Generator *generator);

This function returns a pointer to the generator's buffer. If you want to modify the this or use it after calling SDP_DestroyGenerator(), use strdup() or some comparable function to copy it.

SDP_SaveGeneratedOutput(generator, filename)

 int SDP_SaveGeneratedOutput(
 	SDP_Generator *   generator,
 	const char *      filename
 );

This function outputs the generator buffer to a file. If the file specified doesn't already exist, then it will be created. If it does exist, then anything in it will be overwritten.

SDP_DestroyGenerator(generator)

 void SDP_DestroyGenerator(SDP_Generator *generator);

This function destroys an SDP generator, returning its memory to the system.

BUGS

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

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.