Subject: [Sip] Some sipbis-06 ABNF syntax issues

From: Bill Fenner <[email-masked]>
Date: Sun, 3 Feb 2002 10:54:51 -0800

Here are some purely syntactic issues with the ABNF in bis-06.

LHEX  =  digit | "a" | "b" | "c" | "d" | "e" | "f"

This "digit" should be "DIGIT", since that's what's defined above.

quoted-pair     =  "\" (%x00 - %x09 | %x0b | %x0c | %x0e - %x7f)

These ranges must be %x00-09 and %x0e-7f .

hex4           =  1*4HEX

This must be 1*4hex (or the definition of "hex" below "LHEX" could be
changed to "HEX")

scheme         =  alpha *( alpha | digit | "+" | "-" | "." )

This "digit" must also be "DIGIT".

Method            =  "INVITE" | "ACK" | "OPTIONS" | "BYE"
                     | "CANCEL | "REGISTER" | "PRACK"
                     | extension-method

"CANCEL" is missing the closing quote.

Status-Line     =  SIP-version SP Status-Code SP Reason-Phrase CRLF

"SIP-version" should be "SIP-Version".

language-range   =  ( ( 1*8ALPHA *( MINUS 1*8ALPHA ) ) | "*" )

These should be "alpha", not "ALPHA".

credentials       =  ("Digest" digest-response) | (token gen-resp)) 

There's an extra close-paren.

gen-resp          =  *token *((COMMA *token) | (EQUAL
                     (*token | quoted-string))

This is missing a close paren.

This allows foo=bar=baz=bip, is that intended?

AuthenticationInfo __  "Authentication-Info" COLON ainfo *(COMMA ainfo)

This token should be "Authentication-Info" (or its use elsewhere should
be "AuthenticationInfo", and the "__" should be "=".

display-name   =  *(token LWS)| quoted-string)

There's an extra close-paren here.

primary-tag       =  1*8ALPHA
subtag            =  1*8ALPHA

These need to be "1*8alpha".

>From =  ( "From" | "f" ) HCOLON from-spec

This leading > probably doesn't belong.

In-Reply-To  =  "In-Reply-To" HCOLON called *(COMMA called))

I suspect "called" should be "callid".

realm               =  "realm" EQUALS realm-value

This "EQUALS" should be "EQUAL".

URI                 =  absoluteURI | abs_path

This "abs_path" should be "abs-path".

Route        =  "Route" HCOLON route=param *(COMMA route-param)

This "route=param" should be "route-param".

