org.jnetpcap.protocol.voip
Class Sdp

java.lang.Object
  extended by org.jnetpcap.nio.JMemory
      extended by org.jnetpcap.nio.JBuffer
          extended by org.jnetpcap.packet.JHeader
              extended by org.jnetpcap.packet.JMappedHeader
                  extended by org.jnetpcap.protocol.voip.Sdp
All Implemented Interfaces:
JPayloadAccessor

@Header
public class Sdp
extends JMappedHeader

The Session Description Protocol (SDP) is a format for describing streaming media initialization parameters. The IETF published the original specification as an IETF Proposed Standard in April 1998,[1] and subsequently published a revised specification as an IETF Proposed Standard as RFC 4566 in July 2006.[2]

SDP is intended for describing multimedia communication sessions for the purposes of session announcement, session invitation, and parameter negotiation. SDP does not deliver media itself but is used for negotiation between end points of media type, format, and all associated properties. The set of properties and parameters are often called a session profile. SDP is designed to be extensible to support new media types and formats.

SDP started off as a component of the Session Announcement Protocol (SAP), but found other uses in conjunction with Real-time Transport Protocol (RTP), Real-time Streaming Protocol (RTSP), Session Initiation Protocol (SIP) and even as a standalone format for describing multicast sessions.

Description source: http://en.wikipedia.org/wiki/Session_Description_Protocol

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Nested Class Summary
static class Sdp.Fields
          A table of various fields for SDP protocol.
 
Nested classes/interfaces inherited from class org.jnetpcap.packet.JHeader
JHeader.State
 
Nested classes/interfaces inherited from class org.jnetpcap.nio.JMemory
JMemory.Type
 
Field Summary
static int ID
          Constant numerial ID for this protocol's header.
 
Fields inherited from class org.jnetpcap.packet.JHeader
annotatedHeader, BYTE, EMPTY_HEADER_ARRAY, isSubHeader, packet, state
 
Fields inherited from class org.jnetpcap.nio.JMemory
JNETPCAP_LIBRARY_NAME, MAX_DIRECT_MEMORY_DEFAULT, POINTER
 
Constructor Summary
Sdp()
           
 
Method Summary
 java.lang.String[] attributes()
          Returns as array of Strings with all the attributes of this message.
 int attributesLength()
          Returns the length of the 'attributes' field.
 int attributesOffset()
          Returns the offset into the header for the 'attributes' field.
protected  void decodeHeader()
          Decode header.
static int headerLength(JBuffer buffer, int offset)
          Calculates the length of this header from a static context.
 java.lang.String text()
          Experimental function.
 int textLength()
          Experimental function.
 
Methods inherited from class org.jnetpcap.packet.JMappedHeader
addField, addField, addField, clearFields, fieldArray, fieldDescription, fieldDescription, fieldDisplay, fieldDisplay, fieldLength, fieldLength, fieldOffset, fieldOffset, fieldValue, fieldValue, fieldValue, fieldValue, hasField, hasField, map, map
 
Methods inherited from class org.jnetpcap.packet.JHeader
decode, getAnnotatedHeader, getDescription, getFields, getGap, getGapLength, getGapOffset, getHeader, getHeaderLength, getHeaderOffset, getId, getIndex, getLength, getName, getNextHeaderId, getNextHeaderOffset, getNicname, getOffset, getPacket, getParent, getPayload, getPayloadLength, getPayloadOffset, getPostfix, getPostfixLength, getPostfixOffset, getPrefix, getPrefixLength, getPrefixOffset, getPreviousHeaderId, getPreviousHeaderOffset, getState, getSubHeaders, hasDescription, hasGap, hasNextHeader, hasPayload, hasPostfix, hasPrefix, hasPreviousHeader, hasSubHeaders, isFragmented, isGapTruncated, isHeaderTruncated, isPayloadTruncated, isPostfixTruncated, isPrefixTruncated, peer, peer, peerPayloadTo, setPacket, setSubHeaders, sizeof, toString, transferPayloadTo, transferPayloadTo, transferPayloadTo, validateHeader
 
Methods inherited from class org.jnetpcap.nio.JBuffer
findUTF8String, getByte, getByteArray, getByteArray, getByteArray, getDouble, getFloat, getInt, getLong, getShort, getUByte, getUInt, getUShort, getUTF8Char, getUTF8String, getUTF8String, getUTF8String, getUTF8String, isReadonly, order, order, peer, peer, peer, peer, setByte, setByteArray, setByteBuffer, setDouble, setFloat, setInt, setLong, setShort, setShort0, setUByte, setUInt, setUShort, transferFrom, transferFrom, transferFrom, transferTo, transferTo, transferTo
 
Methods inherited from class org.jnetpcap.nio.JMemory
availableDirectMemory, check, cleanup, createReference, isInitialized, isJMemoryBasedOwner, isOwner, maxDirectMemory, peer, reservedDirectMemory, setSize, size, softDirectMemory, toDebugString, toHexdump, toHexdump, totalActiveAllocated, totalAllocateCalls, totalAllocated, totalAllocatedSegments0To255Bytes, totalAllocatedSegments256OrAbove, totalDeAllocateCalls, totalDeAllocated, transferFrom, transferFrom, transferFromDirect, transferOwnership, transferTo, transferTo, transferTo, transferTo, transferTo, transferTo0
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static int ID
Constant numerial ID for this protocol's header.

Constructor Detail

Sdp

public Sdp()
Method Detail

headerLength

@HeaderLength
public static int headerLength(JBuffer buffer,
                                            int offset)
Calculates the length of this header from a static context.

Parameters:
buffer - buffer containing the packet or this header content
offset - offset into the buffer where this header begins
Returns:
length in bytes for this header, excluding payload

attributes

@Field(offset=0,
       length=10,
       format="%s[]")
public java.lang.String[] attributes()
Returns as array of Strings with all the attributes of this message.

Returns:
array containing all the attributes found in this message

attributesLength

@Dynamic(value=LENGTH)
public int attributesLength()
Returns the length of the 'attributes' field.

Returns:
length of the 'attributes' field; the length is in bits

attributesOffset

@Dynamic(value=OFFSET)
public int attributesOffset()
Returns the offset into the header for the 'attributes' field.

Returns:
offset from the start of the header; the offset is in bits

decodeHeader

protected void decodeHeader()
Decode header.

Overrides:
decodeHeader in class JHeader
See Also:
JHeader.decodeHeader()

text

public java.lang.String text()
Experimental function.

Returns:
the entire SDP header as a text string

textLength

public int textLength()
Experimental function.

Returns:
size of the SDP header in bits