Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Synchronet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
127
Issues
127
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main
Synchronet
Commits
f775de66
Commit
f775de66
authored
May 01, 2007
by
rswindell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created macros for the special node "connection" constants, adding values for
RLogin and SSH.
parent
6c477f1d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
42 deletions
+88
-42
src/sbbs3/getnode.cpp
src/sbbs3/getnode.cpp
+26
-13
src/sbbs3/node.c
src/sbbs3/node.c
+28
-14
src/sbbs3/nodedefs.h
src/sbbs3/nodedefs.h
+6
-1
src/sbbs3/userdat.c
src/sbbs3/userdat.c
+28
-14
No files found.
src/sbbs3/getnode.cpp
View file @
f775de66
...
...
@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 200
3
Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 200
7
Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
...
...
@@ -388,6 +388,29 @@ void sbbs_t::nodelist(void)
}
}
static
char
*
node_connection_desc
(
ushort
conn
,
char
*
str
)
{
switch
(
conn
)
{
case
NODE_CONNECTION_LOCAL
:
strcpy
(
str
,
"Locally"
);
break
;
case
NODE_CONNECTION_TELNET
:
strcpy
(
str
,
"via telnet"
);
break
;
case
NODE_CONNECTION_RLOGIN
:
strcpy
(
str
,
"via rlogin"
);
break
;
case
NODE_CONNECTION_SSH
:
strcpy
(
str
,
"via ssh"
);
break
;
default:
sprintf
(
str
,
"at %ubps"
,
conn
);
break
;
}
return
str
;
}
/****************************************************************************/
/* Displays the information for node number 'number' contained in 'node' */
/****************************************************************************/
...
...
@@ -427,12 +450,7 @@ void sbbs_t::printnodedat(uint number, node_t* node)
bputs
(
"New user"
);
attr
(
cfg
.
color
[
clr_nodestatus
]);
bputs
(
" applying for access "
);
if
(
!
node
->
connection
)
bputs
(
"Locally"
);
else
if
(
node
->
connection
==
0xffff
)
bprintf
(
"via telnet"
);
else
bprintf
(
"at %ubps"
,
node
->
connection
);
bputs
(
node_connection_desc
(
node
->
connection
,
tmp
));
break
;
case
NODE_QUIET
:
if
(
!
SYSOP
)
{
...
...
@@ -555,12 +573,7 @@ void sbbs_t::printnodedat(uint number, node_t* node)
default:
bputs
(
ultoa
(
node
->
action
,
tmp
,
10
));
break
;
}
if
(
!
node
->
connection
)
bputs
(
" locally"
);
else
if
(
node
->
connection
==
0xffff
)
bprintf
(
" via telnet"
);
else
bprintf
(
" at %ubps"
,
node
->
connection
);
bprintf
(
" %s"
,
node_connection_desc
(
node
->
connection
,
tmp
));
if
(
node
->
action
==
NODE_DLNG
)
{
if
(
cfg
.
sys_misc
&
SM_MILITARY
)
{
hour
=
node
->
aux
/
60
;
...
...
src/sbbs3/node.c
View file @
f775de66
...
...
@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 200
4
Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 200
7
Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
...
...
@@ -217,12 +217,36 @@ char *unpackchatpass(char *pass, node_t node)
return
(
pass
);
}
static
char
*
node_connection_desc
(
ushort
conn
,
char
*
str
)
{
switch
(
conn
)
{
case
NODE_CONNECTION_LOCAL
:
strcpy
(
str
,
"Locally"
);
break
;
case
NODE_CONNECTION_TELNET
:
strcpy
(
str
,
"via telnet"
);
break
;
case
NODE_CONNECTION_RLOGIN
:
strcpy
(
str
,
"via rlogin"
);
break
;
case
NODE_CONNECTION_SSH
:
strcpy
(
str
,
"via ssh"
);
break
;
default:
sprintf
(
str
,
"at %ubps"
,
conn
);
break
;
}
return
str
;
}
/****************************************************************************/
/* Displays the information for node number 'number' contained in 'node' */
/****************************************************************************/
void
printnodedat
(
int
number
,
node_t
node
)
{
char
hour
,
mer
[
3
];
char
tmp
[
128
];
printf
(
"Node %2d: "
,
number
);
switch
(
node
.
status
)
{
...
...
@@ -250,12 +274,7 @@ void printnodedat(int number, node_t node)
case
NODE_NEWUSER
:
printf
(
"New user"
);
printf
(
" applying for access "
);
if
(
!
node
.
connection
)
printf
(
"locally"
);
else
if
(
node
.
connection
==
0xffff
)
printf
(
"via telnet"
);
else
printf
(
"at %ubps"
,
node
.
connection
);
printf
(
"%s"
,
node_connection_desc
(
node
.
connection
,
tmp
));
break
;
case
NODE_QUIET
:
case
NODE_INUSE
:
...
...
@@ -349,12 +368,7 @@ void printnodedat(int number, node_t node)
default:
printf
(
itoa
(
node
.
action
,
tmp
,
10
));
break
;
}
if
(
!
node
.
connection
)
printf
(
" locally"
);
else
if
(
node
.
connection
==
0xffff
)
printf
(
" via telnet"
);
else
printf
(
" at %ubps"
,
node
.
connection
);
printf
(
" %s"
,
node_connection_desc
(
node
.
connection
,
tmp
));
if
(
node
.
action
==
NODE_DLNG
)
{
if
((
node
.
aux
/
60
)
>=
12
)
{
if
(
node
.
aux
/
60
==
12
)
...
...
@@ -435,7 +449,7 @@ int main(int argc, char **argv)
}
if
(
argc
<
2
)
{
printf
(
"usage: node [
/
debug] [action [on|off]] [node numbers] [...]"
printf
(
"usage: node [
-
debug] [action [on|off]] [node numbers] [...]"
"
\n\n
"
);
printf
(
"actions (default is list):
\n\n
"
);
printf
(
"list = list status
\n
"
);
...
...
src/sbbs3/nodedefs.h
View file @
f775de66
...
...
@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 200
0
Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 200
7
Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
...
...
@@ -43,6 +43,7 @@
#define _NODEDEFS_H
#include "smbdefs.h"
/* uchar, ushort, ulong and _PACK */
#include "limits.h"
enum
{
/* Node Status */
NODE_WFC
/* Waiting for Call */
...
...
@@ -117,6 +118,10 @@ typedef struct _PACK { /* Node information kept in node.dab */
action
;
/* Action User is doing on Node */
ushort
useron
,
/* User on Node */
connection
,
/* Connection rate of Node */
#define NODE_CONNECTION_LOCAL 0
#define NODE_CONNECTION_TELNET USHRT_MAX
/* 0xffff */
#define NODE_CONNECTION_RLOGIN (USHRT_MAX-1)
#define NODE_CONNECTION_SSH (USHRT_MAX-2)
misc
,
/* Miscellaneous bits for node */
aux
;
/* Auxillary word for node */
ulong
extaux
;
/* Extended aux dword for node */
...
...
src/sbbs3/userdat.c
View file @
f775de66
...
...
@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 200
6
Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 200
7
Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
...
...
@@ -800,9 +800,33 @@ char* DLLCALL unpackchatpass(char *pass, node_t* node)
return
(
pass
);
}
static
char
*
node_connection_desc
(
ushort
conn
,
char
*
str
)
{
switch
(
conn
)
{
case
NODE_CONNECTION_LOCAL
:
strcpy
(
str
,
"Locally"
);
break
;
case
NODE_CONNECTION_TELNET
:
strcpy
(
str
,
"via telnet"
);
break
;
case
NODE_CONNECTION_RLOGIN
:
strcpy
(
str
,
"via rlogin"
);
break
;
case
NODE_CONNECTION_SSH
:
strcpy
(
str
,
"via ssh"
);
break
;
default:
sprintf
(
str
,
"at %ubps"
,
conn
);
break
;
}
return
str
;
}
char
*
DLLCALL
nodestatus
(
scfg_t
*
cfg
,
node_t
*
node
,
char
*
buf
,
size_t
buflen
)
{
char
str
[
256
];
char
tmp
[
128
];
char
*
mer
;
int
hour
;
...
...
@@ -835,13 +859,8 @@ char* DLLCALL nodestatus(scfg_t* cfg, node_t* node, char* buf, size_t buflen)
strcpy
(
str
,
"Running external event"
);
break
;
case
NODE_NEWUSER
:
strcpy
(
str
,
"New user applying for access "
);
if
(
!
node
->
connection
)
strcat
(
str
,
"Locally"
);
else
if
(
node
->
connection
==
0xffff
)
{
strcat
(
str
,
"via telnet"
);
}
else
sprintf
(
str
+
strlen
(
str
),
"at %ubps"
,
node
->
connection
);
sprintf
(
str
,
"New user applying for access %s"
,
node_connection_desc
(
node
->
connection
,
tmp
));
break
;
case
NODE_QUIET
:
case
NODE_INUSE
:
...
...
@@ -949,12 +968,7 @@ char* DLLCALL nodestatus(scfg_t* cfg, node_t* node, char* buf, size_t buflen)
sprintf
(
str
+
strlen
(
str
),
"%d"
,
node
->
action
);
break
;
}
if
(
!
node
->
connection
)
strcat
(
str
,
" locally"
);
if
(
node
->
connection
==
0xffff
)
{
strcat
(
str
,
" via telnet"
);
}
else
sprintf
(
str
+
strlen
(
str
),
" at %ubps"
,
node
->
connection
);
strcat
(
str
,
node_connection_desc
(
node
->
connection
,
tmp
));
if
(
node
->
action
==
NODE_DLNG
)
{
if
((
node
->
aux
/
60
)
>=
12
)
{
if
(
node
->
aux
/
60
==
12
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment