mccdReadSDP

Reads an SDP message from a user-provided memory buffer, and generates a tree of data structures containing information from the SDP message. The MCC_SDP data structure is the root data structure in the tree.

Prototype

MCC_SDP * mccdReadSDP ( void * sdpData, unsigned sdpSize, void * outData, unsigned outSize, unsigned * perror)

Argument

Description

sdpData

Pointer to the input memory buffer.

sdpSize

Size of the input memory buffer.

outData

Pointer to the output memory buffer.

outSize

Size of the output memory buffer.

perror

Pointer to the returned completion code. Recognized values include:

  • MCCSDP_OK (Function completed normally.)

  • MCCSDP_MEMORY_ERROR

  • MCCSDP_SYNTAX_ERROR

Return values

mccReadSDP returns a pointer to the created MCC_SDP structure. If an error occurs during processing, the function returns NULL and places the error code into the variable pointed to by the perror argument.

Details

mccReadDSP does not use dynamic memory allocation for the generated data structures. Instead, it places all generated structures into the user-provided output memory buffer. This buffer must be large enough to contain all of the generated information.

The following error codes can occur:

Error code

Description

MCCSDP_MEMORY_ERROR

Output buffer is not large enough to hold the output.

MCCSDP_SYNTAX_ERROR

Output buffer format does not conform to RFC 2327.

Example

    MCC_SDP *   sdp;
    uint32_t    error;
    
    char sdpData[1024];     /* Buffer to write SDP to */
    char buffer[1024];      /* Buffer to create MCC_SDP structure in */

/*Read generated SDP into MCC_SDP */
    
    sdp = mccdReadSDP( sdpData, mccdSdpGetLength(pc), buffer, sizeof(buffer), &error ); 
    
    if ( sdp == 0 ) 
    {
        printf("ERROR: failed to process SDP: %d\n", error);
        return;
    }