Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
35e31928
Commit
35e31928
authored
23 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Baja Module for performing QWK Networking call-outs via FTP.
parent
7a3a6c4c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/qnet-ftp.src
+178
-0
178 additions, 0 deletions
exec/qnet-ftp.src
with
178 additions
and
0 deletions
exec/qnet-ftp.src
0 → 100644
+
178
−
0
View file @
35e31928
# qnet-ftp.src
# $Id$
# @format.tab-size 8, @format.use-tabs true
###############################################################################
# Baja module for performing FTP-based QWKnet call-outs #
# Requires Synchronet v3.00d and Baja v2.30 #
# Developed 2001 by Rob Swindell #
###############################################################################
# Usage: *QNET-FTP HUBID ADDRESSS PASSWORD
# Example: *QNET-FTP VERT vert.synchro.net YOURPASS
# You may use the qnet-ftp.bin module INSTEAD of your normal ftp/script
# QWKnet call-out routine (exec/vert.bat). You can do this by changing
#
# SCFG->Networks->QWK->Hubs->VERT->Call-out Command Line to:
#
# *QNET-FTP VERT vert.synchro.net YOURPASS
#
# The asterisk is important! YOURPASS is your QWKnet password here on Vertrauen
.
#
# No modification or recompilation of this module should be necessary.
!include sbbsdefs.inc
!include file_io.inc
# Must be FIRST function call (or module will immediately terminate)
set _online ON_LOCAL
# Variables
int i argc argv sock port
str tmp rep qwk hubid addr user password
str cmdline
set _ftp_mode FTP_PASV
# Process command line arguments
set hubid ""
set addr ""
set password ""
# Display command line
copy cmdline str
lprintf "QNET-FTP: %s" cmdline
set argc 0
:process_args
compare_str ""
if_true
goto end_args
end_if
sprintf tmp "%.1s" str
shift_str 1
compare tmp " "
if_true
add argc 1
goto process_args
end_if
switch argc
case 0
strcat hubid tmp
end_case
case 1
strcat addr tmp
end_case
case 2
strcat password tmp
end_case
default
goto usage
end_switch
goto process_args
:usage
lprintf "QNET-FTP: !INCORRECT USAGE: %s" cmdline
return
:end_args
compare hubid ""
if_true
goto usage
end_if
compare addr ""
if_true
goto usage
end_if
compare password ""
if_true
goto usage
end_if
sprintf rep "%%j%s.rep" hubid
sprintf qwk "%%j%s.qwk" hubid
chkfile qwk
if_true
lprintf "QNET-FTP: %s already exists!" qwk
set i 0
:check_qwk
sprintf qwk "%%j%s.QW%ld" hubid i
chkfile qwk
if_true
lprintf "QNET-FTP: %s already exists!" qwk
add i 1
compare i 10
if_equal
goto exit
end_if
goto check_qwk
end_if
end_if
socket_open sock
if_false
lprintf "QNET-FTP: !socket_open failure socket_error=%d" _socket_error
goto exit
end_if
set port 21 # default FTP port
lprintf "QNET-FTP: Connecting to %s ... " addr
socket_connect sock addr port
crlf
if_false
lprintf "QNET-FTP: !socket_connect failed socket_error=%d" _socket_error
goto exit
end_if
lprintf "QNET-FTP: Connected to %s" addr
set user "%q"
lprintf "QNET-FTP: Logging in as '%s' (PW: '%s')" user password
ftp_login sock user password
if_false
lprintf "QNET-FTP: !ftp_login failed socket_error=%d" _socket_error
goto exit
end_if
lprintf "QNET-FTP: Logged in successfully"
chkfile rep
if_true
###################
# Send REP packet #
###################
lprintf "QNET-FTP: Sending REP packet: %s" rep
sprintf str "%s.rep" hubid
ftp_put sock rep str
if_false
lprintf "QNET-FTP: !ftp_put failed socket_error=%d\r\n" _socket_error
else
lprintf "QNET-FTP: REP packet sent successfully"
end_if
remove_file rep
end_if
#######################
# Download QWK packet #
#######################
sprintf str "%s.qwk" hubid
lprintf "QNET-FTP: Downloading QWK Packet: %s" str
ftp_get sock str qwk
if_true
lprintf "QNET-FTP: Downloaded %s successfully" str
else
lprintf "QNET-FTP: %s NOT downloaded (no new messages?)" str
end_if
#################
# Exit routine #
#################
:exit
lprintf "QNET-FTP: Done."
# End of QNET-FTP.SRC
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment