Patch: remove nntp protocol constants from include/nntp.h in inn-CURRENT-20061121

Adam J. Richter adam at yggdrasil.com
Wed Nov 22 14:39:19 UTC 2006


Hi Russ,

	Currently, include/nntp.h and include/inn/nntp.h each define
a different set of symbol names for numeric NNTP response codes.  The
following switches everything to use the codes from include/inn/nntp.h,
replacing the definitions in include/nntp.h with a #include "inn/nntp.h".

	If I compile without "-O2 -g", I get exactly the same .o files
with and without this patch applied.  I have also verified that it builds
with "./configure --prefix=/usr && make all && make install".

	By the way, compiling with "-O2 generated different .o files
under "-g -O2", even after stripping them, in the case of about six of
the .o files in the tree.  From running diff on the generated
x86 assembler code in for backends/nntpget.c, it appears that gcc -O2
had moved some variable initializion that originally looked like this:


	  foo = 0;
	  bar = 0;
	  baz = 0;
	  if (func() == 0)
	     exit(1);

	...to...

	  if (func() == 0)
	     exit(1);
	  foo = 0;
	  bar = 0;
	  baz = 0;

	...presumably because it told that exit does not return.  It
made this optimization both before and after the patch was applied.
The difference was that the order of foo, bar and baz being cleared.
I have no idea why gcc-4.1.1 did this, especially since none of the
assignments in referred to the symbols that had been changed, so it's
hard for me even to point a finger at the change from #define
constants to enums to the nntp integer constants.

	Even if I make a separate include/inn/nntp_protocol.h file for
include/nntp.h to include so that it does not bring in the additional
#include lines files referred to in include/inn/nntp.h, I still get
these modified .o files when compiling with "-g -O2", while the files
match when compling no optimization or debugging flags (and then being
stripped before comparison, as usual).

	The change is entirely the output of a shell script, which I can
also post if there is interest, although it is much hairy script than
before that is messy in that it writes to a bunch of places in /tmp, and
in at least one point it has a hardwired line number to do one of its
edits.

	Anyhow, here is the patch.


Adam Richter

diff -u -r inn-CURRENT-20061121/backends/innxbatch.c inn-CURRENT/backends/innxbatch.c
--- inn-CURRENT-20061121/backends/innxbatch.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/backends/innxbatch.c	2006-11-22 21:51:25.000000000 +0800
@@ -246,14 +246,14 @@
     return false;
     /* NOTREACHED */
     break;
-  case NNTP_RESENDIT_VAL:
-  case NNTP_GOODBYE_VAL:
+  case NNTP_FAIL_XBATCH:
+  case NNTP_FAIL_TERMINATING:
     notice("%s xbatch failed %s", REMhost, buf);
     STATrejected++;
     return false;
     /* NOTREACHED */
     break;
-  case NNTP_OK_XBATCHED_VAL:
+  case NNTP_OK_XBATCH:
     STATaccepted++;
     if (Debug) fprintf(stderr, "will unlink(%s)\n", XBATCHname);
     if (unlink(XBATCHname)) {
@@ -517,19 +517,19 @@
       ExitWithStats(1);
       /* NOTREACHED */
       break;
-    case NNTP_RESENDIT_VAL:
-    case NNTP_GOODBYE_VAL:
+    case NNTP_FAIL_XBATCH:
+    case NNTP_FAIL_TERMINATING:
       /* Most likely out of space -- no point in continuing. */
       notice("%s xbatch failed %s", REMhost, buff);
       ExitWithStats(1);
       /* NOTREACHED */
-    case NNTP_CONT_XBATCH_VAL:
+    case NNTP_CONT_XBATCH:
       if (!REMsendxbatch(ToServer, XBATCHbuffer, XBATCHsize))
 	ExitWithStats(1);
       /* NOTREACHED */
       break;
-    case NNTP_SYNTAX_VAL:
-    case NNTP_BAD_COMMAND_VAL:
+    case NNTP_ERR_SYNTAX:
+    case NNTP_ERR_COMMAND:
       warn("%s xbatch failed %s", REMhost, buff);
       break;
     }
diff -u -r inn-CURRENT-20061121/backends/innxmit.c inn-CURRENT/backends/innxmit.c
--- inn-CURRENT-20061121/backends/innxmit.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/backends/innxmit.c	2006-11-22 21:51:25.000000000 +0800
@@ -631,22 +631,22 @@
 	if (DoRequeue)
 	    Requeue(Article, MessageID);
 	break;
-    case NNTP_BAD_COMMAND_VAL:
-    case NNTP_SYNTAX_VAL:
-    case NNTP_ACCESS_VAL:
+    case NNTP_ERR_COMMAND:
+    case NNTP_ERR_SYNTAX:
+    case NNTP_ERR_ACCESS:
 	/* The receiving server is likely confused...no point in continuing */
         syslog(L_FATAL, GOT_BADCOMMAND, REMhost, MessageID, REMclean(buff));
         RequeueRestAndExit(Article, MessageID);
         /* NOTREACHED */
-    case NNTP_RESENDIT_VAL:
-    case NNTP_GOODBYE_VAL:
+    case NNTP_FAIL_IHAVE_DEFER:
+    case NNTP_FAIL_TERMINATING:
 	Requeue(Article, MessageID);
 	break;
-    case NNTP_TOOKIT_VAL:
+    case NNTP_OK_IHAVE:
 	STATaccepted++;
 	STATacceptedsize += (double)art->len;
 	break;
-    case NNTP_REJECTIT_VAL:
+    case NNTP_FAIL_IHAVE_REJECT:
         if (logRejects)
             syslog(L_NOTICE, REJECTED, REMhost,
                    MessageID, Article, REMclean(buff));
@@ -802,11 +802,11 @@
 	/* Skip the 1XX informational messages */
 	if ((resp >= 100) && (resp < 200)) continue;
 	switch (resp) { /* first time is to verify it */
-	case NNTP_ERR_GOTID_VAL:
-	case NNTP_OK_SENDID_VAL:
-	case NNTP_OK_RECID_VAL:
-	case NNTP_ERR_FAILID_VAL:
-	case NNTP_RESENDID_VAL:
+	case NNTP_FAIL_CHECK_REFUSE:
+	case NNTP_OK_CHECK:
+	case NNTP_OK_TAKETHIS:
+	case NNTP_FAIL_TAKETHIS_REJECT:
+	case NNTP_FAIL_CHECK_DEFER:
 	    if ((id = strchr(buff, '<')) != NULL) {
 		p = strchr(id, '>');
 		if (p) *(p+1) = '\0';
@@ -821,7 +821,7 @@
 		return (true);
 	    }
 	    break;
-	case NNTP_GOODBYE_VAL:
+	case NNTP_FAIL_TERMINATING:
 	    /* Most likely out of space -- no point in continuing. */
 	    syslog(L_NOTICE, IHAVE_FAIL, REMhost, REMclean(buff));
 	    return true;
@@ -834,7 +834,7 @@
 	    return (true);
 	}
 	switch (resp) { /* now we take some action */
-	case NNTP_RESENDID_VAL:	/* remote wants it later */
+	case NNTP_FAIL_CHECK_DEFER:	/* remote wants it later */
 	    /* try again now because time has passed */
 	    if (stbuf[i].st_retry < STNRETRY) {
 		if (check(i)) return true;
@@ -845,24 +845,24 @@
 		strel(i); /* release entry */
 	    }
 	    break;
-	case NNTP_ERR_GOTID_VAL:	/* remote doesn't want it */
+	case NNTP_FAIL_CHECK_REFUSE:	/* remote doesn't want it */
 	    strel(i); /* release entry */
 	    STATrefused++;
 	    stnofail = 0;
 	    break;
 		
-	case NNTP_OK_SENDID_VAL:	/* remote wants article */
+	case NNTP_OK_CHECK:	/* remote wants article */
 	    if (takethis(i)) return true;
 	    stnofail++;
 	    break;
 
-	case NNTP_OK_RECID_VAL:	/* remote received it OK */
+	case NNTP_OK_TAKETHIS:	/* remote received it OK */
 	    STATacceptedsize += (double) stbuf[i].st_size;
 	    strel(i); /* release entry */
 	    STATaccepted++;
 	    break;
 		
-	case NNTP_ERR_FAILID_VAL:
+	case NNTP_FAIL_TAKETHIS_REJECT:
 	    STATrejectedsize += (double) stbuf[i].st_size;
 	    if (logRejects)
 		syslog(L_NOTICE, REJ_STREAM, REMhost,
@@ -1168,11 +1168,11 @@
                     warn("unknown reply to %s -- %s", modestream, buff);
 		    CanStream = false;
 		    break;
-		case NNTP_OK_STREAM_VAL:	/* YES! */
+		case NNTP_OK_STREAM:	/* YES! */
 		    CanStream = true;
 		    break;
-                case NNTP_AUTH_NEEDED_VAL: /* authentication refusal */
-		case NNTP_BAD_COMMAND_VAL: /* normal refusal */
+                case NNTP_FAIL_AUTH_NEEDED: /* authentication refusal */
+		case NNTP_ERR_COMMAND: /* normal refusal */
 		    CanStream = false;
 		    break;
 		}
@@ -1201,7 +1201,7 @@
 		switch (atoi(buff)) {
 		case 250:		/* YES! */
 		    break;
-		case NNTP_BAD_COMMAND_VAL: /* normal refusal */
+		case NNTP_ERR_COMMAND: /* normal refusal */
                     die("%s not allowed -- %s", modeheadfeed, buff);
 		default:
                     die("unknown reply to %s -- %s", modeheadfeed, buff);
@@ -1408,25 +1408,25 @@
 	    if (DoRequeue)
 		Requeue(Article, MessageID);
 	    break;
-        case NNTP_BAD_COMMAND_VAL:
-        case NNTP_SYNTAX_VAL:
-        case NNTP_ACCESS_VAL:
+        case NNTP_ERR_COMMAND:
+        case NNTP_ERR_SYNTAX:
+        case NNTP_ERR_ACCESS:
             /* The receiving server is likely confused...no point in continuing */
             syslog(L_FATAL, GOT_BADCOMMAND, REMhost, MessageID, REMclean(buff));
 	    RequeueRestAndExit(Article, MessageID);
 	    /* NOTREACHED */
-        case NNTP_AUTH_NEEDED_VAL:
-	case NNTP_RESENDIT_VAL:
-	case NNTP_GOODBYE_VAL:
+        case NNTP_FAIL_AUTH_NEEDED:
+	case NNTP_FAIL_IHAVE_DEFER:
+	case NNTP_FAIL_TERMINATING:
 	    /* Most likely out of space -- no point in continuing. */
 	    syslog(L_NOTICE, IHAVE_FAIL, REMhost, REMclean(buff));
 	    RequeueRestAndExit(Article, MessageID);
 	    /* NOTREACHED */
-	case NNTP_SENDIT_VAL:
+	case NNTP_CONT_IHAVE:
 	    if (!REMsendarticle(Article, MessageID, art))
 		RequeueRestAndExit(Article, MessageID);
 	    break;
-	case NNTP_HAVEIT_VAL:
+	case NNTP_FAIL_IHAVE_REFUSE:
 	    STATrefused++;
 	    break;
 #if	defined(NNTP_SENDIT_LATER)
diff -u -r inn-CURRENT-20061121/backends/nntpget.c inn-CURRENT/backends/nntpget.c
--- inn-CURRENT-20061121/backends/nntpget.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/backends/nntpget.c	2006-11-22 21:51:24.000000000 +0800
@@ -365,7 +365,7 @@
                 syswarn("cannot offer %s", mesgid);
 		break;
 	    }
-	    if (atoi(buff) != NNTP_SENDIT_VAL)
+	    if (atoi(buff) != NNTP_CONT_IHAVE)
 		continue;
 	}
 
@@ -377,7 +377,7 @@
 	    printf("%s\n", mesgid);
 	    break;
 	}
-	if (atoi(buff) != NNTP_ARTICLE_FOLLOWS_VAL) {
+	if (atoi(buff) != NNTP_OK_ARTICLE) {
           if (Offer) {
               SITEwrite(Local, ".", 1);
               if (!SITEread(Local, buff)) {
@@ -424,9 +424,9 @@
 		break;
 	    }
 	    i = atoi(buff);
-	    if (i == NNTP_TOOKIT_VAL)
+	    if (i == NNTP_OK_IHAVE)
 		continue;
-	    if (i == NNTP_RESENDIT_VAL) {
+	    if (i == NNTP_FAIL_IHAVE_DEFER) {
 		printf("%s\n", mesgid);
 		break;
 	    }
diff -u -r inn-CURRENT-20061121/frontends/feedone.c inn-CURRENT/frontends/feedone.c
--- inn-CURRENT-20061121/frontends/feedone.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/frontends/feedone.c	2006-11-22 21:51:24.000000000 +0800
@@ -151,11 +151,11 @@
     /* Does the server want this article? */
     if (PostMode) {
 	fprintf(ToServer, "post\r\n");
-	i = NNTP_START_POST_VAL;
+	i = NNTP_CONT_POST;
     }
     else {
 	fprintf(ToServer, "ihave %s\r\n", mesgid);
-	i = NNTP_SENDIT_VAL;
+	i = NNTP_CONT_IHAVE;
     }
     SafeFlush(ToServer);
     GetFromServer(buff, sizeof buff, "cannot offer article to server");
@@ -184,7 +184,7 @@
     /* How did the server respond? */
     GetFromServer(buff, sizeof buff,
 	"no reply from server after sending the article");
-    i = PostMode ? NNTP_POSTEDOK_VAL : NNTP_TOOKIT_VAL;
+    i = PostMode ? NNTP_OK_POST : NNTP_OK_IHAVE;
     if (atoi(buff) != i)
         sysdie("cannot send article to the server: %s", buff);
 
diff -u -r inn-CURRENT-20061121/frontends/inews.c inn-CURRENT/frontends/inews.c
--- inn-CURRENT-20061121/frontends/inews.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/frontends/inews.c	2006-11-22 21:51:25.000000000 +0800
@@ -134,7 +134,7 @@
 	*p = '\0';
     if ((p = strchr(buff, '\n')) != NULL)
 	*p = '\0';
-    if (atoi(buff) != NNTP_GOODBYE_ACK_VAL)
+    if (atoi(buff) != NNTP_OK_QUIT)
         die("server did not reply to quit properly: %s", buff);
     fclose(FromServer);
     fclose(ToServer);
@@ -295,7 +295,7 @@
     fprintf(ToServer, "head %s\r\n", msgid);
     SafeFlush(ToServer);
     if (fgets(buff, sizeof buff, FromServer) == NULL
-     || atoi(buff) != NNTP_HEAD_FOLLOWS_VAL) {
+     || atoi(buff) != NNTP_OK_HEAD) {
 	if (JustReturn)
 	    return;
         die("server has no such article");
@@ -984,10 +984,10 @@
 	SafeFlush(ToServer);
 	if (fgets(buff, HEADER_STRLEN, FromServer) == NULL)
             sysdie("cannot tell server we're reading");
-	if ((j = atoi(buff)) != NNTP_BAD_COMMAND_VAL)
+	if ((j = atoi(buff)) != NNTP_ERR_COMMAND)
 	    i = j;
 
-	if (i != NNTP_POSTOK_VAL)
+	if (i != NNTP_OK_BANNER_POST)
             die("you do not have permission to post");
 	deadfile = NULL;
     }
@@ -1050,13 +1050,13 @@
 
     /* Article is prepared, offer it to the server. */
     i = OfferArticle(buff, false);
-    if (i == NNTP_AUTH_NEEDED_VAL) {
+    if (i == NNTP_FAIL_AUTH_NEEDED) {
 	/* Posting not allowed, try to authorize. */
 	if (NNTPsendpassword((char *)NULL, FromServer, ToServer) < 0)
             sysdie("authorization error");
 	i = OfferArticle(buff, true);
     }
-    if (i != NNTP_START_POST_VAL)
+    if (i != NNTP_CONT_POST)
         die("server doesn't want the article: %s", buff);
 
     /* Write the headers, a blank line, then the article. */
@@ -1076,7 +1076,7 @@
 	*p = '\0';
     if ((p = strchr(buff, '\n')) != NULL)
 	*p = '\0';
-    if (atoi(buff) != NNTP_POSTEDOK_VAL)
+    if (atoi(buff) != NNTP_OK_POST)
         die("cannot send article to server: %s", buff);
 
     /* Close up. */
diff -u -r inn-CURRENT-20061121/frontends/rnews.c inn-CURRENT/frontends/rnews.c
--- inn-CURRENT-20061121/frontends/rnews.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/frontends/rnews.c	2006-11-22 21:51:25.000000000 +0800
@@ -281,12 +281,12 @@
         free(wirefmt);
         notice("unknown_reply after ihave %s", buff);
 	return false;
-    case NNTP_RESENDIT_VAL:
+    case NNTP_FAIL_IHAVE_DEFER:
         free(wirefmt);
 	return false;
-    case NNTP_SENDIT_VAL:
+    case NNTP_CONT_IHAVE:
 	break;
-    case NNTP_HAVEIT_VAL:
+    case NNTP_FAIL_IHAVE_REFUSE:
 #if	defined(SYSLOG_RNEWS_LOG_DUPS)
 	*p = '\0';
         notice("duplicate %s %s", id, path);
@@ -333,11 +333,11 @@
     default:
         notice("unknown_reply after article %s", buff);
 	/* FALLTHROUGH */
-    case NNTP_RESENDIT_VAL:
+    case NNTP_FAIL_IHAVE_DEFER:
 	return false;
-    case NNTP_TOOKIT_VAL:
+    case NNTP_OK_IHAVE:
 	break;
-    case NNTP_REJECTIT_VAL:
+    case NNTP_FAIL_IHAVE_REJECT:
 	Reject(article, artlen, "rejected %s", buff);
 	break;
     }
diff -u -r inn-CURRENT-20061121/include/nntp.h inn-CURRENT/include/nntp.h
--- inn-CURRENT-20061121/include/nntp.h	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/include/nntp.h	2006-11-22 21:51:22.000000000 +0800
@@ -21,82 +21,43 @@
 **	I, Information:
 **		No defined semantics
 */
-#define NNTP_HELPOK_VAL			100
-#define NNTP_BAD_COMMAND_VAL		500
+
+#include "inn/nntp.h"
+
 #define NNTP_BAD_COMMAND		"500 Syntax error or bad command"
-#define NNTP_TEMPERR_VAL		503
 #define NNTP_ACCESS			"502 Permission denied"
-#define NNTP_ACCESS_VAL			502
 #define NNTP_GOODBYE_ACK		"205 ."
-#define NNTP_GOODBYE_ACK_VAL		205
 #define NNTP_GOODBYE			"400"
-#define NNTP_GOODBYE_VAL		400
 #define NNTP_HAVEIT			"435 Duplicate"
 #define NNTP_HAVEIT_BADID		"435 Bad Message-ID"
-#define NNTP_HAVEIT_VAL			435
 #define NNTP_LIST_FOLLOWS		"215"
-#define NNTP_LIST_FOLLOWS_VAL		215
 #define NNTP_HELP_FOLLOWS		"100 Legal commands"
-#define NNTP_HELP_FOLLOWS_VAL		100
-#define NNTP_NOTHING_FOLLOWS_VAL	223
 #define NNTP_ARTICLE_FOLLOWS		"220"
-#define NNTP_ARTICLE_FOLLOWS_VAL	220
-#define NNTP_NEWGROUPS_FOLLOWS_VAL	231
 #define NNTP_HEAD_FOLLOWS		"221"
-#define NNTP_HEAD_FOLLOWS_VAL		221
-#define NNTP_BODY_FOLLOWS_VAL		222
-#define NNTP_OVERVIEW_FOLLOWS_VAL	224
-#define NNTP_DATE_FOLLOWS_VAL		111
 #define NNTP_POSTOK			"200"
-#define NNTP_POSTOK_VAL			200
-#define NNTP_START_POST_VAL		340
-#define NNTP_NOPOSTOK_VAL		201
-#define NNTP_SLAVEOK_VAL		202
-#define NNTP_REJECTIT_VAL		437
 #define NNTP_REJECTIT_EMPTY		"437 Empty article"
 #define NNTP_DONTHAVEIT			"430"
-#define NNTP_DONTHAVEIT_VAL		430
 #define NNTP_RESENDIT_LATER             "436 Retry later"
-#define NNTP_RESENDIT_VAL		436
 #define NNTP_POSTEDOK			"240 Article posted"
-#define NNTP_POSTEDOK_VAL		240
-#define NNTP_POSTFAIL_VAL		441
-#define NNTP_GROUPOK_VAL		211
 #define NNTP_SENDIT			"335"
-#define NNTP_SENDIT_VAL			335
 #define NNTP_SYNTAX_USE			"501 Bad command use"
-#define NNTP_SYNTAX_VAL			501
 #define NNTP_BAD_SUBCMD			"501 Bad subcommand"
 #define NNTP_TOOKIT			"235"
-#define NNTP_TOOKIT_VAL			235
 #define NNTP_NOTINGROUP			"412 Not in a newsgroup"
-#define NNTP_NOTINGROUP_VAL		412
 #define NNTP_NOSUCHGROUP		"411 No such group"
-#define NNTP_NOSUCHGROUP_VAL		411
 #define NNTP_NEWNEWSOK			"230 New news follows"
 #define NNTP_NOARTINGRP			"423 Bad article number"
-#define NNTP_NOARTINGRP_VAL		423
 #define NNTP_NOCURRART			"420 No current article"
-#define NNTP_NOCURRART_VAL		420
-#define NNTP_NONEXT_VAL			421
-#define NNTP_NOPREV_VAL			422
 #define NNTP_CANTPOST			"440 Posting not allowed"
-#define NNTP_CANTPOST_VAL		440
 
 /* new entries for the "streaming" protocol */
 /* response to "mode stream" else 500 if stream not supported */
-#define NNTP_OK_STREAM_VAL		203	/* Streaming supported */
 
 /* response to "check <id>".  Must include ID of article.
 ** Example: "431 <1234 at host.domain>"
 */
-#define NNTP_OK_SENDID_VAL		238	/* I want article <id> */
-#define NNTP_RESENDID_VAL		431	/* try <id> again later */
-#define NNTP_ERR_GOTID_VAL		438	/* Got <id>, don't send */
 
 /* responses to "takethis <id>.  Must include ID of article */
-#define NNTP_OK_RECID_VAL		239	/* Article <id> received OK */
-#define NNTP_ERR_FAILID_VAL		439	/* Transfer of <id> failed */
 
 /* End of new entries for the "streaming" protocol */
 
@@ -112,50 +73,34 @@
 **  Authentication commands from the RFC update (not official).
 */
 #define NNTP_AUTH_NEEDED		"480"
-#define NNTP_AUTH_NEEDED_VAL		480
 #define NNTP_AUTH_BAD			"481"
-#define NNTP_AUTH_BAD_VAL		481
 #define NNTP_AUTH_NEXT			"381"
-#define NNTP_AUTH_NEXT_VAL		381
 #define NNTP_AUTH_SASL_CHAL		"383"
-#define NNTP_AUTH_SASL_CHAL_VAL		383
 #define NNTP_AUTH_OK			"281"
-#define NNTP_AUTH_OK_VAL		281
 #define NNTP_AUTH_SASL_OK		"283"
-#define NNTP_AUTH_SASL_OK_VAL		283
-#define NNTP_AUTH_REJECT_VAL		482
 
 /*
 **  Starttls commands (not official).
 */
 #define NNTP_STARTTLS_NEXT		"382"
-#define NNTP_STARTTLS_NEXT_VAL	382
 #define NNTP_STARTTLS_DONE		"483"
-#define NNTP_STARTTLS_DONE_VAL	483
 #define NNTP_STARTTLS_BAD		"580"
-#define NNTP_STARTTLS_BAD_VAL	580
 
 /*
 **  XGTITLE, from ANU news.
 */
-#define NNTP_XGTITLE_BAD		481	/* Yes, 481. */
-#define NNTP_XGTITLE_OK			282
 
 /*
 **  MODE CANCEL extension.
 */
-#define NNTP_OK_CANCEL_VAL      284
 #define NNTP_OK_CANCELLED       "289"
-#define NNTP_ERR_CANCEL_VAL     484
 
 /*
 **  XBATCH feed extension.
 */
-#define NNTP_OK_XBATCHED_VAL	239	/* Batch transferred successfully */
 #define NNTP_OK_XBATCHED	"239"
-#define NNTP_CONT_XBATCH_VAL	339	/* Continue to send batch */
-#define NNTP_CONT_XBATCH	"339"
-/* and one more meaning for the 436 code NNTP_RESENDIT_VAL */
+#define NNTP_CONT_XBATCH_STR	"339"
+/* and one more meaning for the 436 code NNTP_FAIL_IHAVE_DEFER */
 #define NNTP_RESENDIT_XBATCHERR	"436 xbatch failed: "
 /* and one more meaning for the 501 code NNTP_SYNTAX_USE */
 #define NNTP_XBATCH_BADSIZE	"501 Invalid or missing size for xbatch"
diff -u -r inn-CURRENT-20061121/innd/art.c inn-CURRENT/innd/art.c
--- inn-CURRENT-20061121/innd/art.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/innd/art.c	2006-11-22 21:51:25.000000000 +0800
@@ -636,7 +636,7 @@
       *p = '\0';
     snprintf(cp->Error, sizeof(cp->Error),
              "%d No colon-space in \"%s\" header",
-             NNTP_REJECTIT_VAL, MaxLength(header, header));
+             NNTP_FAIL_IHAVE_REJECT, MaxLength(header, header));
     if (p != NULL)
       *p = '\r';
     return;
@@ -662,7 +662,7 @@
 	*p = '\0';
 	snprintf(cp->Error, sizeof(cp->Error),
                  "%d Space before colon in \"%s\" header",
-                 NNTP_REJECTIT_VAL, MaxLength(header, header));
+                 NNTP_FAIL_IHAVE_REJECT, MaxLength(header, header));
 	*p = c;
 	return;
       }
@@ -798,7 +798,7 @@
 {
     va_list args;
 
-    snprintf(cp->Error, sizeof(cp->Error), "%d ", NNTP_REJECTIT_VAL);
+    snprintf(cp->Error, sizeof(cp->Error), "%d ", NNTP_FAIL_IHAVE_REJECT);
     va_start(args, format);
     vsnprintf(cp->Error + 4, sizeof(cp->Error) - 4, format, args);
     va_end(args);
@@ -1010,10 +1010,10 @@
       if (HDR_FOUND(i))
         continue;
       if (hc[i].Length < 0) {
-        sprintf(buff, "%d Duplicate \"%s\" header", NNTP_REJECTIT_VAL,
+        sprintf(buff, "%d Duplicate \"%s\" header", NNTP_FAIL_IHAVE_REJECT,
                 hp[1].Name);
       } else {
-	sprintf(buff, "%d Missing \"%s\" header", NNTP_REJECTIT_VAL,
+	sprintf(buff, "%d Missing \"%s\" header", NNTP_FAIL_IHAVE_REJECT,
                 hp[i].Name);
       }
       TMRstop(TMR_ARTCLEAN);
@@ -1024,7 +1024,7 @@
   /* assumes Message-ID header is required header */
   if (!ARTidok(HDR(HDR__MESSAGE_ID))) {
     HDR_LEN(HDR__MESSAGE_ID) = 0;
-    sprintf(buff, "%d Bad \"Message-ID\" header", NNTP_REJECTIT_VAL);
+    sprintf(buff, "%d Bad \"Message-ID\" header", NNTP_FAIL_IHAVE_REJECT);
     TMRstop(TMR_ARTCLEAN);
     return false;
   }
@@ -1033,7 +1033,7 @@
     p = HDR(HDR__LINES);
     i = data->Lines;
     if ((delta = i - atoi(p)) != 0 && abs(delta) > innconf->linecountfuzz) {
-      sprintf(buff, "%d Linecount %s != %d +- %ld", NNTP_REJECTIT_VAL,
+      sprintf(buff, "%d Linecount %s != %d +- %ld", NNTP_FAIL_IHAVE_REJECT,
 	MaxLength(p, p), i, innconf->linecountfuzz);
       TMRstop(TMR_ARTCLEAN);
       return false;
@@ -1045,7 +1045,7 @@
   p = HDR(HDR__DATE);
   data->Posted = parsedate_rfc2822_lax(p);
   if (data->Posted == (time_t) -1) {
-    sprintf(buff, "%d Bad \"Date\" header -- \"%s\"", NNTP_REJECTIT_VAL,
+    sprintf(buff, "%d Bad \"Date\" header -- \"%s\"", NNTP_FAIL_IHAVE_REJECT,
       MaxLength(p, p));
     TMRstop(TMR_ARTCLEAN);
     return false;
@@ -1054,7 +1054,7 @@
       long cutoff = innconf->artcutoff * 24 * 60 * 60;
 
       if (data->Posted < Now.tv_sec - cutoff) {
-          sprintf(buff, "%d Too old -- \"%s\"", NNTP_REJECTIT_VAL,
+          sprintf(buff, "%d Too old -- \"%s\"", NNTP_FAIL_IHAVE_REJECT,
                   MaxLength(p, p));
           TMRstop(TMR_ARTCLEAN);
           return false;
@@ -1062,7 +1062,7 @@
   }
   if (data->Posted > Now.tv_sec + DATE_FUZZ) {
     sprintf(buff, "%d Article posted in the future -- \"%s\"",
-      NNTP_REJECTIT_VAL, MaxLength(p, p));
+      NNTP_FAIL_IHAVE_REJECT, MaxLength(p, p));
     TMRstop(TMR_ARTCLEAN);
     return false;
   }
@@ -1080,7 +1080,7 @@
     &data->Newsgroups)) == 0) {
     TMRstop(TMR_ARTCLEAN);
     sprintf(buff, "%d Unwanted character in \"Newsgroups\" header",
-      NNTP_REJECTIT_VAL);
+      NNTP_FAIL_IHAVE_REJECT);
     return false;
   }
 
@@ -1820,7 +1820,7 @@
   hopcount = ARTparsepath(HDR(HDR__PATH), HDR_LEN(HDR__PATH), &data->Path);
   if (hopcount == 0) {
     snprintf(cp->Error, sizeof(cp->Error), "%d illegal path element",
-            NNTP_REJECTIT_VAL);
+            NNTP_FAIL_IHAVE_REJECT);
     ARTreject(REJECT_OTHER, cp, article);
     return false;
   }
@@ -1840,7 +1840,7 @@
   hash = HashMessageID(HDR(HDR__MESSAGE_ID));
   data->Hash = &hash;
   if (HIScheck(History, HDR(HDR__MESSAGE_ID))) {
-    snprintf(cp->Error, sizeof(cp->Error), "%d Duplicate", NNTP_REJECTIT_VAL);
+    snprintf(cp->Error, sizeof(cp->Error), "%d Duplicate", NNTP_FAIL_IHAVE_REJECT);
     ARTlog(data, ART_REJECT, cp->Error);
     ARTreject(REJECT_DUPLICATE, cp, article);
     return false;
@@ -1869,7 +1869,7 @@
   for(j = 0 ; ME.Exclusions && ME.Exclusions[j] ; j++) {
     if (ListHas((const char **)hops, (const char *)ME.Exclusions[j])) {
       snprintf(cp->Error, sizeof(cp->Error), "%d Unwanted site %s in path",
-	NNTP_REJECTIT_VAL, MaxLength(ME.Exclusions[j], ME.Exclusions[j]));
+	NNTP_FAIL_IHAVE_REJECT, MaxLength(ME.Exclusions[j], ME.Exclusions[j]));
       ARTlog(data, ART_REJECT, cp->Error);
       if (innconf->remembertrash && (Mode == OMrunning) &&
 	  !InndHisRemember(HDR(HDR__MESSAGE_ID)))
@@ -1893,7 +1893,7 @@
     if (innconf->dontrejectfiltered) {
       Filtered = true;
     } else {
-      snprintf(cp->Error, sizeof(cp->Error), "%d %.200s", NNTP_REJECTIT_VAL,
+      snprintf(cp->Error, sizeof(cp->Error), "%d %.200s", NNTP_FAIL_IHAVE_REJECT,
                filterrc);
       syslog(L_NOTICE, "rejecting[python] %s %s", HDR(HDR__MESSAGE_ID),
              cp->Error);
@@ -1919,7 +1919,7 @@
     if (innconf->dontrejectfiltered) {
       Filtered = true;
     } else {
-      snprintf(cp->Error, sizeof(cp->Error), "%d %.200s", NNTP_REJECTIT_VAL,
+      snprintf(cp->Error, sizeof(cp->Error), "%d %.200s", NNTP_FAIL_IHAVE_REJECT,
                filterrc);
       syslog(L_NOTICE, "rejecting[perl] %s %s", HDR(HDR__MESSAGE_ID),
              cp->Error);
@@ -1938,7 +1938,7 @@
   if (HDR_FOUND(HDR__DISTRIBUTION)) {
     if (HDR(HDR__DISTRIBUTION)[0] == ',') {
       snprintf(cp->Error, sizeof(cp->Error), "%d bogus distribution \"%s\"",
-               NNTP_REJECTIT_VAL,
+               NNTP_FAIL_IHAVE_REJECT,
                MaxLength(HDR(HDR__DISTRIBUTION), HDR(HDR__DISTRIBUTION)));
       ARTlog(data, ART_REJECT, cp->Error);
       if (innconf->remembertrash && Mode == OMrunning &&
@@ -1953,7 +1953,7 @@
       if (ME.Distributions &&
 	!DISTwantany(ME.Distributions, data->Distribution.List)) {
 	snprintf(cp->Error, sizeof(cp->Error),
-                 "%d Unwanted distribution \"%s\"", NNTP_REJECTIT_VAL,
+                 "%d Unwanted distribution \"%s\"", NNTP_FAIL_IHAVE_REJECT,
                  MaxLength(data->Distribution.List[0],
                            data->Distribution.List[0]));
 	ARTlog(data, ART_REJECT, cp->Error);
@@ -2081,7 +2081,7 @@
     /* Basic validity check. */
     if (ngp->Rest[0] == NF_FLAG_MODERATED && !Approved) {
       snprintf(cp->Error, sizeof(cp->Error), "%d Unapproved for \"%s\"",
-               NNTP_REJECTIT_VAL, MaxLength(ngp->Name, ngp->Name));
+               NNTP_FAIL_IHAVE_REJECT, MaxLength(ngp->Name, ngp->Name));
       ARTlog(data, ART_REJECT, cp->Error);
       if (innconf->remembertrash && (Mode == OMrunning) &&
 	  !InndHisRemember(HDR(HDR__MESSAGE_ID)))
@@ -2107,7 +2107,7 @@
       continue;
     } else if (canpost < 0) {
       snprintf(cp->Error, sizeof(cp->Error),
-               "%d Won't accept posts in \"%s\"", NNTP_REJECTIT_VAL,
+               "%d Won't accept posts in \"%s\"", NNTP_FAIL_IHAVE_REJECT,
                MaxLength(p, p));
       ARTlog(data, ART_REJECT, cp->Error);
       ARTreject(REJECT_GROUP, cp, article);
@@ -2170,11 +2170,11 @@
     if (!Accepted) {
       if (NoHistoryUpdate) {
 	snprintf(cp->Error, sizeof(cp->Error), "%d Can't post to \"%s\"",
-                NNTP_REJECTIT_VAL, MaxLength(data->Newsgroups.List[0],
+                NNTP_FAIL_IHAVE_REJECT, MaxLength(data->Newsgroups.List[0],
                                              data->Newsgroups.List[0]));
       } else {
         snprintf(cp->Error, sizeof(cp->Error),
-                 "%d Unwanted newsgroup \"%s\"", NNTP_REJECTIT_VAL,
+                 "%d Unwanted newsgroup \"%s\"", NNTP_FAIL_IHAVE_REJECT,
                  MaxLength(data->Newsgroups.List[0],
                            data->Newsgroups.List[0]));
       }
@@ -2222,12 +2222,12 @@
       if (HDR_FOUND(HDR__XREF)) {
 	snprintf(cp->Error, sizeof(cp->Error),
                  "%d Xref header \"%s\" invalid in xrefslave mode",
-                 NNTP_REJECTIT_VAL,
+                 NNTP_FAIL_IHAVE_REJECT,
                  MaxLength(HDR(HDR__XREF), HDR(HDR__XREF)));
       } else {
 	snprintf(cp->Error, sizeof(cp->Error),
                  "%d Xref header required in xrefslave mode",
-                 NNTP_REJECTIT_VAL);
+                 NNTP_FAIL_IHAVE_REJECT);
       }
       ARTlog(data, ART_REJECT, cp->Error);
       ARTreject(REJECT_OTHER, cp, article);
@@ -2255,7 +2255,7 @@
   if (token.type == TOKEN_EMPTY) {
     syslog(L_ERROR, "%s cant store article: %s", LogName, SMerrorstr);
     snprintf(cp->Error, sizeof(cp->Error), "%d cant store article",
-             NNTP_RESENDIT_VAL);
+             NNTP_FAIL_IHAVE_DEFER);
     ARTlog(data, ART_REJECT, cp->Error);
     if ((Mode == OMrunning) && !InndHisRemember(HDR(HDR__MESSAGE_ID)))
       syslog(L_ERROR, "%s cant write history %s %m", LogName,
@@ -2297,7 +2297,7 @@
     syslog(L_ERROR, "%s cant write history %s %m", LogName,
       HDR(HDR__MESSAGE_ID));
     snprintf(cp->Error, sizeof(cp->Error), "%d cant write history, %s",
-             NNTP_RESENDIT_VAL, strerror(errno));
+             NNTP_FAIL_IHAVE_DEFER, strerror(errno));
     ARTlog(data, ART_REJECT, cp->Error);
     ARTreject(REJECT_OTHER, cp, article);
     return false;
@@ -2311,15 +2311,15 @@
     if (data->CRwithoutLF > 0 && data->LFwithoutCR == 0)
       snprintf(cp->Error, sizeof(cp->Error),
                "%d article includes CR without LF(%d)",
-               NNTP_REJECTIT_VAL, data->CRwithoutLF);
+               NNTP_FAIL_IHAVE_REJECT, data->CRwithoutLF);
     else if (data->CRwithoutLF == 0 && data->LFwithoutCR > 0)
       snprintf(cp->Error, sizeof(cp->Error),
                "%d article includes LF without CR(%d)",
-               NNTP_REJECTIT_VAL, data->LFwithoutCR);
+               NNTP_FAIL_IHAVE_REJECT, data->LFwithoutCR);
     else
       snprintf(cp->Error, sizeof(cp->Error),
                "%d article includes CR without LF(%d) and LF withtout CR(%d)",
-               NNTP_REJECTIT_VAL, data->CRwithoutLF, data->LFwithoutCR);
+               NNTP_FAIL_IHAVE_REJECT, data->CRwithoutLF, data->LFwithoutCR);
     ARTlog(data, ART_STRSTR, cp->Error);
   }
   ARTlog(data, Accepted ? ART_ACCEPT : ART_JUNK, (char *)NULL);
diff -u -r inn-CURRENT-20061121/innd/nc.c inn-CURRENT/innd/nc.c
--- inn-CURRENT-20061121/innd/nc.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/innd/nc.c	2006-11-22 21:51:25.000000000 +0800
@@ -199,7 +199,7 @@
     cp->Received++;
     if (cp->Sendid.size > 3) { /* We be streaming */
       cp->Takethis_Ok++;
-      snprintf(buff, sizeof(buff), "%d", NNTP_OK_RECID_VAL);
+      snprintf(buff, sizeof(buff), "%d", NNTP_OK_TAKETHIS);
       cp->Sendid.data[0] = buff[0];
       cp->Sendid.data[1] = buff[1];
       cp->Sendid.data[2] = buff[2];
@@ -339,9 +339,9 @@
     SMfreearticle(art);
 
     /* Write the message. */
-    length = snprintf(NULL, 0, "%d 0 %s", NNTP_NOTHING_FOLLOWS_VAL, p) + 1;
+    length = snprintf(NULL, 0, "%d 0 %s", NNTP_OK_STAT, p) + 1;
     buff = xmalloc(length);
-    snprintf(buff, length, "%d 0 %s", NNTP_NOTHING_FOLLOWS_VAL, p);
+    snprintf(buff, length, "%d 0 %s", NNTP_OK_STAT, p);
     NCwritereply(cp, buff);
     free(buff);
 }
@@ -473,7 +473,7 @@
             cp->Sendid.data = xmalloc(cp->Sendid.size);
         }
         snprintf(cp->Sendid.data, cp->Sendid.size, "%d %.200s",
-                 NNTP_HAVEIT_VAL, filterrc);
+                 NNTP_FAIL_IHAVE_REFUSE, filterrc);
         NCwritereply(cp, cp->Sendid.data);
         free(cp->Sendid.data);
         cp->Sendid.size = 0;
@@ -500,7 +500,7 @@
 	    cp->Sendid.data = xmalloc(cp->Sendid.size);
 	}
 	snprintf(cp->Sendid.data, cp->Sendid.size, "%d %.200s",
-                 NNTP_HAVEIT_VAL, filterrc);
+                 NNTP_FAIL_IHAVE_REFUSE, filterrc);
 	NCwritereply(cp, cp->Sendid.data);
 	free(cp->Sendid.data);
 	cp->Sendid.size = 0;
@@ -570,7 +570,7 @@
      * with it
      */
     cp->State = CSgetxbatch;
-    NCwritereply(cp, NNTP_CONT_XBATCH);
+    NCwritereply(cp, NNTP_CONT_XBATCH_STR);
 }
 
 /*
@@ -650,7 +650,7 @@
              (!StreamingOff && cp->Streaming)) {
 	char buff[16];
 
-	snprintf(buff, sizeof(buff), "%d StreamOK.", NNTP_OK_STREAM_VAL);
+	snprintf(buff, sizeof(buff), "%d StreamOK.", NNTP_OK_STREAM);
 	NCwritereply(cp, buff);
 	syslog(L_NOTICE, "%s NCmode \"mode stream\" received",
 		CHANname(cp));
@@ -659,7 +659,7 @@
        char buff[16];
 
        cp->State = CScancel;
-       snprintf(buff, sizeof(buff), "%d CancelOK.", NNTP_OK_CANCEL_VAL);
+       snprintf(buff, sizeof(buff), "%d CancelOK.", NNTP_OK_MODE_CANCEL);
        NCwritereply(cp, buff);
        syslog(L_NOTICE, "%s NCmode \"mode cancel\" received",
                CHANname(cp));
@@ -714,7 +714,7 @@
     cp->Start = cp->Next;
     *p = '\0';
     snprintf(buff, sizeof(buff), "%d \"%s\" not implemented; try \"help\".",
-             NNTP_BAD_COMMAND_VAL, MaxLength(q, q));
+             NNTP_ERR_COMMAND, MaxLength(q, q));
     NCwritereply(cp, buff);
 }
 
@@ -971,7 +971,7 @@
 	  CHANname(cp), i, NNTP_STRLEN);
 	cp->LargeCmdSize = 0;
 	snprintf(buff, sizeof(buff), "%d command exceeds limit of %d bytes",
-                 NNTP_BAD_COMMAND_VAL, NNTP_STRLEN);
+                 NNTP_ERR_COMMAND, NNTP_STRLEN);
 	cp->State = CSgetcmd;
 	cp->Start = cp->Next;
 	NCwritereply(cp, buff);
@@ -1162,7 +1162,7 @@
 	/* Worked in main, now it fails?  Curious. */
 	p = Path.data;
     snprintf(buff, sizeof(buff), "%d %s InterNetNews server %s ready",
-	    NNTP_POSTOK_VAL, p, INN_VERSION_STRING);
+	    NNTP_OK_BANNER_POST, p, INN_VERSION_STRING);
     NCgreeting = xstrdup(buff);
 }
 
@@ -1282,7 +1282,7 @@
     }
     if (!ARTidok(p)) {
 	snprintf(cp->Sendid.data, cp->Sendid.size, "%d %s",
-                 NNTP_ERR_GOTID_VAL, p);
+                 NNTP_FAIL_CHECK_REFUSE, p);
 	NCwritereply(cp, cp->Sendid.data);
 	syslog(L_NOTICE, "%s bad_messageid %s", CHANname(cp), MaxLength(p, p));
 	return;
@@ -1292,7 +1292,7 @@
 	cp->Refused++;
 	cp->Check_cybercan++;
 	snprintf(cp->Sendid.data, cp->Sendid.size, "%d %s",
-                 NNTP_ERR_GOTID_VAL, p);
+                 NNTP_FAIL_CHECK_REFUSE, p);
 	NCwritereply(cp, cp->Sendid.data);
 	return;
     }
@@ -1303,7 +1303,7 @@
     if (filterrc) {
 	cp->Refused++;
 	snprintf(cp->Sendid.data, cp->Sendid.size, "%d %s",
-                 NNTP_ERR_GOTID_VAL, p);
+                 NNTP_FAIL_CHECK_REFUSE, p);
 	NCwritereply(cp, cp->Sendid.data);
 	return;
     }
@@ -1315,7 +1315,7 @@
     if (filterrc) {
 	cp->Refused++;
 	snprintf(cp->Sendid.data, cp->Sendid.size, "%d %s",
-                 NNTP_ERR_GOTID_VAL, p);
+                 NNTP_FAIL_CHECK_REFUSE, p);
 	NCwritereply(cp, cp->Sendid.data);
 	return;
     }
@@ -1325,23 +1325,23 @@
 	cp->Refused++;
 	cp->Check_got++;
 	snprintf(cp->Sendid.data, cp->Sendid.size, "%d %s",
-                 NNTP_ERR_GOTID_VAL, p);
+                 NNTP_FAIL_CHECK_REFUSE, p);
 	NCwritereply(cp, cp->Sendid.data);
     } else if (WIPinprogress(p, cp, true)) {
 	cp->Check_deferred++;
 	if (cp->NoResendId) {
 	    cp->Refused++;
 	    snprintf(cp->Sendid.data, cp->Sendid.size, "%d %s",
-                     NNTP_ERR_GOTID_VAL, p);
+                     NNTP_FAIL_CHECK_REFUSE, p);
 	} else {
 	    snprintf(cp->Sendid.data, cp->Sendid.size, "%d %s",
-                     NNTP_RESENDID_VAL, p);
+                     NNTP_FAIL_CHECK_DEFER, p);
 	}
 	NCwritereply(cp, cp->Sendid.data);
     } else {
 	cp->Check_send++;
 	snprintf(cp->Sendid.data, cp->Sendid.size, "%d %s",
-                 NNTP_OK_SENDID_VAL, p);
+                 NNTP_OK_CHECK, p);
 	NCwritereply(cp, cp->Sendid.data);
     }
     /* stay in command mode */
