Merge branch 'from-hg'

This commit is contained in:
Robert James Clay
2011-08-16 19:05:23 -04:00
682 changed files with 5860 additions and 7741 deletions

View File

@@ -1,6 +1,6 @@
# Makefile for mbcico.
# Copyright (c) 1998, 2001 by M. Broek.
# $Id$
# $Id: Makefile,v 1.46 2007/05/27 12:50:47 mbse Exp $
include ../Makefile.global

View File

@@ -1,4 +1,4 @@
$Id$
$Id: README,v 1.2 2004/01/11 13:01:43 mbroek Exp $
This is the README file for mbcico, the fidonet mailer for MBSE BBS.

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: answer.c,v 1.15 2005/10/16 11:37:54 mbse Exp $
* Purpose ...............: Fidonet mailer - awnser a call
*
*****************************************************************************

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: atoul.c,v 1.6 2005/10/11 20:49:46 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,7 +1,7 @@
#ifndef _ATOUL_H
#define _ATOUL_H
/* $Id$ */
/* $Id: atoul.h,v 1.2 2005/10/11 20:49:46 mbse Exp $ */
unsigned int atoul(char *);

View File

@@ -1,11 +1,10 @@
/*****************************************************************************
*
* $Id$
* Purpose .................: Fidonet binkp protocol
* Binkp protocol copyright : Dima Maloff.
*
*****************************************************************************
* Copyright (C) 1997-2007
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -72,7 +71,7 @@ extern char *tempinbound;
extern char *ttystat[];
extern int Loaded;
extern pid_t mypid;
extern struct sockaddr_in peeraddr;
extern struct sockaddr_in peeraddr4;
extern int most_debug;
extern int laststat;
extern int crashme;
@@ -693,7 +692,7 @@ SM_STATE(WaitConn)
SM_ERROR;
}
if (!CFG.NoMD5 && ((bp.MD_Challenge = MD_getChallenge(NULL, &peeraddr)) != NULL)) {
if (!CFG.NoMD5 && ((bp.MD_Challenge = MD_getChallenge(NULL, &peeraddr4)) != NULL)) {
/*
* Answering site MUST send CRAM message as very first M_NUL
*/
@@ -1807,7 +1806,7 @@ int binkp_send_frame(int cmd, char *buf, int len)
unsigned short header = 0;
int rc, id;
#ifdef HAVE_ZLIB_H
int rcz, last;
int rcz;
uLongf zlen;
Bytef *zbuf;
@@ -1834,7 +1833,6 @@ int binkp_send_frame(int cmd, char *buf, int len)
}
#ifdef HAVE_ZLIB_H
last = bp.cmpblksize;
/*
* Only use compression for DATA blocks larger then 20 bytes.
* Also, don't send PLZ blocks if GZ or BZ2 mode is active.
@@ -2434,7 +2432,7 @@ int binkp_process_messages(void)
the_queue *tmpq, *oldq;
binkp_list *tmp;
file_list *tsl;
int Found, rmode;
int Found;
char *lname, *ropts;
time_t ltime;
int lsize, loffs;
@@ -2447,20 +2445,13 @@ int binkp_process_messages(void)
for (tmpq = tql; tmpq; tmpq = tmpq->next) {
Syslog('+', "Binkp: %s \"%s\"", bstate[tmpq->cmd], printable(tmpq->data, 0));
if (tmpq->cmd == MM_GET) {
rmode = CompNone;
snprintf(lname, 512, "%s", strtok(tmpq->data, " \n\r"));
lsize = atoi(strtok(NULL, " \n\r"));
ltime = atoi(strtok(NULL, " \n\r"));
loffs = atoi(strtok(NULL, " \n\r"));
snprintf(ropts, 512, "%s", printable(strtok(NULL, " \n\r\0"), 0));
Syslog('b', "Binkp: m_file options \"%s\"", ropts);
if (strcmp((char *)"GZ", ropts) == 0)
rmode = CompGZ;
else if (strcmp((char *)"BZ2", ropts) == 0)
rmode = CompBZ2;
else
if (strcmp((char *)"NZ", ropts) == 0) {
rmode = CompNone;
if (strcmp((char *)"NZ", ropts) == 0) {
#ifdef HAVE_ZLIB_H
bp.GZwe = bp.GZthey = No;
#endif

View File

@@ -2,7 +2,7 @@
#define _BINKP_H
/* $Id$ */
/* $Id: binkp.h,v 1.11 2005/09/12 13:47:09 mbse Exp $ */
/*

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: bopenfile.c,v 1.4 2008/11/26 22:01:01 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,4 +1,4 @@
/* $Id$ */
/* $Id: bopenfile.h,v 1.1 2005/09/12 13:47:09 mbse Exp $ */
#ifndef _BOPENFILE_H
#define _BOPENFILE_H

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: call.c,v 1.39 2005/09/12 13:47:09 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: callstat.c,v 1.13 2007/08/26 12:21:15 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,4 +1,4 @@
/* $Id$ */
/* $Id: callstat.h,v 1.4 2005/10/16 12:13:20 mbse Exp $ */
#ifndef CALLSTAT_H
#define CALLSTAT_H

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id$
* Purpose ...............: Fidonet mailer - modem chat
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -146,7 +145,7 @@ void almhdl(int sig)
int expect_str(int, int, char *);
int expect_str(int timeout, int aftermode, char *Phone)
{
int matched = FALSE, smatch = FALSE, ematch = FALSE, ioerror = FALSE, i, rc;
int matched = FALSE, smatch = FALSE, ioerror = FALSE, i, rc;
char inbuf[256];
unsigned char ch = '\0';
int eol = FALSE;
@@ -188,7 +187,6 @@ int expect_str(int timeout, int aftermode, char *Phone)
if (strlen(modem.error[i]))
if (strncmp(modem.error[i], inbuf, strlen(modem.error[i])) == 0) {
matched = TRUE;
ematch = TRUE;
Syslog('+', "chat: got \"%s\", aborting", printable(inbuf, 0));
}

View File

@@ -1,7 +1,7 @@
#ifndef _CHAT_H
#define _CHAT_H
/* $Id$ */
/* $Id: chat.h,v 1.2 2002/07/02 20:00:51 mbroek Exp $ */
char *tranphone(char *);
int chat(char *, int, int, char *);

View File

@@ -1,7 +1,7 @@
#ifndef _CONFIG_H
#define _CONFIG_H
/* $Id$ */
/* $Id: config.h,v 1.3 2005/10/11 20:49:46 mbse Exp $ */
extern int configtime;
extern int maxfsize;

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: dial.c,v 1.16 2005/10/16 11:37:54 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,7 +1,7 @@
#ifndef _DIAL_H
#define _DIAL_H
/* $Id$ */
/* $Id: dial.h,v 1.2 2002/07/02 20:00:51 mbroek Exp $ */
int dialphone(char *);

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: dietifna.c,v 1.9 2007/08/26 12:21:16 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: dirlock.c,v 1.1 2005/09/12 13:47:09 mbse Exp $
* Purpose ...............: Lock a directory
*
*****************************************************************************

View File

@@ -1,7 +1,7 @@
#ifndef _DIRLOCK_H
#define _DIRLOCK_H
/* $Id$ */
/* $Id: dirlock.h,v 1.1 2005/09/12 13:47:09 mbse Exp $ */
int lockdir(char *);
void ulockdir(char *);

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: emsi.c,v 1.26 2007/08/26 12:21:16 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,7 +1,7 @@
#ifndef EMSI_H
#define EMSI_H
/* $Id$ */
/* $Id: emsi.h,v 1.2 2003/02/23 21:00:49 mbroek Exp $ */
#define LCODE_PUA 0x0001
#define LCODE_PUP 0x0002

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: emsidat.c,v 1.26 2007/11/25 15:49:46 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: filelist.c,v 1.32 2008/11/26 22:01:01 mbse Exp $
* Purpose ...............: fidonet mailer
*
*****************************************************************************

View File

@@ -1,4 +1,4 @@
/* $Id$ */
/* $Id: filelist.h,v 1.4 2005/10/11 20:49:46 mbse Exp $ */
#ifndef _FILELIST_H
#define _FILELIST_H

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: filetime.c,v 1.5 2004/02/21 17:22:01 mbroek Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: ftsc.c,v 1.22 2007/04/30 19:04:17 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,11 +1,10 @@
/*****************************************************************************
*
* $Id$
* Purpose ...............: Fidonet mailer - Hydra protocol driver
* Remark ................: See below for more copyright details and credits.
*
*****************************************************************************
* Copyright (C) 1997-2007
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -1405,7 +1404,6 @@ int hydra_batch(int role, file_list *to_send)
*/
else if ((rxlen > 41) && (rxbuf[rxlen - 1] == 0)) {
time_t timestamp;
time_t orgstamp;
int filesize, tt;
char dosname[8 + 1 + 3 + 1], *Name;
@@ -1413,7 +1411,6 @@ int hydra_batch(int role, file_list *to_send)
timestamp = (time_t)tt;
/* convert timestamp to UNIX time */
orgstamp = timestamp;
timestamp = sl2mtime(timestamp);
/*

View File

@@ -1,4 +1,4 @@
/* $Id$ */
/* $Id: hydra.h,v 1.4 2003/10/22 21:11:40 mbroek Exp $ */
/*
* As this file has been derived from the HydraCom source, here is the
* original copyright information:

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: inbound.c,v 1.9 2007/08/26 14:02:28 mbse Exp $
* Purpose ...............: Fidonet mailer, inbound functions
*
*****************************************************************************

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: inbound.h,v 1.3 2005/10/11 20:49:46 mbse Exp $
* Purpose ...............: Fidonet mailer, inbound functions
*
*****************************************************************************

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: lutil.c,v 1.10 2005/10/11 20:49:46 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,7 +1,7 @@
#ifndef LUTIL_H
#define LUTIL_H
/* $Id$ */
/* $Id: lutil.h,v 1.4 2005/10/11 20:49:46 mbse Exp $ */
void setmyname(char *);
char *date(time_t);

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: m7recv.c,v 1.6 2004/02/21 17:22:01 mbroek Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: m7send.c,v 1.6 2004/02/21 17:22:01 mbroek Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: mbcico.c,v 1.46 2007/09/02 11:17:31 mbse Exp $
* Purpose: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,7 +1,7 @@
#ifndef _MBCICO_H
#define _MBCICO_H
/* $Id$ */
/* $Id: mbcico.h,v 1.3 2003/11/30 14:36:53 mbroek Exp $ */
void usage(void);

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id$
* Purpose: MBSE BBS Outbound Manager
*
*****************************************************************************
* Copyright (C) 1997-2007
* Copyright (C) 1997-2010
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -326,6 +325,8 @@ int main(int argc, char *argv[])
if (argv[4][0] == '-')
Fatal((char *)"Invalid filename given", MBERR_COMMANDLINE);
if (argv[4][0] != '/')
Fatal((char *)"Must use absolute path/filename (or ~/path/filename)", MBERR_COMMANDLINE);
if (file_exist(argv[4], R_OK) != 0)
Fatal((char *)"File doesn't exist", MBERR_COMMANDLINE);

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: md5b.c,v 1.5 2007/08/25 15:29:14 mbse Exp $
* Purpose ...............: MD5 for binkp protocol driver
*
*****************************************************************************

View File

@@ -1,7 +1,7 @@
#ifndef MD5B_H
#define MD5B_H
/* $Id$ */
/* $Id: md5b.h,v 1.2 2005/10/11 20:49:46 mbse Exp $ */
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved.

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: nlinfo.c,v 1.15 2005/08/28 13:45:26 mbse Exp $
* Purpose ...............: MBSE BBS Outbound Manager - show node info
*
*****************************************************************************

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: openfile.c,v 1.14 2008/11/26 22:01:01 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,4 +1,4 @@
/* $Id$ */
/* $Id: openfile.h,v 1.2 2003/08/23 14:57:52 mbroek Exp $ */
#ifndef _OPENFILE_H
#define _OPENFILE_H

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id$
* Purpose ...............: Fidonet mailer
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -387,7 +386,7 @@ static struct termios tios;
int tty_raw(int speed)
{
int rc;
speed_t tspeed, is, os;
speed_t tspeed;
Syslog('t', "Set tty raw");
tspeed = transpeed(speed);
@@ -414,8 +413,8 @@ int tty_raw(int speed)
if ((rc = tcsetattr(0,TCSADRAIN,&tios)))
WriteError("$tcsetattr(0,TCSADRAIN,raw) return %d",rc);
is = cfgetispeed(&tios);
os = cfgetospeed(&tios);
cfgetispeed(&tios);
cfgetospeed(&tios);
return rc;
}

View File

@@ -1,7 +1,7 @@
#ifndef _OPENPORT_H
#define _OPENPORT_H
/* $Id$ */
/* $Id: openport.h,v 1.2 2003/10/13 21:36:31 mbroek Exp $ */
void linedrop(int);
void interrupt(int);

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id$
* Purpose ...............: Fidonet mailer
*
*****************************************************************************
* Copyright (C) 1997-2005
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -59,26 +58,32 @@ static int tcp_is_open = FALSE;
/* opentcp() was rewritten by Martin Junius */
int opentcp(char *name)
/*
* Parameter may be:
* host.example.com
* host.example.com:portnumber
* host.example.com:portname
*/
int opentcp(char *servname)
{
struct servent *se;
struct hostent *he;
struct sockaddr_in server;
int a1, a2, a3, a4, GotPort = FALSE;
char *errmsg, *portname;
short portnum;
int rc, GotPort = FALSE;
char *portname, *ipver = NULL, servport[20], ipstr[INET6_ADDRSTRLEN];
u_int16_t portnum;
struct addrinfo hints, *res=NULL, *p;
Syslog('+', "Open TCP connection to \"%s\"", MBSE_SS(name));
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
Syslog('+', "Open TCP connection to \"%s\"", MBSE_SS(servname));
tcp_is_open = FALSE;
server.sin_family = AF_INET;
/*
* Get port number from name argument if there is a : part
*/
if ((portname = strchr(name,':'))) {
if ((portname = strchr(servname,':'))) {
*portname++='\0';
if ((portnum = atoi(portname))) {
server.sin_port=htons(portnum);
@@ -112,23 +117,16 @@ int opentcp(char *name)
default: server.sin_port = htons(FIDOPORT);
}
}
snprintf(servport, 19, "%d", ntohs(server.sin_port));
/*
* Get IP address for the hostname
* Lookup hostname and return list of IPv4 and or IPv6 addresses.
*/
if (sscanf(name,"%d.%d.%d.%d",&a1,&a2,&a3,&a4) == 4)
server.sin_addr.s_addr = inet_addr(name);
else if ((he = gethostbyname(name)))
memcpy(&server.sin_addr,he->h_addr,he->h_length);
else {
switch (h_errno) {
case HOST_NOT_FOUND: errmsg = (char *)"Authoritative: Host not found"; break;
case TRY_AGAIN: errmsg = (char *)"Non-Authoritive: Host not found"; break;
case NO_RECOVERY: errmsg = (char *)"Non recoverable errors"; break;
case NO_ADDRESS: errmsg = (char *)"Host has no IP address"; break;
default: errmsg = (char *)"Unknown error"; break;
}
Syslog('+', "No IP address for %s: %s\n", name, errmsg);
if ((rc = getaddrinfo(servname, servport, &hints, &res))) {
if (rc == EAI_SYSTEM)
WriteError("opentcp: getaddrinfo() failed");
else
Syslog('+', "Host not found --> %s\n", gai_strerror(rc));
return -1;
}
@@ -142,29 +140,68 @@ int opentcp(char *name)
close(0);
close(1);
if ((fd = socket(AF_INET,SOCK_STREAM,0)) != 0) {
WriteError("$Cannot create socket (got %d, expected 0)", fd);
open("/dev/null",O_RDONLY);
open("/dev/null",O_WRONLY);
return -1;
/*
* In case a node has a A and AAAA dns entry, we now have a list of
* possible connections to make, we try them until we succeed.
* Most likely, the first one is ok.
* Nice that this also works for clustered hosts, not that we will
* find any in fidonet, but .....
*/
for (p = res; p != NULL; p = p->ai_next) {
void *addr;
rc = 0;
if (p->ai_family == AF_INET) {
struct sockaddr_in *ipv4 = (struct sockaddr_in *)p->ai_addr;
addr = &(ipv4->sin_addr);
ipver = (char *)"IPv4";
} else {
struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)p->ai_addr;
addr = &(ipv6->sin6_addr);
ipver = (char *)"IPv6";
}
inet_ntop(p->ai_family, addr, ipstr, sizeof ipstr);
Syslog('+', "Trying %s %s port %s", ipver, ipstr, servport);
if ((fd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) != 0) {
if (fd > 0)
WriteError("Cannot create socket (got %d, expected 0)", fd);
else
WriteError("$Cannot create socket");
rc = -1;
} else {
if (dup(fd) != 1) {
WriteError("$Cannot dup socket");
rc = -1;
} else {
clearerr(stdin);
clearerr(stdout);
if (connect(fd, p->ai_addr, p->ai_addrlen) == -1) {
Syslog('+', "$Cannot connect %s port %s", ipstr, servport);
close(fd+1); /* close duped socket */
close(fd); /* close this socket */
rc = -1;
} else {
/*
* Connected, leave this loop
*/
break;
}
}
}
}
if (dup(fd) != 1) {
WriteError("$Cannot dup socket");
open("/dev/null",O_WRONLY);
return -1;
}
clearerr(stdin);
clearerr(stdout);
if (connect(fd,(struct sockaddr *)&server,sizeof(server)) == -1) {
Syslog('+', "$Cannot connect %s",inet_ntoa(server.sin_addr));
if (rc == -1) {
open("/dev/null", O_RDONLY);
open("/dev/null", O_WRONLY);
freeaddrinfo(res);
return -1;
}
f_flags=0;
Syslog('+', "Established %s/TCP connection with %s, port %d",
Syslog('+', "Established %s/TCP %s connection with %s, port %s",
(tcp_mode == TCPMODE_IFC) ? "IFC":(tcp_mode == TCPMODE_ITN) ?"ITN":(tcp_mode == TCPMODE_IBN) ? "IBN":"Unknown",
inet_ntoa(server.sin_addr), (int)ntohs(server.sin_port));
ipver, ipstr, servport);
freeaddrinfo(res);
c_start = time(NULL);
carrier = TRUE;
tcp_is_open = TRUE;
@@ -181,7 +218,7 @@ void closetcp(void)
if (!tcp_is_open)
return;
shutdown(fd, 2);
shutdown(fd, SHUT_RDWR);
signal(SIGHUP, SIG_IGN);
signal(SIGPIPE, SIG_IGN);

View File

@@ -1,4 +1,4 @@
/* $Id$ */
/* $Id: opentcp.h,v 1.6 2004/02/01 14:38:49 mbroek Exp $ */
#ifndef _OPENTCP_H
#define _OPENTCP_H

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: outstat.c,v 1.34 2005/10/11 20:49:46 mbse Exp $
* Purpose ...............: Show mail outbound status
*
*****************************************************************************

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: portsel.c,v 1.8 2005/08/28 11:34:24 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,4 +1,4 @@
/* $Id$ */
/* $Id: portsel.h,v 1.2 2002/03/03 21:23:55 mbroek Exp $ */
#ifndef _PORTSEL_H
#define _PORTSEL_H

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: rdoptions.c,v 1.13 2006/01/28 20:37:05 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: recvbark.c,v 1.7 2004/02/21 17:22:01 mbroek Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id$
* Purpose ...............: Fidonet mailer - respond to filerequests
*
*****************************************************************************
* Copyright (C) 1997-2008
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -159,7 +158,6 @@ file_list *respfreq(char *nm, char *pw, char *dt)
time_t upd = 0L;
int newer = 1, Send;
FILE *fa, *fi;
int Area;
struct FILEIndex idx;
struct _fdbarea *fdb_area = NULL;
@@ -246,7 +244,6 @@ file_list *respfreq(char *nm, char *pw, char *dt)
WriteError("$Can't open %s", p);
return NULL;
}
Area = 0L;
free(p);
Syslog('f', "Start search ...");

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: scanout.c,v 1.15 2007/09/24 18:54:05 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: sendbark.c,v 1.9 2005/08/28 13:45:26 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id$
* Purpose ...............: Fidonet mailer
*
*****************************************************************************
* Copyright (C) 1997-2007
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -63,7 +62,8 @@ int session_state = STATE_BAD;
static char *data=NULL;
struct sockaddr_in peeraddr;
struct sockaddr_in peeraddr4;
struct sockaddr_in6 peeraddr6;
char *typestr(int);
@@ -103,6 +103,17 @@ void geoiplookup(GeoIP* gi, char *hostname, int i)
Syslog('+', "GeoIP location: %s, %s %s\n", country_name, country_code, country_continent);
}
}
if (GEOIP_COUNTRY_EDITION_V6 == i) {
country_id = GeoIP_id_by_name_v6(gi, hostname);
country_code = GeoIP_country_code[country_id];
country_name = GeoIP_country_name[country_id];
country_continent = GeoIP_country_continent[country_id];
if (country_code == NULL) {
Syslog('+', "%s: IP Address not found\n", GeoIPDBDescription[i]);
} else {
Syslog('+', "GeoIP location: %s, %s %s\n", country_name, country_code, country_continent);
}
}
}
#endif
@@ -111,12 +122,12 @@ void geoiplookup(GeoIP* gi, char *hostname, int i)
int session(faddr *a, node *nl, int role, int tp, char *dt)
{
int rc = MBERR_OK;
socklen_t addrlen = sizeof(struct sockaddr_in);
socklen_t addrlen = sizeof(struct sockaddr_in6);
fa_list *tmpl;
int Fdo = -1, input_pipe[2], output_pipe[2];
pid_t ipid, opid;
char str[INET6_ADDRSTRLEN];
#ifdef HAVE_GEOIP_H
char *hostname;
GeoIP *gi;
#endif
@@ -124,18 +135,26 @@ int session(faddr *a, node *nl, int role, int tp, char *dt)
session_type = tp;
nlent = nl;
if (getpeername(0,(struct sockaddr*)&peeraddr,&addrlen) == 0) {
Syslog('s', "TCP connection: len=%d, family=%hd, port=%hu, addr=%s",
addrlen,peeraddr.sin_family, peeraddr.sin_port, inet_ntoa(peeraddr.sin_addr));
if (getpeername(0,(struct sockaddr *)&peeraddr6, &addrlen) == 0) {
/*
* Copy IPv4 part into the IPv6 structure. There has to be a better way
* to deal with mixed incoming sockets ???
*/
memcpy(&peeraddr4, &peeraddr6, sizeof(struct sockaddr_in));
if ((peeraddr6.sin6_family == AF_INET6) && (inet_ntop(AF_INET6, &peeraddr6.sin6_addr, str, sizeof(str)))) {
Syslog('s', "IPv6 TCP connection: len=%d, port=%hu, addr=%s", addrlen, ntohs(peeraddr6.sin6_port), str);
} else if ((peeraddr4.sin_family == AF_INET) && (inet_ntop(AF_INET, &peeraddr4.sin_addr, str, sizeof(str)))) {
Syslog('s', "IPv4 TCP connection: len=%d, port=%hu, addr=%s", addrlen, ntohs(peeraddr4.sin_port), str);
}
if (role == 0) {
if (tcp_mode == TCPMODE_IBN) {
Syslog('+', "Incoming IBN/TCP connection from %s", inet_ntoa(peeraddr.sin_addr));
Syslog('+', "Incoming IBN/TCP connection from %s", str);
IsDoing("Incoming IBN/TCP");
} else if (tcp_mode == TCPMODE_IFC) {
Syslog('+', "Incoming IFC/TCP connection from %s", inet_ntoa(peeraddr.sin_addr));
Syslog('+', "Incoming IFC/TCP connection from %s", str);
IsDoing("Incoming IFC/TCP");
} else if (tcp_mode == TCPMODE_ITN) {
Syslog('+', "Incoming ITN/TCP connection from %s", inet_ntoa(peeraddr.sin_addr));
Syslog('+', "Incoming ITN/TCP connection from %s", str);
IsDoing("Incoming ITN/TCP");
} else if (tcp_mode == TCPMODE_NONE) {
WriteError("Unknown TCP connection, parameter missing");
@@ -145,13 +164,21 @@ int session(faddr *a, node *nl, int role, int tp, char *dt)
session_flags |= SESSION_TCP;
#ifdef HAVE_GEOIP_H
hostname = inet_ntoa(peeraddr.sin_addr);
_GeoIP_setup_dbfilename();
if (GeoIP_db_avail(GEOIP_COUNTRY_EDITION)) {
if ((gi = GeoIP_open_type(GEOIP_COUNTRY_EDITION, GEOIP_STANDARD)) != NULL) {
geoiplookup(gi, hostname, GEOIP_COUNTRY_EDITION);
if (peeraddr6.sin6_family == AF_INET6) {
if (GeoIP_db_avail(GEOIP_COUNTRY_EDITION_V6)) {
if ((gi = GeoIP_open_type(GEOIP_COUNTRY_EDITION_V6, GEOIP_STANDARD)) != NULL) {
geoiplookup(gi, str, GEOIP_COUNTRY_EDITION_V6);
}
GeoIP_delete(gi);
}
} else if (peeraddr6.sin6_family == AF_INET) {
if (GeoIP_db_avail(GEOIP_COUNTRY_EDITION)) {
if ((gi = GeoIP_open_type(GEOIP_COUNTRY_EDITION, GEOIP_STANDARD)) != NULL) {
geoiplookup(gi, str, GEOIP_COUNTRY_EDITION);
}
GeoIP_delete(gi);
}
GeoIP_delete(gi);
}
#endif
@@ -163,7 +190,6 @@ int session(faddr *a, node *nl, int role, int tp, char *dt)
* since it's now on stadin and stdout.
*/
Fdo = dup(0);
Syslog('s', "session: new socket %d", Fdo);
/*
* Close stdin and stdout so that when we create the pipes to

View File

@@ -1,4 +1,4 @@
/* $Id$ */
/* $Id: session.h,v 1.10 2007/04/30 19:04:18 mbse Exp $ */
#ifndef _SESSION_H
#define _SESSION_H

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: tcp.c,v 1.8 2004/02/21 17:22:01 mbroek Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: tcpproto.c,v 1.19 2005/10/11 20:49:46 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: telnet.c,v 1.6 2004/02/21 17:22:01 mbroek Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,7 +1,7 @@
#ifndef _TELNET_H
#define _TELNET_H
/* $Id$ */
/* $Id: telnet.h,v 1.2 2004/02/01 21:17:40 mbroek Exp $ */
#define TOPT_BIN 0

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: ttyio.c,v 1.20 2004/02/21 17:22:01 mbroek Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,4 +1,4 @@
/* $Id$ */
/* $Id: ttyio.h,v 1.6 2004/01/25 13:42:09 mbroek Exp $ */
#ifndef TTYIO_H
#define TTYIO_H

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: ulock.c,v 1.12 2005/08/28 13:45:26 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: wazoo.c,v 1.9 2004/02/21 17:22:01 mbroek Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id$
* Purpose ...............: Fidonet mailer
*
*****************************************************************************
* Copyright (C) 1997-2007
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -125,7 +124,7 @@ SM_NAMES
SM_EDECL
int tmp, i;
int SEAlink = FALSE, Slo = FALSE;
int SEAlink = FALSE;
int crcmode = session_flags & FTSC_XMODEM_CRC;
int count=0,junk=0,cancount=0;
int header = 0;
@@ -192,7 +191,6 @@ SM_STATE(waitblk0)
} else {
switch (header) {
case EOT: Syslog('x', "got EOT");
Slo = FALSE;
if (ackd_blk == -1L)
last=1;
else {
@@ -457,7 +455,6 @@ SM_STATE(checktelink)
remtime=sl2mtime(((time_t)xmblk.data[4])+ ((time_t)xmblk.data[5]<<8)+
((time_t)xmblk.data[6]<<16)+ ((time_t)xmblk.data[7]<<24));
if (xmblk.data[40]) {
Slo = TRUE;
remote_flags |= FTSC_XMODEM_SLO;
} else
remote_flags &= ~FTSC_XMODEM_SLO;
@@ -519,7 +516,6 @@ SM_STATE(recvm7)
SM_STATE(goteof)
Slo = FALSE;
closeit(1);
if (ackd_blk == -1L)
last=1;

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: xmsend.c,v 1.11 2005/10/11 20:49:46 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: yoohoo.c,v 1.25 2007/08/25 18:32:08 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************

View File

@@ -1,5 +1,5 @@
/*
* $Id$
* $Id: zmmisc.c,v 1.7 2005/10/11 20:49:46 mbse Exp $
*
* Z M . C
* Copyright 1994 Omen Technology Inc All Rights Reserved

View File

@@ -1,7 +1,7 @@
#ifndef ZMODEM_H
#define ZMODEM_H
/* $Id$ */
/* $Id: zmodem.h,v 1.2 2005/10/11 20:49:46 mbse Exp $ */
#ifndef TRUE
#define TRUE 1

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id$
* Purpose ...............: Fidonet mailer
*
*****************************************************************************
* Copyright (C) 1997-2005
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -483,20 +482,16 @@ int ackbibi(void)
*/
int procheader(char *Name)
{
register char *openmode, *p;
register char *p;
static int dummy;
char ctt[32];
Syslog('z', "procheader \"%s\"",printable(Name,0));
/* set default parameters and overrides */
openmode = (char *)"w";
Syslog('z', "procheader \"%s\"", printable(Name,0));
/*
* Process ZMODEM remote file management requests
*/
Thisbinary = (zconv != ZCNL); /* Remote ASCII override */
if (zmanag == ZMAPND)
openmode = (char *)"a";
Bytesleft = DEFBYTL;
Filemode = 0;

View File

@@ -1,6 +1,6 @@
/*****************************************************************************
*
* $Id$
* $Id: zmsend.c,v 1.14 2005/10/11 20:49:46 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************