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
27bfa2cb
Commit
27bfa2cb
authored
9 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Make stuff from the system object configurable.
parent
ae0ce335
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/load/binkp.js
+31
-18
31 additions, 18 deletions
exec/load/binkp.js
with
31 additions
and
18 deletions
exec/load/binkp.js
+
31
−
18
View file @
27bfa2cb
...
@@ -4,20 +4,27 @@ load("sockdefs.js");
...
@@ -4,20 +4,27 @@ load("sockdefs.js");
* A binkp implementation...
* A binkp implementation...
*
*
* Create a new instance with New passing a path to place received files
* Create a new instance with New passing a path to place received files
* in to the constructor (defaults to system.tem_dir).
* in to the constructor (defaults to system.tem
p
_dir).
*
*
* Next, adjust defaults as needed...
* Next, adjust defaults as needed...
* default_zone - if no zone is specified, use this one for all addresses.
* default_zone - if no zone is specified, use this one for all addresses.
* debug - If set, logs all sent/received frames via log(LOG_DEBUG)
* debug - If set, logs all sent/received frames via log(LOG_DEBUG)
* skipfiles - Do not accept any incoming files until after the first EOB from the remote.
* skipfiles - Do not accept any incoming files until after the first EOB from the remote.
* intended for FREQ sessions.
* intended for FREQ sessions.
* require_md5 - Require that the remote support MD5
* require_md5 - Require that the remote support MD5
* timeout - Max timeout
* timeout - Max timeout
* rx_callback - Function that is called with a single filename argument
* addr_list - list of addresses handled by this system. Defaults to system.fido_addr_list
* when a file is received successfully.
* system_name - BBS name to send to remote defaults to system.name
* Intended for REQ/TIC processing. This callback can call
* system_operator - SysOp name to send to remote defaults to system.operator
* the addFile(filename) method (may not work unless
* system_location - System location to send to remote defaults to system.location
* ver1_1 is true)
* rx_callback - Function that is called with a single filename argument
* when a file is received successfully.
* Intended for REQ/TIC processing. This callback can call
* the addFile(filename) method (may not work unless
* ver1_1 is true)
* auth_callback - Function that is called with a list of addresses and a list of
* passwords (two arguments) which returns true if the session is secure
* or false if it is not.
*
*
* Now add any files you wish to send using the addFile(filename) method
* Now add any files you wish to send using the addFile(filename) method
*
*
...
@@ -30,13 +37,14 @@ load("sockdefs.js");
...
@@ -30,13 +37,14 @@ load("sockdefs.js");
* transfer.
* transfer.
*/
*/
function
BinkP
(
inbound
,
rx_callback
)
function
BinkP
(
inbound
,
rx_callback
,
auth_callback
)
{
{
var
addr
;
var
addr
;
if
(
inbound
===
undefined
)
if
(
inbound
===
undefined
)
inbound
=
system
.
temp_dir
;
inbound
=
system
.
temp_dir
;
this
.
rx_callback
=
rx_callback
;
this
.
rx_callback
=
rx_callback
;
this
.
auth_callback
=
auth_callback
;
this
.
default_zone
=
1
;
this
.
default_zone
=
1
;
addr
=
this
.
parse_addr
(
system
.
fido_addr_list
[
0
]);
addr
=
this
.
parse_addr
(
system
.
fido_addr_list
[
0
]);
if
(
addr
.
zone
!==
undefined
)
if
(
addr
.
zone
!==
undefined
)
...
@@ -54,6 +62,11 @@ function BinkP(inbound, rx_callback)
...
@@ -54,6 +62,11 @@ function BinkP(inbound, rx_callback)
this
.
require_md5
=
true
;
this
.
require_md5
=
true
;
this
.
inbound
=
backslash
(
inbound
);
this
.
inbound
=
backslash
(
inbound
);
this
.
timeout
=
120
;
this
.
timeout
=
120
;
this
.
addr_list
=
[];
this
.
system_name
=
system
.
name
;
this
.
system_operator
=
system
.
operator
;
this
.
system_location
=
system
.
location
;
system
.
fido_addr_list
.
forEach
(
function
(
addr
,
this
){
this
.
addr_list
.
push
(
addr
);});
this
.
sent_files
=
[];
this
.
sent_files
=
[];
this
.
failed_sent_files
=
[];
this
.
failed_sent_files
=
[];
...
@@ -217,14 +230,14 @@ BinkP.prototype.session = function(addr, password, port)
...
@@ -217,14 +230,14 @@ BinkP.prototype.session = function(addr, password, port)
}
}
this
.
authenticated
=
undefined
;
this
.
authenticated
=
undefined
;
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
SYS
"
+
system
.
name
);
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
SYS
"
+
system
_
name
);
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
ZYZ
"
+
system
.
operator
);
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
ZYZ
"
+
system
_
operator
);
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
LOC
"
+
system
.
location
);
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
LOC
"
+
system
_
location
);
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
NDL 115200,TCP,BINKP
"
);
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
NDL 115200,TCP,BINKP
"
);
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
TIME
"
+
system
.
timestr
());
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
TIME
"
+
system
.
timestr
());
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
VER JSBinkP/0.0.0/
"
+
system
.
platform
+
"
binkp/1.1
"
);
this
.
sendCmd
(
this
.
command
.
M_NUL
,
"
VER JSBinkP/0.0.0/
"
+
system
.
platform
+
"
binkp/1.1
"
);
for
(
i
=
0
;
i
<
system
.
fido_
addr_list
.
length
;
i
++
)
for
(
i
=
0
;
i
<
this
.
addr_list
.
length
;
i
++
)
this
.
sendCmd
(
this
.
command
.
M_ADR
,
system
.
fido_
addr_list
[
i
]);
this
.
sendCmd
(
this
.
command
.
M_ADR
,
this
.
addr_list
[
i
]);
while
(
!
js
.
terminated
&&
this
.
remote_addrs
===
undefined
)
{
while
(
!
js
.
terminated
&&
this
.
remote_addrs
===
undefined
)
{
pkt
=
this
.
recvFrame
(
this
.
timeout
);
pkt
=
this
.
recvFrame
(
this
.
timeout
);
...
...
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