@@ -1376,7 +1376,7 @@
 	cp->Sendid.data = xmalloc(cp->Sendid.size);
     }
     /* save ID for later NACK or ACK */
-    snprintf(cp->Sendid.data, cp->Sendid.size, "%d %s", NNTP_ERR_FAILID_VAL,
+    snprintf(cp->Sendid.data, cp->Sendid.size, "%d %s", NNTP_FAIL_TAKETHIS_REJECT,
              p);
 
     cp->ArtBeg = Now.tv_sec;
@@ -1404,7 +1404,7 @@
     if (res) {
         char buff[SMBUF];
 
-        snprintf(buff, sizeof(buff), "%d %s", NNTP_ERR_CANCEL_VAL,
+        snprintf(buff, sizeof(buff), "%d %s", NNTP_FAIL_CANCEL,
                  MaxLength(res, res));
         syslog(L_NOTICE, "%s cant_cancel %s", CHANname(cp),
                MaxLength(res, res));
diff -u -r inn-CURRENT-20061121/innd/rc.c inn-CURRENT/innd/rc.c
--- inn-CURRENT-20061121/innd/rc.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/innd/rc.c	2006-11-22 21:51:25.000000000 +0800
@@ -533,11 +533,11 @@
 	    i = (i + 1) & (REMOTETABLESIZE - 1);
 	}
 	if (remotecount == RemoteTotal) {
-	    reject_val = NNTP_GOODBYE_VAL;
+	    reject_val = NNTP_FAIL_TERMINATING;
 	    reject_message = "400 Server overloaded, try later";
 	}
 	else if (found >= RemoteLimit && !RCnolimit(&tempchan)) {
-	    reject_val = NNTP_GOODBYE_VAL;
+	    reject_val = NNTP_FAIL_TERMINATING;
 	    reject_message = "400 Connection rejected, you're making too"
                 " many connects per minute";
 	}
@@ -620,7 +620,7 @@
 	    syslog(L_ERROR, "%s cant close %d %m", LogName, fd);
 	return;
     } else {
-	reject_val = NNTP_ACCESS_VAL;
+	reject_val = NNTP_ERR_ACCESS;
 	reject_message = NNTP_ACCESS;
         new = CHANcreate(fd, CTreject, CSwritegoodbye, RCrejectreader,
             RCrejectwritedone);
diff -u -r inn-CURRENT-20061121/innd/status.c inn-CURRENT/innd/status.c
--- inn-CURRENT-20061121/innd/status.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/innd/status.c	2006-11-22 21:51:25.000000000 +0800
@@ -319,20 +319,20 @@
     fprintf (F, "reject size: %-8s\n",       PrettySize(status->RejectSize, str));
     fprintf (F, "  Protocol:\n");
     fprintf (F, "      Ihave: %-6ld SendIt[%d]: %-6ld    Got[%d]: %-6ld Deferred[%d]: %ld\n",
-	     status->Ihave, NNTP_SENDIT_VAL, status->Ihave_SendIt,
-	     NNTP_HAVEIT_VAL, status->Ihave_Duplicate, NNTP_RESENDIT_VAL,
+	     status->Ihave, NNTP_CONT_IHAVE, status->Ihave_SendIt,
+	     NNTP_FAIL_IHAVE_REFUSE, status->Ihave_Duplicate, NNTP_FAIL_IHAVE_DEFER,
 	     status->Ihave_Deferred);
     fprintf (F, "      Check: %-6ld SendIt[%d]: %-6ld    Got[%d]: %-6ld Deferred[%d]: %ld\n",
-	     status->Check, NNTP_OK_SENDID_VAL, status->Check_send,
-	     NNTP_ERR_GOTID_VAL, status->Check_got, NNTP_RESENDID_VAL,
+	     status->Check, NNTP_OK_CHECK, status->Check_send,
+	     NNTP_FAIL_CHECK_REFUSE, status->Check_got, NNTP_FAIL_CHECK_DEFER,
 	     status->Check_deferred);
     fprintf (F, "   Takethis: %-6ld     Ok[%d]: %-6ld  Error[%d]: %-6ld\n",
-	     status->Takethis, NNTP_OK_RECID_VAL, status->Takethis_Ok,
-	     NNTP_ERR_FAILID_VAL, status->Takethis_Err);
+	     status->Takethis, NNTP_OK_TAKETHIS, status->Takethis_Ok,
+	     NNTP_FAIL_TAKETHIS_REJECT, status->Takethis_Err);
     if (innconf->refusecybercancels) {
         fprintf (F, "   Cancelrejects:    Ihave[%d]: %-6ld  Check[%d]: %-6ld\n",
-	     NNTP_HAVEIT_VAL, status->Ihave_Cybercan,
-	     NNTP_ERR_GOTID_VAL, status->Check_cybercan);
+	     NNTP_FAIL_IHAVE_REFUSE, status->Ihave_Cybercan,
+	     NNTP_FAIL_CHECK_REFUSE, status->Check_cybercan);
     }
     fputc ('\n', F) ;
     tmp = status->next;
diff -u -r inn-CURRENT-20061121/lib/clientlib.c inn-CURRENT/lib/clientlib.c
--- inn-CURRENT-20061121/lib/clientlib.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/lib/clientlib.c	2006-11-22 21:51:25.000000000 +0800
@@ -58,7 +58,7 @@
     put_server("mode reader");
     if (get_server(line2, (int)sizeof line2) < 0)
 	return -1;
-    if (atoi(line2) != NNTP_BAD_COMMAND_VAL)
+    if (atoi(line2) != NNTP_ERR_COMMAND)
 	strlcpy(ser_line, line2, sizeof(ser_line));
 
     /* Connected; return server's reply code. */
@@ -83,7 +83,7 @@
     default:
 	printf("Unknown response code %d from %s.\n", response, host);
 	return -1;
-     case NNTP_GOODBYE_VAL:
+     case NNTP_FAIL_TERMINATING:
 	if (atoi(ser_line) == response) {
 	    p = &ser_line[strlen(ser_line) - 1];
 	    if (*p == '\n' && *--p == '\r')
@@ -96,13 +96,13 @@
 	}
 	printf("News server %s unavailable, try later.\n", host);
 	return -1;
-    case NNTP_ACCESS_VAL:
+    case NNTP_ERR_ACCESS:
 	printf(CANTUSE, host);
 	return -1;
-    case NNTP_NOPOSTOK_VAL:
+    case NNTP_OK_BANNER_NOPOST:
 	printf("%s.\n", CANTPOST);
 	/* FALLTHROUGH */
-    case NNTP_POSTOK_VAL:
+    case NNTP_OK_BANNER_POST:
 	break;
     }
     return 0;
diff -u -r inn-CURRENT-20061121/lib/localopen.c inn-CURRENT/lib/localopen.c
--- inn-CURRENT-20061121/lib/localopen.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/lib/localopen.c	2006-11-22 21:51:23.000000000 +0800
@@ -72,7 +72,7 @@
 	return -1;
     }
     j = atoi(buff);
-    if (j != NNTP_POSTOK_VAL && j != NNTP_NOPOSTOK_VAL) {
+    if (j != NNTP_OK_BANNER_POST && j != NNTP_OK_BANNER_NOPOST) {
 	fclose(F);
 	/* This seems like a reasonable error code to use... */
 	errno = EPERM;
diff -u -r inn-CURRENT-20061121/lib/remopen.c inn-CURRENT/lib/remopen.c
--- inn-CURRENT-20061121/lib/remopen.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/lib/remopen.c	2006-11-22 21:51:23.000000000 +0800
@@ -47,7 +47,7 @@
     if (fgets(buff, len, F) == NULL)
         goto fail;
     code = atoi(buff);
-    if (code != NNTP_POSTOK_VAL && code != NNTP_NOPOSTOK_VAL) {
+    if (code != NNTP_OK_BANNER_POST && code != NNTP_OK_BANNER_NOPOST) {
         errno = EPERM;
         goto fail;
     }
diff -u -r inn-CURRENT-20061121/lib/sendpass.c inn-CURRENT/lib/sendpass.c
--- inn-CURRENT-20061121/lib/sendpass.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/lib/sendpass.c	2006-11-22 21:51:24.000000000 +0800
@@ -75,7 +75,7 @@
 	    if (fflush(ToServer) == EOF || ferror(ToServer))
 		break;
 	    if (fgets(input, sizeof input, FromServer) == NULL
-	     || atoi(input) != NNTP_AUTH_NEXT_VAL)
+	     || atoi(input) != NNTP_CONT_AUTHINFO)
 		break;
 	}
 
@@ -85,7 +85,7 @@
 	    if (fflush(ToServer) == EOF || ferror(ToServer))
 		break;
 	    if (fgets(input, sizeof input, FromServer) == NULL
-	     || atoi(input) != NNTP_AUTH_OK_VAL)
+	     || atoi(input) != NNTP_OK_AUTHINFO)
 		break;
 	}
 
