1 /* 2 * Response codes for NNTP server 3 * 4 * @(#)nntp.h 1.7 (Berkeley) 1/11/88 5 * 6 * First digit: 7 * 8 * 1xx Informative message 9 * 2xx Command ok 10 * 3xx Command ok so far, continue 11 * 4xx Command was correct, but couldn't be performed 12 * for some specified reason. 13 * 5xx Command unimplemented, incorrect, or a 14 * program error has occured. 15 * 16 * Second digit: 17 * 18 * x0x Connection, setup, miscellaneous 19 * x1x Newsgroup selection 20 * x2x Article selection 21 * x3x Distribution 22 * x4x Posting 23 */ 24 25 #ifndef _NN_NNTP_H 26 #define _NN_NNTP_H 1 27 28 #define CHAR_INF '1' 29 #define CHAR_OK '2' 30 #define CHAR_CONT '3' 31 #define CHAR_ERR '4' 32 #define CHAR_FATAL '5' 33 34 #define INF_HELP 100 /* Help text on way */ 35 #define INF_DEBUG 199 /* Debug output */ 36 37 #define OK_CANPOST 200 /* Hello; you can post */ 38 #define OK_NOPOST 201 /* Hello; you can't post */ 39 #define OK_SLAVE 202 /* Slave status noted */ 40 #define OK_GOODBYE 205 /* Closing connection */ 41 #define OK_GROUP 211 /* Group selected */ 42 #define OK_GROUPS 215 /* Newsgroups follow */ 43 #define OK_ARTICLE 220 /* Article (head & body) follows */ 44 #define OK_HEAD 221 /* Head follows */ 45 #define OK_BODY 222 /* Body follows */ 46 #define OK_NOTEXT 223 /* No text sent -- stat, next, last */ 47 #define OK_NOV 224 /* Nov data follows */ 48 #define OK_NEWNEWS 230 /* New articles by message-id follow */ 49 #define OK_NEWGROUPS 231 /* New newsgroups follow */ 50 #define OK_XFERED 235 /* Article transferred successfully */ 51 #define OK_POSTED 240 /* Article posted successfully */ 52 #define OK_AUTH 281 /* Authentication completed OK */ 53 54 #define CONT_XFER 335 /* Continue to send article */ 55 #define CONT_POST 340 /* Continue to post article */ 56 #define OK_NEEDPASS 381 /* Authentication username ok, need passwd */ 57 58 #define ERR_GOODBYE 400 /* Have to hang up for some reason */ 59 #define ERR_NOGROUP 411 /* No such newsgroup */ 60 #define ERR_NCING 412 /* Not currently in newsgroup */ 61 #define ERR_NOCRNT 420 /* No current article selected */ 62 #define ERR_NONEXT 421 /* No next article in this group */ 63 #define ERR_NOPREV 422 /* No previous article in this group */ 64 #define ERR_NOARTIG 423 /* No such article in this group */ 65 #define ERR_NOART 430 /* No such article at all */ 66 #define ERR_GOTIT 435 /* Already got that article, don't send */ 67 #define ERR_XFERFAIL 436 /* Transfer failed */ 68 #define ERR_XFERRJCT 437 /* Article rejected, don't resend */ 69 #define ERR_NOPOST 440 /* Posting not allowed */ 70 #define ERR_POSTFAIL 441 /* Posting failed */ 71 #define ERR_NEEDAUTH 480 /* need to authenticate with "authinfo" */ 72 73 #define ERR_COMMAND 500 /* Command not recognized */ 74 #define ERR_CMDSYN 501 /* Command syntax error */ 75 #define ERR_ACCESS 502 /* Access to server denied */ 76 #define ERR_FAULT 503 /* Program fault, command not performed */ 77 78 /* RFC 977 defines this; don't change it. */ 79 80 #define NNTP_STRLEN 512 81 82 void nntp_check(void); 83 int nntp_set_group(group_header *); 84 FILE *nntp_get_newsgroups(void); 85 FILE *nntp_get_article(article_number, int); 86 char *nntp_get_filename(article_number, group_header *); 87 void nntp_close_server(void); 88 void nntp_cleanup(void); 89 int nntp_post(char *temp_file); 90 91 #ifdef NOV 92 struct novgroup *nntp_get_overview(group_header *, article_number, article_number); 93 FILE *nntp_fopen_list(char *); 94 char *nntp_fgets(char *, int); 95 #else 96 int nntp_get_active(void); 97 article_number *nntp_get_article_list(group_header *); 98 #endif 99 100 #endif /* _NN_NNTP_H */ 101