ietf-nntp Formal syntax of NNTP commands

Paul Overell paulo at turnpike.com
Tue Sep 2 07:41:17 PDT 1997


I would like to offer this formal syntax of the NNTP commands for
inclusion in the next draft.

I have tried to represent as closely as possible the commands described
in draft-ietf-nntpext-base-01.txt.  The only liberty that I have taken
is to allow extraneous whitespace before a command's CRLF.  The text is
silent on this matter but current NNTP implementations seem to allow it. 

Draft 1, Paul Overell <paulo at turnpike.com>, Turnpike Ltd

-----------------------------------------------------------

NNTP command syntax specified in Augmented BNF for Syntax
Specifications: ABNF (draft-ieft-drums-abnt-03.txt)

This syntax defines the non-terminal "command".  The non-terminal
"parameter" is used for command parameters whose syntax is specified
elsewhere.  The syntax is in alphabetical order.  Note that ABNF strings
are case insensitive. 
  


article-command = "ARTICLE" [1*WSP (msg-id / article-number)] *WSP CRLF

article-number = 1*16DIGIT

augument = parameter ; excluding sequence ".."

authenticator = parameter ; excluding sequence ".."

authinfo-generic-command = "AUTHINFO" 1*WSP "GENERIC" 1*WSP   
                           authenticator *(1*WSP argument) *WSP CRLF

authinfo-pass-command = "AUTHINFO" 1*WSP "PASS" 1*WSP password *WSP CRLF

authinfo-user-command = "AUTHINFO" 1*WSP "USER" 1*WSP username *WSP CRLF

body-command = "BODY" [1*WSP (msg-id / article-number)] *WSP CRLF

charset = parameter

charset-command = "CHARSET" [1*WSP charset] *WSP CRLF

command = article-command /
          authinfo-generic-command /
          authinfo-pass-command /
          authinfo-user-command /
          body-command /
          charset-command /
          date-command /
          group-command /
          head-command /
          help-command /
          ihave-command /
          last-command /
          list-active-times-command /
          list-distrib-pats-command /
          list-distributions-command /
          list-extensions-command /
          list-newsgroups-command /
          list-overview-fmt-command /
          list-subscriptions-command /
          list-command /
          listgroup-command /
          mode-reader-command /
          newgroups-command /
          newnews-command /
          next-command /
          over-command /
          pat-command /
          post-command /
          quit-command /
          stat-command

CR = %x0D

CRLF = CR LF

date-command = "DATE" *WSP CRLF 

date = 6*8DIGIT

DIGIT = %x30-39

distribution = parameter

group-command = "GROUP" 1*WSP newsgroup *WSP CRLF

head-command = "HEAD" [1*WSP (msg-id / article-number)] *WSP CRLF

header = parameter

help-command = "HELP" *WSP CRLF

HT = %x09

ihave-command = "IHAVE" 1*WSP msg-id *WSP CRLF

last-command = "LAST" *WSP CRLF

LF = %x0A

list-active-times-command = "LIST" 1*WSP "ACTIVE.TIMES"
                            [1*WSP wildmat] *WSP CRLF

list-command = "LIST" [1*WSP "ACTIVE" [1*WSP wildmat]] *WSP CRLF

list-distrib-pats-command = "LIST" 1*WSP "DISTRIB.PATS" *WSP CRLF

list-distributions-command = "LIST" 1*WSP "DISTRIBUTIONS" *WSP CRLF

list-extensions-command = "LIST" 1*WSP "EXTENSIONS" *WSP CRLF

list-newsgroups-command = "LIST" 1*WSP "NEWSGROUPS" [1*WSP wildmat]
                          *WSP CRLF

list-overview-fmt-command = "LIST" 1*WSP "OVERVIEW.FMT" *WSP CRLF

list-subscriptions-command = "LIST" 1*WSP "SUBSCRIPTIONS" *WSP CRLF

listgroup-command = "LISTGROUP" [1*WSP newsgroup] *WSP CRLF

mode-reader-command = "MODE" 1*WSP "READER" *WSP CRLF

msg-id = <defined in RFC822>

newgroups-command = "NEWGROUPS" 1*WSP date 1*WSP time [1*WSP "GMT"]
                    [1*WSP "<" wildmat ">"] *WSP CRLF

newnews-command = "NEWNEWS" 1*WSP newsgroup *("," newsgroup)
                  1*WSP date 1*WSP time [1*WSP "GMT"]
                  [1*WSP "<" distribution *("," distribution) ">"]
                  *WSP CRLF

newsgroup = parameter

next-command = "NEXT" *WSP CRLF

over-command = "OVER" [1*WSP range] *WSP CRLF

parameter = 1*(%x21-FF) ; generic command parameter

password = parameter

pat-command = "PAT" 1*WSP header 1*WSP (range / msg-id)
              *(1*WSP wildmat) *WSP CRLF

post-command = "POST" *WSP CRLF

quit-command = "QUIT" *WSP CRLF

range = article-number ["-" [article-number]] 

SP = %x20

stat-command = "STAT" [1*WSP (msg-id / article-number)] *WSP CRLF

time = 6DIGIT

username = parameter

wildmat = 1*("*" / "?" / wildmat-exact / wildmat-set / "\" %x21-FF)

wildmat-exact = %x21-29 / %x2B-3E / %x40-5A / %x5D-FF
                ; exclude space * ? [ \

wildmat-non-hyphen = %x21-2C / %x2E-FF ; exclude space -

wildmat-set = "[" ["^"] ["]" / "-"]
              *(wildmat-non-hypen ["-" wildmat-non-hypen])
              ["-"] "]"

WSP = SP / HT

-- 
Paul Overell                                        T U R N P I K E  Ltd



More information about the ietf-nntp mailing list