diff -u -r inn-CURRENT-20061121/nnrpd/article.c inn-CURRENT/nnrpd/article.c
--- inn-CURRENT-20061121/nnrpd/article.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/nnrpd/article.c	2006-11-22 21:51:26.000000000 +0800
@@ -44,16 +44,16 @@
 static char		ARTnocurrart[] = NNTP_NOCURRART;
 static ARTHANDLE        *ARThandle = NULL;
 static SENDDATA		SENDbody = {
-    STbody,	NNTP_BODY_FOLLOWS_VAL,		"body"
+    STbody,	NNTP_OK_BODY,		"body"
 };
 static SENDDATA		SENDarticle = {
-    STarticle,	NNTP_ARTICLE_FOLLOWS_VAL,	"article"
+    STarticle,	NNTP_OK_ARTICLE,	"article"
 };
 static SENDDATA		SENDstat = {
-    STstat,	NNTP_NOTHING_FOLLOWS_VAL,	"status"
+    STstat,	NNTP_OK_STAT,	"status"
 };
 static SENDDATA		SENDhead = {
-    SThead,	NNTP_HEAD_FOLLOWS_VAL,		"head"
+    SThead,	NNTP_OK_HEAD,		"head"
 };
 
 
@@ -309,7 +309,7 @@
 	    if (!History) {
 		syslog(L_NOTICE, "cant initialize history");
 		Reply("%d NNTP server unavailable. Try later.\r\n",
-		      NNTP_TEMPERR_VAL);
+		      NNTP_ERR_UNAVAILABLE);
 		ExitWithStats(1, true);
 	    }
 	    statinterval = 30;
@@ -625,7 +625,7 @@
     /* Requesting by Message-ID? */
     if (ac == 2 && av[1][0] == '<') {
 	if (!ARTopenbyid(av[1], &art, final)) {
-	    Reply("%d No such article\r\n", NNTP_DONTHAVEIT_VAL);
+	    Reply("%d No such article\r\n", NNTP_FAIL_NOTFOUND);
 	    return;
 	}
 	if (!PERMartok()) {
@@ -711,12 +711,12 @@
     next = (av[0][0] == 'n' || av[0][0] == 'N');
     if (next) {
 	delta = 1;
-	errcode = NNTP_NONEXT_VAL;
+	errcode = NNTP_FAIL_NEXT;
 	message = "next";
     }
     else {
 	delta = -1;
-	errcode = NNTP_NOPREV_VAL;
+	errcode = NNTP_FAIL_PREV;
 	message = "previous";
     }
 
@@ -736,7 +736,7 @@
 
     ARTclose();
     Reply("%d %d %s Article retrieved; request text separately.\r\n",
-	   NNTP_NOTHING_FOLLOWS_VAL, ARTnumber, msgid);
+	   NNTP_OK_STAT, ARTnumber, msgid);
 }
 
 
@@ -844,7 +844,7 @@
     /* Parse range. */
     if (!CMDgetrange(ac, av, &range, &DidReply)) {
 	if (!DidReply) {
-	    Reply("%d data follows\r\n", NNTP_OVERVIEW_FOLLOWS_VAL);
+	    Reply("%d data follows\r\n", NNTP_OK_OVER);
 	    Printf(".\r\n");
 	    return;
 	}
@@ -854,9 +854,9 @@
     gettimeofday(&stv, NULL);
     if ((handle = (void *)OVopensearch(GRPcur, range.Low, range.High)) == NULL) {
 	if (av[1] != NULL)
-	    Reply("%d %s fields follow\r\n.\r\n", NNTP_OVERVIEW_FOLLOWS_VAL, av[1]);
+	    Reply("%d %s fields follow\r\n.\r\n", NNTP_OK_OVER, av[1]);
 	else
-	    Reply("%d %d fields follow\r\n.\r\n", NNTP_OVERVIEW_FOLLOWS_VAL, ARTnumber);
+	    Reply("%d %d fields follow\r\n.\r\n", NNTP_OK_OVER, ARTnumber);
 	return;
     }
     if (PERMaccessconf->nnrpdoverstats) {
@@ -866,9 +866,9 @@
     }
 
     if (av[1] != NULL)
-	Reply("%d %s fields follow\r\n", NNTP_OVERVIEW_FOLLOWS_VAL, av[1]);
+	Reply("%d %s fields follow\r\n", NNTP_OK_OVER, av[1]);
     else
-	Reply("%d %d fields follow\r\n", NNTP_OVERVIEW_FOLLOWS_VAL, ARTnumber);
+	Reply("%d %d fields follow\r\n", NNTP_OK_OVER, ARTnumber);
     fflush(stdout);
     if (PERMaccessconf->nnrpdoverstats)
 	gettimeofday(&stv, NULL);
@@ -997,10 +997,10 @@
 	if (ac > 2 && av[2][0] == '<') {
 	    p = av[2];
 	    if (!ARTopenbyid(p, &artnum, false)) {
-		Printf("%d No such article.\r\n", NNTP_DONTHAVEIT_VAL);
+		Printf("%d No such article.\r\n", NNTP_FAIL_NOTFOUND);
 		break;
 	    }
-	    Printf("%d %s matches follow (ID)\r\n", NNTP_HEAD_FOLLOWS_VAL,
+	    Printf("%d %s matches follow (ID)\r\n", NNTP_OK_HEAD,
 		   header);
 	    if ((text = GetHeader(header)) != NULL
 		&& (!pattern || uwildmat_simple(text, pattern)))
@@ -1020,7 +1020,7 @@
 	if (!CMDgetrange(ac - 1, av + 1, &range, &DidReply)) {
 	    if (!DidReply) {
 		Reply("%d %s no matches follow (range)\r\n",
-		      NNTP_HEAD_FOLLOWS_VAL, header ? header : "\"\"");
+		      NNTP_OK_HEAD, header ? header : "\"\"");
 		Printf(".\r\n");
 		break;
 	    }
@@ -1031,7 +1031,7 @@
 
 	/* Not in overview, we have to fish headers out from the articles */
 	if (Overview < 0 ) {
-	    Reply("%d %s matches follow (art)\r\n", NNTP_HEAD_FOLLOWS_VAL,
+	    Reply("%d %s matches follow (art)\r\n", NNTP_OK_HEAD,
 		  header);
 	    for (i = range.Low; i <= range.High && range.High > 0; i++) {
 		if (!ARTopen(i))
@@ -1054,11 +1054,11 @@
 	handle = (void *)OVopensearch(GRPcur, range.Low, range.High);
 	if (handle == NULL) {
 	    Reply("%d %s no matches follow (NOV)\r\n.\r\n",
-		  NNTP_HEAD_FOLLOWS_VAL, header);
+		  NNTP_OK_HEAD, header);
 	    break;
 	}	
 	
-	Printf("%d %s matches follow (NOV)\r\n", NNTP_HEAD_FOLLOWS_VAL,
+	Printf("%d %s matches follow (NOV)\r\n", NNTP_OK_HEAD,
 	       header);
 	while (OVsearch(handle, &artnum, &data, &len, &token, NULL)) {
 	    if (len == 0 || (PERMaccessconf->nnrpdcheckart
diff -u -r inn-CURRENT-20061121/nnrpd/commands.c inn-CURRENT/nnrpd/commands.c
--- inn-CURRENT-20061121/nnrpd/commands.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/nnrpd/commands.c	2006-11-22 21:51:26.000000000 +0800
@@ -47,7 +47,7 @@
     PERMaccessconf->allowapproved = false;
 
     if (!*av) {
-	Reply("%d no authenticator\r\n", NNTP_SYNTAX_VAL);
+	Reply("%d no authenticator\r\n", NNTP_ERR_SYNTAX);
 	return(-1);
     }
 
@@ -56,7 +56,7 @@
        portability */
     for (p = av[0]; *p; p++)
 	if (strncmp(p, "../", 3) == 0) {
-	    Reply("%d ../ in authenticator %s\r\n", NNTP_SYNTAX_VAL, av[0]);
+	    Reply("%d ../ in authenticator %s\r\n", NNTP_ERR_SYNTAX, av[0]);
 	    return(-1);
 	}
 
@@ -76,7 +76,7 @@
 #endif  /* !defined(S_IXUSR) && defined(S_IEXEC) */
 
     if (stat(path, &stb) || !(stb.st_mode&S_IXUSR)) {
-	Reply("%d No such authenticator %s\r\n", NNTP_TEMPERR_VAL, av[0]);
+	Reply("%d No such authenticator %s\r\n", NNTP_ERR_UNAVAILABLE, av[0]);
 	return -1;
     }
 	
@@ -89,7 +89,7 @@
 
     for (i = 0; (pid = fork()) < 0; i++) {
 	if (i == innconf->maxforks) {
-	    Reply("%d Can't fork %s\r\n", NNTP_TEMPERR_VAL,
+	    Reply("%d Can't fork %s\r\n", NNTP_ERR_UNAVAILABLE,
 		strerror(errno));
 	    syslog(L_FATAL, "cant fork %s %m", av[0]);
 	    return -1;
@@ -184,7 +184,7 @@
 		PERMpostlist = PERMreadlist;
 		syslog(L_NOTICE, "%s auth %s (%s -> %s)", Client.host, PERMuser,
 			logrec, PERMauthstring? PERMauthstring: "" );
-		Reply("%d Authentication succeeded\r\n", NNTP_AUTH_OK_VAL);
+		Reply("%d Authentication succeeded\r\n", NNTP_OK_AUTHINFO);
 		PERMneedauth = false;
 		PERMauthorized = true;
 		free(logrec);
@@ -192,7 +192,7 @@
 	    case 0:
 		syslog(L_NOTICE, "%s bad_auth %s (%s)", Client.host, PERMuser,
 			logrec);
-		Reply("%d Authentication failed\r\n", NNTP_ACCESS_VAL);
+		Reply("%d Authentication failed\r\n", NNTP_ERR_ACCESS);
 		free(logrec);
 		ExitWithStats(1, false);
 	    default:
@@ -209,7 +209,7 @@
 
 	if (strcasecmp(av[1], "simple") == 0) {
 	    if (ac != 4) {
-		Reply("%d AUTHINFO SIMPLE <USER> <PASS>\r\n", NNTP_BAD_COMMAND_VAL);
+		Reply("%d AUTHINFO SIMPLE <USER> <PASS>\r\n", NNTP_ERR_COMMAND);
 		return;
 	    }
 	    strlcpy(User, av[2], sizeof(User));
@@ -217,16 +217,16 @@
 	} else {
 	    if (strcasecmp(av[1], "user") == 0) {
 		strlcpy(User, av[2], sizeof(User));
-		Reply("%d PASS required\r\n", NNTP_AUTH_NEXT_VAL);
+		Reply("%d PASS required\r\n", NNTP_CONT_AUTHINFO);
 		return;
 	    }
 
 	    if (strcasecmp(av[1], "pass") != 0) {
-		Reply("%d bad authinfo param\r\n", NNTP_BAD_COMMAND_VAL);
+		Reply("%d bad authinfo param\r\n", NNTP_ERR_COMMAND);
 		return;
 	    }
 	    if (User[0] == '\0') {
-		Reply("%d USER required\r\n", NNTP_AUTH_REJECT_VAL);
+		Reply("%d USER required\r\n", NNTP_FAIL_AUTHINFO_REJECT);
 		return;
 	    }
 
@@ -239,7 +239,7 @@
                 fprintf(locallog, "%s user (%s):%s\n", Client.host, Username, PERMuser);
                 fflush(locallog);
             }
-            Reply("%d Ok\r\n", NNTP_AUTH_OK_VAL);
+            Reply("%d Ok\r\n", NNTP_OK_AUTHINFO);
             PERMneedauth = false;
             PERMauthorized = true;
             return;
@@ -255,7 +255,7 @@
                 fprintf(locallog, "%s user (%s):%s\n", Client.host, Username, PERMuser);
                 fflush(locallog);
             }
-            Reply("%d Ok\r\n", NNTP_AUTH_OK_VAL);
+            Reply("%d Ok\r\n", NNTP_OK_AUTHINFO);
             PERMneedauth = false;
             PERMauthorized = true;
             return;
@@ -264,9 +264,9 @@
 	syslog(L_NOTICE, "%s bad_auth", Client.host);
         if (errorstr[0] != '\0') {
             syslog(L_NOTICE, "%s script error str: %s", Client.host, errorstr);
-            Reply("%d %s\r\n", NNTP_ACCESS_VAL, errorstr);
+            Reply("%d %s\r\n", NNTP_ERR_ACCESS, errorstr);
         } else {
-            Reply("%d Authentication error\r\n", NNTP_ACCESS_VAL);
+            Reply("%d Authentication error\r\n", NNTP_ERR_ACCESS);
         }
 	ExitWithStats(1, false);
     }
@@ -286,11 +286,11 @@
     now = time(NULL);
     gmt = gmtime(&now);
     if (now == (time_t) -1 || gmt == NULL) {
-        Reply("%d Can't get time, %s\r\n", NNTP_TEMPERR_VAL, strerror(errno));
+        Reply("%d Can't get time, %s\r\n", NNTP_ERR_UNAVAILABLE, strerror(errno));
         return;
     }
     Reply("%d %04.4d%02.2d%02.2d%02.2d%02.2d%02.2d\r\n",
-          NNTP_DATE_FOLLOWS_VAL,
+          NNTP_INFO_DATE,
           gmt->tm_year + 1900, gmt->tm_mon + 1, gmt->tm_mday,
           gmt->tm_hour, gmt->tm_min, gmt->tm_sec);
 }
@@ -305,11 +305,11 @@
 {
     if (strcasecmp(av[1], "reader") == 0)
 	Reply("%d %s InterNetNews NNRP server %s ready (%s).\r\n",
-	       PERMcanpost ? NNTP_POSTOK_VAL : NNTP_NOPOSTOK_VAL,
+	       PERMcanpost ? NNTP_OK_BANNER_POST : NNTP_OK_BANNER_NOPOST,
                PERMaccessconf->pathhost, INN_VERSION_STRING,
 	       PERMcanpost ? "posting ok" : "no posting");
     else
-	Reply("%d What?\r\n", NNTP_SYNTAX_VAL);
+	Reply("%d What?\r\n", NNTP_ERR_SYNTAX);
 }
 
 static int GroupCompare(const void *a1, const void* b1) {
@@ -345,7 +345,7 @@
     local = !(ac > 3 && strcasecmp(av[3], "GMT") == 0);
     date = parsedate_nntp(av[1], av[2], local);
     if (date == (time_t) -1) {
-        Reply("%d Bad date\r\n", NNTP_SYNTAX_VAL);
+        Reply("%d Bad date\r\n", NNTP_ERR_SYNTAX);
         return;
     }
 
@@ -356,7 +356,7 @@
        of groups. */
     if ((qp = QIOopen(ACTIVETIMES)) == NULL) {
 	syslog(L_ERROR, "%s cant fopen %s %m", Client.host, ACTIVETIMES);
-	Reply("%d New newsgroups follow.\r\n", NNTP_NEWGROUPS_FOLLOWS_VAL);
+	Reply("%d New newsgroups follow.\r\n", NNTP_OK_NEWGROUPS);
         Printf(".\r\n");
 	return;
     }
@@ -399,11 +399,11 @@
 
     if ((qp = QIOopen(ACTIVE)) == NULL) {
 	syslog(L_ERROR, "%s cant fopen %s %m", Client.host, ACTIVE);
-	Reply("%d Cannot open active file.\r\n", NNTP_TEMPERR_VAL);
+	Reply("%d Cannot open active file.\r\n", NNTP_ERR_UNAVAILABLE);
 	return;
     }
     qsort(grouplist, numgroups, sizeof(GROUPDATA), GroupCompare);
-    Reply("%d New newsgroups follow.\r\n", NNTP_NEWGROUPS_FOLLOWS_VAL);
+    Reply("%d New newsgroups follow.\r\n", NNTP_OK_NEWGROUPS);
     for (numfound = numgroups; (p = QIOread(qp)) && numfound;) {
 	if ((q = strchr(p, ' ')) == NULL)
 	    continue;
@@ -528,7 +528,7 @@
 		strlcpy(idbuff, p, sizeof(idbuff));
 	    }
 	}
-	Reply("%d Ok, recommended ID %s\r\n", NNTP_START_POST_VAL, idbuff);
+	Reply("%d Ok, recommended ID %s\r\n", NNTP_CONT_POST, idbuff);
     }
     fflush(stdout);
 
@@ -597,7 +597,7 @@
     if (longline) {
 	warn("%s toolong in post", Client.host);
 	Printf("%d Line %d too long\r\n", 
-	       ihave ? NNTP_REJECTIT_VAL : NNTP_POSTFAIL_VAL, longline);
+	       ihave ? NNTP_FAIL_IHAVE_REJECT : NNTP_FAIL_POST_REJECT, longline);
 	POSTrejected++;
 	return;
     }
@@ -617,7 +617,7 @@
 	notice("%s post failed %s", Client.host, response);
 	if (!ihave || permanent) {
 	    /* for permanent errors reject the message */
-	    Reply("%d %s\r\n", ihave ? NNTP_REJECTIT_VAL : NNTP_POSTFAIL_VAL,
+	    Reply("%d %s\r\n", ihave ? NNTP_FAIL_IHAVE_REJECT : NNTP_FAIL_POST_REJECT,
 		  response);
 	} else {
 	    /* non-permanent errors only have relevance to ihave, for
diff -u -r inn-CURRENT-20061121/nnrpd/group.c inn-CURRENT/nnrpd/group.c
--- inn-CURRENT-20061121/nnrpd/group.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/nnrpd/group.c	2006-11-22 21:51:26.000000000 +0800
@@ -34,16 +34,16 @@
 
     if (!hookpresent && !PERMcanread) {
         if (PERMspecified)
-	    Reply("%d Permission denied\r\n", NNTP_ACCESS_VAL);
+	    Reply("%d Permission denied\r\n", NNTP_ERR_ACCESS);
         else
-            Reply("%d Authentication required\r\n", NNTP_AUTH_NEEDED_VAL);
+            Reply("%d Authentication required\r\n", NNTP_FAIL_AUTH_NEEDED);
 	return;
     }
 
     /* Parse arguments. */
     if (ac == 1) {
 	if (GRPcur == NULL) {
-	    Printf("%d No group specified\r\n", NNTP_XGTITLE_BAD);
+	    Printf("%d No group specified\r\n", NNTP_FAIL_XGTITLE);
 	    return;
 	} else {
 	    group = xstrdup(GRPcur);
@@ -71,7 +71,7 @@
 	} else {
 	    if (reply != NULL) {
 	        syslog(L_TRACE, "PY_dynamic() returned a refuse string for user %s at %s who wants to read %s: %s", PERMuser, Client.host, group, reply);
-		Reply("%d %s\r\n", NNTP_ACCESS_VAL, reply);
+		Reply("%d %s\r\n", NNTP_ERR_ACCESS, reply);
 		free(group);
                 free(reply);
 		return;
@@ -85,12 +85,12 @@
             grplist[0] = group;
             grplist[1] = NULL;
             if (!PERMmatch(PERMreadlist, grplist)) {
-                Reply("%d Permission denied\r\n", NNTP_ACCESS_VAL);
+                Reply("%d Permission denied\r\n", NNTP_ERR_ACCESS);
                 free(group);
                 return;
             }
         } else {
-            Reply("%d Authentication required\r\n", NNTP_AUTH_NEEDED_VAL);
+            Reply("%d Authentication required\r\n", NNTP_FAIL_AUTH_NEEDED);
             free(group);
             return;
         }
@@ -103,7 +103,7 @@
     /* Doing a "group" command? */
     if (strcasecmp(av[0], "group") == 0) {
 	if (count == 0)
-	    Reply("%d 0 0 0 %s\r\n", NNTP_GROUPOK_VAL, group);
+	    Reply("%d 0 0 0 %s\r\n", NNTP_OK_GROUP, group);
 	else {
 	    /* if we're an NFS reader, check the last nfsreaderdelay
 	     * articles in the group to see if they arrived in the
@@ -121,7 +121,7 @@
 		    low = ARThigh - innconf->nfsreaderdelay;
 		handle = OVopensearch(group, low, ARThigh);
 		if (!handle) {
-		    Reply("%d group disappeared\r\n", NNTP_TEMPERR_VAL);
+		    Reply("%d group disappeared\r\n", NNTP_ERR_UNAVAILABLE);
 		    free(group);
 		    return;
 		}
@@ -135,7 +135,7 @@
 		}
 		OVclosesearch(handle);
 	    }
-	    Reply("%d %d %lu %lu %s\r\n", NNTP_GROUPOK_VAL, count, ARTlow,
+	    Reply("%d %d %lu %lu %s\r\n", NNTP_OK_GROUP, count, ARTlow,
                   ARThigh, group);
 	}
 	GRPcount++;
@@ -154,10 +154,10 @@
            returns the same data as GROUP does and since we have it all
            available it shouldn't hurt to return the same thing. */
         if (count == 0) {
-            Reply("%d 0 0 0 %s\r\n", NNTP_GROUPOK_VAL, group);
+            Reply("%d 0 0 0 %s\r\n", NNTP_OK_GROUP, group);
             Printf(".\r\n");
         } else if ((handle = OVopensearch(group, ARTlow, ARThigh)) != NULL) {
-            Reply("%d %d %lu %lu %s\r\n", NNTP_GROUPOK_VAL, count, ARTlow,
+            Reply("%d %d %lu %lu %s\r\n", NNTP_OK_GROUP, count, ARTlow,
                   ARThigh, group);
 	    while (OVsearch(handle, &i, NULL, NULL, &token, NULL)) {
 		if (PERMaccessconf->nnrpdcheckart && !ARTinstorebytoken(token))
@@ -218,7 +218,7 @@
     /* Parse the arguments. */
     if (ac == 1) {
 	if (GRPcount == 0) {
-	    Printf("%d No group specified\r\n", NNTP_XGTITLE_BAD);
+	    Printf("%d No group specified\r\n", NNTP_FAIL_XGTITLE);
 	    return;
 	}
 	p = GRPcur;
@@ -227,7 +227,7 @@
 	p = av[1];
 
     if (!PERMspecified) {
-	Printf("%d list follows\r\n", NNTP_XGTITLE_OK);
+	Printf("%d list follows\r\n", NNTP_OK_XGTITLE);
 	Printf(".\r\n");
 	return;
     }
@@ -235,10 +235,10 @@
     /* Open the file, get ready to scan. */
     if ((qp = QIOopen(NEWSGROUPS)) == NULL) {
 	syslog(L_ERROR, "%s cant open %s %m", Client.host, NEWSGROUPS);
-	Printf("%d Can't open %s\r\n", NNTP_XGTITLE_BAD, NEWSGROUPS);
+	Printf("%d Can't open %s\r\n", NNTP_FAIL_XGTITLE, NEWSGROUPS);
 	return;
     }
-    Printf("%d list follows\r\n", NNTP_XGTITLE_OK);
+    Printf("%d list follows\r\n", NNTP_OK_XGTITLE);
 
     /* Print all lines with matching newsgroup name. */
     while ((line = QIOread(qp)) != NULL) {
diff -u -r inn-CURRENT-20061121/nnrpd/list.c inn-CURRENT/nnrpd/list.c
--- inn-CURRENT-20061121/nnrpd/list.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/nnrpd/list.c	2006-11-22 21:51:26.000000000 +0800
@@ -91,7 +91,7 @@
     const struct cvector *standard;
     unsigned int i;
 
-    Reply("%d %s.\r\n", NNTP_LIST_FOLLOWS_VAL, lp->Format);
+    Reply("%d %s.\r\n", NNTP_OK_LIST, lp->Format);
     standard = overview_fields();
     for (i = 0; i < standard->count; ++i) {
 	Printf("%s:\r\n", standard->strings[i]);
@@ -111,7 +111,7 @@
 {
     const char *mechlist = NULL;
 
-    Reply("%d %s.\r\n", NNTP_SLAVEOK_VAL, lp->Format);
+    Reply("%d %s.\r\n", NNTP_OK_EXTENSIONS, lp->Format);
 
 #ifdef HAVE_SSL
     if (!nnrpd_starttls_done && PERMauthorized != true)
@@ -153,7 +153,7 @@
             return false;
     }
     if (OVgroupstats(group, &lo, &hi, NULL, &flag) && flag != '=') {
-        Reply("%d %s.\r\n", NNTP_LIST_FOLLOWS_VAL, INFOactive.Format);
+        Reply("%d %s.\r\n", NNTP_OK_LIST, INFOactive.Format);
         Printf("%s %010u %010u %c\r\n.\r\n", group, hi, lo, flag);
         return true;
     }
@@ -224,18 +224,18 @@
     free(path);
     if (qp == NULL) {
 	if (!lp->Required && errno == ENOENT) {
-	    Reply("%d %s.\r\n", NNTP_LIST_FOLLOWS_VAL, lp->Format);
+	    Reply("%d %s.\r\n", NNTP_OK_LIST, lp->Format);
 	    Printf(".\r\n");
 	}
 	else {
 	    syslog(L_ERROR, "%s cant fopen %s %m", Client.host, lp->File);
 	    Reply("%d No list of %s available.\r\n",
-		NNTP_TEMPERR_VAL, lp->Items);
+		NNTP_ERR_UNAVAILABLE, lp->Items);
 	}
 	return;
     }
 
-    Reply("%d %s.\r\n", NNTP_LIST_FOLLOWS_VAL, lp->Format);
+    Reply("%d %s.\r\n", NNTP_OK_LIST, lp->Format);
     if (!PERMspecified) {
 	/* Optmize for unlikely case of no permissions and false default. */
 	QIOclose(qp);
diff -u -r inn-CURRENT-20061121/nnrpd/misc.c inn-CURRENT/nnrpd/misc.c
--- inn-CURRENT-20061121/nnrpd/misc.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/nnrpd/misc.c	2006-11-22 21:51:26.000000000 +0800
@@ -519,11 +519,11 @@
   tls_init();
   if (nnrpd_starttls_done == 1) {
       Reply("%d Already successfully executed STARTTLS\r\n",
-            NNTP_STARTTLS_DONE_VAL);
+            NNTP_FAIL_STARTTLS);
       return;
   }
 
-  Reply("%d Begin TLS negotiation now\r\n", NNTP_STARTTLS_NEXT_VAL);
+  Reply("%d Begin TLS negotiation now\r\n", NNTP_CONT_STARTTLS);
   fflush(stdout);
 
   /* must flush our buffers before starting tls */
@@ -531,7 +531,7 @@
   result=tls_start_servertls(0, /* read */
 			     1); /* write */
   if (result==-1) {
-    Reply("%d Starttls failed\r\n", NNTP_STARTTLS_BAD_VAL);
+    Reply("%d Starttls failed\r\n", NNTP_ERR_STARTTLS);
     return;
   }
 
diff -u -r inn-CURRENT-20061121/nnrpd/newnews.c inn-CURRENT/nnrpd/newnews.c
--- inn-CURRENT-20061121/nnrpd/newnews.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/nnrpd/newnews.c	2006-11-22 21:51:26.000000000 +0800
@@ -227,7 +227,7 @@
   bool          local;
 
   if (!PERMaccessconf->allownewnews) {
-      Reply("%d NEWNEWS command disabled by administrator\r\n", NNTP_ACCESS_VAL);
+      Reply("%d NEWNEWS command disabled by administrator\r\n", NNTP_ERR_ACCESS);
       return;
   }
 
@@ -258,7 +258,7 @@
   /* Parse the newsgroups. */
   AllGroups = (strcmp(av[1], "*") == 0);
   if (!AllGroups && !NGgetlist(&groups, av[1])) {
-      Reply("%d Bad newsgroup specifier %s\r\n", NNTP_SYNTAX_VAL, av[1]);
+      Reply("%d Bad newsgroup specifier %s\r\n", NNTP_ERR_SYNTAX, av[1]);
       TMRstop(TMR_NEWNEWS);
       return;
   }
@@ -267,7 +267,7 @@
   local = !(ac > 4 && strcasecmp(av[4], "GMT") == 0);
   date = parsedate_nntp(av[2], av[3], local);
   if (date == (time_t) -1) {
-      Reply("%d Bad date\r\n", NNTP_SYNTAX_VAL);
+      Reply("%d Bad date\r\n", NNTP_ERR_SYNTAX);
       TMRstop(TMR_NEWNEWS);
       return;
   }
@@ -284,10 +284,10 @@
       qp = QIOopen(path);
       if (qp == NULL) {
 	  if (errno == ENOENT) {
-	      Reply("%d Can't open active\r\n", NNTP_TEMPERR_VAL);
+	      Reply("%d Can't open active\r\n", NNTP_ERR_UNAVAILABLE);
 	  } else {
 	      syswarn("%s cant fopen %s", Client.host, path);
-	      Reply("%d Can't open active\r\n", NNTP_TEMPERR_VAL);
+	      Reply("%d Can't open active\r\n", NNTP_ERR_UNAVAILABLE);
 	  }
 	  free(path);
 	  TMRstop(TMR_NEWNEWS);
diff -u -r inn-CURRENT-20061121/nnrpd/nnrpd.c inn-CURRENT/nnrpd/nnrpd.c
--- inn-CURRENT-20061121/nnrpd/nnrpd.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/nnrpd/nnrpd.c	2006-11-22 21:51:26.000000000 +0800
@@ -318,10 +318,10 @@
 {
     if (strcasecmp(av[0], "slave") == 0)
 	/* Somebody sends us this?  I don't believe it! */
-	Reply("%d Unsupported\r\n", NNTP_SLAVEOK_VAL);
+	Reply("%d Unsupported\r\n", NNTP_OK_EXTENSIONS);
     else
 	Reply("%d %s not implemented; try help\r\n",
-	    NNTP_BAD_COMMAND_VAL, av[0]);
+	    NNTP_ERR_COMMAND, av[0]);
 }
 
 
@@ -397,7 +397,7 @@
     if (getpeername(STDIN_FILENO, sac, &length) < 0) {
         if (!isatty(STDIN_FILENO)) {
 	    sysnotice("? cant getpeername");
-	    Printf("%d I can't get your name.  Goodbye.\r\n", NNTP_ACCESS_VAL);
+	    Printf("%d I can't get your name.  Goodbye.\r\n", NNTP_ERR_ACCESS);
 	    ExitWithStats(1, true);
 	}
         strlcpy(Client.host, "stdin", sizeof(Client.host));
@@ -424,7 +424,7 @@
 	if (getsockname(STDIN_FILENO, sas, &length) < 0) {
 	    sysnotice("%s can't getsockname", Client.host);
 	    Printf("%d Can't figure out where you connected to.  Goodbye\r\n",
-                   NNTP_ACCESS_VAL);
+                   NNTP_ERR_ACCESS);
 	    ExitWithStats(1, true);
 	}
 	HostErrorStr = default_host_error;
@@ -630,26 +630,26 @@
     val = true;
     if (SMsetup(SM_PREOPEN, (void *)&val) && !SMinit()) {
 	syslog(L_NOTICE, "cant initialize storage method, %s", SMerrorstr);
-	Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_TEMPERR_VAL);
+	Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_ERR_UNAVAILABLE);
 	ExitWithStats(1, true);
     }
     OVextra = overview_extra_fields();
     if (OVextra == NULL) {
 	/* overview_extra_fields should already have logged something
 	 * useful */
-	Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_TEMPERR_VAL);
+	Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_ERR_UNAVAILABLE);
 	ExitWithStats(1, true);
     }
     overhdr_xref = overview_index("Xref", OVextra);
     if (!OVopen(OV_READ)) {
 	/* This shouldn't really happen. */
 	syslog(L_NOTICE, "cant open overview %m");
-	Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_TEMPERR_VAL);
+	Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_ERR_UNAVAILABLE);
 	ExitWithStats(1, true);
     }
     if (!OVctl(OVCACHEKEEP, &val)) {
 	syslog(L_NOTICE, "cant enable overview cache %m");
-	Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_TEMPERR_VAL);
+	Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_ERR_UNAVAILABLE);
 	ExitWithStats(1, true);
     }
 }
@@ -945,7 +945,7 @@
     if (initialSSL) {
         tls_init();
         if (tls_start_servertls(0, 1) == -1) {
-            Reply("%d SSL connection failed\r\n", NNTP_STARTTLS_BAD_VAL);
+            Reply("%d SSL connection failed\r\n", NNTP_ERR_STARTTLS);
             ExitWithStats(1, false);
         }
         nnrpd_starttls_done = 1;
@@ -962,7 +962,7 @@
         else {
             if ((int)(load[0] + 0.5) > innconf->nnrpdloadlimit) {
                 syslog(L_NOTICE, "load %.2f > %ld", load[0], innconf->nnrpdloadlimit);
-                Reply("%d load at %.2f, try later\r\n", NNTP_GOODBYE_VAL,
+                Reply("%d load at %.2f, try later\r\n", NNTP_FAIL_TERMINATING,
                       load[0]);
                 ExitWithStats(1, true);
             }
@@ -977,7 +977,7 @@
     if (!PERMcanread && !PERMcanpost && !PERMneedauth) {
 	syslog(L_NOTICE, "%s no_permission", Client.host);
 	Printf("%d You have no permission to talk.  Goodbye.\r\n",
-	       NNTP_ACCESS_VAL);
+	       NNTP_ERR_ACCESS);
 	ExitWithStats(1, false);
     }
 
@@ -1046,13 +1046,13 @@
 
     if (PERMaccessconf) {
         Reply("%d %s InterNetNews NNRP server %s ready (%s).\r\n",
-	   PERMcanpost ? NNTP_POSTOK_VAL : NNTP_NOPOSTOK_VAL,
+	   PERMcanpost ? NNTP_OK_BANNER_POST : NNTP_OK_BANNER_NOPOST,
            PERMaccessconf->pathhost, INN_VERSION_STRING,
 	   PERMcanpost ? "posting ok" : "no posting");
 	clienttimeout = PERMaccessconf->clienttimeout;
     } else {
         Reply("%d %s InterNetNews NNRP server %s ready (%s).\r\n",
-	   PERMcanpost ? NNTP_POSTOK_VAL : NNTP_NOPOSTOK_VAL,
+	   PERMcanpost ? NNTP_OK_BANNER_POST : NNTP_OK_BANNER_NOPOST,
            innconf->pathhost, INN_VERSION_STRING,
 	   PERMcanpost ? "posting ok" : "no posting");
 	clienttimeout = innconf->clienttimeout;
@@ -1110,7 +1110,7 @@
 		}
 		/* FALLTHROUGH */		
 	    case RTlong:
-		Reply("%d Line too long\r\n", NNTP_BAD_COMMAND_VAL);
+		Reply("%d Line too long\r\n", NNTP_ERR_COMMAND);
 		continue;
 	    case RTeof:
 		/* Handled below. */
@@ -1132,7 +1132,7 @@
 		syslog(L_NOTICE, "%s unrecognized %.40s...", Client.host, buff);
 	    else
 		syslog(L_NOTICE, "%s unrecognized %s", Client.host, buff);
-	    Reply("%d What?\r\n", NNTP_BAD_COMMAND_VAL);
+	    Reply("%d What?\r\n", NNTP_ERR_COMMAND);
 	    continue;
 	}
 
@@ -1140,14 +1140,14 @@
 	if ((cp->Minac != CMDany && ac < cp->Minac)
 	 || (cp->Maxac != CMDany && ac > cp->Maxac)) {
 	    Reply("%d %s\r\n",
-		NNTP_SYNTAX_VAL,  cp->Help ? cp->Help : "Usage error");
+		NNTP_ERR_SYNTAX,  cp->Help ? cp->Help : "Usage error");
 	    continue;
 	}
 
 	/* Check permissions and dispatch. */
 	if (cp->Needauth && PERMneedauth) {
 	    Reply("%d Authentication required for command\r\n",
-		NNTP_AUTH_NEEDED_VAL);
+		NNTP_FAIL_AUTH_NEEDED);
 	    continue;
 	}
 	setproctitle("%s %s", Client.host, av[0]);
diff -u -r inn-CURRENT-20061121/nnrpd/perl.c inn-CURRENT/nnrpd/perl.c
--- inn-CURRENT-20061121/nnrpd/perl.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/nnrpd/perl.c	2006-11-22 21:51:25.000000000 +0800
@@ -233,7 +233,7 @@
 
   if (perl_get_cv("access", 0) == NULL) {
     syslog(L_ERROR, "Perl function access not defined");
-    Reply("%d Internal Error (3).  Goodbye\r\n", NNTP_ACCESS_VAL);
+    Reply("%d Internal Error (3).  Goodbye\r\n", NNTP_ERR_ACCESS);
     ExitWithStats(1, true);
   }
 
@@ -244,13 +244,13 @@
   if (rc == 0 ) { /* Error occured, same as checking $@ */
     syslog(L_ERROR, "Perl function access died: %s",
            SvPV(ERRSV, PL_na));
-    Reply("%d Internal Error (1).  Goodbye\r\n", NNTP_ACCESS_VAL);
+    Reply("%d Internal Error (1).  Goodbye\r\n", NNTP_ERR_ACCESS);
     ExitWithStats(1, true);
   }
 
   if ((rc % 2) != 0) {
     syslog(L_ERROR, "Perl function access returned an odd number of arguments: %i", rc);
-    Reply("%d Internal Error (2).  Goodbye\r\n", NNTP_ACCESS_VAL);
+    Reply("%d Internal Error (2).  Goodbye\r\n", NNTP_ERR_ACCESS);
     ExitWithStats(1, true);
   }
 
@@ -295,7 +295,7 @@
     
     if (perl_get_cv("auth_init", 0) == NULL) {
       syslog(L_ERROR, "Perl function auth_init not defined");
-      Reply("%d Internal Error (3).  Goodbye\r\n", NNTP_ACCESS_VAL);
+      Reply("%d Internal Error (3).  Goodbye\r\n", NNTP_ERR_ACCESS);
       ExitWithStats(1, true);
     }
 
@@ -307,7 +307,7 @@
     if (SvTRUE(ERRSV))     /* check $@ */ {
 	syslog(L_ERROR, "Perl function authenticate died: %s",
 	       SvPV(ERRSV, PL_na));
-	Reply("%d Internal Error (1).  Goodbye\r\n", NNTP_ACCESS_VAL);
+	Reply("%d Internal Error (1).  Goodbye\r\n", NNTP_ERR_ACCESS);
 	ExitWithStats(1, true);
     }
 
@@ -330,11 +330,11 @@
     int             code;
     
     if (!PerlFilterActive)
-        return NNTP_ACCESS_VAL;
+        return NNTP_ERR_ACCESS;
 
     if (perl_get_cv("authenticate", 0) == NULL) {
         syslog(L_ERROR, "Perl function authenticate not defined");
-        Reply("%d Internal Error (3).  Goodbye\r\n", NNTP_ACCESS_VAL);
+        Reply("%d Internal Error (3).  Goodbye\r\n", NNTP_ERR_ACCESS);
         ExitWithStats(1, true);
     }
 
@@ -358,13 +358,13 @@
     if (rc == 0 ) { /* Error occured, same as checking $@ */
 	syslog(L_ERROR, "Perl function authenticate died: %s",
 	       SvPV(ERRSV, PL_na));
-	Reply("%d Internal Error (1).  Goodbye\r\n", NNTP_ACCESS_VAL);
+	Reply("%d Internal Error (1).  Goodbye\r\n", NNTP_ERR_ACCESS);
 	ExitWithStats(1, false);
     }
 
     if ((rc != 3) && (rc != 2)) {
 	syslog(L_ERROR, "Perl function authenticate returned wrong number of results: %d", rc);
-	Reply("%d Internal Error (2).  Goodbye\r\n", NNTP_ACCESS_VAL);
+	Reply("%d Internal Error (2).  Goodbye\r\n", NNTP_ERR_ACCESS);
 	ExitWithStats(1, false);
     }
 
@@ -381,10 +381,10 @@
 
     code = POPi;
 
-    if ((code == NNTP_POSTOK_VAL) || (code == NNTP_NOPOSTOK_VAL))
-	code = PERMcanpost ? NNTP_POSTOK_VAL : NNTP_NOPOSTOK_VAL;
+    if ((code == NNTP_OK_BANNER_POST) || (code == NNTP_OK_BANNER_NOPOST))
+	code = PERMcanpost ? NNTP_OK_BANNER_POST : NNTP_OK_BANNER_NOPOST;
 
-    if (code == NNTP_AUTH_NEEDED_VAL) 
+    if (code == NNTP_FAIL_AUTH_NEEDED) 
 	PERMneedauth = true;
 
     hv_undef(attribs);
diff -u -r inn-CURRENT-20061121/nnrpd/perm.c inn-CURRENT/nnrpd/perm.c
--- inn-CURRENT-20061121/nnrpd/perm.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/nnrpd/perm.c	2006-11-22 21:51:26.000000000 +0800
@@ -578,7 +578,7 @@
 {
     syslog(L_ERROR, "%s syntax error in %s(%d), %s", Client.host,
       f->filename, f->lineno, err);
-    Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_TEMPERR_VAL);
+    Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_ERR_UNAVAILABLE);
     ExitWithStats(1, true);
 }
 
@@ -1095,7 +1095,7 @@
     cf		= xmalloc(sizeof(CONFCHAIN));
     if ((cf->f = CONFfopen(filename)) == NULL) {
 	syslog(L_ERROR, "%s cannot open %s: %m", Client.host, filename);
-	Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_TEMPERR_VAL);
+	Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_ERR_UNAVAILABLE);
 	ExitWithStats(1, true);
     }
     cf->parent	= 0;
@@ -1401,7 +1401,7 @@
 	/* no one can talk, empty file */
 	syslog(L_NOTICE, "%s no_permission", Client.host);
 	Printf("%d You have no permission to talk.  Goodbye.\r\n",
-	  NNTP_ACCESS_VAL);
+	  NNTP_ERR_ACCESS);
 	ExitWithStats(1, true);
     }
 
@@ -1434,7 +1434,7 @@
 	/* couldn't resolve the user. */
 	syslog(L_NOTICE, "%s no_user", Client.host);
 	Printf("%d Could not get your access name.  Goodbye.\r\n",
-	  NNTP_ACCESS_VAL);
+	  NNTP_ERR_ACCESS);
 	ExitWithStats(1, true);
     } else {
 	PERMneedauth = true;
@@ -1577,7 +1577,7 @@
         vector_free(access_vec);
       } else {
         syslog(L_ERROR, "No script specified in perl_access method.\n");
-        Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_TEMPERR_VAL);
+        Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_ERR_UNAVAILABLE);
         ExitWithStats(1, true);
       }
       free(cpp);
@@ -1612,7 +1612,7 @@
             vector_free(access_vec);
         } else {
             syslog(L_ERROR, "No script specified in python_access method.\n");
-            Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_TEMPERR_VAL);
+            Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_ERR_UNAVAILABLE);
             ExitWithStats(1, true);
         }
         free(cpp);
@@ -1655,7 +1655,7 @@
 	    syslog(L_ERROR, "%s rejected by rule (%s)",
 		Client.host, access_realms[i]->rejectwith);
 	    Reply("%d Permission denied:  %s\r\n",
-		NNTP_ACCESS_VAL, access_realms[i]->rejectwith);
+		NNTP_ERR_ACCESS, access_realms[i]->rejectwith);
 	    ExitWithStats(1, true);
 	}
 	if (access_realms[i]->read) {
@@ -1682,7 +1682,7 @@
 	    if (PERMaccessconf->domain == NULL) {
 		syslog(L_ERROR, "%s virtualhost needs domain parameter(%s)",
 		    Client.host, PERMaccessconf->name);
-		Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_TEMPERR_VAL);
+		Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_ERR_UNAVAILABLE);
 		ExitWithStats(1, true);
 	    }
 	    if (VirtualPath)
@@ -1693,7 +1693,7 @@
 		if (innconf->domain != NULL && strcmp(innconf->domain, PERMaccessconf->domain) == 0) {
 		    syslog(L_ERROR, "%s domain parameter(%s) in readers.conf must be different from the one in inn.conf",
 			Client.host, PERMaccessconf->name);
-		    Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_TEMPERR_VAL);
+		    Reply("%d NNTP server unavailable. Try later.\r\n", NNTP_ERR_UNAVAILABLE);
 		    ExitWithStats(1, true);
 		}
                 VirtualPath = concat(PERMaccessconf->domain, "!", (char *) 0);
