HP-UX Multimedia Streaming Protocols (MSP) Programmer's Guide
SDP APIs
The APIs included in the SDP library have the following functions:
• “Parsing the Buffer and Filling Up the SDP Structure” (page 69)
• “Generating an SDP Packet from the SDP Structure” (page 69)
• “Obtaining or Setting SDP Structure Members” (page 70)
• “Obtaining or Adding the Structure Members for Media Descriptions” (page 74)
• “Initializing the SDP Structure and Allocating Space” (page 75)
• “Freeing the Space Allocated for the SDP Structure” (page 76)
• “Creating an SDP Packet” (page 76)
• “Parsing an SDP Packet” (page 78)
Parsing the Buffer and Filling Up the SDP Structure
The SDP header file, sdp.h, contains the declaration of sdp_parse_buf as follows:
#include <sdp.h>
int sdp_parse_buf(sdp_t *sdp, char *sdp_buf);
The sdp_parse_buf API parses the input buffer, sdp_buf, which contains SDP
descriptions and fills up the SDP structure.
For more information, type man 3 sdp_parse_buf at the HP-UX command prompt.
Return Values
Upon success, sdp_parse_buf returns SDP_SUCCESS; upon failure, it returns one
of the following error values:
• SDP_EPROT
Non-RFC compliant description string encountered.
• SDP_EEOF
EOF/end of buffer reached while parsing.
• SDP_ENOMEM
Memory allocation failure.
• SDP_EBUFOVFLW
Buffer overflow encountered.
• SDP_ETYPE
Type is not expected in <type>= in the SDP description.
Generating an SDP Packet from the SDP Structure
The SDP header file, sdp.h, contains the declaration of sdp_create_buf as follows:
#include <sdp.h>
int sdp_create_buf(sdp_t *sdp, char **sdp_buf, size_t *bufsize);
SDP Library 69