head 1.14;
access;
symbols
SOURCE_RESTRUCTURING_BEFORE:1.13
LMTP2NNTP_1_2a1:1.13
LMTP2NNTP_1_1_1:1.13
LMTP2NNTP_1_1_0:1.13
LMTP2NNTP_1_1b4:1.13
LMTP2NNTP_1_1b3:1.13
LMTP2NNTP_1_1b2:1.13
LMTP2NNTP_1_1b1:1.12
LMTP2NNTP_1_0_0:1.11
LMTP2NNTP_0_9_7:1.11
LMTP2NNTP_0_9_6:1.11
LMTP2NNTP_0_9_5:1.11
LMTP2NNTP_0_9_4:1.7
LMTP2NNTP_0_9_3:1.7
LMTP2NNTP_0_9_2:1.7
LMTP2NNTP_0_9_1:1.6
LMTP2NNTP_0_9_0:1.6;
locks; strict;
comment @ * @;
1.14
date 2001.12.31.11.09.53; author thl; state dead;
branches;
next 1.13;
1.13
date 2001.10.15.12.48.57; author thl; state Exp;
branches;
next 1.12;
1.12
date 2001.10.09.12.08.59; author rse; state Exp;
branches;
next 1.11;
1.11
date 2001.09.10.14.11.33; author thl; state Exp;
branches;
next 1.10;
1.10
date 2001.09.10.12.48.14; author thl; state Exp;
branches;
next 1.9;
1.9
date 2001.09.07.15.02.08; author thl; state Exp;
branches;
next 1.8;
1.8
date 2001.09.04.09.46.06; author rse; state Exp;
branches;
next 1.7;
1.7
date 2001.08.23.07.52.25; author thl; state Exp;
branches;
next 1.6;
1.6
date 2001.08.16.15.00.50; author thl; state Exp;
branches;
next 1.5;
1.5
date 2001.08.14.14.42.41; author thl; state Exp;
branches;
next 1.4;
1.4
date 2001.08.13.15.16.32; author thl; state Exp;
branches;
next 1.3;
1.3
date 2001.08.13.06.41.42; author thl; state Exp;
branches;
next 1.2;
1.2
date 2001.08.07.09.05.56; author thl; state Exp;
branches;
next 1.1;
1.1
date 2001.08.01.07.04.13; author thl; state Exp;
branches;
next ;
desc
@@
1.14
log
@Mega-Commit: Finally restructure the lmtp2nntp source tree in order to clean
it up. We especially use a consistent prefix for all inlined sources.
@
text
@/*
** Copyright (c) 2001 The OSSP Project
** Copyright (c) 2001 Cable & Wireless Deutschland
**
** This file is part of OSSP lmtp2nntp, an LMTP speaking local
** mailer which forwards mails as Usenet news articles via NNTP.
** It can be found at http://www.ossp.org/pkg/lmtp2nntp/.
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version
** 2.0 of the License, or (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this file; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
** USA, or contact the OSSP project .
**
** nntp.h: Network News Transfer Protocol (NNTP) client library (API)
*/
#ifndef __NNTP_H__
#define __NNTP_H__
#include
#include
#include
#include
#include "msg.h"
struct nntp_st;
typedef struct nntp_st nntp_t;
typedef struct {
void *ctx;
ssize_t (*read)(void *, void *, size_t);
ssize_t (*write)(void *, const void *, size_t);
} nntp_io_t;
typedef enum {
NNTP_OK,
NNTP_EOF,
NNTP_DEFER,
NNTP_FAKE,
NNTP_ERR_SYSTEM,
NNTP_ERR_ARG,
NNTP_ERR_OVERFLOW,
NNTP_ERR_DELIVERY,
NNTP_ERR_INIT,
NNTP_ERR_UNKNOWN
} nntp_rc_t;
typedef struct {
int fd;
} nntp_fd_t;
nntp_t *nntp_create (nntp_io_t *);
nntp_rc_t nntp_init (nntp_t *);
void nntp_destroy (nntp_t *);
nntp_rc_t nntp_readline (nntp_t *, char *, size_t);
nntp_rc_t nntp_writeline(nntp_t *, char *);
nntp_rc_t nntp_post (nntp_t *, msg_t *msg);
nntp_rc_t nntp_feed (nntp_t *, msg_t *msg);
char *nntp_lastresp (nntp_t *nntp);
char *nntp_error (nntp_rc_t);
ssize_t nntp_fd_read (void *, void *, size_t);
ssize_t nntp_fd_write (void *, const void *, size_t);
#endif /* __NNTP_H__ */
@
1.13
log
@Remember text from last NNTP error message and pass it back to LMTP
@
text
@@
1.12
log
@- Change NNTP library to fully use OSSP SA.
- Removed timeout handling from NNTP library and use SA timeouts instead.
@
text
@d69 1
@
1.11
log
@fake mode now supports NTTP-less setups
@
text
@d41 2
a42 3
int (*select)(void *, int, fd_set *, fd_set *, fd_set *, struct timeval *);
ssize_t (*read)(void *, int, void *, size_t);
ssize_t (*write)(void *, int, const void *, size_t);
a47 1
NNTP_TIMEOUT,
d58 5
a62 2
nntp_t *nntp_create (int, int, nntp_io_t *);
nntp_rc_t nntp_timeout (nntp_t *nntp, long);
d70 2
@
1.10
log
@POST really should be called DELIVERY as we support posting and feeding
@
text
@d51 1
@
1.9
log
@Replace ad-hoc tracing with L2_LEVEL_TRACE based approach.
@
text
@d54 1
a54 1
NNTP_ERR_POST,
@
1.8
log
@Finally apply GNU General Public License (GPL) to OSSP lmtp2nntp.
@
text
@d40 4
a43 3
int (*select)(int, fd_set *, fd_set *, fd_set *, struct timeval *);
ssize_t (*read)(int, void *, size_t);
ssize_t (*write)(int, const void *, size_t);
@
1.7
log
@added NNTP_ERR_UNKNOWN which is useful for injecting artifical errors when debugging
@
text
@d2 24
a25 27
* nntp.h: NNTP library (API definition)
*
* Copyright (c) 2001 The OSSP Project (http://www.ossp.org/)
* Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/)
*
* This file is part of OSSP nntp2nntp, an NNTP speaking local
* mailer which forwards mails as Usenet news articles via NNTP.
* It can be found at http://www.ossp.com/pkg/nntp2nntp/.
*
* Permission to use, copy, modify, and distribute this software for
* any purpose with or without fee is hereby granted, provided that
* the above copyright notice and this permission notice appear in all
* copies.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
@
1.6
log
@INN kludge, IHAVE feeding, -d deliverymode command line option, DEFER handing
@
text
@d57 2
a58 1
NNTP_ERR_INIT
@
1.5
log
@connected LMTP and NNTP side, now featuring all three -g groupmodes, added post1000 articles burn-in
@
text
@d52 1
a56 1
NNTP_ERR_POSTDEFER,
d67 1
@
1.4
log
@first successful posting
@
text
@d67 1
a67 1
char *nntp_error (nntp_t *, nntp_rc_t);
@
1.3
log
@moved message issues from lmtp2nntp.[ch] and nntp.[ch] into separate new file msg.[ch]
@
text
@d55 1
a55 1
NNTP_ERR_POSTPERM,
@
1.2
log
@lmtp/nntp joined at command args and lhlo
@
text
@d37 1
d55 2
d66 1
a66 1
nntp_rc_t nntp_post (nntp_t *, char *);
@
1.1
log
@first client using sock.[ch]. Just connects, reads, writes and quits
@
text
@d42 1
d50 1
d53 2
a54 1
NNTP_ERR_OVERFLOW
d58 2
@