@@ -1972,7 +1972,7 @@
           
                 newUser[0] = '\0';
                 code = perlAuthenticate(username, password, errorstr, newUser);
-                if (code == NNTP_AUTH_OK_VAL) {
+                if (code == NNTP_OK_AUTHINFO) {
                     if (newUser[0] != '\0')
                         user = xstrdup(newUser);
                     else
@@ -2006,7 +2006,7 @@
                 code = PY_authenticate(script_path, username, password,
                                        errorstr, newUser);
                 free(script_path);
-                if (code == NNTP_AUTH_OK_VAL) {
+                if (code == NNTP_OK_AUTHINFO) {
                     if (newUser[0] != '\0')
                         user = xstrdup(newUser);
                     else
diff -u -r inn-CURRENT-20061121/nnrpd/post.c inn-CURRENT/nnrpd/post.c
--- inn-CURRENT-20061121/nnrpd/post.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/nnrpd/post.c	2006-11-22 21:51:25.000000000 +0800
@@ -1107,7 +1107,7 @@
 
     /* Offer article to server. */
     i = OfferArticle(buff, (int)sizeof buff, FromServer, ToServer);
-    if (i == NNTP_AUTH_NEEDED_VAL) {
+    if (i == NNTP_FAIL_AUTH_NEEDED) {
         /* Send authorization. */
         if (NNTPsendpassword(PERMaccessconf->nnrpdposthost, FromServer, ToServer) < 0) {
             snprintf(Error, sizeof(Error), "Can't authorize with %s",
@@ -1116,12 +1116,12 @@
         }
         i = OfferArticle(buff, (int)sizeof buff, FromServer, ToServer);
     }
-    if (i != NNTP_SENDIT_VAL) {
+    if (i != NNTP_CONT_IHAVE) {
         strlcpy(Error, buff, sizeof(Error));
         SendQuit(FromServer, ToServer);
-	if (i != NNTP_HAVEIT_VAL)
+	if (i != NNTP_FAIL_IHAVE_REFUSE)
 	    return Spoolit(article, Error);
-	if (i == NNTP_REJECTIT_VAL || i == NNTP_RESENDIT_VAL) {
+	if (i == NNTP_FAIL_IHAVE_REJECT || i == NNTP_FAIL_IHAVE_DEFER) {
 	    *permanent = false;
 	}
         return Error;
@@ -1179,13 +1179,13 @@
     }
 
     /* Did the server want the article? */
-    if ((i = atoi(buff)) != NNTP_TOOKIT_VAL) {
+    if ((i = atoi(buff)) != NNTP_OK_IHAVE) {
 	strlcpy(Error, buff, sizeof(Error));
 	SendQuit(FromServer, ToServer);
 	syslog(L_TRACE, "%s server rejects %s from %s", Client.host, HDR(HDR__MESSAGEID), HDR(HDR__PATH));
-	if (i != NNTP_REJECTIT_VAL && i != NNTP_HAVEIT_VAL)
+	if (i != NNTP_FAIL_IHAVE_REJECT && i != NNTP_FAIL_IHAVE_REFUSE)
 	    return Spoolit(article, Error);
-	if (i == NNTP_REJECTIT_VAL || i == NNTP_RESENDIT_VAL) {
+	if (i == NNTP_FAIL_IHAVE_REJECT || i == NNTP_FAIL_IHAVE_DEFER) {
 	    *permanent = false;
 	}
 	return Error;
diff -u -r inn-CURRENT-20061121/nnrpd/python.c inn-CURRENT/nnrpd/python.c
--- inn-CURRENT-20061121/nnrpd/python.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/nnrpd/python.c	2006-11-22 21:51:26.000000000 +0800
@@ -157,7 +157,7 @@
         || ((PyTuple_Size(result) != 2) && (PyTuple_Size(result) != 3)))
     {
         syslog(L_ERROR, "python authenticate method returned wrong result");
-	Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ACCESS_VAL);
+	Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
 	ExitWithStats(1, true);
     }
 
@@ -168,7 +168,7 @@
     if (!PyInt_Check(item))
     {
         syslog(L_ERROR, "python authenticate method returned bad NNTP response code");
-	Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ACCESS_VAL);
+	Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
 	ExitWithStats(1, true);
     }
 
@@ -182,7 +182,7 @@
     if (!PyString_Check(item))
     {
         syslog(L_ERROR, "python authenticate method returned bad error string");
-	Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ACCESS_VAL);
+	Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
 	ExitWithStats(1, true);
     }
 
@@ -198,7 +198,7 @@
         /* Check the item */
         if (!PyString_Check(item)) {
             syslog(L_ERROR, "python authenticate method returned bad username string");
-            Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ACCESS_VAL);
+            Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
             ExitWithStats(1, true);
         }
 
@@ -242,7 +242,7 @@
     /* Exit if access method is not defined */
     if (proc == NULL) {
         syslog(L_ERROR, "python access method not defined");
- 	Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ACCESS_VAL);
+ 	Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
  	ExitWithStats(1, true);
      }
  
@@ -289,7 +289,7 @@
     /* Check the response */
     if (result == NULL || result == Py_None || !PyDict_Check(result)) {
         syslog(L_ERROR, "python access method returned wrong result - expected a dictionary");
-	Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ACCESS_VAL);
+	Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
 	ExitWithStats(1, true);
      }
  
@@ -301,12 +301,12 @@
     while(PyDict_Next(result, &i, &key, &value)) {
         if (!PyString_Check(key)) {
             syslog(L_ERROR, "python access method return dictionary key %i not a string", i);
-            Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ACCESS_VAL);
+            Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
             ExitWithStats(1, false);
         }
         if (!PyString_Check(value)) {
             syslog(L_ERROR, "python access method return dictionary value %i not a string", i);
-            Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ACCESS_VAL);
+            Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
             ExitWithStats(1, false);
         }
         
@@ -426,7 +426,7 @@
     if (result == NULL || (result != Py_None && !PyString_Check(result)))
     {
         syslog(L_ERROR, "python dyanmic method (%s access) returned wrong result", PostFlag ? "post" : "read");
-	Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ACCESS_VAL);
+	Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
 	ExitWithStats(1, false);
     }
 
@@ -706,7 +706,7 @@
         /* See if nnrpd auth object is defined in auth module */
         if (PYAuthObject == NULL) {
             syslog(L_ERROR, "python auth object is not defined");
-            Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ACCESS_VAL);
+            Reply("%d Internal Error (7).  Goodbye\r\n", NNTP_ERR_ACCESS);
             PY_close_python();
             ExitWithStats(1, false);
         } else {
diff -u -r inn-CURRENT-20061121/nnrpd/sasl.c inn-CURRENT/nnrpd/sasl.c
--- inn-CURRENT-20061121/nnrpd/sasl.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/nnrpd/sasl.c	2006-11-22 21:51:25.000000000 +0800
@@ -40,7 +40,7 @@
     int r = SASL_OK;
 
     if (ac < 3 || ac > 4) {
-	Reply("%d AUTHINFO SASL <MECH> [<INIT-RESP]>\r\n", NNTP_BAD_COMMAND_VAL);
+	Reply("%d AUTHINFO SASL <MECH> [<INIT-RESP]>\r\n", NNTP_ERR_COMMAND);
 	return;
     }
 
@@ -78,7 +78,7 @@
 	if (r != SASL_CONTINUE) break;
 	    
 	/* send the challenge to the client */
-	Reply("%d %s\r\n", NNTP_AUTH_SASL_CHAL_VAL,
+	Reply("%d %s\r\n", NNTP_CONT_SASL,
 	      serveroutlen ? base64 : "=");
 	fflush(stdout);
 
@@ -109,7 +109,7 @@
 
 	/* check if client cancelled */
 	if (strcmp(clientin, "*") == 0) {
-	    Reply("%d Client cancelled authentication\r\n", NNTP_AUTH_BAD_VAL);
+	    Reply("%d Client cancelled authentication\r\n", NNTP_FAIL_AUTHINFO_BAD);
 	    return;
 	}
 
@@ -152,9 +152,9 @@
 	syslog(L_NOTICE, "%s user %s", Client.host, PERMuser);
 
 	if (serveroutlen)
-	    Reply("%d %s\r\n", NNTP_AUTH_SASL_OK_VAL, base64);
+	    Reply("%d %s\r\n", NNTP_OK_SASL, base64);
 	else
-	    Reply("%d Authentication succeeded\r\n", NNTP_AUTH_OK_VAL);
+	    Reply("%d Authentication succeeded\r\n", NNTP_OK_AUTHINFO);
 
 	/* save info about the negotiated security layer for I/O functions */
 	sasl_ssf = *ssfp;
@@ -170,17 +170,17 @@
 
 	switch (r) {
 	case SASL_BADPROT:
-	    resp_code = NNTP_AUTH_REJECT_VAL;
+	    resp_code = NNTP_FAIL_AUTHINFO_REJECT;
 	    break;
 	case SASL_NOMECH:
 	case SASL_TOOWEAK:
-	    resp_code = NNTP_SYNTAX_VAL;
+	    resp_code = NNTP_ERR_SYNTAX;
 	    break;
 	case SASL_ENCRYPT:
-	    resp_code = NNTP_STARTTLS_DONE_VAL;
+	    resp_code = NNTP_FAIL_STARTTLS;
 	    break;
 	default:
-	    resp_code = NNTP_AUTH_BAD_VAL;
+	    resp_code = NNTP_FAIL_AUTHINFO_BAD;
 	    break;
 	}
 
diff -u -r inn-CURRENT-20061121/nnrpd/tls.c inn-CURRENT/nnrpd/tls.c
--- inn-CURRENT-20061121/nnrpd/tls.c	2006-11-21 18:04:08.000000000 +0800
+++ inn-CURRENT/nnrpd/tls.c	2006-11-22 21:51:26.000000000 +0800
@@ -527,7 +527,7 @@
 				       innconf->tlscertfile,
 				       innconf->tlskeyfile);
     if (ssl_result == -1) {
-        Reply("%d Error initializing TLS\r\n", NNTP_STARTTLS_BAD_VAL);
+        Reply("%d Error initializing TLS\r\n", NNTP_ERR_STARTTLS);
         syslog(L_ERROR, "error initializing TLS: "
                "[CA_file: %s] [CA_path: %s] [cert_file: %s] [key_file: %s]",
                innconf->tlscafile, innconf->tlscapath,


More information about the inn-workers mailing list