Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 69a1b233 authored by deuce's avatar deuce

Add modem support (untested)

parent c6852789
...@@ -8,6 +8,7 @@ src/sbbs3/telnet.h ...@@ -8,6 +8,7 @@ src/sbbs3/telnet.h
src/sbbs3/zmodem.c src/sbbs3/zmodem.c
src/sbbs3/zmodem.h src/sbbs3/zmodem.h
src/sbbs3/xmodem.h src/sbbs3/xmodem.h
src/sbbs3/sexyz.h
src/smblib/crc16.c src/smblib/crc16.c
src/smblic/crc16.h src/smblic/crc16.h
src/smblib/crc32.c src/smblib/crc32.c
...@@ -15,6 +16,7 @@ src/smblic/crc32.h ...@@ -15,6 +16,7 @@ src/smblic/crc32.h
src/syncterm/* src/syncterm/*
src/uifc/* src/uifc/*
src/xpdev/* src/xpdev/*
src/comio/*
The directory structure under src *must* be kept intact. Once you have all The directory structure under src *must* be kept intact. Once you have all
this in place, a simple "make" should build everything you need. If you're this in place, a simple "make" should build everything you need. If you're
......
...@@ -17,10 +17,10 @@ ifdef PREFIX ...@@ -17,10 +17,10 @@ ifdef PREFIX
CFLAGS += -DPREFIX=\"${PREFIX}\" CFLAGS += -DPREFIX=\"${PREFIX}\"
endif endif
CFLAGS += $(UIFC-MT_CFLAGS) $(CIOLIB-MT_CFLAGS) $(XPDEV-MT_CFLAGS) -I../sbbs3 -I../smblib CFLAGS += $(UIFC-MT_CFLAGS) $(CIOLIB-MT_CFLAGS) $(XPDEV-MT_CFLAGS) -I../sbbs3 -I../smblib -I../comio
LDFLAGS += $(UIFC-MT_LDFLAGS) $(CIOLIB-MT_LDFLAGS) $(XPDEV-MT_LDFLAGS) LDFLAGS += $(UIFC-MT_LDFLAGS) $(CIOLIB-MT_LDFLAGS) $(XPDEV-MT_LDFLAGS)
vpath %.c ../sbbs3 ../smblib ../uifc ../guts vpath %.c ../sbbs3 ../smblib ../uifc ../guts ../comio
INSTALL_EXE ?= install INSTALL_EXE ?= install
INSTALL_DATA ?= install -m 0444 INSTALL_DATA ?= install -m 0444
......
...@@ -565,8 +565,8 @@ void change_settings(void) ...@@ -565,8 +565,8 @@ void change_settings(void)
char inipath[MAX_PATH+1]; char inipath[MAX_PATH+1];
FILE *inifile; FILE *inifile;
str_list_t inicontents; str_list_t inicontents;
char opts[4][80]; char opts[6][80];
char *opt[4]; char *opt[6];
int i,j; int i,j;
char str[64]; char str[64];
int cur=0; int cur=0;
...@@ -580,14 +580,16 @@ void change_settings(void) ...@@ -580,14 +580,16 @@ void change_settings(void)
inicontents=strListInit(); inicontents=strListInit();
} }
for(i=0; i<4; i++) for(i=0; i<6; i++)
opt[i]=opts[i]; opt[i]=opts[i];
opts[3][0]=0; opts[5][0]=0;
for(;;) { for(;;) {
sprintf(opts[0],"Confirm Program Exit %s",settings.confirm_close?"Yes":"No"); sprintf(opts[0],"Confirm Program Exit %s",settings.confirm_close?"Yes":"No");
sprintf(opts[1],"Startup Video Mode %s",screen_modes[settings.startup_mode]); sprintf(opts[1],"Startup Video Mode %s",screen_modes[settings.startup_mode]);
sprintf(opts[2],"Scrollback Buffer Lines %d",settings.backlines); sprintf(opts[2],"Scrollback Buffer Lines %d",settings.backlines);
sprintf(opts[3],"Modem Device %s",settings.mdm.device_name);
sprintf(opts[4],"Modem Init String %s",settings.mdm.init_string);
switch(uifc.list(WIN_ACT|WIN_MID|WIN_SAV,0,0,0,&cur,NULL,"Program Settings",opt)) { switch(uifc.list(WIN_ACT|WIN_MID|WIN_SAV,0,0,0,&cur,NULL,"Program Settings",opt)) {
case -1: case -1:
goto write_ini; goto write_ini;
...@@ -629,6 +631,22 @@ void change_settings(void) ...@@ -629,6 +631,22 @@ void change_settings(void)
} }
} }
break; break;
case 3:
uifc.helpbuf= "`Modem Device`\n\n"
#ifdef _WIN32
"Enter the modem device name (ie: COM1).";
#else
"Enter the modem device name (ie: /dev/ttyd0).";
#endif
uifc.input(WIN_MID|WIN_SAV,0,0,"Modem Device",settings.mdm.device_name,LIST_NAME_MAX,K_EDIT);
iniSetString(&inicontents,"SyncTERM","ModemDevice",settings.mdm.device_name,&ini_style);
break;
case 4:
uifc.helpbuf= "`Modem Init String`\n\n"
"Your modem init string goes here.";
uifc.input(WIN_MID|WIN_SAV,0,0,"Modem Init String",settings.mdm.init_string,LIST_NAME_MAX,K_EDIT);
iniSetString(&inicontents,"SyncTERM","ModemInit",settings.mdm.init_string,&ini_style);
break;
} }
} }
write_ini: write_ini:
......
...@@ -13,11 +13,12 @@ ...@@ -13,11 +13,12 @@
#include "rlogin.h" #include "rlogin.h"
#include "raw.h" #include "raw.h"
#include "ssh.h" #include "ssh.h"
#include "modem.h"
#include "conn_telnet.h" #include "conn_telnet.h"
struct conn_api conn_api; struct conn_api conn_api;
char *conn_types[]={"Unknown","RLogin","Telnet","Raw","SSH",NULL}; char *conn_types[]={"Unknown","RLogin","Telnet","Raw","SSH","Modem",NULL};
int conn_ports[]={0,513,23,0,22}; int conn_ports[]={0,513,23,0,22,0};
struct conn_buffer conn_inbuf; struct conn_buffer conn_inbuf;
struct conn_buffer conn_outbuf; struct conn_buffer conn_outbuf;
...@@ -273,6 +274,9 @@ int conn_connect(struct bbslist *bbs) ...@@ -273,6 +274,9 @@ int conn_connect(struct bbslist *bbs)
conn_api.connect=ssh_connect; conn_api.connect=ssh_connect;
conn_api.close=ssh_close; conn_api.close=ssh_close;
break; break;
case CONN_TYPE_MODEM:
conn_api.connect=modem_connect;
conn_api.close=modem_close;
} }
if(conn_api.connect) { if(conn_api.connect) {
conn_api.connect(bbs); conn_api.connect(bbs);
......
...@@ -17,6 +17,7 @@ enum { ...@@ -17,6 +17,7 @@ enum {
,CONN_TYPE_TELNET ,CONN_TYPE_TELNET
,CONN_TYPE_RAW ,CONN_TYPE_RAW
,CONN_TYPE_SSH ,CONN_TYPE_SSH
,CONN_TYPE_MODEM
,CONN_TYPE_TERMINATOR ,CONN_TYPE_TERMINATOR
}; };
......
...@@ -6,8 +6,11 @@ OBJS = \ ...@@ -6,8 +6,11 @@ OBJS = \
$(MTOBJODIR)$(DIRSEP)rlogin$(OFILE) \ $(MTOBJODIR)$(DIRSEP)rlogin$(OFILE) \
$(MTOBJODIR)$(DIRSEP)ssh$(OFILE) \ $(MTOBJODIR)$(DIRSEP)ssh$(OFILE) \
$(MTOBJODIR)$(DIRSEP)telnet_io$(OFILE) \ $(MTOBJODIR)$(DIRSEP)telnet_io$(OFILE) \
$(MTOBJODIR)$(DIRSEP)modem$(OFILE) \
$(MTOBJODIR)$(DIRSEP)conn_telnet$(OFILE) \ $(MTOBJODIR)$(DIRSEP)conn_telnet$(OFILE) \
$(MTOBJODIR)$(DIRSEP)conn$(OFILE) \ $(MTOBJODIR)$(DIRSEP)conn$(OFILE) \
$(MTOBJODIR)$(DIRSEP)comio$(OFILE) \
$(MTOBJODIR)$(DIRSEP)comio_nix$(OFILE) \
$(MTOBJODIR)$(DIRSEP)telnet$(OFILE) \ $(MTOBJODIR)$(DIRSEP)telnet$(OFILE) \
$(MTOBJODIR)$(DIRSEP)term$(OFILE) \ $(MTOBJODIR)$(DIRSEP)term$(OFILE) \
$(MTOBJODIR)$(DIRSEP)window$(OFILE) \ $(MTOBJODIR)$(DIRSEP)window$(OFILE) \
......
...@@ -680,6 +680,7 @@ void parse_url(char *url, struct bbslist *bbs, int dflt_conn_type, int force_def ...@@ -680,6 +680,7 @@ void parse_url(char *url, struct bbslist *bbs, int dflt_conn_type, int force_def
bbs->port=conn_ports[bbs->conn_type]; bbs->port=conn_ports[bbs->conn_type];
p1=url+9; p1=url+9;
} }
/* ToDo: RFC2806 */
/* Remove trailing / (Win32 adds one 'cause it hates me) */ /* Remove trailing / (Win32 adds one 'cause it hates me) */
p2=strchr(p1,'/'); p2=strchr(p1,'/');
if(p2!=NULL) if(p2!=NULL)
...@@ -859,6 +860,12 @@ void load_settings(struct syncterm_settings *set) ...@@ -859,6 +860,12 @@ void load_settings(struct syncterm_settings *set)
set->confirm_close=iniReadBool(inifile,"SyncTERM","ConfirmClose",FALSE); set->confirm_close=iniReadBool(inifile,"SyncTERM","ConfirmClose",FALSE);
set->startup_mode=iniReadInteger(inifile,"SyncTERM","VideoMode",FALSE); set->startup_mode=iniReadInteger(inifile,"SyncTERM","VideoMode",FALSE);
set->backlines=iniReadInteger(inifile,"SyncTERM","ScrollBackLines",2000); set->backlines=iniReadInteger(inifile,"SyncTERM","ScrollBackLines",2000);
char* iniReadString(FILE*, const char* section, const char* key
,const char* deflt, char* value);
/* Modem settings */
iniReadString(inifile, "SyncTERM", "ModemInit", "AT&F", set->mdm.init_string);
iniReadString(inifile, "SyncTERM", "ModemDevice", "/dev/ttyd0", set->mdm.device_name);
if(inifile) if(inifile)
fclose(inifile); fclose(inifile);
} }
......
...@@ -13,10 +13,16 @@ enum { ...@@ -13,10 +13,16 @@ enum {
,SYNCTERM_DEFAULT_TRANSFER_PATH ,SYNCTERM_DEFAULT_TRANSFER_PATH
}; };
struct modem_settings {
char init_string[INI_MAX_VALUE_LEN];
char device_name[INI_MAX_VALUE_LEN+1];
};
struct syncterm_settings { struct syncterm_settings {
int confirm_close; int confirm_close;
int startup_mode; int startup_mode;
int backlines; int backlines;
struct modem_settings mdm;
}; };
extern char *inpath; extern char *inpath;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment