Compare commits
90
Commits
0.25.1
...
b14e52133d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b14e52133d | ||
|
|
07edf66b72 | ||
|
|
8261016c7e | ||
|
|
4d48c2abe9 | ||
|
|
7f7e420b13 | ||
|
|
52b3b230b9 | ||
|
|
416795159f | ||
|
|
04f62c7725 | ||
|
|
ddf8f3f9e0 | ||
|
|
6245ad3e10 | ||
|
|
e3a1f7e52e | ||
|
|
e94fffb110 | ||
|
|
a7cda5b70f | ||
|
|
0d4a4945fe | ||
|
|
c658e03af5 | ||
|
|
57e5e00ca3 | ||
|
|
1f7d70b755 | ||
|
|
3c60f8de01 | ||
|
|
c47397c800 | ||
|
|
224115fffe | ||
|
|
875ea3505f | ||
|
|
d581b113c8 | ||
|
|
a296d43987 | ||
|
|
aa32dac10e | ||
|
|
6a1a0a6838 | ||
|
|
83ce06579c | ||
|
|
8339af8eac | ||
|
|
2477709da4 | ||
|
|
136eca95f1 | ||
|
|
030322225f | ||
|
|
92bd4cae56 | ||
|
|
1837ebd57c | ||
|
|
2eb30b7644 | ||
|
|
7733d5d663 | ||
|
|
6a2320d922 | ||
|
|
5f10b52c77 | ||
|
|
55fc94a95b | ||
|
|
1667d8a800 | ||
|
|
5eced105c8 | ||
|
|
7486b9c141 | ||
|
|
2fbe1d3e54 | ||
|
|
fa8e081584 | ||
|
|
981d4f00b3 | ||
|
|
26ecb8b64c | ||
|
|
526338f720 | ||
|
|
06f48fe1c1 | ||
|
|
4767b57ec9 | ||
|
|
8892e3f740 | ||
|
|
21eeae69cc | ||
|
|
9799f977b9 | ||
|
|
727f7cfdf3 | ||
|
|
36747d9071 | ||
|
|
9fa59cacca | ||
|
|
b66dd2156c | ||
|
|
80275d30d3 | ||
|
|
a62ae3afca | ||
|
|
a9f98cdee9 | ||
|
|
10d30223d1 | ||
|
|
c5fc6e9245 | ||
|
|
29000cfdd7 | ||
|
|
de6ef3936b | ||
|
|
8db2ee4260 | ||
|
|
25081b1bae | ||
|
|
deaa8140f5 | ||
|
|
7fb8e32a9b | ||
|
|
235a6a3072 | ||
|
|
4da486264b | ||
|
|
25cfb143dc | ||
|
|
4e86852c41 | ||
|
|
324b11aad7 | ||
|
|
7fd0d85557 | ||
|
|
0cb9a2b2cf | ||
|
|
9bc3a14dd0 | ||
|
|
abb1153cf3 | ||
|
|
3f9d10e467 | ||
|
|
46312ebc1b | ||
|
|
5ef2b09861 | ||
|
|
f72259cfe3 | ||
|
|
73a3376a3d | ||
|
|
983440fc29 | ||
|
|
5a7bac039a | ||
|
|
bba77edecd | ||
|
|
9aed37b92e | ||
|
|
3526bc5ece | ||
|
|
a1c93b8016 | ||
|
|
e6266e8eab | ||
|
|
34daba8a0e | ||
|
|
ea4e8c806f | ||
|
|
51034e6e59 | ||
|
|
6235b78239 |
@@ -0,0 +1,42 @@
|
||||
name: Archlinux build
|
||||
run-name: Deploy to ${{ inputs.deploy_target }} by @${{ github.actor }} 🚀
|
||||
on:
|
||||
- push
|
||||
- workflow_dispatch
|
||||
if: ${{ github.ref }} == 'refs/head/master'
|
||||
jobs:
|
||||
build-arch:
|
||||
runs-on: arch-latest
|
||||
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
steps:
|
||||
- name: Checking environment
|
||||
continue-on-error: true
|
||||
run: printenv
|
||||
- name: Installing prerequisites - update pacman
|
||||
run: pacman -Sy
|
||||
- name: Installing prerequisites - install nodejs for actions & git
|
||||
run: pacman --disable-sandbox --noconfirm -v -S git nodejs
|
||||
- name: Adding user builder
|
||||
continue-on-error: true
|
||||
run: useradd -d /builder -g users -m builder
|
||||
- name: Downloading PKGBUILD
|
||||
run: |
|
||||
su - builder -c "curl -O http://zxprj:3001/zx/bforce/raw/branch/master/archlinux/bforce.install"
|
||||
su - builder -c "curl -o PKGBUILD http://zxprj:3001/zx/bforce/raw/branch/master/archlinux/PKGBUILD.ci"
|
||||
- name: Building archlinux package
|
||||
run: |
|
||||
su -w GITHUB_SHA,GITHUB_REF_NAME,GITHUB_REF_TYPE - builder -c makepkg
|
||||
su - builder -c "ls -la"
|
||||
- name: Constructing artifact name and version
|
||||
run: |
|
||||
echo "BFORCE_VER=$(cat /builder/src/bforce/source/.version)-$(date +%Y%M%d)" >> $GITHUB_ENV
|
||||
- name: Retrieving artifact files
|
||||
run: mkdir bforce && cp /builder/bforce-*.pkg.tar.zst bforce
|
||||
- name: Try to upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: bforce-${{ env.BFORCE_VER }}-Arch
|
||||
path: bforce
|
||||
@@ -0,0 +1,52 @@
|
||||
name: Debian build
|
||||
run-name: Deploy to ${{ inputs.deploy_target }} by @${{ github.actor }} 🚀
|
||||
on:
|
||||
- push
|
||||
- workflow_dispatch
|
||||
jobs:
|
||||
build-ubuntu:
|
||||
runs-on: ubuntu-latest
|
||||
branches:
|
||||
- 'master'
|
||||
- 'zx'
|
||||
steps:
|
||||
- name: Checking environment
|
||||
continue-on-error: true
|
||||
run: printenv
|
||||
- name: Installing build-essentials
|
||||
continue-on-error: false
|
||||
run: |
|
||||
apt update
|
||||
apt install -y build-essential fakeroot devscripts debhelper pkg-config --no-install-recommends
|
||||
- name: Installing dependencies
|
||||
continue-on-error: false
|
||||
run: |
|
||||
echo '---- bison ----'
|
||||
apt install -y bison
|
||||
echo '---- tcl ------'
|
||||
apt install -y tcl
|
||||
- name: Cloning source
|
||||
uses: actions/checkout@v4
|
||||
- name: Getting version info
|
||||
run: |
|
||||
echo "BFORCE_VER=$(cat ${{ env.GITHUB_WORKSPACE }}/source/.version)-$(date +%Y%M%d)" >> $GITHUB_ENV
|
||||
- name: Building package
|
||||
continue-on-error: false
|
||||
run: |
|
||||
pwd
|
||||
echo '---------------------'
|
||||
cd ${GITHUB_WORKSPACE}/debian
|
||||
ls -l
|
||||
debuild -us -uc -b
|
||||
echo '---build complete---'
|
||||
ls -l ${{ env.GITHUB_WORKSPACE }}/../
|
||||
- name: Collecting artifacts
|
||||
run: |
|
||||
mkdir -pv ${{ env.GITHUB_WORKSPACE }}/artifacts
|
||||
mv -v ${{ env.GITHUB_WORKSPACE }}/../*.deb ${{ env.GITHUB_WORKSPACE }}/artifacts/
|
||||
- name: Try to upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: bforce-${{ env.BFORCE_VER }}-Ubuntu
|
||||
path: ${{ env.GITHUB_WORKSPACE }}/artifacts/bforce*.deb
|
||||
- run: echo "This job's over"
|
||||
@@ -7,6 +7,3 @@ source/config.log
|
||||
source/config.status
|
||||
source/include/config.h
|
||||
bforce.geany
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -253,3 +253,29 @@ Alexey Khromov (zx@zxalexis.ru)
|
||||
|
||||
0.25.1
|
||||
+ Added testing script for PSTN comms (tests folder).
|
||||
|
||||
0.25.2
|
||||
+ Adopted for outgoing IPv6 communication
|
||||
|
||||
0.25.3
|
||||
+ Fixed IPv6 address logging in inetd connections
|
||||
+ Fixed outgoing proto detection and order - as Direct, BinkP, Ifcico,
|
||||
Telnet, Modem first allowed to connect. You may change this order
|
||||
individually by override flags.
|
||||
+ Daemon mode now tries to make outgoing tcp calls prior to modem
|
||||
+ Daemon mode - fixed working time for tcp nodes (CM)
|
||||
+ Fixed some x64 errors in comparisons to integers
|
||||
+ Added systemd and xinetd service files to contrib folder
|
||||
+ Fixed flag files creation
|
||||
+ Added flags for TIC files (inctic_flag) and files (incfile_flag)
|
||||
+ Fixed nodelist index creation
|
||||
+ Added support for TCP port description in IBN/IFC/ITN flags
|
||||
|
||||
0.26
|
||||
+ Fixed incorrect binkp protocol realization in unprotected sessions.
|
||||
+ Fixed binkp override appliance in incoming handshake
|
||||
|
||||
0.26.1
|
||||
+ Fixed binkp stuck on overrides in config
|
||||
+ ReDebianized
|
||||
+ Added CI automation: builds for Archlinux and Ubuntu
|
||||
|
||||
@@ -1,10 +1,29 @@
|
||||

|
||||

|
||||
|
||||
BinkleyForce FTN mailer
|
||||
-----------------------
|
||||
|
||||
BinkleyForce is a simple ifcico like FTN mailer. It can works via
|
||||
BinkleyForce is a simple ifcico like FTN mailer. It can work via
|
||||
TCP/IP as well as on modem links. Look sample configs for more
|
||||
information.
|
||||
|
||||
Supported Features
|
||||
------------------
|
||||
|
||||
- PSTN dial-out with EMSI-II/EMSI/YooHoo handshake
|
||||
- PSTN protocols: Hydra, ZedZap, ZModem
|
||||
- PSTN dial-in through mgetty
|
||||
- TCP/IP dial-out through IPv4 and IPv6 networks
|
||||
- TCP/IP protocols - ifcico / BinkP 1.1
|
||||
- TCP/IP dial-in through xinetd/inetd
|
||||
- Daemon mode for outbound queue managing
|
||||
|
||||
Linux 2.4.11+, FreeBSD (6+ AFAIR) compatible.
|
||||
|
||||
Licence
|
||||
-------
|
||||
|
||||
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, or (at your option)
|
||||
@@ -12,8 +31,9 @@ any later version. See the COPYING file for further information.
|
||||
|
||||
Known Bugs
|
||||
----------
|
||||
- BinkD use and expect local file time at BinkP sessions, but
|
||||
BinkleyForce always use UTC time (?)
|
||||
- BinkleyForce has no support (yet) for multiple INA: addresses
|
||||
- Can not rotate hidden lines
|
||||
- Can not rotate supported IP protocols in case of failure
|
||||
|
||||
Bug Reports
|
||||
-----------
|
||||
@@ -26,6 +46,10 @@ New Versions
|
||||
|
||||
https://prj.zxalexis.ru/gitea/zx/bforce
|
||||
|
||||
SAST Tools
|
||||
----------
|
||||
[PVS-Studio](https://pvs-studio.com/pvs-studio/?utm_source=website&utm_medium=github&utm_campaign=open_source) - static analyzer for C, C++, C#, and Java code.
|
||||
|
||||
Older Sources
|
||||
-------------
|
||||
https://github.com/zotrix/binkleyforce/
|
||||
@@ -39,4 +63,4 @@ Copyright <br>
|
||||
> (c) 2007-2008 Sergey Babitch<br>
|
||||
> (c) 2011-2014 Sergey Dorofeev<br>
|
||||
> (c) 2014 Alexander Skovpen<br>
|
||||
> (c) 2024 Alexey Khromov<br>
|
||||
> (c) 2024-2025 Alexey Khromov<br>
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
pkgname=bforce
|
||||
pkgver=r235.a1c93b8
|
||||
pkgrel=1
|
||||
pkgdesc="binkleyforce FTN mailer"
|
||||
arch=('i686' 'x86_64' 'aarch64')
|
||||
url="https://prj.zxalexis.ru/gitea/zx/bforce/"
|
||||
license=('GPL2')
|
||||
source=(
|
||||
"${pkgname}::git+https://prj.zxalexis.ru/gitea/zx/bforce.git"
|
||||
)
|
||||
makedepends=('git' 'gcc' 'make' 'glibc')
|
||||
provides=('bforce')
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${pkgname}/source"
|
||||
./configure --prefix=/ --disable-syslog --with-owner=fido --with-group=uucp
|
||||
make
|
||||
}
|
||||
|
||||
prepare() {
|
||||
cd "${pkgname}"
|
||||
printf "$( pwd )\n"
|
||||
}
|
||||
|
||||
pkgver() {
|
||||
cd "$pkgname"
|
||||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
||||
}
|
||||
|
||||
package() {
|
||||
cd ${pkgdir}
|
||||
mkdir -p ${pkgdir}/etc
|
||||
mkdir -p ${pkgdir}/usr/bin
|
||||
mkdir -p ${pkgdir}/usr/local/bin
|
||||
mkdir -p ${pkgdir}/usr/share/doc/bforce
|
||||
mkdir -p ${pkgdir}/usr/share/man/man1
|
||||
mkdir -p ${pkgdir}/var/log/bforce
|
||||
mkdir -p ${pkgdir}/var/spool/bforce
|
||||
mkdir -p ${pkgdir}/var/spool/bforce/bt/in
|
||||
mkdir -p ${pkgdir}/var/spool/bforce/bt/pin
|
||||
mkdir -p ${pkgdir}/var/spool/bforce/bt/out
|
||||
mkdir -p ${pkgdir}/var/spool/bforce/ndl
|
||||
mkdir -p ${pkgdir}/var/spool/bforce/bforce
|
||||
/usr/bin/install -c ${srcdir}/${pkgname}/source/bin/bforce ${pkgdir}/usr/bin/bforce
|
||||
/usr/bin/install -c ${srcdir}/${pkgname}/source/bin/bfindex ${pkgdir}/usr/bin/bfindex
|
||||
/usr/bin/install -c ${srcdir}/${pkgname}/source/bin/bfstat ${pkgdir}/usr/bin/bfstat
|
||||
/usr/bin/install -c ${srcdir}/${pkgname}/source/bin/nlookup ${pkgdir}/usr/bin/nlookup
|
||||
/usr/bin/install -c ${srcdir}/${pkgname}/man/*.1 ${pkgdir}/usr/share/man/man1/
|
||||
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/bforce.conf ${pkgdir}/etc/bforce.conf.sample
|
||||
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/bforce.subst ${pkgdir}/etc/bforce.subst.sample
|
||||
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/bforce.passwd ${pkgdir}/etc/bforce.passwd.sample
|
||||
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/freq.aliases ${pkgdir}/etc/freq.aliases.sample
|
||||
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/freq.dirs ${pkgdir}/etc/freq.dirs.sample
|
||||
/usr/bin/install -c ${srcdir}/${pkgname}/contrib/outman ${pkgdir}/usr/local/bin/outman
|
||||
echo "Please, edit /usr/local/bin/outman"
|
||||
cp ${srcdir}/${pkgname}/docs/* ${pkgdir}/usr/share/doc/bforce/
|
||||
}
|
||||
|
||||
sha256sums=('SKIP')
|
||||
@@ -0,0 +1,64 @@
|
||||
pkgname=bforce
|
||||
pkgver=r235.a1c93b8
|
||||
pkgrel=1
|
||||
pkgdesc="binkleyforce FTN mailer"
|
||||
arch=('i686' 'x86_64' 'aarch64')
|
||||
url="https://prj.zxalexis.ru/gitea/zx/bforce/"
|
||||
license=('GPL2')
|
||||
source=(
|
||||
"${pkgname}::git+https://prj.zxalexis.ru/gitea/zx/bforce.git"
|
||||
)
|
||||
makedepends=('git' 'gcc' 'make' 'glibc')
|
||||
provides=('bforce')
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${pkgname}/source"
|
||||
./configure --prefix=/ --disable-syslog --with-owner=fido --with-group=uucp
|
||||
make
|
||||
}
|
||||
|
||||
prepare() {
|
||||
cd "${pkgname}"
|
||||
git checkout "${GITHUB_SHA}"
|
||||
printf "$( pwd )\n"
|
||||
}
|
||||
|
||||
pkgver() {
|
||||
cd "$pkgname"
|
||||
if [ "${GITHUB_REF_TYPE}" = "tags" ]; then
|
||||
printf "v%s" "${GITHUB_REF_NAME}"
|
||||
else
|
||||
printf "r%s.%s.%s" "$(git rev-list --count ${GITHUB_SHA})" "$(git rev-parse --short ${GITHUB_SHA})" "${GITHUB_REF_NAME}"
|
||||
fi
|
||||
}
|
||||
|
||||
package() {
|
||||
cd ${pkgdir}
|
||||
mkdir -p ${pkgdir}/etc
|
||||
mkdir -p ${pkgdir}/usr/bin
|
||||
mkdir -p ${pkgdir}/usr/local/bin
|
||||
mkdir -p ${pkgdir}/usr/share/doc/bforce
|
||||
mkdir -p ${pkgdir}/usr/share/man/man1
|
||||
mkdir -p ${pkgdir}/var/log/bforce
|
||||
mkdir -p ${pkgdir}/var/spool/bforce
|
||||
mkdir -p ${pkgdir}/var/spool/bforce/bt/in
|
||||
mkdir -p ${pkgdir}/var/spool/bforce/bt/pin
|
||||
mkdir -p ${pkgdir}/var/spool/bforce/bt/out
|
||||
mkdir -p ${pkgdir}/var/spool/bforce/ndl
|
||||
mkdir -p ${pkgdir}/var/spool/bforce/bforce
|
||||
/usr/bin/install -c ${srcdir}/${pkgname}/source/bin/bforce ${pkgdir}/usr/bin/bforce
|
||||
/usr/bin/install -c ${srcdir}/${pkgname}/source/bin/bfindex ${pkgdir}/usr/bin/bfindex
|
||||
/usr/bin/install -c ${srcdir}/${pkgname}/source/bin/bfstat ${pkgdir}/usr/bin/bfstat
|
||||
/usr/bin/install -c ${srcdir}/${pkgname}/source/bin/nlookup ${pkgdir}/usr/bin/nlookup
|
||||
/usr/bin/install -c ${srcdir}/${pkgname}/man/*.1 ${pkgdir}/usr/share/man/man1/
|
||||
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/bforce.conf ${pkgdir}/etc/bforce.conf.sample
|
||||
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/bforce.subst ${pkgdir}/etc/bforce.subst.sample
|
||||
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/bforce.passwd ${pkgdir}/etc/bforce.passwd.sample
|
||||
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/freq.aliases ${pkgdir}/etc/freq.aliases.sample
|
||||
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/freq.dirs ${pkgdir}/etc/freq.dirs.sample
|
||||
/usr/bin/install -c ${srcdir}/${pkgname}/contrib/outman ${pkgdir}/usr/local/bin/outman
|
||||
echo "Please, edit /usr/local/bin/outman"
|
||||
cp ${srcdir}/${pkgname}/docs/* ${pkgdir}/usr/share/doc/bforce/
|
||||
}
|
||||
|
||||
sha256sums=('SKIP')
|
||||
@@ -0,0 +1,7 @@
|
||||
post_install() {
|
||||
chmod
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
post_install
|
||||
}
|
||||
@@ -10,10 +10,10 @@
|
||||
# These files are considered legacy and are unnecessary on legacy-free
|
||||
# systems.
|
||||
|
||||
d /run/lock 0777 root lock -
|
||||
L /var/lock - - - - ../run/lock
|
||||
z /run/lock 0777 root lock -
|
||||
z /var/lock 0777 root lock - ../run/lock
|
||||
|
||||
# /run/lock/subsys is used for serializing SysV service execution, and
|
||||
# hence without use on SysV-less systems.
|
||||
|
||||
d /run/lock/subsys 0775 root lock -
|
||||
z /run/lock/subsys 0775 root lock -
|
||||
|
||||
Executable
+92
@@ -0,0 +1,92 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Directories and static values
|
||||
DEFZONE=2
|
||||
# Default outbound
|
||||
# OUTBOUND="."
|
||||
# Our AKA
|
||||
# AKA="2:5030/723@fidonet"
|
||||
# FLO Extension
|
||||
FLOEXT="dlo"
|
||||
# BFCONFIG=/opt/fidonms/etc/bforce.conf
|
||||
|
||||
if [ "${BFCONFIG}" == "" ]; then
|
||||
BFCONF="/etc/bforce/bforce.conf"
|
||||
else
|
||||
BFCONF=${BFCONFIG}
|
||||
fi
|
||||
|
||||
if [ "$1" == "" ]; then
|
||||
echo "No FTN provided. Usage: mkpoll <address>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Address to create poll
|
||||
FTNA=$1
|
||||
|
||||
# Outbound address
|
||||
OUTB=""
|
||||
if [ -f "${BFCONF}" ]; then
|
||||
# We have config!
|
||||
OUTB=$(grep -E "^outbound_directory" ${BFCONF} | awk '{print $2}')
|
||||
else
|
||||
OUTB=${OUTBOUND}
|
||||
fi
|
||||
|
||||
#echo "FTNA: ${FTNA} OUTB: ${OUTB}"
|
||||
|
||||
FZONE=$(echo -n ${FTNA}| awk -F':' '{print $1}')
|
||||
FNET=$(echo -n ${FTNA} | awk -F':' '{print $2}' | awk -F'/' '{ print $1 }')
|
||||
FNODE=$(echo -n ${FTNA}| awk -F'/' '{print $2}' | awk -F'@' '{ print $1 }'| awk -F'.' '{ print $1 }')
|
||||
FPNT=$(echo -n ${FTNA} | awk -F'/' '{print $2}' | awk -F'@' '{ print $1 }'| awk -F'.' '{ print $2 }')
|
||||
FDOM=$(echo -n ${FTNA} | awk -F'@' '{print $2}')
|
||||
|
||||
# echo "Dest ZONE: ${FZONE}, NET: ${FNET}, NODE: ${FNODE}, PNT: ${FPNT} DOM: ${FDOM}"
|
||||
|
||||
# Our AKA
|
||||
FAKA=""
|
||||
if [ -f "${BFCONF}" ]; then
|
||||
# We have config!
|
||||
FAKA=$(grep -E "^address" ${BFCONF} | awk '{print $2}')
|
||||
else
|
||||
FAKA=${AKA}
|
||||
fi
|
||||
|
||||
AZONE=$(echo -n ${FAKA}| awk -F':' '{print $1}')
|
||||
ANET=$(echo -n ${FAKA} | awk -F':' '{print $2}' | awk -F'/' '{ print $1 }')
|
||||
ANODE=$(echo -n ${FAKA}| awk -F'/' '{print $2}' | awk -F'@' '{ print $1 }'| awk -F'.' '{ print $1 }')
|
||||
APNT=$(echo -n ${FAKA} | awk -F'/' '{print $2}' | awk -F'@' '{ print $1 }'| awk -F'.' '{ print $2 }')
|
||||
ADOM=$(echo -n ${FAKA} | awk -F'@' '{print $2}')
|
||||
|
||||
# echo "Our ZONE: ${AZONE}, NET: ${ANET}, NODE: ${ANODE}, PNT: ${APNT} DOM: ${ADOM}"
|
||||
|
||||
|
||||
FTNB=$( printf "%04x%04x" ${FNET} ${FNODE} )
|
||||
|
||||
if [ "${FPNT}" == "" ]; then
|
||||
FPNT="0"
|
||||
fi
|
||||
|
||||
FFLO=""
|
||||
if [ "${AZONE}" == "${FZONE}" ] && [ "${FNET}" == "${ANET}" ] && [ "${FNODE}" == "${ANODE}" ] && [ ! "${FPNT}" == "0" ]; then
|
||||
# echo "Point operations!"
|
||||
FLOFIL=$( printf "%08x.${FLOEXT}" ${FPNT} )
|
||||
PNTDIR=$( echo -n "${OUTB}/${FTNB}.pnt")
|
||||
FFLO=$( echo -n "${PNTDIR}/${FLOFIL}" )
|
||||
elif [ ! "${DEFZONE}" == "${FZONE}" ]; then
|
||||
# Interzonal poll
|
||||
FLOFIL=$( echo -n "${FTNB}.${FLOEXT}" )
|
||||
FDIR=$( printf "%03x" ${FZONE} )
|
||||
FFLO=$( echo -n "${OUTB}.${FDIR}/${FLOFIL}" )
|
||||
else
|
||||
# Normal in-zone poll
|
||||
FLOFIL=$( echo -n "${FTNB}.${FLOEXT}" )
|
||||
FFLO=$( echo -n "${OUTB}/${FLOFIL}" )
|
||||
fi
|
||||
|
||||
# echo "FloFile: ${FFLO}"
|
||||
|
||||
if [ ! -f "${FFLO}" ]; then
|
||||
touch "${FFLO}"
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Binkleyforce Outbound server
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/tmp/bforce.pid
|
||||
User=fido
|
||||
Group=fido
|
||||
ExecStart=/usr/bin/bforce -d -C /opt/fidonms/etc/bforce.conf
|
||||
ExecStop=/usr/bin/bforce -q
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,13 @@
|
||||
#binkleyforce ifc (port 60179) EMSI-over-ip
|
||||
service binkp
|
||||
{
|
||||
disable = no
|
||||
socket_type = stream
|
||||
# flags = IPv4
|
||||
protocol = tcp
|
||||
port = 24554
|
||||
wait = no
|
||||
user = fido
|
||||
server = /usr/bin/bforce
|
||||
server_args = -C /opt/fidonms/etc/bforce.conf -i binkp
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#binkleyforce ifc (port 60179) EMSI-over-ip
|
||||
service ifc
|
||||
{
|
||||
disable = no
|
||||
socket_type = stream
|
||||
# flags = IPv4
|
||||
protocol = tcp
|
||||
port = 60179
|
||||
wait = no
|
||||
user = fido
|
||||
server = /usr/bin/bforce
|
||||
server_args = -C /opt/fidonms/etc/bforce.conf -i auto
|
||||
}
|
||||
Vendored
+12
@@ -1,3 +1,15 @@
|
||||
bforce (0.26.1) UNRELEASED; urgency=medium
|
||||
|
||||
* Fixed for ubuntu/debian builds and CI actions
|
||||
|
||||
-- Alexey Khromov <zx@zxalexis.ru> Sun, 13 Apr 2025 20:06:54 +0300
|
||||
|
||||
bforce (0.26) UNRELEASED; urgency=medium
|
||||
|
||||
* Fixed for IPv6 and build on amd64 and aarch64 platforms
|
||||
|
||||
-- Alexey Khromov <zx@zxalexis.ru> Sun, 13 Apr 2025 12:53:54 +0000
|
||||
|
||||
bforce (0.22.9-3) unstable; urgency=low
|
||||
|
||||
* fixes in init.d script
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
4
|
||||
3
|
||||
|
||||
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
/etc/bforce/bforce.conf
|
||||
/etc/bforce/bforce.subst
|
||||
/etc/bforce/bforce.passwd
|
||||
/etc/bforce/freq.dirs
|
||||
/etc/bforce/freq.aliases
|
||||
|
||||
Vendored
+2
-2
@@ -1,13 +1,13 @@
|
||||
Source: bforce
|
||||
Section: net
|
||||
Priority: optional
|
||||
Maintainer: Evgeniy Kozhuhovskiy <e.kozhuhovskiy@gmail.com>
|
||||
Maintainer: Alexey Khromov <zx@zxalexis.ru>
|
||||
Build-Depends: debhelper (>> 3.0.0), bison (>> 1.0.0)
|
||||
Standards-Version: 3.5.10
|
||||
|
||||
Package: bforce
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}
|
||||
Depends: ${shlibs:Depends}, tclsh:any
|
||||
Description: Binkey Force FTN mailer
|
||||
FTN mailer is a program that transmit files (netmail and echomail)
|
||||
between your FTN node and other.
|
||||
|
||||
Vendored
+1
@@ -1,5 +1,6 @@
|
||||
usr/bin
|
||||
usr/lib/bforce
|
||||
usr/lib/systemd/system
|
||||
etc/bforce
|
||||
etc/default
|
||||
etc/default/bforce
|
||||
|
||||
Vendored
+2
-6
@@ -1,9 +1,5 @@
|
||||
README
|
||||
README.kst
|
||||
README.ugenk
|
||||
README.md
|
||||
TODO
|
||||
CHANGES
|
||||
CHANGES.kst
|
||||
CHANGES.ugenk
|
||||
INSTALL
|
||||
INSTALL.ru
|
||||
SYSLOG
|
||||
|
||||
Vendored
+9
-9
@@ -26,15 +26,15 @@ set -e
|
||||
case "$1" in
|
||||
configure)
|
||||
|
||||
if ! grep -s news /etc/group >/dev/null 2>&1; then
|
||||
addgroup --system news
|
||||
fi
|
||||
|
||||
if ! id uucp >/dev/null 2>&1; then
|
||||
adduser --system --disabled-password uucp
|
||||
chsh -s /bin/sh uucp
|
||||
adduser uucp dialout
|
||||
fi
|
||||
# if ! grep -s news /etc/group >/dev/null 2>&1; then
|
||||
# addgroup --system news
|
||||
# fi
|
||||
#
|
||||
# if ! id uucp >/dev/null 2>&1; then
|
||||
# adduser --system --disabled-password uucp
|
||||
# chsh -s /bin/sh uucp
|
||||
# adduser uucp dialout
|
||||
# fi
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
|
||||
Vendored
+6
-7
@@ -6,8 +6,7 @@
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
# This is the debhelper compatibility version to use.
|
||||
export DH_COMPAT=3
|
||||
|
||||
export DH_COMPAT=11
|
||||
|
||||
PACKAGE = bforce
|
||||
|
||||
@@ -49,7 +48,7 @@ clean:
|
||||
rm -f build-stamp configure-stamp
|
||||
|
||||
# Add here commands to clean up after the build process.
|
||||
-$(MAKE) -C source clean
|
||||
# -$(MAKE) -C source clean
|
||||
dh_clean
|
||||
rm -f source/config.cache source/include/config.h source/config.log\
|
||||
source/config.status source/Makefile
|
||||
@@ -57,7 +56,7 @@ clean:
|
||||
install: build
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_prep
|
||||
dh_installdirs
|
||||
|
||||
# Add here commands to install the package into debian/bforce.
|
||||
@@ -74,7 +73,7 @@ install: build
|
||||
/usr/bin/install -c -m 600 -o $(USER) -g $(GROUP) examples/bforce.passwd $(CURDIR)/debian/bforce/etc/bforce/bforce.passwd
|
||||
/usr/bin/install -c -m 644 -o $(USER) -g $(GROUP) examples/freq.aliases $(CURDIR)/debian/bforce/etc/bforce/freq.aliases
|
||||
/usr/bin/install -c -m 644 -o $(USER) -g $(GROUP) examples/freq.dirs $(CURDIR)/debian/bforce/etc/bforce/freq.dirs
|
||||
|
||||
/usr/bin/install -c -m 660 contrib/systemd/bforce.service $(CURDIR)/debian/bforce/usr/lib/systemd/system/bforce.service
|
||||
/usr/bin/install $(CURDIR)/debian/bfha.def $(CURDIR)/debian/bforce/etc/default/bforce/bfha
|
||||
/usr/bin/install $(CURDIR)/contrib/bfha/bfha-debian.pl $(CURDIR)/debian/bforce/usr/lib/bforce/bfha.pl
|
||||
|
||||
@@ -92,8 +91,8 @@ binary-arch: build install
|
||||
# dh_installlogrotate
|
||||
dh_installinit
|
||||
# dh_installcron
|
||||
dh_installman $(CURDIR)/debian/bfindex.1 $(CURDIR)/debian/bforce.1 \
|
||||
$(CURDIR)/debian/bfstat.1 $(CURDIR)/debian/nlookup.1
|
||||
dh_installman $(CURDIR)/man/bfindex.1 $(CURDIR)/man/bforce.1 \
|
||||
$(CURDIR)/man/bfstat.1 $(CURDIR)/man/nlookup.1 $(CURDIR)/man/outman.1
|
||||
# dh_installinfo
|
||||
dh_installchangelogs CHANGES
|
||||
dh_link
|
||||
|
||||
@@ -103,6 +103,11 @@ nodial_flag /etc/nodial
|
||||
#incnet_flag /var/spool/fido/flags/mail
|
||||
# Arcmail:
|
||||
#incarc_flag /var/spool/fido/flags/echo
|
||||
# FileEcho TIC
|
||||
#inctic_flag /var/spool/fido/flags/tick
|
||||
# Regular file recieve
|
||||
#incfile_flag /var/spool/fido/flags/alert
|
||||
|
||||
|
||||
#
|
||||
# Inbound directories
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
Summary: Bforce, Fidonet mailer
|
||||
Name: bforce
|
||||
Version: 0.22.8
|
||||
Release: ugenk4
|
||||
Version: 0.26.1
|
||||
Release: 0
|
||||
Copyright: GPL
|
||||
Group: Fidonet/mailer
|
||||
Source0: bforce-%{version}.%{release}.tar.gz
|
||||
@@ -56,7 +56,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%attr(550,uucp,news) /usr/bin/bfstat
|
||||
%attr(550,uucp,news) /usr/bin/nlookup
|
||||
%attr(550,uucp,news) /usr/bin/outman
|
||||
%attr(644,root,root) /usr/share/doc/bforce-0.22.8/*
|
||||
%attr(644,root,root) /usr/share/doc/bforce/*
|
||||
%dir %attr(770,uucp,news) /var/log/bforce
|
||||
%dir %attr(770,uucp,news) /var/spool/fido/ndl
|
||||
%attr(775,uucp,news) /var/spool/fido/bt
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
0.25.1
|
||||
0.26.1
|
||||
|
||||
@@ -20,10 +20,14 @@ s_cval_entry *conf_first(bforce_config_keyword keyword)
|
||||
{
|
||||
s_cval_entry *ptrl;
|
||||
|
||||
for( ptrl = bforce_config[keyword].data; ptrl; ptrl = ptrl->next )
|
||||
if( !ptrl->expr.expr || eventexpr(&ptrl->expr) )
|
||||
return ptrl;
|
||||
DEB((D_CONFIG, "conf_first entry nr %d",(int16_t)keyword));
|
||||
|
||||
for( ptrl = bforce_config[keyword].data; ptrl; ptrl = ptrl->next )
|
||||
if( !ptrl->expr.expr || eventexpr(&ptrl->expr) ) {
|
||||
DEB((D_CONFIG, "conf_first ptrl found"));
|
||||
return ptrl;
|
||||
}
|
||||
DEB((D_CONFIG, "conf_first ptrl not found"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -32,9 +36,11 @@ s_cval_entry *conf_next(s_cval_entry *ptrl)
|
||||
ASSERT(ptrl);
|
||||
|
||||
for( ptrl = ptrl->next; ptrl; ptrl = ptrl->next )
|
||||
if( !ptrl->expr.expr || eventexpr(&ptrl->expr) )
|
||||
if( !ptrl->expr.expr || eventexpr(&ptrl->expr) ) {
|
||||
DEB((D_CONFIG, "conf_next ptrl found"));
|
||||
return ptrl;
|
||||
|
||||
}
|
||||
DEB((D_CONFIG, "conf_next ptrl not found"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -91,7 +97,7 @@ long conf_number(bforce_config_keyword keyword)
|
||||
s_override *conf_override(bforce_config_keyword keyword, s_faddr addr)
|
||||
{
|
||||
s_cval_entry *ptrl;
|
||||
|
||||
DEB((D_CONFIG, "conf_override entry"));
|
||||
for( ptrl = conf_first(keyword); ptrl; ptrl = conf_next(ptrl) )
|
||||
if( !ftn_addrcomp(ptrl->d.override.addr, addr) )
|
||||
return &ptrl->d.override;
|
||||
|
||||
@@ -100,6 +100,8 @@ s_conf_entry bforce_config[BFORCE_NUMBER_OF_KEYWORDS+1] = {
|
||||
CONF_KEY(freq_srif_command, CT_STRING),
|
||||
CONF_KEY(incnet_flag, CT_STRING),
|
||||
CONF_KEY(incarc_flag, CT_STRING),
|
||||
CONF_KEY(inctic_flag, CT_STRING),
|
||||
CONF_KEY(incfile_flag, CT_STRING),
|
||||
CONF_KEY(hide_our_aka, CT_ADDRESS),
|
||||
CONF_KEY(history_file, CT_STRING),
|
||||
CONF_KEY(hydra_options, CT_OPTIONS),
|
||||
|
||||
+49
-4
@@ -178,7 +178,7 @@ static int daemon_sysentry_deinit(s_sysentry *sysent)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool daemon_node_cancall_line(const s_node *node, const s_override *ovrd)
|
||||
static int daemon_node_cancall_line(const s_node *node, const s_override *ovrd)
|
||||
{
|
||||
bool good_phone = FALSE;
|
||||
bool good_host = FALSE;
|
||||
@@ -208,6 +208,11 @@ static bool daemon_node_cancall_line(const s_node *node, const s_override *ovrd)
|
||||
if( tcpip_isgood_host(ovrd->sIpaddr) )
|
||||
good_host = TRUE;
|
||||
}
|
||||
else if ( node && *node->host )
|
||||
{
|
||||
if( tcpip_isgood_host(node->host) )
|
||||
good_host = TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check work time
|
||||
@@ -231,6 +236,16 @@ static bool daemon_node_cancall_line(const s_node *node, const s_override *ovrd)
|
||||
good_time = TRUE;
|
||||
}
|
||||
|
||||
|
||||
// Must be more complicated, i.e. call to IP even if modem is not good time
|
||||
if ( good_host )
|
||||
{
|
||||
good_time = TRUE;
|
||||
}
|
||||
|
||||
DEB((D_DAEMON, "daemon: node_cancall_line good_phone: %d, good_time:%d, good_host:%d",
|
||||
good_phone, good_time, good_host));
|
||||
|
||||
if( good_time )
|
||||
{
|
||||
if( good_host )
|
||||
@@ -323,9 +338,23 @@ static bool daemon_node_cancall(s_sysentry *syst, bool ign_wtime, bool tcpip)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Make check for tcpip out */
|
||||
if ( tcpip )
|
||||
{
|
||||
rc = daemon_node_cancall_line(&syst->node, NULL);
|
||||
DEB((D_DAEMON, "daemon tcpip: node_cancall rc=%d", rc));
|
||||
if ( rc == 2 )
|
||||
{
|
||||
syst->tcpip = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Make checks for all lines */
|
||||
if( syst->overrides )
|
||||
{
|
||||
DEB((D_DAEMON, "daemon: node_cancall OVR-IN"));
|
||||
if( syst->lineptr && syst->lineptr->hidden )
|
||||
{
|
||||
line = syst->line + 1;
|
||||
@@ -363,11 +392,18 @@ static bool daemon_node_cancall(s_sysentry *syst, bool ign_wtime, bool tcpip)
|
||||
}
|
||||
line++;
|
||||
}
|
||||
|
||||
}
|
||||
else /* Node without overriden parameters */
|
||||
{
|
||||
syst->line = line = 0;
|
||||
return daemon_node_cancall_line(&syst->node, NULL);
|
||||
rc = daemon_node_cancall_line(&syst->node, NULL);
|
||||
DEB((D_DAEMON, "daemon: node_cancall rc=%d", rc));
|
||||
if ( rc )
|
||||
{
|
||||
syst->tcpip = (rc == 2) ? TRUE : FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
@@ -687,6 +723,8 @@ int daemon_rescan_sysqueue(s_sysqueue *q, s_daemon_queue dqs[])
|
||||
|
||||
#ifdef DEBUG
|
||||
log_sysqueue(q);
|
||||
DEB((D_DAEMON, "daemon rescan_sysqueue daemon queue: MODEM: %d, %d; TCPIP: %d, %d",
|
||||
dqs[MODEM_QUEUE].circle, dqs[MODEM_QUEUE].current, dqs[TCPIP_QUEUE].circle, dqs[TCPIP_QUEUE].current));
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
@@ -1010,10 +1048,17 @@ int daemon_run(const char *confname, const char *incname, bool quit)
|
||||
timer_set(&timer_alive, DAEMON_ALIVE_TIMER);
|
||||
}
|
||||
|
||||
if( max_modem > 0 )
|
||||
daemon_queue_do(&daemon_queues[MODEM_QUEUE]);
|
||||
if( max_tcpip > 0 )
|
||||
{
|
||||
DEB((D_DAEMON,"daemon: daemon_tcpip_queue"));
|
||||
daemon_queue_do(&daemon_queues[TCPIP_QUEUE]);
|
||||
}
|
||||
|
||||
if( max_modem > 0 )
|
||||
{
|
||||
DEB((D_DAEMON,"daemon: daemon_modem_queue"));
|
||||
daemon_queue_do(&daemon_queues[MODEM_QUEUE]);
|
||||
}
|
||||
|
||||
(void)sleep(DAEMON_IDLE_SLEEP);
|
||||
break;
|
||||
|
||||
@@ -54,7 +54,12 @@ static int daemon_call_branch(s_sysentry *syst, const char *lockdir, s_modemport
|
||||
|
||||
s_bforce_opts opts;
|
||||
// TODO: add hiddenline round-robin
|
||||
opts.hiddline=0;
|
||||
memset(&opts, '\0', sizeof(s_bforce_opts));
|
||||
|
||||
opts.hiddline = 0;
|
||||
if ( syst->tcpip )
|
||||
opts.runmode = MODE_CALL_IP;
|
||||
else
|
||||
opts.runmode = MODE_CALL_DEFAULT;
|
||||
opts.ipproto = NULL;
|
||||
opts.phone = NULL;
|
||||
@@ -62,7 +67,7 @@ static int daemon_call_branch(s_sysentry *syst, const char *lockdir, s_modemport
|
||||
opts.inetd = 0;
|
||||
opts.connect = NULL;
|
||||
opts.device = NULL;
|
||||
|
||||
DEB((D_DAEMON, "daemon_call: calling call_system from branch"));
|
||||
// log("doing call_system");
|
||||
return call_system(syst->node.addr, &opts);
|
||||
}
|
||||
@@ -88,7 +93,10 @@ int daemon_call(s_sysentry *syst)
|
||||
* Check whether this node is allready locked
|
||||
*/
|
||||
if( out_bsy_check(syst->node.addr) )
|
||||
{
|
||||
DEB((D_DAEMON, "daemon_call: node locked by .bsy file"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set state structure to make expressions works properly now
|
||||
@@ -101,6 +109,7 @@ int daemon_call(s_sysentry *syst)
|
||||
|
||||
if( syst->tcpip == FALSE )
|
||||
{
|
||||
DEB((D_DAEMON, "daemon_call: tcpip false - prep modem line"));
|
||||
if( (p_lockdir = conf_string(cf_uucp_lock_directory)) == NULL )
|
||||
p_lockdir = BFORCE_LOCK_DIR;
|
||||
|
||||
@@ -110,6 +119,9 @@ int daemon_call(s_sysentry *syst)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
DEB((D_DAEMON, "call %s line %d via %s",
|
||||
ftn_addrstr(abuf, syst->node.addr), syst->line,
|
||||
syst->tcpip ? "TCP/IP" : modemport->name));
|
||||
|
||||
log("call %s line %d via %s",
|
||||
ftn_addrstr(abuf, syst->node.addr), syst->line,
|
||||
@@ -138,7 +150,7 @@ int daemon_call(s_sysentry *syst)
|
||||
}
|
||||
|
||||
/* Now we are in child process */
|
||||
|
||||
DEB((D_DAEMON, "daemon_call: fork success - calling..."));
|
||||
exit(daemon_call_branch(syst, p_lockdir, modemport));
|
||||
}
|
||||
|
||||
|
||||
@@ -950,7 +950,7 @@ int yydebug;
|
||||
`-----------------------------------------------*/
|
||||
|
||||
static void
|
||||
yydestruct (const char *yymsg,
|
||||
yydestruct (char *yymsg,
|
||||
yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
|
||||
{
|
||||
YY_USE (yyvaluep);
|
||||
@@ -1059,6 +1059,7 @@ yysetstate:
|
||||
/* Give user a chance to reallocate the stack. Use copies of
|
||||
these so that the &'s don't force the real ones into
|
||||
memory. */
|
||||
YYSTYPE *yyls1 = yyls;
|
||||
yy_state_t *yyss1 = yyss;
|
||||
YYSTYPE *yyvs1 = yyvs;
|
||||
|
||||
@@ -1069,7 +1070,9 @@ yysetstate:
|
||||
yyoverflow (YY_("memory exhausted"),
|
||||
&yyss1, yysize * YYSIZEOF (*yyssp),
|
||||
&yyvs1, yysize * YYSIZEOF (*yyvsp),
|
||||
&yyls1, yysize * YYSIZEOF (*yylsp),
|
||||
&yystacksize);
|
||||
yyls = yyls1;
|
||||
yyss = yyss1;
|
||||
yyvs = yyvs1;
|
||||
}
|
||||
|
||||
@@ -360,7 +360,8 @@ static int expr_check_mailer(const char *str)
|
||||
|
||||
static int expr_check_addr(const char *str)
|
||||
{
|
||||
s_faddr addr;
|
||||
s_faddr addr = { 0, 0, 0, 0, 0, '\0' };
|
||||
|
||||
#ifdef DEBUG
|
||||
char abuf1[BF_MAXADDRSTR+1];
|
||||
char abuf2[BF_MAXADDRSTR+1];
|
||||
@@ -368,6 +369,7 @@ static int expr_check_addr(const char *str)
|
||||
DEB((D_EVENT, "[yacc] addr: \"%s\" (session with \"%s\")",
|
||||
ftn_addrstr(abuf1, addr),
|
||||
ftn_addrstr(abuf2, state.node.addr)));
|
||||
|
||||
#endif
|
||||
|
||||
if( !state.valid )
|
||||
|
||||
+71
-20
@@ -19,29 +19,49 @@
|
||||
|
||||
#define DEFAULT_PORT 60179 /* Birthday .. mother fucker :) */
|
||||
|
||||
struct addrinfo *ai = NULL;
|
||||
|
||||
static RETSIGTYPE tcpip_interrupt(int sig)
|
||||
{
|
||||
tty_abort = TRUE;
|
||||
log("terminating on signal %d", sig);
|
||||
(void)log("terminating on signal %d", sig);
|
||||
}
|
||||
|
||||
static RETSIGTYPE tcpip_brokenpipe(int sig)
|
||||
{
|
||||
tty_abort = TRUE;
|
||||
if( tty_online )
|
||||
log("connection closed");
|
||||
(void)log("connection closed");
|
||||
else
|
||||
log("terminating on signal %d", sig);
|
||||
(void)log("terminating on signal %d", sig);
|
||||
}
|
||||
|
||||
static int tcpip_connect2(struct sockaddr_in server)
|
||||
static int tcpip_connect2(struct addrinfo *ai)
|
||||
{
|
||||
int fd;
|
||||
int fd = -1;
|
||||
char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];
|
||||
|
||||
DEB((D_INFO, "tcpip_connect2: trying \"%s\" at port %d",
|
||||
inet_ntoa(server.sin_addr), (int)ntohs(server.sin_port)));
|
||||
struct addrinfo *rai;
|
||||
|
||||
if( (fd = socket(AF_INET, SOCK_STREAM, 0)) < 0 )
|
||||
for (rai = ai; rai != NULL; rai = rai->ai_next)
|
||||
{
|
||||
if (getnameinfo(rai->ai_addr, rai->ai_addrlen, hbuf, sizeof(hbuf), sbuf,
|
||||
sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV) == 0)
|
||||
DEB((D_INFO, "tcpip_connect2: trying host=%s, serv=%s", hbuf, sbuf));
|
||||
|
||||
fd = socket (rai->ai_family, rai->ai_socktype, rai->ai_protocol);
|
||||
|
||||
if ( fd == -1 )
|
||||
{
|
||||
DEB((D_INFO, "tcpip_connect2: socket error"));
|
||||
}
|
||||
else break;
|
||||
|
||||
hbuf[0]='\0';
|
||||
sbuf[0]='\0';
|
||||
}
|
||||
DEB((D_INFO, "tcpip_connect2: socket success: %d", fd));
|
||||
if (fd < 0 )
|
||||
{
|
||||
logerr("can't create socket");
|
||||
return(1);
|
||||
@@ -84,9 +104,9 @@ static int tcpip_connect2(struct sockaddr_in server)
|
||||
clearerr(stdout);
|
||||
clearerr(stderr);
|
||||
|
||||
if( connect(0, (struct sockaddr*)&server, sizeof(server)) == -1 )
|
||||
if( connect(0, rai->ai_addr, rai->ai_addrlen) == -1 )
|
||||
{
|
||||
logerr("can't connect to %s", inet_ntoa(server.sin_addr));
|
||||
logerr("can't connect to %s", hbuf);
|
||||
close(0);
|
||||
close(1);
|
||||
close(2);
|
||||
@@ -99,8 +119,7 @@ static int tcpip_connect2(struct sockaddr_in server)
|
||||
return 1;
|
||||
}
|
||||
|
||||
log("TCP/IP connect to %s on port %d",
|
||||
inet_ntoa(server.sin_addr), (int)ntohs(server.sin_port));
|
||||
(void)log("TCP/IP connect success to %s on service %s", hbuf, sbuf);
|
||||
|
||||
return(0);
|
||||
}
|
||||
@@ -108,14 +127,23 @@ static int tcpip_connect2(struct sockaddr_in server)
|
||||
int tcpip_connect(const char *hostname, e_tcpmode tcpmode)
|
||||
{
|
||||
int rc = 0;
|
||||
struct hostent *he = NULL;
|
||||
struct servent *se = NULL;
|
||||
struct sockaddr_in server;
|
||||
//struct hostent *he = NULL;
|
||||
//struct servent *se = NULL;
|
||||
//struct sockaddr_in server;
|
||||
//struct sockaddr_storage server;
|
||||
|
||||
struct addrinfo *aisave = NULL;
|
||||
struct addrinfo aihints;
|
||||
int nameres = 0;
|
||||
|
||||
|
||||
char *host = xstrcpy(hostname);
|
||||
char *p = strrchr(host, ':');
|
||||
const char *port = NULL;
|
||||
|
||||
server.sin_family = AF_INET;
|
||||
|
||||
// AF_INET - only IPv4
|
||||
//server.sin_family = AF_INET;
|
||||
|
||||
if( p )
|
||||
{ *p++ = '\0'; port = p; }
|
||||
@@ -126,15 +154,31 @@ int tcpip_connect(const char *hostname, e_tcpmode tcpmode)
|
||||
else /* Can not rely on /etc/services - it is not well-known port */
|
||||
port = "60179";
|
||||
|
||||
// Do not need it
|
||||
/*
|
||||
if( ISDEC(port) )
|
||||
server.sin_port = htons(atoi(port));
|
||||
else if( (se = getservbyname(port, "tcp")) )
|
||||
server.sin_port = se->s_port;
|
||||
else
|
||||
{ log("invalid port or service name \"%s\"", port); rc = 1; }
|
||||
*/
|
||||
//if( rc == 0 )
|
||||
//{
|
||||
DEB((D_INFO, "tcpip_connect: port is %s", port));
|
||||
memset( &aihints, 0, sizeof( aihints) );
|
||||
aihints.ai_family = AF_UNSPEC;
|
||||
//aihints.ai_socktype = SOCK_STREAM;
|
||||
aihints.ai_protocol = IPPROTO_TCP;
|
||||
|
||||
if( rc == 0 )
|
||||
nameres = getaddrinfo ( host, port, &aihints, &ai );
|
||||
if ( nameres != 0 )
|
||||
{
|
||||
rc = 1;
|
||||
log("Resolver error for host %s, port %s: \"%s\".", host, port, gai_strerror(nameres));
|
||||
}
|
||||
// GetHostByName works with IPv4 only and *deprecated*
|
||||
/*
|
||||
if( (he = gethostbyname(host)) )
|
||||
{
|
||||
memcpy(&server.sin_addr, he->h_addr, he->h_length);
|
||||
@@ -159,12 +203,19 @@ int tcpip_connect(const char *hostname, e_tcpmode tcpmode)
|
||||
log("unknown error while resolving host \"%s\"", host);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} */
|
||||
//}
|
||||
|
||||
if( host ) { free(host); host = NULL; }
|
||||
DEB((D_INFO, "tcpip_connect: resolver got result!"));
|
||||
aisave = ai;
|
||||
|
||||
return rc ? rc : tcpip_connect2(server);
|
||||
if (rc == 0 )
|
||||
rc = tcpip_connect2(ai);
|
||||
|
||||
freeaddrinfo( aisave );
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int tcpip_init(void)
|
||||
|
||||
@@ -118,6 +118,9 @@ int tio_get(int fd, TIO *tio)
|
||||
{
|
||||
#ifdef HAVE_TERMIOS_H
|
||||
return tcgetattr(fd, tio);
|
||||
#else
|
||||
DEB(("io_unix_tio: TERMIOS not supported!"));
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -127,6 +130,9 @@ int tio_set(int fd, TIO *tio)
|
||||
{
|
||||
#ifdef HAVE_TERMIOS_H
|
||||
return tcsetattr(fd, TCSANOW, tio);
|
||||
#else
|
||||
DEB(("io_unix_tio: TERMIOS not supported!"));
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -177,7 +183,7 @@ int tio_get_speed(TIO *tio)
|
||||
return speedtab[i].nspeed;
|
||||
}
|
||||
|
||||
return-1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int tio_set_flow_control(int fd, TIO *tio, int flow)
|
||||
|
||||
+18
-12
@@ -106,11 +106,15 @@ int log_open(const char *logname, const char *ext, const char *tty)
|
||||
|
||||
if( logname )
|
||||
{
|
||||
DEB((D_INFO,"log_open: Opening log file %s", logname));
|
||||
|
||||
strnxcpy(log_name, logname, sizeof(log_name));
|
||||
|
||||
// May be NULL, so check both
|
||||
if( tty && *tty )
|
||||
strnxcpy(log_ttyname, tty, sizeof(log_ttyname));
|
||||
|
||||
// May be NULL, so check both
|
||||
if( ext && *ext )
|
||||
{
|
||||
strnxcpy(log_extension, ext, sizeof(log_extension));
|
||||
@@ -142,7 +146,9 @@ int log_close(void)
|
||||
|
||||
if( log_fp )
|
||||
{
|
||||
rc = fclose(log_fp); log_fp = NULL;
|
||||
rc = fclose(log_fp);
|
||||
DEB((D_INFO,"Closing log file."));
|
||||
log_fp = NULL;
|
||||
}
|
||||
|
||||
return rc;
|
||||
@@ -166,7 +172,7 @@ int log_reopen(const char *logname, const char *ext, const char *tty)
|
||||
}
|
||||
|
||||
|
||||
int log(const char *s, ...)
|
||||
void log(const char *s, ...)
|
||||
|
||||
{
|
||||
char timestr[40];
|
||||
@@ -206,10 +212,10 @@ int log(const char *s, ...)
|
||||
|
||||
va_end(args);
|
||||
|
||||
return 0;
|
||||
//return 0;
|
||||
}
|
||||
|
||||
int logerr(const char *s, ...)
|
||||
void logerr(const char *s, ...)
|
||||
{
|
||||
char timestr[40];
|
||||
va_list args;
|
||||
@@ -275,7 +281,7 @@ int logerr(const char *s, ...)
|
||||
|
||||
va_end(args);
|
||||
|
||||
return 0;
|
||||
//return 0;
|
||||
}
|
||||
|
||||
#endif /* USE_SYSLOG */
|
||||
@@ -302,7 +308,7 @@ int log_open(const char *logname, const char *ext, const char *tty)
|
||||
p = xstrcat(p, BF_VERSION);
|
||||
int fac = conf_number(cf_syslog_facility);
|
||||
if( tty && *tty )
|
||||
strncpy(p, tty, sizeof(p));
|
||||
strncpy(p, tty, strlen(p));
|
||||
openlog(p, LOG_PID, fac);
|
||||
slog_active = TRUE;
|
||||
return 0;
|
||||
@@ -324,7 +330,7 @@ int log_close(void)
|
||||
|
||||
}
|
||||
|
||||
int log(const char *s, ...)
|
||||
void log(const char *s, ...)
|
||||
|
||||
{
|
||||
char timestr[40];
|
||||
@@ -351,10 +357,10 @@ int log(const char *s, ...)
|
||||
|
||||
va_end(args);
|
||||
|
||||
return 0;
|
||||
//return 0;
|
||||
}
|
||||
|
||||
int logerr(const char *s, ...)
|
||||
void logerr(const char *s, ...)
|
||||
|
||||
{
|
||||
char timestr[40];
|
||||
@@ -373,7 +379,7 @@ int logerr(const char *s, ...)
|
||||
|
||||
va_end(args);
|
||||
|
||||
return 0;
|
||||
// return 0;
|
||||
}
|
||||
|
||||
#endif /* USE_SYSLOG */
|
||||
@@ -524,7 +530,7 @@ int debug_close(void)
|
||||
return rc;
|
||||
}
|
||||
|
||||
int debug(unsigned long what, const char *str, ...)
|
||||
void debug(unsigned long what, const char *str, ...)
|
||||
{
|
||||
char buf[40];
|
||||
va_list args;
|
||||
@@ -548,7 +554,7 @@ int debug(unsigned long what, const char *str, ...)
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
//return 0;
|
||||
}
|
||||
|
||||
#endif /* DEBUG */
|
||||
|
||||
@@ -56,18 +56,25 @@ int nodelist_checkflag(const char *nodeflags, const char *flag)
|
||||
const char *searchbase = nodeflags;
|
||||
char *q;
|
||||
|
||||
while( p = strstr(searchbase, flag) )
|
||||
DEB((D_NODELIST, "nodelist: checking flag \"%s\" in flags \"%s\"", flag, nodeflags));
|
||||
if ( nodeflags ) {
|
||||
while( p = strcasestr(searchbase, flag) ) // p - found flag
|
||||
{
|
||||
if( p == searchbase || *(p-1) == ',' )
|
||||
if( (p == searchbase) || (p != searchbase && *(p-1) == ',') )
|
||||
{
|
||||
if( (q = strchr(p, ',')) == NULL || (q - p) == strlen(flag) )
|
||||
if( (q = strchr(p, ',')) == NULL || (q - p) == strlen(flag) ) {
|
||||
DEB((D_NODELIST, "nodelist: found flag %s", flag));
|
||||
return 0;
|
||||
if( (strchrnul(p, ':') - p) == strlen(flag) )
|
||||
}
|
||||
if( (strchrnul(p, ':') - p) == strlen(flag) ) {
|
||||
DEB((D_NODELIST, "nodelist: found flag %s", flag));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
searchbase = p + 1; // avoid finding again the same
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -243,7 +250,7 @@ int nodelist_parsestring(s_node *node, char *str)
|
||||
strnxcpy(node->phone, argv[NODELIST_POSPHONE], sizeof(node->phone));
|
||||
strnxcpy(node->flags, argv[NODELIST_POSFLAGS], sizeof(node->flags));
|
||||
node->speed = atoi(argv[NODELIST_POSSPEED]);
|
||||
|
||||
DEB((D_NODELIST, "nodelist: Parsed common values SYS: %s, ZYZ: %s, LOC: %s, PHONE: %s", node->name, node->sysop, node->location, node->phone));
|
||||
/*
|
||||
* Replace all '_' by space character
|
||||
*/
|
||||
@@ -291,8 +298,11 @@ int nodelist_parsestring(s_node *node, char *str)
|
||||
node->do_ifcico = nodelist_checkflag(node->flags, "IFC") == 0;
|
||||
node->do_telnet = nodelist_checkflag(node->flags, "ITN") == 0;
|
||||
|
||||
//TODO: Add more INA flags to array
|
||||
nodelist_flagvalue(node->flags, "INA", node->host);
|
||||
|
||||
DEB((D_NODELIST, "nodelist: Parsed inet values IBN: %d, IFC: %d, ITN: %d, INA: %s", node->do_binkp, node->do_ifcico, node->do_telnet, node->host));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+11
-3
@@ -152,6 +152,7 @@ int exec_redirect_descriptor(int desc, const char *fname, int flags)
|
||||
{
|
||||
log("exec error: cannot open \"%s\" <--> %d (got %d)",
|
||||
fname, desc, fd);
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -329,6 +330,7 @@ int xsystem(const char *command, const char *p_input, const char *p_output)
|
||||
{
|
||||
pid_t pid;
|
||||
int status;
|
||||
int fd;
|
||||
|
||||
ASSERT(command != NULL);
|
||||
|
||||
@@ -342,27 +344,33 @@ int xsystem(const char *command, const char *p_input, const char *p_output)
|
||||
if( p_input )
|
||||
{
|
||||
close(0);
|
||||
if( open(p_input, O_RDONLY) != 0 )
|
||||
fd = open(p_input, O_RDONLY);
|
||||
if( fd != 0 )
|
||||
{
|
||||
logerr("can't open stdin \"%s\"", p_input);
|
||||
close(fd);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
if( p_output )
|
||||
{
|
||||
close(1);
|
||||
if( open(p_output, O_WRONLY|O_APPEND|O_CREAT, 0600) != 1 )
|
||||
fd = open(p_output, O_WRONLY|O_APPEND|O_CREAT, 0600);
|
||||
if( fd != 1 )
|
||||
{
|
||||
logerr("can't open stdout \"%s\"", p_output);
|
||||
close(fd);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
if( p_output )
|
||||
{
|
||||
close(2);
|
||||
if( open(p_output, O_WRONLY|O_APPEND|O_CREAT, 0600) != 2 )
|
||||
fd = open(p_output, O_WRONLY|O_APPEND|O_CREAT, 0600);
|
||||
if( fd != 2 )
|
||||
{
|
||||
logerr("can't open stderr \"%s\"", p_output);
|
||||
close(fd);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ int out_filetype(const char *fname)
|
||||
else
|
||||
p_nam = fname;
|
||||
|
||||
DEB((D_EVENT, "outb_fsqueue: getting type of file %s", p_nam));
|
||||
/*
|
||||
* Get file name extension
|
||||
*/
|
||||
@@ -39,12 +40,19 @@ int out_filetype(const char *fname)
|
||||
|
||||
for( i = 0; outtab[i].ext; i++ )
|
||||
if( strcasemask(p_ext, outtab[i].ext) == 0 )
|
||||
{
|
||||
DEB((D_EVENT, "outb_fsqueue: got type %d from outtab ext %s", outtab[i].type, p_ext ));
|
||||
return outtab[i].type;
|
||||
}
|
||||
|
||||
for( i = 0; exttab[i].ext; i++ )
|
||||
if( strcasemask(p_ext, exttab[i].ext) == 0 )
|
||||
{
|
||||
DEB((D_EVENT, "outb_fsqueue: got type %d from exttab ext %s", exttab[i].type, p_ext ));
|
||||
return exttab[i].type;
|
||||
}
|
||||
|
||||
DEB((D_EVENT, "outb_fsqueue: got type UNKNOWN", exttab[i].type, p_ext ));
|
||||
return TYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
|
||||
+81
-36
@@ -95,12 +95,12 @@ int binkp_loop(s_binkp_state *bstate) {
|
||||
bstate->emptyloop = 0;
|
||||
bstate->continuesend = false;
|
||||
|
||||
unsigned short read_pos=0;
|
||||
unsigned short read_blklen=0;
|
||||
unsigned short want_read=BINKP_HEADER;
|
||||
uint16_t read_pos=0;
|
||||
uint16_t read_blklen=0;
|
||||
uint16_t want_read=BINKP_HEADER;
|
||||
|
||||
unsigned short write_pos=0;
|
||||
unsigned short have_to_write=0;
|
||||
uint16_t write_pos=0;
|
||||
uint16_t have_to_write=0;
|
||||
|
||||
int n, m;
|
||||
bool no_more_to_send = false;
|
||||
@@ -124,7 +124,7 @@ int binkp_loop(s_binkp_state *bstate) {
|
||||
bstate->continuesend = false;
|
||||
}
|
||||
|
||||
if (have_to_write==0 && (!no_more_to_send || bstate->extracmd[0]!=-1)) {
|
||||
if (have_to_write==0 && (!no_more_to_send || bstate->extracmd[0]!=(char)-1)) {
|
||||
m = binkp_getforsend(bstate, writebuf+BINKP_HEADER, &block_type, &block_length);
|
||||
if(m==1 || m==3) {
|
||||
//DEB((D_24554, "got block for sending %d %hu", block_type, block_length));
|
||||
@@ -140,6 +140,7 @@ int binkp_loop(s_binkp_state *bstate) {
|
||||
return PRC_ERROR;
|
||||
}
|
||||
writebuf[1] = block_length&0xff;
|
||||
// TODO: FIX unprotected mode
|
||||
if (bstate->mode==bmode_transfer && bstate->remote_data->options&BINKP_OPT_CRYPT)
|
||||
encrypt_buf(writebuf, have_to_write, bstate->remote_data->keys_out);
|
||||
}
|
||||
@@ -209,15 +210,19 @@ int binkp_loop(s_binkp_state *bstate) {
|
||||
log("read: remote socket shutdown");
|
||||
return PRC_REMOTEABORTED;
|
||||
}
|
||||
if (bstate->mode==bmode_transfer && bstate->remote_data->options & BINKP_OPT_CRYPT)
|
||||
// TODO: FIX unprotected mode
|
||||
if (bstate->mode==bmode_transfer && bstate->remote_data->options & BINKP_OPT_CRYPT) {
|
||||
decrypt_buf(readbuf+read_pos, n, bstate->remote_data->keys_in);
|
||||
} else {
|
||||
DEB((D_24554,"binkp: not encripted transfer"));
|
||||
};
|
||||
DEB((D_24554, "got %d bytes", n));
|
||||
want_read -= n;
|
||||
read_pos += n;
|
||||
if (read_pos == BINKP_HEADER) {
|
||||
// have read header, want read body
|
||||
DEB((D_24554, "it should be 0: %d", want_read));
|
||||
want_read = ((unsigned short)(readbuf[0]&0x7F)<<8) | readbuf[1];
|
||||
want_read = ((uint16_t)(readbuf[0]&0x7F)<<8) | (uint16_t)readbuf[1];
|
||||
DEB((D_24554, "got block header, block length %u", want_read));
|
||||
} // no else here: if want_read may be zero here for zero length block
|
||||
}
|
||||
@@ -228,6 +233,7 @@ int binkp_loop(s_binkp_state *bstate) {
|
||||
block_length = read_pos - BINKP_HEADER;
|
||||
DEB((D_24554, "binkp: complete block is received %d %hu", block_type, block_length));
|
||||
m = binkp_doreceiveblock(bstate, readbuf+BINKP_HEADER, block_type, block_length);
|
||||
DEB((D_24554, "binkp: dorecieveblock result is %d", m));
|
||||
if(m==1) {
|
||||
DEB((D_24554, "block is successfully accepted"));
|
||||
read_pos = 0;
|
||||
@@ -340,7 +346,7 @@ int binkp_getforsend(s_binkp_state *bstate, char *buf, int *block_type, unsigned
|
||||
{
|
||||
int my_sf, wr_pos;
|
||||
int n; // read file
|
||||
if (bstate->extracmd[0]!=-1) {
|
||||
if (bstate->extracmd[0]!=(char)-1) {
|
||||
DEB((D_24554, "Send cmd to remote %d %s", bstate->extracmd[0], bstate->extracmd+1));
|
||||
buf[0] = bstate->extracmd[0];
|
||||
strcpy(buf+1, bstate->extracmd+1);
|
||||
@@ -419,6 +425,7 @@ case 7:
|
||||
// seems not to remove files from inbound until successful session end is enough to eliminate dupes
|
||||
// if (!nodelist_checkflag (state.node.flags, "ND"))
|
||||
// strcat(buf+1, " ND");
|
||||
// TODO: add GZ BZ2 and maybe EXTCMD
|
||||
*block_length = 1 + strlen(buf+1);
|
||||
DEB((D_24554, "send M_NUL %s", buf+1));
|
||||
return 1;
|
||||
@@ -516,27 +523,48 @@ case 3: // send password on outgoing or pw confirmation on incoming
|
||||
|
||||
|
||||
case 4:
|
||||
;
|
||||
char pbuf[32];
|
||||
int pwset = 0;
|
||||
|
||||
if (bstate->mode==bmode_incoming_handshake) {
|
||||
char * p;
|
||||
DEB((D_24554, "incoming handshake is complete"));
|
||||
bstate->complete = true;
|
||||
char *p;
|
||||
char pbuf[32];
|
||||
|
||||
for (i=0;i<state.n_remoteaddr;i++)
|
||||
if( !session_get_password(state.remoteaddrs[i].addr, pbuf, sizeof(pbuf)) ){
|
||||
init_keys(bstate->remote_data->keys_in, pbuf?pbuf:"-");
|
||||
pwset = 1;
|
||||
init_keys(bstate->remote_data->keys_in, pbuf[0]?pbuf:"-");
|
||||
init_keys(bstate->remote_data->keys_out, "-");
|
||||
for (p=pbuf?pbuf:"-"; *p; p++)
|
||||
for (p=pbuf[0]?pbuf:"-"; *p; p++)
|
||||
update_keys(bstate->remote_data->keys_out, (int)*p);
|
||||
}
|
||||
//TODO: FIX incoming options
|
||||
}
|
||||
else {
|
||||
//TODO: Fix outgoing options
|
||||
DEB((D_24554, "outgoing handshake: everything is sent"));
|
||||
for (i=0;i<state.n_remoteaddr;i++)
|
||||
if( !session_get_password(state.remoteaddrs[i].addr, pbuf, sizeof(pbuf)) ){
|
||||
pwset = 1;
|
||||
}
|
||||
|
||||
}
|
||||
// We have password-protected link. Remote options are already set,
|
||||
// Now we determine how to CRYPT or not to CRYPT our file transfer
|
||||
// Our CRYPT flag is always sent, so if the other side have CRYPT
|
||||
// and link is password is set - The CRYPT must be
|
||||
// Literally: if we have no pass -> drop the CRYPT flag
|
||||
if ( !pwset ) {
|
||||
DEB((D_24554, "binkp handshake: password NOT set, dropping CRYPT"));
|
||||
bstate->remote_data->options &= !BINKP_OPT_CRYPT;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
}
|
||||
else if (bstate->mode == bmode_transfer) {
|
||||
else if (bstate->mode == bmode_transfer) {
|
||||
|
||||
switch (bstate->phase) {
|
||||
send_next_file:
|
||||
@@ -651,7 +679,10 @@ bstate->extracmd[0] = BPMSG_ERR; strcpy(bstate->extracmd+1, msg); bstate->extrai
|
||||
|
||||
int binkp_doreceiveblock(s_binkp_state *bstate, char *buf, int block_type, unsigned short block_length)
|
||||
{
|
||||
DEB((D_24554, "dorecieveblock_type: %d", block_type));
|
||||
DEB((D_24554, "dorecieveblock_bytes: %x %x %x %x", buf[0], buf[1], buf[2], buf[3]));
|
||||
switch (block_type) {
|
||||
|
||||
case BINKP_BLK_CMD:
|
||||
if (block_length<1) {
|
||||
PROTO_ERROR("Zero length command received")
|
||||
@@ -668,12 +699,12 @@ case BPMSG_ADR: /* List of addresses */
|
||||
if (bstate->address_established) {
|
||||
PROTO_ERROR("remote tries to change address");
|
||||
}
|
||||
if( bstate->extracmd[0] !=-1 ) return 0; // suspend !!!
|
||||
if( bstate->extracmd[0] != (char)-1 ) return 0; // suspend !!!
|
||||
binkp_process_ADR(buf+1);
|
||||
|
||||
if( !state.n_remoteaddr ) {
|
||||
log("error: remote did not supplied any addresses");
|
||||
if( bstate->extracmd[0] !=-1 ) return 0; // suspend
|
||||
if( bstate->extracmd[0] != (char)-1 ) return 0; // suspend
|
||||
bstate->extracmd[0] = BPMSG_BSY;
|
||||
strcpy(bstate->extracmd+1, "No addresses was presented");
|
||||
bstate->extraislast = true;
|
||||
@@ -687,14 +718,17 @@ case BPMSG_ADR: /* List of addresses */
|
||||
bstate->extraislast = false;
|
||||
sprintf(bstate->extracmd+1,"OPT MB CRYPT");
|
||||
s_override ovr;
|
||||
DEB((D_24554, "process adr overrides"));
|
||||
for(i = 0; i < state.n_remoteaddr; i++) {
|
||||
ovr.sFlags = "";
|
||||
override_get (&ovr, state.remoteaddrs[i].addr, 0);
|
||||
DEB((D_24554, "got adr overrides"));
|
||||
if (nodelist_checkflag (ovr.sFlags, "NR")==0) {
|
||||
strcat (bstate->extracmd+1, " NR");
|
||||
break;
|
||||
}
|
||||
}
|
||||
DEB((D_24554, "process adr overrides"));
|
||||
}
|
||||
// further use extracmd only for errors
|
||||
|
||||
@@ -740,7 +774,7 @@ case BPMSG_PWD: /* Session password */
|
||||
/* Do authorization */
|
||||
if( binkp_auth_incoming(bstate->remote_data) ) {
|
||||
log("error: invalid password");
|
||||
if( bstate->extracmd[0] !=-1 ) return 0; // suspend if extra is occupied
|
||||
if( bstate->extracmd[0] != (char)-1 ) return 0; // suspend if extra is occupied
|
||||
bstate->extracmd[0] = BPMSG_ERR;
|
||||
strcpy(bstate->extracmd+1, "Security violation");
|
||||
bstate->extraislast = true;
|
||||
@@ -749,7 +783,7 @@ case BPMSG_PWD: /* Session password */
|
||||
// lock addresses
|
||||
if( session_addrs_lock(state.remoteaddrs, state.n_remoteaddr) ) {
|
||||
log("error locking addresses of the remote");
|
||||
if( bstate->extracmd[0] !=-1 ) return 0; // suspend if extra is occupied
|
||||
if( bstate->extracmd[0] != (char)-1 ) return 0; // suspend if extra is occupied
|
||||
bstate->extracmd[0] = BPMSG_BSY;
|
||||
strcpy(bstate->extracmd+1, "All addresses are busy");
|
||||
bstate->extraislast = true;
|
||||
@@ -770,6 +804,7 @@ case BPMSG_FILE: /* File information */
|
||||
s_bpfinfo recvfi;
|
||||
if( binkp_parsfinfo(buf+1, &recvfi, true) ) {
|
||||
log ("M_FILE parse error: %s", buf + 1);
|
||||
DEB((D_24554, "M_FILE parse error: %s", buf + 1 ));
|
||||
PROTO_ERROR("invalid M_FILE");
|
||||
}
|
||||
bstate->batch_recv_count += 1;
|
||||
@@ -786,9 +821,9 @@ case BPMSG_FILE: /* File information */
|
||||
return 1;
|
||||
}
|
||||
DEB((D_24554, "no, skipping; TODO: accept it"));
|
||||
if( bstate->extracmd[0] != -1 ) return 0;
|
||||
if( bstate->extracmd[0] != (char)-1 ) return 0;
|
||||
bstate->extracmd[0] = BPMSG_SKIP;
|
||||
sprintf(bstate->extracmd+1, "%s %ld %ld %ld", recvfi.fn, recvfi.sz, recvfi.tm);
|
||||
sprintf(bstate->extracmd+1, "%s %ld %ld %ld", recvfi.fn, recvfi.sz, recvfi.tm, recvfi.offs);
|
||||
bstate->extraislast = false;
|
||||
return 1;
|
||||
}
|
||||
@@ -798,7 +833,7 @@ case BPMSG_FILE: /* File information */
|
||||
PROTO_ERROR("invalid mode for M_FILE");
|
||||
}
|
||||
|
||||
if( bstate->extracmd[0] != -1 ) return 0;
|
||||
if( bstate->extracmd[0] != (char)-1 ) return 0;
|
||||
switch(p_rx_fopen(bstate->pi, recvfi.fn, recvfi.sz, recvfi.tm, 0)) {
|
||||
case 0:
|
||||
if (bstate->pi->recv->bytes_skipped == recvfi.offs) {
|
||||
@@ -844,7 +879,7 @@ case BPMSG_OK: /* Password was acknowleged (data ignored) */
|
||||
}
|
||||
if (session_addrs_lock(state.remoteaddrs, state.n_remoteaddr)) {
|
||||
log("error: unable to lock");
|
||||
if (bstate->extracmd[0]!=-1) return 0;
|
||||
if (bstate->extracmd[0]!= (char)-1) return 0;
|
||||
bstate->extracmd[0] = BPMSG_BSY;
|
||||
strcpy(bstate->extracmd+1, "All addresses are busy");
|
||||
bstate->extraislast = true;
|
||||
@@ -920,10 +955,10 @@ got_skip:
|
||||
|
||||
check_that_all_files_are_confirmed:
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < bstate->pi->n_sentfiles; i++) {
|
||||
int j;
|
||||
for (j = 0; j < bstate->pi->n_sentfiles; j++) {
|
||||
if (bstate->pi->sentfiles[i].status == FSTAT_WAITACK) {
|
||||
DEB((D_24554, "sent file %d waits for acknowlede", i));
|
||||
DEB((D_24554, "sent file %d waits for acknowlede", j));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -954,7 +989,7 @@ case BPMSG_GET: /* Get a file from offset */
|
||||
}
|
||||
DEB((D_24554, "M_GET file %s size %d time %d offset %d", getfi.fn, getfi.sz, getfi.tm, getfi.offs));
|
||||
|
||||
if (bstate->extracmd[0] != -1) return 0;
|
||||
if (bstate->extracmd[0] != (char)-1) return 0;
|
||||
|
||||
if (bstate->pi->send) if (p_compfinfo(bstate->pi->send, getfi.fn, getfi.sz, getfi.tm)==0) {
|
||||
DEB((D_24554, "M_GET for currently transmitted file"));
|
||||
@@ -1044,14 +1079,14 @@ case BINKP_BLK_DATA:
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (bstate->extracmd[0] != -1) return 0;
|
||||
if (bstate->extracmd[0] != (char)-1) return 0;
|
||||
|
||||
long int n;
|
||||
n = p_rx_writefile(buf, block_length, bstate->pi);
|
||||
|
||||
if( n < 0 ) {
|
||||
log("error writing local file");
|
||||
if( n == -2 ) {
|
||||
if( n == (long int)-2 ) {
|
||||
bstate->extracmd[0] = BPMSG_GOT;
|
||||
sprintf(bstate->extracmd+1, "%s %ld %ld", bstate->pi->recv->net_name, (long)bstate->pi->recv->bytes_total,
|
||||
(long)bstate->pi->recv->mod_time);
|
||||
@@ -1080,11 +1115,13 @@ case BINKP_BLK_DATA:
|
||||
p_rx_fclose(bstate->pi);
|
||||
PROTO_ERROR("extra data for file")
|
||||
}
|
||||
else if( bstate->pi->recv->bytes_received == bstate->pi->recv->bytes_total ) {
|
||||
else if( bstate->pi->recv->bytes_received == bstate->pi->recv->bytes_total )
|
||||
{
|
||||
DEB((D_24554, "receive completed"));
|
||||
bstate->frs = frs_nothing;
|
||||
bstate->pi->recv->status = FSTAT_SUCCESS;
|
||||
if( !p_rx_fclose(bstate->pi) ) {
|
||||
if( !p_rx_fclose(bstate->pi) )
|
||||
{
|
||||
bstate->extracmd[0] = BPMSG_GOT;
|
||||
sprintf(bstate->extracmd+1, "%s %ld %ld",
|
||||
bstate->pi->recv->net_name, (long)bstate->pi->recv->bytes_total,
|
||||
@@ -1092,7 +1129,8 @@ case BINKP_BLK_DATA:
|
||||
bstate->extraislast = false;
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
DEB((D_24554, "some error committing file"));
|
||||
bstate->extracmd[0] = BPMSG_SKIP;
|
||||
sprintf(bstate->extracmd+1, "%s %ld %ld",
|
||||
@@ -1101,7 +1139,9 @@ case BINKP_BLK_DATA:
|
||||
bstate->extraislast = false;
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
DEB((D_24554, "data block accepted"));
|
||||
return 1;
|
||||
}
|
||||
@@ -1117,7 +1157,7 @@ default:
|
||||
|
||||
void binkp_process_NUL(s_binkp_sysinfo *remote_data, char *buffer)
|
||||
{
|
||||
char *p, *q;
|
||||
|
||||
|
||||
if( strncmp(buffer, "SYS ", 4) == 0 )
|
||||
strnxcpy(remote_data->systname, buffer+4, sizeof(remote_data->systname));
|
||||
@@ -1140,14 +1180,16 @@ void binkp_process_NUL(s_binkp_sysinfo *remote_data, char *buffer)
|
||||
}
|
||||
else
|
||||
strnxcpy(remote_data->opt, buffer+4, sizeof(remote_data->opt));
|
||||
|
||||
DEB((D_24554,"Process OPT"));
|
||||
binkp_parse_options(remote_data, buffer+4);
|
||||
}
|
||||
else if( strncmp(buffer, "VER ", 4) == 0 )
|
||||
{
|
||||
char *p;
|
||||
/* <mailer> [<protocol>/<vermaj>.<vermin>] */
|
||||
if( (p = strchr(buffer+4, ' ')) )
|
||||
{
|
||||
char *q;
|
||||
strnxcpy(remote_data->progname, buffer+4,
|
||||
MIN(sizeof(remote_data->progname), p - (buffer+4) + 1));
|
||||
++p;
|
||||
@@ -1181,13 +1223,16 @@ void binkp_process_ADR(char *buffer)
|
||||
{
|
||||
s_faddr addr;
|
||||
char *p, *q;
|
||||
|
||||
DEB((D_24554, "process ADR: %s", buffer));
|
||||
for( p = string_token(buffer, &q, NULL, 0); p; p = string_token(NULL, &q, NULL, 0) )
|
||||
{
|
||||
DEB((D_24554, "binkp_process_ADR got token \"%s\" ",p ));
|
||||
if( ftn_addrparse(&addr, p, FALSE) )
|
||||
log("BinkP got unparsable address \"%s\"", string_printable(p));
|
||||
else
|
||||
else {
|
||||
session_addrs_add(&state.remoteaddrs, &state.n_remoteaddr, addr);
|
||||
DEB((D_24554, "process ADR complete"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ void binkp_set_sysinfo(s_binkp_sysinfo *binkp, s_faddr *remote_addr, bool caller
|
||||
void binkp_parse_options(s_binkp_sysinfo *binkp, char *options)
|
||||
{
|
||||
char *p, *n;
|
||||
|
||||
DEB((D_24554,"binkp: parse_options: %s", options));
|
||||
for( p = string_token(options, &n, NULL, 0); p;
|
||||
p = string_token(NULL, &n, NULL, 0) )
|
||||
{
|
||||
|
||||
@@ -415,6 +415,7 @@ int p_tx_rewind(s_protinfo *pi, size_t pos)
|
||||
|
||||
void prot_traffic_update(s_traffic *traf, size_t size, int xtime, int type)
|
||||
{
|
||||
DEB((D_EVENT, "prot_common: Adding type %d with size %ld to stats", type, size));
|
||||
if( type & TYPE_REQANSW )
|
||||
{
|
||||
traf->freqed_size += size;
|
||||
@@ -433,6 +434,10 @@ void prot_traffic_update(s_traffic *traf, size_t size, int xtime, int type)
|
||||
traf->arcmail_time += xtime;
|
||||
traf->arcmail_num++;
|
||||
}
|
||||
else if( type & TYPE_TICFILE )
|
||||
{
|
||||
traf->ticfile_num++;
|
||||
}
|
||||
else
|
||||
{
|
||||
traf->files_size += size;
|
||||
|
||||
+21
-11
@@ -22,8 +22,16 @@
|
||||
int answ_system(e_session type, char *connstr, int inetd)
|
||||
{
|
||||
TIO oldtio;
|
||||
struct sockaddr_in client;
|
||||
union {
|
||||
struct sockaddr a;
|
||||
struct sockaddr_in in;
|
||||
struct sockaddr_in6 in6;
|
||||
} client;
|
||||
//struct sockaddr_storage client;
|
||||
int clientlen = sizeof(client);
|
||||
char clienthost[NI_MAXHOST];
|
||||
char clientport[NI_MAXSERV];
|
||||
int clientres = 0;
|
||||
int rc = 0;
|
||||
char *p;
|
||||
|
||||
@@ -74,18 +82,20 @@ int answ_system(e_session type, char *connstr, int inetd)
|
||||
log("Answering TCPIP call...");
|
||||
if( connstr && *connstr )
|
||||
state.connstr = (char*)xstrcpy(connstr);
|
||||
else if( getpeername(0, (struct sockaddr*)&client, &clientlen) == -1 )
|
||||
logerr("can't get client address");
|
||||
else
|
||||
{
|
||||
#ifdef IPV6
|
||||
>char addr_str[INET6_ADDRSTRLEN+1];
|
||||
state.peername = (char*)xstrcpy(inet_ntop(AF_INET6, client.sin6_addr, addr_str, INET6_ADDRSTRLEN));
|
||||
state.peerport = (long)ntohs(client.sin6_port);
|
||||
#else
|
||||
state.peername = (char*)xstrcpy(inet_ntoa(client.sin_addr));
|
||||
state.peerport = (long)ntohs(client.sin_port);
|
||||
#endif
|
||||
if(getpeername(0, &client.a, &clientlen))
|
||||
log("sess_answ: can't detrmine socket client");
|
||||
clientres = getnameinfo( &client.a, clientlen,
|
||||
clienthost, sizeof(clienthost), clientport,
|
||||
sizeof(clientport), NI_NUMERICHOST | NI_NUMERICSERV);
|
||||
if ( clientres == 0 )
|
||||
{
|
||||
state.peername = (char*)xstrcpy(clienthost);
|
||||
state.peerport = (long)atol(clientport);
|
||||
}
|
||||
else
|
||||
log("sess_answ: can't get client address: ", gai_strerror(clientres));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+102
-32
@@ -480,10 +480,15 @@ int call_system_tcpip(int callwith) // only TCPIP values
|
||||
{
|
||||
char abuf[BF_MAXADDRSTR+1];
|
||||
int rc = BFERR_NOERROR;
|
||||
|
||||
char * pbuf;
|
||||
char * target = 0;
|
||||
int resflg;
|
||||
/*
|
||||
* Set verbal line name to "tcpip" value
|
||||
*/
|
||||
memset(abuf, '\0', BF_MAXADDRSTR+1);
|
||||
target = xmalloc(1024);
|
||||
memset(target, '\0', 1024);
|
||||
|
||||
state.linename = xstrcpy("tcpip");
|
||||
state.inet = TRUE;
|
||||
@@ -502,14 +507,17 @@ int call_system_tcpip(int callwith) // only TCPIP values
|
||||
case CALL_TCPIP_BINKP:
|
||||
state.tcpmode = TCPMODE_BINKP;
|
||||
state.session = SESSION_BINKP;
|
||||
target = xstrcpy("IBN");
|
||||
break;
|
||||
case CALL_TCPIP_IFCICO:
|
||||
state.tcpmode = TCPMODE_RAW;
|
||||
state.session = SESSION_UNKNOWN;
|
||||
target = xstrcpy("IFC");
|
||||
break;
|
||||
case CALL_TCPIP_TELNET:
|
||||
state.tcpmode = TCPMODE_TELNET;
|
||||
state.session = SESSION_UNKNOWN;
|
||||
target = xstrcpy("ITN");
|
||||
break;
|
||||
defalt:
|
||||
log("invalid protocol for TCP/IP module");
|
||||
@@ -521,7 +529,45 @@ defalt:
|
||||
(state.node.name && *state.node.name ) ? state.node.name : "<none>",
|
||||
(state.node.host && *state.node.host) ? state.node.host : "<none>");
|
||||
|
||||
if( (rc = tcpip_connect(state.node.host, state.tcpmode)) == 0
|
||||
memset(abuf, '\0', BF_MAXADDRSTR+1);
|
||||
pbuf = xmalloc(1024);
|
||||
|
||||
resflg = nodelist_lookup_string(pbuf, 1024, state.node.addr);
|
||||
if ( ! resflg )
|
||||
{
|
||||
|
||||
char *p = string_casestr(pbuf, target);
|
||||
|
||||
if ( p )
|
||||
{
|
||||
target = strchr(p, ',');
|
||||
if ( target ) target[0] = '\0';
|
||||
target = 0;
|
||||
target = strrchr(p, ':');
|
||||
if ( target ) {
|
||||
target++;
|
||||
strcpy(abuf,target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free(pbuf);
|
||||
pbuf = xstrcpy(state.node.host);
|
||||
|
||||
|
||||
if ( ! resflg )
|
||||
{
|
||||
if ( abuf[0] != '\0' )
|
||||
{
|
||||
// port not empty
|
||||
DEB((D_EVENT, "Modifying host address %s with port %s", pbuf, abuf));
|
||||
pbuf = xstrcat(pbuf, ":");
|
||||
pbuf = xstrcat(pbuf, abuf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( (rc = tcpip_connect(pbuf, state.tcpmode)) == 0
|
||||
&& (rc = tcpip_init() == 0) )
|
||||
{
|
||||
TTYSTATUS(1);
|
||||
@@ -532,7 +578,7 @@ defalt:
|
||||
{
|
||||
rc = BFERR_CANT_CONNECT10;
|
||||
}
|
||||
|
||||
free(pbuf);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -543,7 +589,7 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
||||
char s[300];
|
||||
snprintf(s, 299, "bforce calling system %d:%d/%d.%d", addr.zone, addr.net, addr.node, addr.point );
|
||||
log(s);
|
||||
|
||||
DEB((D_EVENT, s));
|
||||
// find suitable way of connection and try to make session
|
||||
|
||||
int rc = 0;
|
||||
@@ -568,12 +614,13 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
||||
}
|
||||
|
||||
state.listed = state.node.listed;
|
||||
//DEB((D_EVENT, "Calling init, listed=%d", state.listed));
|
||||
state.node.addr.domain[0] = '\0'; /* Discard domain for node address */
|
||||
|
||||
// 1. If call method specified in cmdline, do use it
|
||||
// 2. If not, use nodelist data and overrides and call all available methods
|
||||
// If override contains Phone or IP flags, ignore nodelist connect methods (but save INA if not overrided)
|
||||
|
||||
DEB((D_EVENT, "Calling init, runmode=%d", opts->runmode));
|
||||
// 1st - get all allowed call ways
|
||||
// 2nd - gather information reqired to call and remove unavailable ways (no info, node does not support)
|
||||
|
||||
@@ -581,7 +628,7 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
||||
|
||||
if( opts->runmode == MODE_CALL_DEFAULT )
|
||||
{
|
||||
call_mayuse = CALL_MODEM | CALL_TCPIP_ANY;
|
||||
call_mustuse = CALL_MODEM | CALL_TCPIP_ANY;
|
||||
}
|
||||
else if( opts->runmode == MODE_CALL_STDIO )
|
||||
{
|
||||
@@ -593,7 +640,14 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
||||
}
|
||||
else if( opts->runmode == MODE_CALL_IP )
|
||||
{
|
||||
if( strcasecmp(opts->ipproto, "binkp") == 0 )
|
||||
DEB((D_EVENT, "Calling init, MODE_CALL_IP"));
|
||||
if( !(opts->ipproto) ) // determine from nodelist/override
|
||||
{
|
||||
DEB((D_EVENT, "ipproto not set"));
|
||||
call_mayuse = CALL_TCPIP_ANY;
|
||||
call_mustuse = 0;
|
||||
}
|
||||
else if( strcasecmp(opts->ipproto, "binkp") == 0 )
|
||||
{
|
||||
call_mustuse = CALL_TCPIP_BINKP;
|
||||
}
|
||||
@@ -605,20 +659,17 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
||||
{
|
||||
call_mustuse = CALL_TCPIP_TELNET;
|
||||
}
|
||||
else if( opts->ipproto == NULL ) // determine from nodelist/override
|
||||
{
|
||||
call_mayuse = CALL_TCPIP_ANY;
|
||||
call_mustuse = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEB((D_EVENT, "Unknown protocol %s", opts->ipproto));
|
||||
log("Unknown protocol");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
log("Unknown protocol");
|
||||
DEB((D_EVENT, "Unknown runmode %d", opts->runmode));
|
||||
log("Unknown runmode");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -627,9 +678,10 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
||||
//char s[300];
|
||||
//snprintf(s, 299, "initial: may use %d must use %d", call_mayuse, call_mustuse);
|
||||
//log(s);
|
||||
//DEB((D_EVENT, s));
|
||||
|
||||
|
||||
if( call_mayuse & CALL_MODEM )
|
||||
if( (call_mayuse & CALL_MODEM) )
|
||||
{
|
||||
// 1. use phone from opts
|
||||
// 2. use overrides
|
||||
@@ -650,7 +702,7 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
||||
{
|
||||
log("bad phone, excluding modem");
|
||||
call_mayuse &= ~CALL_MODEM;
|
||||
if( call_mustuse & CALL_MODEM )
|
||||
if( !(call_mayuse) )
|
||||
{
|
||||
errmsg = "don't know phone number";
|
||||
gotoexit(BFERR_PHONE_UNKNOWN);
|
||||
@@ -684,7 +736,7 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
||||
{
|
||||
call_mayuse &= ~CALL_MODEM;
|
||||
log("bad worktime, excluding modem");
|
||||
if( call_mustuse & CALL_MODEM )
|
||||
if( !(call_mayuse) )
|
||||
{
|
||||
errmsg = "not works now, try later";
|
||||
gotoexit(BFERR_NOTWORKING);
|
||||
@@ -693,9 +745,9 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
||||
}
|
||||
}
|
||||
|
||||
// snprintf(s, 299, "after phone check: may use %d must use %d", call_mayuse, call_mustuse);
|
||||
// log(s);
|
||||
|
||||
//snprintf(s, 299, "after phone check: may use %d must use %d", call_mayuse, call_mustuse);
|
||||
//log(s);
|
||||
//DEB((D_EVENT, s));
|
||||
/*
|
||||
* Apply overrides to the node information
|
||||
*/
|
||||
@@ -714,7 +766,8 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
||||
|
||||
if( !(call_mustuse & CALL_TCPIP_BINKP) && (call_mayuse & CALL_TCPIP_BINKP) )
|
||||
{
|
||||
if( nodelist_checkflag(state.node.flags, "BINKP") != 0 && nodelist_checkflag(state.node.flags, "IBN") != 0 )
|
||||
//if( nodelist_checkflag(state.node.flags, "BINKP") != 0 && nodelist_checkflag(state.node.flags, "IBN") != 0 )
|
||||
if( state.node.do_binkp == 0 )
|
||||
{
|
||||
call_mayuse &= ~CALL_TCPIP_BINKP;
|
||||
}
|
||||
@@ -722,7 +775,8 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
||||
|
||||
if( !(call_mustuse & CALL_TCPIP_IFCICO) && (call_mayuse & CALL_TCPIP_IFCICO) )
|
||||
{
|
||||
if( nodelist_checkflag(state.node.flags, "IFC") != 0 && nodelist_checkflag(state.node.flags, "IFC") != 0 )
|
||||
//if( nodelist_checkflag(state.node.flags, "IFC") != 0 && nodelist_checkflag(state.node.flags, "IFC") != 0 )
|
||||
if( state.node.do_ifcico == 0 )
|
||||
{
|
||||
call_mayuse &= ~CALL_TCPIP_IFCICO;
|
||||
}
|
||||
@@ -730,7 +784,8 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
||||
|
||||
if( !(call_mustuse & CALL_TCPIP_TELNET) && (call_mayuse & CALL_TCPIP_TELNET) )
|
||||
{
|
||||
if( nodelist_checkflag(state.node.flags, "TELN") != 0 && nodelist_checkflag(state.node.flags, "TLN") != 0 )
|
||||
//if( nodelist_checkflag(state.node.flags, "TELN") != 0 && nodelist_checkflag(state.node.flags, "TLN") != 0 )
|
||||
if( state.node.do_telnet == 0 )
|
||||
{
|
||||
call_mayuse &= ~CALL_TCPIP_TELNET;
|
||||
}
|
||||
@@ -746,7 +801,12 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
||||
state.override.sIpaddr, sizeof(state.node.host));
|
||||
}
|
||||
|
||||
if( call_mayuse & CALL_TCPIP_ANY && !tcpip_isgood_host(state.node.host) ) {
|
||||
//DEB((D_EVENT, "Calling init, IPHOST", state.node.host));
|
||||
|
||||
// We have at least one protocol and not valid address - try to
|
||||
// find INA with through Fidonet DNS
|
||||
if( (call_mayuse & CALL_TCPIP_ANY) && !tcpip_isgood_host(state.node.host) )
|
||||
{
|
||||
char *fidodnszone = conf_string(cf_fidodnszone);
|
||||
if (fidodnszone) {
|
||||
if (addr.point) {
|
||||
@@ -761,17 +821,21 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
||||
}
|
||||
}
|
||||
|
||||
if( call_mayuse & CALL_TCPIP_ANY && !tcpip_isgood_host(state.node.host) )
|
||||
// We have no valid tcpip protocols OR not valid address
|
||||
if( !(call_mayuse & CALL_TCPIP_ANY) || !tcpip_isgood_host(state.node.host) )
|
||||
{
|
||||
call_mayuse &= ~CALL_TCPIP_ANY;
|
||||
log("bad host, exclude IP");
|
||||
if( call_mustuse & CALL_TCPIP_ANY )
|
||||
DEB((D_EVENT, "bad host or proto -> exclude IP, mayuse=%d", call_mayuse));
|
||||
|
||||
// If we had ONLY tcpip command - go out with error
|
||||
if( !(call_mayuse) )
|
||||
{
|
||||
errmsg = "don't know host name";
|
||||
errmsg = "Aborting, don't know host name";
|
||||
gotoexit(BFERR_PHONE_UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
DEB((D_EVENT,"sess_call: may use %d must use %d", call_mayuse, call_mustuse));
|
||||
// snprintf(s, 299, "after IP check: may use %d must use %d", call_mayuse, call_mustuse);
|
||||
// log(s);
|
||||
|
||||
@@ -808,28 +872,33 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
||||
// try allowed methods and break if rc == 0
|
||||
rc = -1;
|
||||
|
||||
if( rc && call_mayuse & CALL_STDIO )
|
||||
if( rc && (call_mayuse & CALL_STDIO) )
|
||||
{
|
||||
DEB((D_EVENT,"sess_call: calling stdio"));
|
||||
rc = call_system_quiet(opts->connect, opts->inetd);
|
||||
}
|
||||
|
||||
if( rc && call_mayuse & CALL_TCPIP_BINKP )
|
||||
if( rc && (call_mayuse & CALL_TCPIP_BINKP) )
|
||||
{
|
||||
DEB((D_EVENT,"sess_call: calling binkp"));
|
||||
rc = call_system_tcpip(CALL_TCPIP_BINKP);
|
||||
}
|
||||
|
||||
if( rc && call_mayuse & CALL_TCPIP_IFCICO )
|
||||
if( rc && (call_mayuse & CALL_TCPIP_IFCICO) )
|
||||
{
|
||||
DEB((D_EVENT,"sess_call: calling ifcico"));
|
||||
rc = call_system_tcpip(CALL_TCPIP_IFCICO);
|
||||
}
|
||||
|
||||
if( rc && call_mayuse & CALL_TCPIP_TELNET )
|
||||
if( rc && (call_mayuse & CALL_TCPIP_TELNET) )
|
||||
{
|
||||
DEB((D_EVENT,"sess_call: calling telnet"));
|
||||
rc = call_system_tcpip(CALL_TCPIP_TELNET);
|
||||
}
|
||||
|
||||
if( rc && call_mayuse & CALL_MODEM )
|
||||
if( rc && (call_mayuse & CALL_MODEM) )
|
||||
{
|
||||
DEB((D_EVENT,"sess_call: calling MODEM"));
|
||||
setproctitle("bforce calling %.32s, %.32s",
|
||||
ftn_addrstr(abuf, state.node.addr), state.node.phone);
|
||||
rc = -1;
|
||||
@@ -850,6 +919,7 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
||||
|
||||
if( port_lock(p_lockdir, state.modemport) == 0 ) /* Successfuly locked port */
|
||||
{
|
||||
DEB((D_EVENT,"sess_call: call_system_modem running"));
|
||||
rc = call_system_modem();
|
||||
port_unlock(p_lockdir, state.modemport);
|
||||
}
|
||||
|
||||
@@ -135,15 +135,17 @@ int override_get(s_override *dest, s_faddr addr, int line)
|
||||
{
|
||||
s_override *p;
|
||||
int curline = 0;
|
||||
|
||||
p = conf_override(cf_override, addr);
|
||||
|
||||
curline = 0;
|
||||
if (line > 0)
|
||||
{
|
||||
while( p && curline < line )
|
||||
{
|
||||
p = p->hidden;
|
||||
++curline;
|
||||
}
|
||||
}
|
||||
|
||||
if( p && curline == line )
|
||||
{
|
||||
|
||||
@@ -264,7 +264,7 @@ int session_check_addr(s_faddr addr)
|
||||
int session_get_password(s_faddr addr, char *buffer, size_t buflen)
|
||||
{
|
||||
s_cval_entry *pwd_ptr;
|
||||
|
||||
buffer[0]='\0';
|
||||
for( pwd_ptr = conf_first(cf_password); pwd_ptr;
|
||||
pwd_ptr = conf_next(pwd_ptr) )
|
||||
{
|
||||
@@ -897,11 +897,20 @@ int session(void)
|
||||
p_log_txrxstat(&pi);
|
||||
|
||||
|
||||
// Protocol info - real info from protocol
|
||||
DEB((D_EVENT,"sess_main: Pi stats> Net: %d, Arc: %d, Fil: %d, Tic: %d",
|
||||
pi.traffic_rcvd.netmail_num, pi.traffic_rcvd.arcmail_num,
|
||||
pi.traffic_rcvd.files_num, pi.traffic_rcvd.ticfile_num));
|
||||
|
||||
// Session info - HANDSHAKE info for traffic
|
||||
DEB((D_EVENT,"sess_main: Sess stats> Net: %d, Arc: %d, Fil: %d, Tic: %d",
|
||||
state.traff_recv.netmail_num, state.traff_recv.arcmail_num,
|
||||
state.traff_recv.files_num, state.traff_recv.ticfile_num));
|
||||
/*
|
||||
* Raise flags if session incoming traffic was not empty
|
||||
*/
|
||||
if ( (p = conf_string(cf_incnet_flag)) )
|
||||
if (state.traff_recv.netmail_size > 0) {
|
||||
if (pi.traffic_rcvd.netmail_size > 0) {
|
||||
DEB((D_EVENT, "Incoming netmail > 0, raising flag"));
|
||||
log("Raising flag for netmail in %s", p);
|
||||
fd = open(p, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP );
|
||||
@@ -915,7 +924,7 @@ int session(void)
|
||||
}
|
||||
|
||||
if ( (p = conf_string(cf_incarc_flag)) )
|
||||
if (state.traff_recv.arcmail_size > 0) {
|
||||
if (pi.traffic_rcvd.arcmail_size > 0) {
|
||||
DEB((D_EVENT, "Incoming arcmail > 0, raising flag"));
|
||||
log("Raising flag for arcmail in %s", p);
|
||||
fd = open(p, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
|
||||
@@ -928,6 +937,33 @@ int session(void)
|
||||
}
|
||||
}
|
||||
|
||||
if ( (p = conf_string(cf_inctic_flag)) )
|
||||
if (pi.traffic_rcvd.ticfile_num > 0) {
|
||||
DEB((D_EVENT, "Incoming TIC files > 0, raising flag"));
|
||||
log("Raising flag for TIC in %s", p);
|
||||
fd = open(p, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
|
||||
if (fd == -1) {
|
||||
DEB((D_EVENT, "Error raising ticfiles flag"));
|
||||
log("Error creating flag for ticfiles in %s", p);
|
||||
} else {
|
||||
/* all ok - closing file */
|
||||
close(fd);
|
||||
}
|
||||
}
|
||||
if ( (p = conf_string(cf_incfile_flag)) )
|
||||
if (pi.traffic_rcvd.files_size > 0) {
|
||||
DEB((D_EVENT, "Incoming FILES > 0, raising flag"));
|
||||
log("Raising flag for files in %s", p);
|
||||
fd = open(p, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
|
||||
if (fd == -1) {
|
||||
DEB((D_EVENT, "Error raising files flag"));
|
||||
log("Error creating flag for files in %s", p);
|
||||
} else {
|
||||
/* all ok - closing file */
|
||||
close(fd);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Save session traffic before deiniting
|
||||
*/
|
||||
|
||||
@@ -189,7 +189,8 @@ static int ftn_addrparse_fido(s_faddr *addr, const char *s, bool wildcard)
|
||||
{
|
||||
strnxcpy(addr->domain, string_printable(p), sizeof(addr->domain));
|
||||
}
|
||||
|
||||
DEB((D_INFO,"u_ftn: Parsed ftn address z:%d, net:%d, node:%d, point:%d",
|
||||
addr->zone, addr->net, addr->node, addr->point));
|
||||
return badaddr;
|
||||
}
|
||||
|
||||
@@ -326,6 +327,7 @@ int ftn_addrparse(s_faddr *addr, const char *s, bool wildcard)
|
||||
addr->node = DEFAULT_NODE;
|
||||
addr->point = 0;
|
||||
|
||||
DEB((D_INFO, "u_ftn: parsing ftnaddr %s", s));
|
||||
if( addr->inetform )
|
||||
badaddr = ftn_addrparse_inet(addr, s, wildcard);
|
||||
else
|
||||
|
||||
@@ -81,6 +81,7 @@ void *xrealloc(void *buf, size_t size)
|
||||
else if( (tmp = (char*)(buf ? realloc(buf, size) : malloc(size))) == NULL )
|
||||
{
|
||||
log("failed to reallocate %ld bytes -> abort", size);
|
||||
if( buf ) free(buf);
|
||||
abort();
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ static int nodelist_makeindex(s_nodelist *nlp, s_faddr addr)
|
||||
switch(keyword) {
|
||||
case KEYWORD_ZONE:
|
||||
bni.zone = value;
|
||||
bni.net = 0;
|
||||
bni.net = value; // zxalexis
|
||||
bni.node = 0;
|
||||
bni.point = 0;
|
||||
bni.hub = 0;
|
||||
|
||||
+115
-113
@@ -159,128 +159,130 @@ typedef struct filebox {
|
||||
} s_filebox;
|
||||
|
||||
typedef enum {
|
||||
cf_address,
|
||||
cf_amiga_outbound_directory,
|
||||
cf_binkp_timeout,
|
||||
cf_daemon_circle,
|
||||
cf_daemon_circle_crash,
|
||||
cf_daemon_circle_direct,
|
||||
cf_daemon_circle_immed,
|
||||
cf_daemon_circle_modem,
|
||||
cf_daemon_circle_normal,
|
||||
cf_daemon_circle_rescan,
|
||||
cf_daemon_maxclients_modem,
|
||||
cf_daemon_maxclients_tcpip,
|
||||
cf_daemon_pid_file,
|
||||
cf_delay_files_recv,
|
||||
cf_delay_files_send,
|
||||
cf_disable_aka_matching,
|
||||
cf_domain,
|
||||
cf_emsi_FR_time,
|
||||
cf_emsi_OH_time,
|
||||
cf_emsi_slave_sends_nak,
|
||||
cf_emsi_send_tz,
|
||||
cf_emsi_send_time,
|
||||
cf_filebox,
|
||||
cf_filebox_directory,
|
||||
cf_flags,
|
||||
cf_flo_translate,
|
||||
cf_freq_alias_list,
|
||||
cf_freq_dir_list,
|
||||
cf_freq_ignore_masks,
|
||||
cf_freq_limit_number,
|
||||
cf_freq_limit_size,
|
||||
cf_freq_limit_time,
|
||||
cf_freq_min_speed,
|
||||
cf_freq_srif_command,
|
||||
cf_incnet_flag,
|
||||
cf_incarc_flag,
|
||||
cf_hide_our_aka,
|
||||
cf_history_file,
|
||||
cf_hydra_options,
|
||||
cf_hydra_mincps_recv,
|
||||
cf_hydra_mincps_send,
|
||||
cf_hydra_tx_window,
|
||||
cf_hydra_rx_window,
|
||||
cf_inbound_directory,
|
||||
cf_location,
|
||||
cf_log_file,
|
||||
cf_log_file_daemon,
|
||||
cf_max_speed,
|
||||
cf_maxtries,
|
||||
cf_maxtries_nodial,
|
||||
cf_maxtries_noansw,
|
||||
cf_maxtries_noconn,
|
||||
cf_maxtries_hshake,
|
||||
cf_maxtries_sessions,
|
||||
cf_min_cps_recv,
|
||||
cf_min_cps_send,
|
||||
cf_min_cps_time,
|
||||
cf_min_free_space,
|
||||
cf_min_speed_in,
|
||||
cf_min_speed_out,
|
||||
cf_mode_netmail,
|
||||
cf_mode_arcmail,
|
||||
cf_mode_request,
|
||||
cf_mode_ticfile,
|
||||
cf_mode_default,
|
||||
cf_modem_can_send_break,
|
||||
cf_modem_dial_prefix,
|
||||
cf_modem_dial_suffix,
|
||||
cf_modem_dial_response,
|
||||
cf_modem_hangup_command,
|
||||
cf_modem_port,
|
||||
cf_modem_reset_command,
|
||||
cf_modem_stat_command,
|
||||
cf_nodelist,
|
||||
cf_nodelist_directory,
|
||||
cf_nodial_flag,
|
||||
cf_override,
|
||||
cf_options,
|
||||
cf_outbound_directory,
|
||||
cf_password,
|
||||
cf_phone,
|
||||
cf_phone_translate,
|
||||
cf_proto_order,
|
||||
cf_recode_file_in,
|
||||
cf_recode_file_out,
|
||||
cf_recode_intro_in,
|
||||
cf_recv_buffer_size,
|
||||
cf_rescan_delay,
|
||||
cf_run_after_handshake,
|
||||
cf_run_after_session,
|
||||
cf_run_before_session,
|
||||
cf_session_limit_in,
|
||||
cf_session_limit_out,
|
||||
cf_skip_files_recv,
|
||||
cf_status_directory,
|
||||
cf_system_name,
|
||||
cf_sysop_name,
|
||||
cf_uucp_lock_directory,
|
||||
cf_wait_carrier_in,
|
||||
cf_wait_carrier_out,
|
||||
cf_zmodem_mincps_recv,
|
||||
cf_zmodem_mincps_send,
|
||||
cf_zmodem_send_dummy_pkt,
|
||||
cf_zmodem_skip_by_pos,
|
||||
cf_zmodem_start_block_size,
|
||||
cf_zmodem_tx_window,
|
||||
cf_nomail_flag,
|
||||
cf_bind_ip,
|
||||
cf_recieved_to_lower,
|
||||
cf_address, // 0
|
||||
cf_amiga_outbound_directory, // 1
|
||||
cf_binkp_timeout, // 2
|
||||
cf_daemon_circle, // 3
|
||||
cf_daemon_circle_crash, // 4
|
||||
cf_daemon_circle_direct, // 5
|
||||
cf_daemon_circle_immed, // 6
|
||||
cf_daemon_circle_modem, // 7
|
||||
cf_daemon_circle_normal, // 8
|
||||
cf_daemon_circle_rescan, // 9
|
||||
cf_daemon_maxclients_modem, // 10
|
||||
cf_daemon_maxclients_tcpip, // 11
|
||||
cf_daemon_pid_file, // 12
|
||||
cf_delay_files_recv, // 13
|
||||
cf_delay_files_send, // 14
|
||||
cf_disable_aka_matching, // 15
|
||||
cf_domain, // 16
|
||||
cf_emsi_FR_time, // 17
|
||||
cf_emsi_OH_time, // 18
|
||||
cf_emsi_slave_sends_nak, // 19
|
||||
cf_emsi_send_tz, // 20
|
||||
cf_emsi_send_time, // 21
|
||||
cf_filebox, // 22
|
||||
cf_filebox_directory, // 23
|
||||
cf_flags, // 24
|
||||
cf_flo_translate, // 25
|
||||
cf_freq_alias_list, // 26
|
||||
cf_freq_dir_list, // 27
|
||||
cf_freq_ignore_masks, // 28
|
||||
cf_freq_limit_number, // 29
|
||||
cf_freq_limit_size, // 30
|
||||
cf_freq_limit_time, // 31
|
||||
cf_freq_min_speed, // 32
|
||||
cf_freq_srif_command, // 33
|
||||
cf_incnet_flag, // 34
|
||||
cf_incarc_flag, // 35
|
||||
cf_inctic_flag, // 36
|
||||
cf_incfile_flag, // 37
|
||||
cf_hide_our_aka, // 38
|
||||
cf_history_file, // 39
|
||||
cf_hydra_options, // 40
|
||||
cf_hydra_mincps_recv, // 41
|
||||
cf_hydra_mincps_send, // 42
|
||||
cf_hydra_tx_window, // 43
|
||||
cf_hydra_rx_window, // 44
|
||||
cf_inbound_directory, // 45
|
||||
cf_location, // 46
|
||||
cf_log_file, // 47
|
||||
cf_log_file_daemon, // 48
|
||||
cf_max_speed, // 49
|
||||
cf_maxtries, // 50
|
||||
cf_maxtries_nodial, // 51
|
||||
cf_maxtries_noansw, // 52
|
||||
cf_maxtries_noconn, // 53
|
||||
cf_maxtries_hshake, // 54
|
||||
cf_maxtries_sessions, // 55
|
||||
cf_min_cps_recv, // 56
|
||||
cf_min_cps_send, // 57
|
||||
cf_min_cps_time, // 58
|
||||
cf_min_free_space, // 59
|
||||
cf_min_speed_in, // 60
|
||||
cf_min_speed_out, // 61
|
||||
cf_mode_netmail, // 62
|
||||
cf_mode_arcmail, // 63
|
||||
cf_mode_request, // 64
|
||||
cf_mode_ticfile, // 65
|
||||
cf_mode_default, // 66
|
||||
cf_modem_can_send_break, // 67
|
||||
cf_modem_dial_prefix, // 68
|
||||
cf_modem_dial_suffix, // 69
|
||||
cf_modem_dial_response, // 70
|
||||
cf_modem_hangup_command, // 71
|
||||
cf_modem_port, // 72
|
||||
cf_modem_reset_command, // 73
|
||||
cf_modem_stat_command, // 74
|
||||
cf_nodelist, // 75
|
||||
cf_nodelist_directory, // 76
|
||||
cf_nodial_flag, // 77
|
||||
cf_override, // 78
|
||||
cf_options, // 79
|
||||
cf_outbound_directory, // 80
|
||||
cf_password, // 81
|
||||
cf_phone, // 82
|
||||
cf_phone_translate, // 83
|
||||
cf_proto_order, // 84
|
||||
cf_recode_file_in, // 85
|
||||
cf_recode_file_out, // 86
|
||||
cf_recode_intro_in, // 87
|
||||
cf_recv_buffer_size, // 88
|
||||
cf_rescan_delay, // 89
|
||||
cf_run_after_handshake, // 90
|
||||
cf_run_after_session, // 91
|
||||
cf_run_before_session, // 92
|
||||
cf_session_limit_in, // 93
|
||||
cf_session_limit_out, // 94
|
||||
cf_skip_files_recv, // 95
|
||||
cf_status_directory, // 96
|
||||
cf_system_name, // 97
|
||||
cf_sysop_name, // 98
|
||||
cf_uucp_lock_directory, // 99
|
||||
cf_wait_carrier_in, // 100
|
||||
cf_wait_carrier_out, // 101
|
||||
cf_zmodem_mincps_recv, // 102
|
||||
cf_zmodem_mincps_send, // 103
|
||||
cf_zmodem_send_dummy_pkt, // 104
|
||||
cf_zmodem_skip_by_pos, // 105
|
||||
cf_zmodem_start_block_size, // 106
|
||||
cf_zmodem_tx_window, // 107
|
||||
cf_nomail_flag, // 108
|
||||
cf_bind_ip, // 109
|
||||
cf_recieved_to_lower, // 110
|
||||
#ifdef USE_SYSLOG
|
||||
cf_syslog_facility,
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
cf_debug_file,
|
||||
cf_debug_level,
|
||||
cf_debug_file, // 111
|
||||
cf_debug_level, // 112
|
||||
#endif
|
||||
cf_split_inbound,
|
||||
cf_split_inbound, // 113
|
||||
#ifdef NETSPOOL
|
||||
cf_netspool_host,
|
||||
cf_netspool_port,
|
||||
#endif
|
||||
cf_fidodnszone,
|
||||
cf_fidodnszone, // 114
|
||||
BFORCE_NUMBER_OF_KEYWORDS
|
||||
} bforce_config_keyword;
|
||||
|
||||
|
||||
@@ -65,8 +65,8 @@ void log_setident(const char *ident);
|
||||
int log_open(const char *logname, const char *ext, const char *tty);
|
||||
int log_close(void);
|
||||
int log_reopen(const char *logname, const char *ext, const char *tty);
|
||||
int log(const char *s, ...);
|
||||
int logerr(const char *s, ...);
|
||||
void log(const char *s, ...);
|
||||
void logerr(const char *s, ...);
|
||||
|
||||
#ifdef DEBUG
|
||||
//void debug_setlevel(long newlevel, bool logit);
|
||||
@@ -75,7 +75,7 @@ bool debug_isopened(void);
|
||||
//int debug_parsestring(char *str, unsigned long *deblevel);
|
||||
int debug_open();
|
||||
int debug_close();
|
||||
int debug(unsigned long what, const char *str, ...);
|
||||
void debug(unsigned long what, const char *str, ...);
|
||||
void debug_configure();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ typedef struct traffic {
|
||||
int freqed_num;
|
||||
int freqed_time;
|
||||
size_t freqed_size;
|
||||
int ticfile_num;
|
||||
} s_traffic;
|
||||
|
||||
/*
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define BF_VERSION RELEASE_VERSION
|
||||
#define BF_CDATE __DATE__ __TIME__
|
||||
#define BF_REG "free software"
|
||||
#define BF_COPYRIGHT "(c) 1997-2000 by Alexander Belkin"
|
||||
#define BF_COPYRIGHT "(c) 1997-2000 by Alexander Belkin, 2004-2025 fidonet members"
|
||||
|
||||
#define BF_BANNERVER BF_NAME" "BF_VERSION"/"BF_OS
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ function testcomm() {
|
||||
BFCFGA=${CURDIR}/etc/bforceA.conf
|
||||
BFCFGB=${CURDIR}/etc/bforceB.conf
|
||||
|
||||
# Works for Linux
|
||||
|
||||
BFCONFIG=${BFCFGA}
|
||||
BFCONFIG=${BFCFGA} ${BFBIN} -o 99:1/2 > ${CURDIR}/bforceAtoB < ${CURDIR}/bforceBtoA &
|
||||
#
|
||||
@@ -35,6 +37,9 @@ function testcomm() {
|
||||
BFCONFIG=${BFCFGB}
|
||||
BFCONFIG=${BFCFGB} ${BFBIN} -S"CONNECT 9600" auto < ${CURDIR}/bforceAtoB > ${CURDIR}/bforceBtoA
|
||||
|
||||
# For [Free]BSD it need to be replaced - pipes are bidirectional:
|
||||
# ./ping <&1 | ./pong >&0
|
||||
|
||||
rm ${CURDIR}/{bforceAtoB,bforceBtoA}
|
||||
|
||||
## WE MUST CHECK THAT INBOUND ARE FULL!!! ##
|
||||
@@ -88,6 +93,8 @@ else
|
||||
echo -n "--> Running Hydra test..."
|
||||
testcomm
|
||||
|
||||
# TODO: make binkd test over netcat possibly
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user