2001-08-17 05:46:24 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
2002-04-06 14:04:41 +00:00
|
|
|
* $Id$
|
2001-08-17 05:46:24 +00:00
|
|
|
* Purpose ...............: Fidonet mailer
|
|
|
|
*
|
|
|
|
*****************************************************************************
|
2004-01-28 21:10:56 +00:00
|
|
|
* Copyright (C) 1997-2004
|
2001-08-17 05:46:24 +00:00
|
|
|
*
|
|
|
|
* Michiel Broek FIDO: 2:280/2802
|
|
|
|
* Beekmansbos 10
|
|
|
|
* 1971 BV IJmuiden
|
|
|
|
* the Netherlands
|
|
|
|
*
|
|
|
|
* This file is part of MBSE BBS.
|
|
|
|
*
|
|
|
|
* This BBS 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, or (at your option) any
|
|
|
|
* later version.
|
|
|
|
*
|
|
|
|
* MBSE BBS 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 MBSE BBS; see the file COPYING. If not, write to the Free
|
2003-08-15 20:05:34 +00:00
|
|
|
* Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
2001-08-17 05:46:24 +00:00
|
|
|
*****************************************************************************/
|
|
|
|
|
2002-06-30 12:48:44 +00:00
|
|
|
#include "../config.h"
|
2001-08-17 05:46:24 +00:00
|
|
|
#include "../lib/libs.h"
|
|
|
|
#include "../lib/structs.h"
|
|
|
|
#include "../lib/common.h"
|
|
|
|
#include "../lib/clcomm.h"
|
2002-12-28 17:29:06 +00:00
|
|
|
#include "../lib/nodelist.h"
|
2002-10-20 20:58:55 +00:00
|
|
|
#include "../lib/mberrors.h"
|
2001-08-17 05:46:24 +00:00
|
|
|
#include "ttyio.h"
|
|
|
|
#include "session.h"
|
|
|
|
#include "statetbl.h"
|
|
|
|
#include "config.h"
|
|
|
|
#include "emsi.h"
|
|
|
|
#include "respfreq.h"
|
|
|
|
#include "filelist.h"
|
|
|
|
#include "wazoo.h"
|
|
|
|
#include "zmodem.h"
|
|
|
|
|
|
|
|
|
|
|
|
extern int made_request;
|
|
|
|
|
|
|
|
|
|
|
|
int rxwazoo(void)
|
|
|
|
{
|
2002-10-20 20:58:55 +00:00
|
|
|
int rc = 0;
|
|
|
|
fa_list *eff_remote, tmpl;
|
|
|
|
file_list *tosend = NULL, **tmpfl;
|
|
|
|
|
|
|
|
Syslog('+', "Start WaZOO session");
|
|
|
|
|
|
|
|
if (emsi_remote_lcodes & LCODE_NPU) {
|
|
|
|
Syslog('+', "Remote requested \"no pickup\", no send");
|
|
|
|
eff_remote=NULL;
|
|
|
|
} else if (emsi_remote_lcodes & LCODE_PUP) {
|
|
|
|
Syslog('+', "Remote requested \"pickup primary\"");
|
|
|
|
tmpl.addr = remote->addr;
|
|
|
|
tmpl.next = NULL;
|
|
|
|
eff_remote = &tmpl;
|
|
|
|
} else eff_remote=remote;
|
|
|
|
|
|
|
|
tosend = create_filelist(eff_remote,(char *)ALL_MAIL,0);
|
|
|
|
|
|
|
|
if ((rc = zmrcvfiles()) == 0) {
|
|
|
|
if ((emsi_local_opts & OPT_NRQ) == 0) {
|
|
|
|
for (tmpfl = &tosend; *tmpfl; tmpfl = &((*tmpfl)->next));
|
|
|
|
*tmpfl = respond_wazoo();
|
2001-08-17 05:46:24 +00:00
|
|
|
}
|
|
|
|
|
2002-10-20 20:58:55 +00:00
|
|
|
if ((tosend != NULL) || ((emsi_remote_lcodes & LCODE_NPU) == 0))
|
|
|
|
rc = zmsndfiles(tosend);
|
|
|
|
|
|
|
|
if ((rc == 0) && (made_request)) {
|
|
|
|
Syslog('+', "Freq was made, trying to receive files");
|
|
|
|
rc = zmrcvfiles();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tidy_filelist(tosend, (rc == 0));
|
2001-08-17 05:46:24 +00:00
|
|
|
|
2002-10-20 20:58:55 +00:00
|
|
|
if (rc) {
|
|
|
|
WriteError("WaZOO session failed: rc=%d", rc);
|
|
|
|
return MBERR_WAZOO;
|
|
|
|
}
|
|
|
|
|
|
|
|
Syslog('+', "WaZOO session completed");
|
|
|
|
return MBERR_OK;
|
2001-08-17 05:46:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int txwazoo(void)
|
|
|
|
{
|
2002-10-20 20:58:55 +00:00
|
|
|
int rc = 0;
|
|
|
|
file_list *tosend = NULL, *respond = NULL;
|
|
|
|
char *nonhold_mail;
|
|
|
|
|
|
|
|
Syslog('+', "Start WaZOO session");
|
2004-01-28 21:10:56 +00:00
|
|
|
nonhold_mail = (char *)ALL_MAIL;
|
|
|
|
|
2002-10-20 20:58:55 +00:00
|
|
|
if (emsi_remote_lcodes & LCODE_HAT) {
|
|
|
|
Syslog('+', "Remote asked to \"hold all traffic\", no send");
|
|
|
|
tosend = NULL;
|
|
|
|
} else tosend = create_filelist(remote, nonhold_mail, 0);
|
|
|
|
|
|
|
|
if ((tosend != NULL) || ((emsi_remote_lcodes & LCODE_NPU) == 0))
|
|
|
|
rc = zmsndfiles(tosend);
|
|
|
|
if (rc == 0)
|
|
|
|
if ((rc = zmrcvfiles()) == 0)
|
|
|
|
if ((emsi_local_opts & OPT_NRQ) == 0)
|
|
|
|
if ((respond = respond_wazoo()))
|
|
|
|
rc = zmsndfiles(respond);
|
|
|
|
|
|
|
|
tidy_filelist(tosend,(rc == 0));
|
|
|
|
tidy_filelist(respond,0);
|
|
|
|
|
|
|
|
if (rc) {
|
|
|
|
WriteError("WaZOO session failed: rc=%d", rc);
|
|
|
|
return MBERR_WAZOO;
|
|
|
|
}
|
|
|
|
|
|
|
|
Syslog('+', "WaZOO session completed");
|
|
|
|
return MBERR_OK;
|
2001-08-17 05:46:24 +00:00
|
|
|
}
|
|
|
|
|