Supported  =  ( "Supported" | "k" ) HCOLON
              (option-tag *(COMMA option-tag)

This is missing a close paren (or has an extra close-paren).

There are still two undefined tokens:

parameter: Used 1 times, but not defined
request-uri: Used 1 times, but not defined

The comment after "request-uri" says "As specified by HTTP/1.1", so
that's probably OK.  It was not immediately obvious what "parameter"
was supposed to be; perhaps "m-parameter".

The following are not a big deal, just pointing to possible problems
where something was defined to be used and then wasn't.  It's probably
not worth removing the unused definitions.

Punctuation:

ATSIGN: Defined but not used
BANG: Defined but not used
BAR: Defined but not used
CHAR: Defined but not used
CTL: Defined but not used
DOT: Defined but not used
DQUOT: Defined but not used
LANGLE: Defined but not used
LBRACK: Defined but not used
PERCENT: Defined but not used
PLUS: Defined but not used
RANGLE: Defined but not used
RBRACK: Defined but not used
TILDE: Defined but not used

Top-level message (this is obviously external so can't be used):

SIP-message: Defined but not used

Others (possibly points to a problem where these were meant to be
used but weren't):

TEXT-UTF8: Defined but not used
separators: Defined but not used

Rohan found some of the actual grammar problems that I was worried about;
I'm planning to make another pass on the details of the grammar.

  Bill

_______________________________________________
Sip mailing list  https://www1.ietf.org/mailman/listinfo/sip
This list is for NEW development of the core SIP Protocol
Use [email-masked] for questions on current sip
Use [email-masked] for new developments on the application of sip

---

From: Jonathan Rosenberg <[email-masked]>
Date: Sun, 03 Feb 2002 22:21:06 -0500

Bill,

Thanks for your comments and careful read. Responses inline:

> This "digit" should be "DIGIT", since that's what's defined above.

The BNF in bis-07 is now based on rfc2234, so we have reused DIGIT,
which
is defined there. I will note that rule names are case insensitive
according
to rfc2234, so technically LHEX is correct, but I changed it to DIGIT
anyway as part of the conversion to 2234.

> These ranges must be %x00-09 and %x0e-7f .

Good catch. Fixed.

> This must be 1*4hex (or the definition of "hex" below "LHEX" could be

Since we are using rfc2234, its now actually

hex4 = 1*4HEXDIG

and HEXDIG is defined in 2234.

> This "digit" must also be "DIGIT".

Fixed. alpha is now also ALPHA.

> "CANCEL" is missing the closing quote.

Well, this one has changed radically. According to rfc2234, quoted
strings in BNF are case insensitive. However, methods are case
sensitive. To fix this, here is the new, ugly definition of Method:

INVITEm = %x49.4E.56.49.54.45 ; INVITE in caps
ACKm = %x41.43.4B ; ACK in caps
OPTIONSm = %x4F.50.54.49.4F.4E.53 ; OPTIONS in caps
BYEm = %x42.59.45 ; BYE in caps
CANCELm = %x43.41.4E.43.45.4C ; CANCEL in caps
REGISTERm = %x52.45.47.49.53.54.45.52 ; REGISTER in caps
PRACKm = %x50.52.41.43.4B ; PRACK in caps
Method = INVITEm / ACKm / OPTIONSm / BYEm
         / CANCELm / REGISTERm / PRACKm
         / extension-method

Please, please look this over and make sure I didn't screw up my ascii
tables. I'll buy a beer at the next IETF for anyone who can find an
error in the above.

> "SIP-version" should be "SIP-Version".

Fixed, thanks.

> These should be "alpha", not "ALPHA".

They are correct now as ALPHA because ALPHA is defined in 2234.

> credentials       =  ("Digest" digest-response) | (token gen-resp))

Already found that; note also that you missed the missing LWS between
token and gen-resp....

> This allows foo=bar=baz=bip, is that intended?

No, this BNF is wrong so far as I can tell. 

The bnf is now like this:

Authorization     =  "Authorization" HCOLON credentials
credentials       =  ("Digest" LWS digest-response)
                     / other-response 
digest-response   =  dig-resp *(COMMA dig-resp)
other-response    =  auth-scheme LWS auth-param 
                     *(COMMA auth-param)
auth-scheme       =  token 

and this mirrors the BNF for challenge.

> be "AuthenticationInfo", and the "__" should be "=".

Good catch on the token name; fixed. The __ was fixed already.

> There's an extra close-paren here.

I think Rohan pointed out this one already. Fixed.

> These need to be "1*8alpha".

ALPHA is OK now, per 2234.

> This leading > probably doesn't belong.

Fixed.

> I suspect "called" should be "callid".

Yup; already fixed that one.

> This "EQUALS" should be "EQUAL".

Good eye; fixed.

> This "abs_path" should be "abs-path".

Another good one. Fixed.

> This "route=param" should be "route-param".

Already found that one.

> This is missing a close paren (or has an extra close-paren).

It has an extra open paren. Already found that one.

> that's probably OK. 

Almost OK. Since rule names are case insensitive, and we have defined
Request-URI here specifically for SIP, thats a boo-boo. I changed it to
rquest-uri, and said this is equal to request-uri from HTTP/1.1.

> It was not immediately obvious what "parameter"

Yes, I believe so. Changed to m-parameter.

> TILDE: Defined but not used

I think its OK to keep these.

> SIP-message: Defined but not used

Right.

> TEXT-UTF8: Defined but not used

This is a good question. I don't know... maybe Henning or Brian has some
idea.

> separators: Defined but not used

Hmm; I think that is OK. Again, maybe Henning or Brian has some idea if
this is a real issue.

Thanks so much for your comments!!!

-Jonathan R.
-- 
Jonathan D. Rosenberg, Ph.D.            72 Eagle Rock Avenue
Chief Scientist                         First Floor
dynamicsoft                             East Hanover, NJ 07936
[email-masked]                 FAX: (973) 952-5050
http://www.jdrosen.net                  PH:  (973) 952-5000
http://www.dynamicsoft.com

---

From: Bill Fenner <[email-masked]>
Date: Sun, 3 Feb 2002 22:48:37 -0800

>Thanks for your comments and careful read.

Don't give me too much credit; it was less careful reading and more
running through the ABNF parser from www.ops.ietf.org .

>I will note that rule names are case insensitive according
>to rfc2234

Erk.  This means that the "server" and "Server" rules conflict, huh.

server         =  [ [ userinfo "@" ] hostport ]
Server           =  "Server" HCOLON 1*( product | comment )

I think this was already meantioned, but qvalue and response-num are
also multiply-defined:

qvalue           =  ( "0" [ "." 0*3DIGIT ] )
qvalue             =  ( "0" [ "." 0*3DIGIT ] )
response-num  =  1*DIGIT
response-num  =  1*DIGIT

>tables.

I used a handy perl script, "hextoascii", which verified that your
conversions look right.

  Bill

---

From: Jonathan Rosenberg <[email-masked]>
Date: Mon, 04 Feb 2002 03:33:28 -0500

> running through the ABNF parser from www.ops.ietf.org .

Well, thanks for taking the time to do it and post the responses. Geez,
you can't complement anyone these days....

> Server           =  "Server" HCOLON 1*( product | comment )

Changed the former to srvr.

> qvalue             =  ( "0" [ "." 0*3DIGIT ] )

This one I did fix before.

> response-num  =  1*DIGIT

This I hadn't noticed.

> I used a handy perl script, "hextoascii", which verified that your

If I spent more time writing code, and less time writing specs, I would
have done a similar kind of thing. I think its nearing time to swing the
pendulum back the other way...

-Jonathan R.