sdp.bnf 6.89 KB
Newer Older
Pekka Pessi's avatar
Pekka Pessi committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
   ; BNF from RFC 2327

   announcement =        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 =       "v=" 1*DIGIT CRLF
                         ;this memo describes version 0

   origin-field =        "o=" username space
                         sess-id space sess-version space
                         nettype space addrtype space
                         addr CRLF

   session-name-field =  "s=" text CRLF

   information-field =   ["i=" text CRLF]

   uri-field =           ["u=" uri CRLF]

   email-fields =        *("e=" email-address CRLF)

   phone-fields =        *("p=" phone-number CRLF)


   connection-field =    ["c=" nettype space addrtype space
                         connection-address CRLF]
                         ;a connection field must be present
                         ;in every media description or at the
                         ;session-level


   bandwidth-fields =    *("b=" bwtype ":" bandwidth CRLF)


   time-fields =         1*( "t=" start-time space stop-time
                         *(CRLF repeat-fields) CRLF)
                         [zone-adjustments CRLF]


   repeat-fields =       "r=" repeat-interval space typed-time
                         1*(space typed-time)


   zone-adjustments =    "z=" time space ["-"] typed-time
                         *(space time space ["-"] typed-time)


   key-field =           ["k=" key-type CRLF]


   key-type =            "prompt" |
                         "clear:" key-data |
                         "base64:" key-data |
                         "uri:" uri


   key-data =            email-safe | "~" | "


   attribute-fields =    *("a=" attribute CRLF)


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


   media-field =         "m=" media space port ["/" integer]
                         space proto 1*(space fmt) CRLF


   media =               1*(alpha-numeric)
                         ;typically "audio", "video", "application"
                         ;or "data"

   fmt =                 1*(alpha-numeric)
                         ;typically an RTP payload type for audio
                         ;and video media

   proto =               1*(alpha-numeric | "/") ; PPe
                         ;typically "RTP/AVP" or "udp" for IP4


   port =                1*(DIGIT)
                         ;should in the range "1024" to "65535" inclusive
                         ;for UDP based media


   attribute =           (att-field ":" att-value) | att-field


   att-field =           1*(alpha-numeric)


   att-value =           byte-string


   sess-id =             1*(DIGIT)
                         ;should be unique for this originating username/host


   sess-version =        1*(DIGIT)
                         ;0 is a new session


   connection-address =  multicast-address
                         | addr


   multicast-address =   3*(decimal-uchar ".") decimal-uchar "/" ttl
                         [ "/" integer ]
                         ;multicast addresses may be in the range
                         ;224.0.0.0 to 239.255.255.255

   ttl =                 decimal-uchar

   start-time =          time | "0"

   stop-time =           time | "0"

   time =                POS-DIGIT 9*(DIGIT)
                         ;sufficient for 2 more centuries


   repeat-interval =     typed-time

   typed-time =          1*(DIGIT) [fixed-len-time-unit]


   fixed-len-time-unit = "d" | "h" | "m" | "s"


   bwtype =              1*(alpha-numeric)

   bandwidth =           1*(DIGIT)


   username =            safe
                         ;pretty wide definition, but doesn't include space


   email-address =       email | email "(" email-safe ")" |
                         email-safe "<" email ">"


   email =               ;defined in RFC822


   uri=                  ;defined in RFC1630


   phone-number =        phone | phone "(" email-safe ")" |
                         email-safe "<" phone ">"


   phone =               "+" POS-DIGIT 1*(space | "-" | DIGIT)
                         ;there must be a space or hyphen between the
                         ;international code and the rest of the number.


   nettype =             "IN"
                         ;list to be extended


   addrtype =            "IP4" | "IP6"
                         ;list to be extended


   addr =                FQDN | unicast-address


   FQDN =                4*(alpha-numeric|"-"|".")
                         ;fully qualified domain name as specified in RFC1035

   unicast-address =     IP4-address | IP6-address


   IP4-address =         b1 "." decimal-uchar "." decimal-uchar "." b4
   b1 =                  decimal-uchar
                         ;less than "224"; not "0" or "127"
   b4 =                  decimal-uchar
                         ;not "0"

   IP6-address =         ;to be defined


   text =                byte-string
                         ;default is to interpret this as IS0-10646 UTF8
                         ;ISO 8859-1 requires a "a=charset:ISO-8859-1"
                         ;session-level attribute to be used


   byte-string =         1*(0x01..0x09|0x0b|0x0c|0x0e..0xff)
                         ;any byte except NUL, CR or LF


   decimal-uchar =       DIGIT
                         | POS-DIGIT DIGIT
                         | ("1" 2*(DIGIT))
                         | ("2" ("0"|"1"|"2"|"3"|"4") DIGIT)
                         | ("2" "5" ("0"|"1"|"2"|"3"|"4"|"5"))


   integer =             POS-DIGIT *(DIGIT)


   alpha-numeric =       ALPHA | DIGIT


   DIGIT =               "0" | POS-DIGIT


   POS-DIGIT =           "1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"


   ALPHA =               "a"|"b"|"c"|"d"|"e"|"f"|"g"|"h"|"i"|"j"|"k"|
                         "l"|"m"|"n"|"o "|"p"|"q"|"r"|"s"|"t"|"u"|"v"|
                         "w"|"x"|"y"|"z"|"A"|"B"|"C "|"D"|"E"|"F"|"G"|
                         "H"|"I"|"J"|"K"|"L"|"M"|"N"|"O"|"P"|" Q"|"R"|
                         "S"|"T"|"U"|"V"|"W"|"X"|"Y"|"Z"


   email-safe =          safe | space | tab


   safe =                alpha-numeric |
                         "'" | "'" | "-" | "." | "/" | ":" | "?" | """ |
                         "#" | "$" | "&" | "*" | ";" | "=" | "@" | "[" |
                         "]" | "^" | "_" | "`" | "{" | "|" | "}" | "+" |
                         "~" | "


   space =               %d32
   tab =                 %d9
   CRLF =                %d13.10