メインコンテンツまでスキップ

9. SDP 文法 (SDP Grammar)

本節では SDP の拡張バッカス・ナウア記法 (Augmented BNF, ABNF) 文法を提供します。ABNF は [RFC 5234] で定義されています。

SDP 文法定義

; SDP Syntax
session-description = proto-version
origin-field
session-name-field
information-field
uri-field
email-fields
phone-fields
connection-field
bandwidth-fields
time-fields
key-field
attribute-fields
media-descriptions

proto-version = %x76 "=" 1*DIGIT CRLF
;this memo describes version 0

origin-field = %x6f "=" username SP sess-id SP sess-version SP
nettype SP addrtype SP unicast-address CRLF

session-name-field = %x73 "=" text CRLF

information-field = [%x69 "=" text CRLF]

uri-field = [%x75 "=" uri CRLF]

email-fields = *(%x65 "=" email-address CRLF)

phone-fields = *(%x70 "=" phone-number CRLF)

connection-field = [%x63 "=" nettype SP addrtype SP
connection-address CRLF]

bandwidth-fields = *(%x62 "=" bwtype ":" bandwidth CRLF)

time-fields = 1*( %x74 "=" start-time SP stop-time
*(CRLF repeat-fields) CRLF)
[zone-adjustments CRLF]

repeat-fields = %x72 "=" repeat-interval SP typed-time
1*(SP typed-time)

zone-adjustments = %x7a "=" time SP ["-"] typed-time
*(SP time SP ["-"] typed-time)

key-field = [%x6b "=" key-type CRLF]

attribute-fields = *(%x61 "=" attribute CRLF)

media-descriptions = *( media-field
information-field
*connection-field
bandwidth-fields
key-field
attribute-fields )

media-field = %x6d "=" media SP port ["/" integer]
SP proto 1*(SP fmt) CRLF

; サブルール
username = non-ws-string
sess-id = 1*DIGIT
sess-version = 1*DIGIT
nettype = token
addrtype = token
media = token
port = 1*DIGIT
proto = token *("/" token)
fmt = token

注意: 完全な ABNF 文法定義は非常に詳細で、すべてのフィールドの詳細なルールと終端記号の定義が含まれています。完全な文法については RFC 4566 公式文書 の第 9 節を参照してください。