#include "config.h"#include "defines.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#include <time.h>#include <errno.h>#include <sys/stat.h>#include <sys/types.h>#include <sys/time.h>#include <sys/socket.h>#include <netdb.h>#include <unistd.h>#include <netinet/in.h>#include <arpa/inet.h>#include <pthread.h>#include "cf_pthread.h"#include "hashlib.h"#include "utils.h"#include "configparser.h"#include "readline.h"#include "fo_server.h"#include "charconvert.h"#include "serverlib.h"Go to the source code of this file.
Defines | |
| #define | flt_nntp_syntax_error() writen(sock,"501 command syntax error\015\012",26) |
| #define | flt_nntp_cleanup_req() |
| #define | CtoI(n) (n-'0') |
| #define | days_in_year(y) ((y) % 4 ? 365 : (y) % 100 ? 366 : (y) % 400 ? 365 : 366) |
| #define | flt_nntp_is_delim(c) (isspace(c) || (c) == ':' || (c) == '=') |
Functions | |
| u_char * | html_decode (const u_char *str) |
| int | flt_nntp_tokenize (u_char *line, u_char ***tokens) |
| time_t | flt_nntp_parse_date (u_char *t1, u_char *t2) |
| int | flt_nntp_set_us_up_the_socket (struct sockaddr_in *addr) |
| int | flt_nntp_get_article_pointer (t_thread **t, t_posting **p, long *anum, long num) |
| int | flt_nntp_count (void) |
| long | flt_nntp_count_newlines (const t_posting *p1) |
| void | flt_nntp_send_body (const t_thread *t, const t_posting *p, int sock, int dot) |
| void | flt_nntp_send_headers (const t_thread *t, const t_posting *p1, int sock, long anum, int newline) |
| void | send_new_news (int sock, time_t date) |
| void | flt_nntp_handle_request (int sock) |
| int | flt_nntp_run (int main_sock) |
| int | flt_nntp_handle_command (t_configfile *cf, t_conf_opt *opt, u_char **args, int argnum) |
| void | flt_nntp_cleanup (void) |
Variables | |
| sockaddr_in * | NNTP_Addr = NULL |
| t_conf_opt | flt_nntp_config [] |
| t_handler_config | flt_nntp_handlers [] |
| t_module_config | flt_nntp |
Define posting handling
Implement XOVER
Definition in file flt_nntp.c.
|
|
same as atoi() just for a u_char, not for a u_char * Definition at line 67 of file flt_nntp.c. |
|
|
calculate how many days the year has Definition at line 70 of file flt_nntp.c. |
|
|
Value: do { \ while(tnum--) free(tokens[tnum]); \ free(tokens); \ free(line); \ } while(0) Definition at line 60 of file flt_nntp.c. |
|
|
check if character is an delimiter Definition at line 73 of file flt_nntp.c. |
|
|
I am lazy... Definition at line 57 of file flt_nntp.c. |
|
|
This function cleans up the plugin (e.g. it frees allocated memory, it closes the server socket, etc) Definition at line 1039 of file flt_nntp.c. |
|
|
This function counts the existing articles
Definition at line 361 of file flt_nntp.c. |
|
|
This function counts the newlines in a posting text
Definition at line 388 of file flt_nntp.c. |
|
||||||||||||||||||||
|
This function gets the article pointer specified by the article number
Definition at line 295 of file flt_nntp.c. |
|
||||||||||||||||||||
|
This function handles a configuration command
Definition at line 1004 of file flt_nntp.c. |
|
|
This function handles a session
Definition at line 616 of file flt_nntp.c. |
|
||||||||||||
|
This function parses a RFC977 date
Definition at line 172 of file flt_nntp.c. |
|
|
This function creates the server socket and initializes the plugin
Definition at line 967 of file flt_nntp.c. |
|
||||||||||||||||||||
|
This function prepares and sends a posting body
Definition at line 404 of file flt_nntp.c. |
|
||||||||||||||||||||||||
|
This function sends the headers of an article
Definition at line 496 of file flt_nntp.c. |
|
|
This function creates the socket the server is listening to
Definition at line 243 of file flt_nntp.c. |
|
||||||||||||
|
This function tokenizes a NNTP command line read from the client
Definition at line 136 of file flt_nntp.c. |
|
||||||||||||
|
This function sends the news specified by a NEWNEWS command
Definition at line 579 of file flt_nntp.c. |
|
|
Initial value: {
flt_nntp_config,
flt_nntp_handlers,
NULL,
NULL,
NULL,
flt_nntp_cleanup
}
Definition at line 1069 of file flt_nntp.c. |
|
|
Initial value: {
{ "NNTPPort", flt_nntp_handle_command, NULL },
{ "NNTPInterface", flt_nntp_handle_command, NULL },
{ "NNTPHost", flt_nntp_handle_command, NULL },
{ "NNTPMayPost", flt_nntp_handle_command, NULL },
{ "NNTPGroupName", flt_nntp_handle_command, NULL },
{ NULL, NULL, NULL }
}
Definition at line 1049 of file flt_nntp.c. |
|
|
Initial value: {
{ INIT_HANDLER, flt_nntp_run },
{ 0, NULL }
}
Definition at line 1061 of file flt_nntp.c. |
|
|
The address structure the server listens on Definition at line 82 of file flt_nntp.c. |
1.3.5