chiark / gitweb /
Merge branch 'master' of login.chiark.greenend.org.uk:public-git/inn-innduct
[inn-innduct.git] / include / nntp.h
1 /*  $Id: nntp.h 6070 2002-12-26 07:10:10Z rra $
2 **
3 **  Here be a set of NNTP response codes as defined in RFC977 and elsewhere.
4 **  The reponse codes are three digits, RFI, defined like this:
5 **      R, Response:
6 **              1xx     Informative message
7 **              2xx     Command ok
8 **              3xx     Command ok so far, send the rest of it.
9 **              4xx     Command was correct, but couldn't be performed for
10 **                      some reason.
11 **              5xx     Command unimplemented, or incorrect, or a serious
12 **                      program error occurred.
13 **      F, Function:
14 **              x0x     Connection, setup, and miscellaneous messages
15 **              x1x     Newsgroup selection
16 **              x2x     Article selection
17 **              x3x     Distribution functions
18 **              x4x     Posting
19 **              x8x     Nonstandard extensions (AUTHINFO, XGTITLE)
20 **              x9x     Debugging output
21 **      I, Information:
22 **              No defined semantics
23 */
24 #define NNTP_HELPOK_VAL                 100
25 #define NNTP_BAD_COMMAND_VAL            500
26 #define NNTP_BAD_COMMAND                "500 Syntax error or bad command"
27 #define NNTP_TEMPERR_VAL                503
28 #define NNTP_ACCESS                     "502 Permission denied"
29 #define NNTP_ACCESS_VAL                 502
30 #define NNTP_GOODBYE_ACK                "205 ."
31 #define NNTP_GOODBYE_ACK_VAL            205
32 #define NNTP_GOODBYE                    "400"
33 #define NNTP_GOODBYE_VAL                400
34 #define NNTP_HAVEIT                     "435 Duplicate"
35 #define NNTP_HAVEIT_BADID               "435 Bad Message-ID"
36 #define NNTP_HAVEIT_VAL                 435
37 #define NNTP_LIST_FOLLOWS               "215"
38 #define NNTP_LIST_FOLLOWS_VAL           215
39 #define NNTP_HELP_FOLLOWS               "100 Legal commands"
40 #define NNTP_HELP_FOLLOWS_VAL           100
41 #define NNTP_NOTHING_FOLLOWS_VAL        223
42 #define NNTP_ARTICLE_FOLLOWS            "220"
43 #define NNTP_ARTICLE_FOLLOWS_VAL        220
44 #define NNTP_NEWGROUPS_FOLLOWS_VAL      231
45 #define NNTP_HEAD_FOLLOWS               "221"
46 #define NNTP_HEAD_FOLLOWS_VAL           221
47 #define NNTP_BODY_FOLLOWS_VAL           222
48 #define NNTP_OVERVIEW_FOLLOWS_VAL       224
49 #define NNTP_DATE_FOLLOWS_VAL           111
50 #define NNTP_POSTOK                     "200"
51 #define NNTP_POSTOK_VAL                 200
52 #define NNTP_START_POST_VAL             340
53 #define NNTP_NOPOSTOK_VAL               201
54 #define NNTP_SLAVEOK_VAL                202
55 #define NNTP_REJECTIT_VAL               437
56 #define NNTP_REJECTIT_EMPTY             "437 Empty article"
57 #define NNTP_DONTHAVEIT                 "430"
58 #define NNTP_DONTHAVEIT_VAL             430
59 #define NNTP_RESENDIT_LATER             "436 Retry later"
60 #define NNTP_RESENDIT_VAL               436
61 #define NNTP_POSTEDOK                   "240 Article posted"
62 #define NNTP_POSTEDOK_VAL               240
63 #define NNTP_POSTFAIL_VAL               441
64 #define NNTP_GROUPOK_VAL                211
65 #define NNTP_SENDIT                     "335"
66 #define NNTP_SENDIT_VAL                 335
67 #define NNTP_SYNTAX_USE                 "501 Bad command use"
68 #define NNTP_SYNTAX_VAL                 501
69 #define NNTP_BAD_SUBCMD                 "501 Bad subcommand"
70 #define NNTP_TOOKIT                     "235"
71 #define NNTP_TOOKIT_VAL                 235
72 #define NNTP_NOTINGROUP                 "412 Not in a newsgroup"
73 #define NNTP_NOTINGROUP_VAL             412
74 #define NNTP_NOSUCHGROUP                "411 No such group"
75 #define NNTP_NOSUCHGROUP_VAL            411
76 #define NNTP_NEWNEWSOK                  "230 New news follows"
77 #define NNTP_NOARTINGRP                 "423 Bad article number"
78 #define NNTP_NOARTINGRP_VAL             423
79 #define NNTP_NOCURRART                  "420 No current article"
80 #define NNTP_NOCURRART_VAL              420
81 #define NNTP_NONEXT_VAL                 421
82 #define NNTP_NOPREV_VAL                 422
83 #define NNTP_CANTPOST                   "440 Posting not allowed"
84 #define NNTP_CANTPOST_VAL               440
85
86 /* new entries for the "streaming" protocol */
87 /* response to "mode stream" else 500 if stream not supported */
88 #define NNTP_OK_STREAM_VAL              203     /* Streaming supported */
89
90 /* response to "check <id>".  Must include ID of article.
91 ** Example: "431 <1234@host.domain>"
92 */
93 #define NNTP_OK_SENDID_VAL              238     /* I want article <id> */
94 #define NNTP_RESENDID_VAL               431     /* try <id> again later */
95 #define NNTP_ERR_GOTID_VAL              438     /* Got <id>, don't send */
96
97 /* responses to "takethis <id>.  Must include ID of article */
98 #define NNTP_OK_RECID_VAL               239     /* Article <id> received OK */
99 #define NNTP_ERR_FAILID_VAL             439     /* Transfer of <id> failed */
100
101 /* End of new entries for the "streaming" protocol */
102
103 /*
104 **  The first character of an NNTP reply can be used as a category class.
105 */
106 #define NNTP_CLASS_OK                   '2'
107 #define NNTP_CLASS_ERROR                '4'
108 #define NNTP_CLASS_FATAL                '5'
109
110
111 /*
112 **  Authentication commands from the RFC update (not official).
113 */
114 #define NNTP_AUTH_NEEDED                "480"
115 #define NNTP_AUTH_NEEDED_VAL            480
116 #define NNTP_AUTH_BAD                   "481"
117 #define NNTP_AUTH_NEXT                  "381"
118 #define NNTP_AUTH_NEXT_VAL              381
119 #define NNTP_AUTH_OK                    "281"
120 #define NNTP_AUTH_OK_VAL                281
121 #define NNTP_AUTH_REJECT_VAL            482
122
123 /*
124 **  Starttls commands (not official).
125 */
126 #define NNTP_STARTTLS_NEXT              "382"
127 #define NNTP_STARTTLS_NEXT_VAL  382
128 #define NNTP_STARTTLS_DONE              "483"
129 #define NNTP_STARTTLS_DONE_VAL  483
130 #define NNTP_STARTTLS_BAD               "580"
131 #define NNTP_STARTTLS_BAD_VAL   580
132
133 /*
134 **  XGTITLE, from ANU news.
135 */
136 #define NNTP_XGTITLE_BAD                481     /* Yes, 481. */
137 #define NNTP_XGTITLE_OK                 282
138
139 /*
140 **  MODE CANCEL extension.
141 */
142 #define NNTP_OK_CANCEL_VAL      284
143 #define NNTP_OK_CANCELLED       "289"
144 #define NNTP_ERR_CANCEL_VAL     484
145
146 /*
147 **  XBATCH feed extension.
148 */
149 #define NNTP_OK_XBATCHED_VAL    239     /* Batch transferred successfully */
150 #define NNTP_OK_XBATCHED        "239"
151 #define NNTP_CONT_XBATCH_VAL    339     /* Continue to send batch */
152 #define NNTP_CONT_XBATCH        "339"
153 /* and one more meaning for the 436 code NNTP_RESENDIT_VAL */
154 #define NNTP_RESENDIT_XBATCHERR "436 xbatch failed: "
155 /* and one more meaning for the 501 code NNTP_SYNTAX_USE */
156 #define NNTP_XBATCH_BADSIZE     "501 Invalid or missing size for xbatch"
157
158 #define NNTP_STRLEN                     512
159
160 /* Consensus on the USEFOR mailing list in June of 2000 indicates that the
161    next revision of the Usenet article standard will limit the length of the
162    message ID to 250 characters.  This is also the limit recommended by
163    son-of-1036.
164
165    You can increase this limit if you want, but don't increase it above 497.
166    RFC 977 limits each line of the NNTP protocol to 512 octets, including
167    the terminating CRLF.  For a message ID to be passed using the TAKETHIS
168    command, it can therefore be a maximum of 501 octets.  The November 1999
169    draft of the replacement RFC limits it to 497 octets.
170
171    Both Cyclone and DNews are known to reject message IDs longer than 500
172    octets as of June of 2000.  DNews has been reported to have problems with
173    message IDs of 494 octets. */
174
175 #define NNTP_MSGID_MAXLEN       250