Index: misc/mgetty/.cvsignore diff -c /dev/null misc/mgetty/.cvsignore:1.1 *** /dev/null Sat Sep 28 00:21:45 1996 --- misc/mgetty/.cvsignore Sat Sep 28 00:18:59 1996 *************** *** 0 **** --- 1,10 ---- + kvg + login.config + mgetty + mgetty.config + mksed + newslock + policy.h + sedscript + sendfax + sendfax.config Index: misc/mgetty/Makefile diff -c misc/mgetty/Makefile:1.1.1.1 misc/mgetty/Makefile:1.2 *** misc/mgetty/Makefile:1.1.1.1 Fri Sep 13 20:28:13 1996 --- misc/mgetty/Makefile Fri Sep 27 01:24:12 1996 *************** *** 4,11 **** # # this is the C compiler to use (on SunOS, the standard "cc" does not # grok my code, so please use gcc there. On ISC 4.0, use "icc".). ! CC=gcc ! #CC=cc # #### C Compiler Flags #### # --- 4,11 ---- # # this is the C compiler to use (on SunOS, the standard "cc" does not # grok my code, so please use gcc there. On ISC 4.0, use "icc".). ! #CC=gcc ! CC=/usr/5bin/cc # #### C Compiler Flags #### # *************** *** 107,113 **** # prompt first. Don't forget to activate the /AutoPPP/ line in login.config! # #CFLAGS=-Wall -O2 -pipe -DSECUREWARE -DUSE_POLL ! CFLAGS=-O2 -Wall -pipe #CFLAGS=-O -DSVR4 #CFLAGS=-O -DSVR4 -DSVR42 #CFLAGS=-O -DUSE_POLL --- 107,113 ---- # prompt first. Don't forget to activate the /AutoPPP/ line in login.config! # #CFLAGS=-Wall -O2 -pipe -DSECUREWARE -DUSE_POLL ! #CFLAGS=-O2 -Wall -pipe #CFLAGS=-O -DSVR4 #CFLAGS=-O -DSVR4 -DSVR42 #CFLAGS=-O -DUSE_POLL *************** *** 120,125 **** --- 120,126 ---- #CFLAGS=-DNEXTSGTTY -DBSD -O2 # for NeXT with sgtty #CFLAGS=-D_HPUX_SOURCE -Aa -DBSDSTATFS # for HP-UX 9.x #CFLAGS=-cckr -D__STDC__ -O -DSVR42 # for IRIX 5.2 + CFLAGS=-g -DSYSV_TERMIO -DUSE_POLL -D_NO_STDLIB_H -Dsunos4 # *************** *** 144,150 **** # For FreeBSD, add "-lutil" if the linker complains about # "utmp.o: unresolved symbod _login" # ! LDFLAGS= #LDFLAGS=-lprot -lsocket #LDFLAGS=-s -shlib #LDFLAGS=-lsocket --- 145,151 ---- # For FreeBSD, add "-lutil" if the linker complains about # "utmp.o: unresolved symbod _login" # ! LDFLAGS=-g #LDFLAGS=-lprot -lsocket #LDFLAGS=-s -shlib #LDFLAGS=-lsocket *************** *** 171,181 **** # # prefix, where most (all?) of the stuff lives, usually /usr/local or /usr # ! prefix=/usr/local # # prefix for all the spool directories (usually /usr/spool or /var/spool) # ! spool=/var/spool # # where the mgetty + sendfax binaries live (used for "make install") # --- 172,182 ---- # # prefix, where most (all?) of the stuff lives, usually /usr/local or /usr # ! prefix=/local # # prefix for all the spool directories (usually /usr/spool or /var/spool) # ! spool=/local/var/spool # # where the mgetty + sendfax binaries live (used for "make install") # *************** *** 187,193 **** # # where the font+coverpage files go to (check vs. policy.h!) # ! LIBDIR=$(prefix)/lib/mgetty+sendfax # # where the configuration files (*.config, aliases, fax.allow/deny) go to # --- 188,194 ---- # # where the font+coverpage files go to (check vs. policy.h!) # ! LIBDIR=$(prefix)/share/mgetty+sendfax # # where the configuration files (*.config, aliases, fax.allow/deny) go to # *************** *** 222,245 **** # A shell that understands bourne-shell syntax # (on some ultrix systems, you may need /bin/sh5 here) # ! SHELL=/bin/sh # # If you have problems with the awk-programs in the fax/ shell scripts, # try using "nawk" or "gawk" (or whatever works...) here # needed on most SunOS/Solaris/ISC/NeXTStep versions. # ! AWK=awk # # A few (very few) programs want Perl, preferably Perl5. This define # tells them where to find it. You can use everything except "faxrunqd" # and the "tkperl" frontends without PERL, so don't worry if you don't # have it. ! PERL=/usr/bin/perl # # If you have Perl with TK extentions, define it here. This may be the # same as PERL=... above, or different, if you have TkPerl statically # linked. ! TKPERL=/usr/bin/tkperl # # # An echo program that understands escapes like "\n" for newline or --- 223,246 ---- # A shell that understands bourne-shell syntax # (on some ultrix systems, you may need /bin/sh5 here) # ! SHELL=/usr/bin/sh # # If you have problems with the awk-programs in the fax/ shell scripts, # try using "nawk" or "gawk" (or whatever works...) here # needed on most SunOS/Solaris/ISC/NeXTStep versions. # ! AWK=mawk # # A few (very few) programs want Perl, preferably Perl5. This define # tells them where to find it. You can use everything except "faxrunqd" # and the "tkperl" frontends without PERL, so don't worry if you don't # have it. ! PERL=/local/bin/perl # # If you have Perl with TK extentions, define it here. This may be the # same as PERL=... above, or different, if you have TkPerl statically # linked. ! #TKPERL=/usr/bin/tkperl # # # An echo program that understands escapes like "\n" for newline or *************** *** 251,257 **** # please use the "mg.echo" program provided in the compat/ subdirectory. # Set ECHO="mg.echo" and INSTALL_MECHO to mg.echo # ! ECHO="echo" # # INSTALL_MECHO=mg.echo --- 252,258 ---- # please use the "mg.echo" program provided in the compat/ subdirectory. # Set ECHO="mg.echo" and INSTALL_MECHO to mg.echo # ! ECHO="/usr/5bin/echo" # # INSTALL_MECHO=mg.echo Index: misc/mgetty/cnd.c diff -c misc/mgetty/cnd.c:1.1.1.1 misc/mgetty/cnd.c:1.3 *** misc/mgetty/cnd.c:1.1.1.1 Fri Sep 13 20:28:18 1996 --- misc/mgetty/cnd.c Sat Sep 28 00:12:35 1996 *************** *** 42,47 **** --- 42,95 ---- {"REASON FOR NO CALLER NUMBER: ", &CallerId}, {"REASON FOR NO CALLER NAME: ", &CallName}, + /* + * Response to ATI3: + * Motorola Lifestyle 28.8 External 68356 ROM SW REV 3 + * S209415900 -01 11/16/95 4:00pm + */ + /* + * According to the manual it conforms to the Caller-ID specifications + * TR-TSY-000030 and TR-NWT-000031. + * + * You use AT*ID1 to enable the Caller-ID reporting. + * + * If you're lucky it might say something this (Bell Canada): + * + * [0d][0a]CALLER NUMBER:![01][08]09201407[07][0c]PRIVATE NAME[03][07]4836845[d0][10][0d] + * + * This appears to be the raw data from the switch (which would + * correspond to whattt another modem manual I read recently says): + * + * - '!' ???? (indicator that this is raw data?) + * - 0x01 ???? (id code for date/time field?) + * - 0x08 length of the id code + * - "09201407" the date and time (I.e. Sept 20, 14:07). + * - 0x07 ???? (id code of the name field?) + * - 0x0c length of the name field + * - "PRIVATE NAME" The name, in this case hidden + * - 0x03 ???? (id code of the number field?) + * - 0x07 length of the number field + * - "4836845" The calling number. + * - 0xd0 ??? + * - 0x10 ??? + * - 0x0d end of data + * + * I've not yet tried to write code to decode this.... + * I'm hoping my interpretation of the '!' is right, in which case + * detecting and parsing this message will be easy. Maybe Motorola + * can add a hook to permit this style of output all the time.... + * -- + * Greg A. Woods + */ + {"CALLER NAME:", &CallName}, + {"CALLER NAME:", &CallName}, + #if 0 + {"CALLER NUMBER:", &MotorolaRawBellCan}, + #endif + {"CALLER NUMBER:", &CallerId}, + {"FAILURE NUMBER:", &CallerId}, /* actually a failure code? */ + {"FAILURE NAME:", &CallName}, /* probably not possible.... */ + /* for the ZyXEL 2864(D)I: "FM:xxx TO:yyy" */ {"FM:", &CallerId}, *************** *** 120,125 **** --- 168,177 ---- (void) strcpy(*(cp->variable), str+len); } lprintf(L_JUNK, "CND: found: %s", *(cp->variable)); + if (cp->variable == &CallName && *CallName) + lprintf(L_AUDIT, "INCOMING -- Caller: %s", CallName); + if (cp->variable == &CallerId && *CallerId) + lprintf(L_AUDIT, "INCOMING -- Caller Id: %s", CallerId); return; } } Index: misc/mgetty/conf_mg.c diff -c misc/mgetty/conf_mg.c:1.1.1.1 misc/mgetty/conf_mg.c:1.2 *** misc/mgetty/conf_mg.c:1.1.1.1 Fri Sep 13 20:28:18 1996 --- misc/mgetty/conf_mg.c Fri Sep 27 01:21:50 1996 *************** *** 8,13 **** --- 8,14 ---- #include #include #include + #include #include "mgetty.h" #include "policy.h" *************** *** 14,19 **** --- 15,21 ---- #include "syslibs.h" #include "tio.h" + #define defining_conf_data 1 #include "config.h" #include "conf_mg.h" *************** *** 59,72 **** /* this is the default configuration... */ ! ! struct conf_data_mgetty c = { ! { "speed", DEFAULT_PORTSPEED, CT_INT, C_PRESET }, ! { "switchbd", FAX_RECV_SWITCHBD, CT_INT, C_PRESET }, ! { "direct", FALSE, CT_BOOL, C_PRESET }, ! { "blocking", FALSE, CT_BOOL, C_PRESET }, ! ! { "port-owner", (p_int) DEVICE_OWNER, CT_STRING, C_PRESET }, #ifdef DEVICE_GROUP { "port-group", (p_int) DEVICE_GROUP, CT_STRING, C_PRESET }, #else --- 61,73 ---- /* this is the default configuration... */ ! static conf_data_mg_i cdi = { ! /* char *key, p_int i, enum type, enum flags; */ ! { "speed", DEFAULT_PORTSPEED, CT_INT, C_PRESET }, ! { "switchbd", FAX_RECV_SWITCHBD, CT_INT, C_PRESET }, ! { "direct", FALSE, CT_BOOL, C_PRESET }, ! { "blocking", FALSE, CT_BOOL, C_PRESET }, ! { "port-owner", (p_int) DEVICE_OWNER, CT_STRING, C_PRESET }, #ifdef DEVICE_GROUP { "port-group", (p_int) DEVICE_GROUP, CT_STRING, C_PRESET }, #else *************** *** 125,131 **** { "gettydefs", (p_int)GETTYDEFS_DEFAULT_TAG, CT_STRING, C_PRESET }, { "term", 0, CT_STRING, C_EMPTY }, ! { NULL, 0, CT_STRING, C_EMPTY }}; /* * exit_usage() - exit with usage display --- 126,134 ---- { "gettydefs", (p_int)GETTYDEFS_DEFAULT_TAG, CT_STRING, C_PRESET }, { "term", 0, CT_STRING, C_EMPTY }, ! { NULL, 0, CT_STRING, C_EMPTY } ! }; ! conf_data_mg_t c; /* * exit_usage() - exit with usage display *************** *** 159,164 **** --- 162,169 ---- } /* initialize a few things that can't be done statically */ + assert(sizeof(c) == sizeof(cdi)); + memcpy((char *) &c, (char *) &cdi, sizeof(c)); c.init_chat.d.p = (void *) def_init_chat_seq; c.init_chat.flags = C_PRESET; Index: misc/mgetty/conf_mg.h diff -c misc/mgetty/conf_mg.h:1.1.1.1 misc/mgetty/conf_mg.h:1.2 *** misc/mgetty/conf_mg.h:1.1.1.1 Fri Sep 13 20:28:18 1996 --- misc/mgetty/conf_mg.h Fri Sep 27 01:21:53 1996 *************** *** 4,59 **** * It is initialized and loaded in conf_mg.c and accessed from mgetty.c */ ! extern struct conf_data_mgetty { ! struct conf_data ! speed, /* port speed */ ! switchbd, /* speed switch for fax rec.*/ ! direct_line, /* direct lines */ ! blocking, /* do blocking open */ ! port_owner, /* "uucp" */ ! port_group, /* "modem" */ ! port_mode, /* "660" */ ! toggle_dtr, /* toggle DTR for modem reset */ ! toggle_dtr_waittime, /* time to hold DTR low */ ! data_only, /* no fax */ ! fax_only, /* no data */ ! modem_type, /* auto/c2.0/cls2/data */ ! init_chat, /* modem initialization */ ! force_init_chat, /* for stubborn modems */ ! modem_check_time, /* modem still alive? */ ! rings_wanted, /* number of RINGs */ ! getcnd_chat, /* get caller ID (for ELINK)*/ ! answer_chat, /* ATA...CONNECT...""...\n */ ! answer_chat_timeout, /* longer as S7! */ ! autobauding, ! ! ringback, /* ringback enabled */ ! ringback_time, /* ringback time */ ! ! ignore_carrier, /* do not clear CLOCAL */ ! issue_file, /* /etc/issue file */ ! prompt_waittime, /* ms wait before prompting */ ! login_prompt, ! login_time, /* max. time to log in */ ! ! station_id, /* local fax station ID */ ! fax_server_file, /* fax to send upon poll */ ! diskspace, /* min. free disk space */ ! notify_mail, /* fax mail goes to... */ ! fax_owner, /* "fax" */ ! fax_group, /* "staff" */ ! fax_mode, /* "660" */ ! ! debug, /* log level */ ! ! statistics_chat, /* get some call statist. */ ! statistics_file, /* default: log file */ ! gettydefs_tag, ! termtype, /* $TERM=... */ ! end_of_config; } c; int mgetty_parse_args _PROTO(( int argc, char ** argv )); void mgetty_get_config _PROTO(( char * port )); --- 4,68 ---- * It is initialized and loaded in conf_mg.c and accessed from mgetty.c */ ! #define PROTO_CONF_MG_FIELDS \ ! speed, /* port speed */ \ ! switchbd, /* speed switch for fax rec.*/ \ ! direct_line, /* direct lines */ \ ! blocking, /* do blocking open */ \ ! \ ! port_owner, /* "uucp" */ \ ! port_group, /* "modem" */ \ ! port_mode, /* "660" */ \ ! \ ! toggle_dtr, /* toggle DTR for modem reset */ \ ! toggle_dtr_waittime, /* time to hold DTR low */ \ ! data_only, /* no fax */ \ ! fax_only, /* no data */ \ ! modem_type, /* auto/c2.0/cls2/data */ \ ! init_chat, /* modem initialization */ \ ! force_init_chat, /* for stubborn modems */ \ ! \ ! modem_check_time, /* modem still alive? */ \ ! rings_wanted, /* number of RINGs */ \ ! getcnd_chat, /* get caller ID (for ELINK)*/ \ ! answer_chat, /* ATA...CONNECT...""...\n */ \ ! answer_chat_timeout, /* longer as S7! */ \ ! autobauding, /* */ \ ! \ ! ringback, /* ringback enabled */ \ ! ringback_time, /* ringback time */ \ ! \ ! ignore_carrier, /* do not clear CLOCAL */ \ ! issue_file, /* /etc/issue file */ \ ! prompt_waittime, /* ms wait before prompting */ \ ! login_prompt, /* */ \ ! login_time, /* max. time to log in */ \ ! \ ! station_id, /* local fax station ID */ \ ! fax_server_file, /* fax to send upon poll */ \ ! diskspace, /* min. free disk space */ \ ! notify_mail, /* fax mail goes to... */ \ ! fax_owner, /* "fax" */ \ ! fax_group, /* "staff" */ \ ! fax_mode, /* "660" */ \ ! \ ! debug, /* log level */ \ ! \ ! statistics_chat, /* get some call statist. */ \ ! statistics_file, /* default: log file */ \ ! gettydefs_tag, /* */ \ ! termtype, /* $TERM=... */ \ ! end_of_config /* */ ! typedef struct conf_data_mgetty { ! struct conf_data PROTO_CONF_MG_FIELDS; ! } conf_data_mg_t; ! typedef struct conf_data_mgetty_i { ! struct conf_data_i PROTO_CONF_MG_FIELDS; ! } conf_data_mg_i; ! extern conf_data_mg_t c; int mgetty_parse_args _PROTO(( int argc, char ** argv )); void mgetty_get_config _PROTO(( char * port )); Index: misc/mgetty/conf_sf.c diff -c misc/mgetty/conf_sf.c:1.1.1.1 misc/mgetty/conf_sf.c:1.2 *** misc/mgetty/conf_sf.c:1.1.1.1 Fri Sep 13 20:28:18 1996 --- misc/mgetty/conf_sf.c Fri Sep 27 01:21:55 1996 *************** *** 8,13 **** --- 8,14 ---- #include #include #include + #include #include "mgetty.h" #include "policy.h" *************** *** 26,32 **** #define FAX_SEND_SWITCHBD 0 #endif ! struct conf_data_sendfax c = { { "fax-devices", 0, CT_STRING, C_EMPTY }, { "fax-devices", 0, CT_STRING, C_IGNORE }, { "modem-init", 0, CT_STRING, C_EMPTY }, --- 27,33 ---- #define FAX_SEND_SWITCHBD 0 #endif ! static conf_data_sendfax_i cdi = { { "fax-devices", 0, CT_STRING, C_EMPTY }, { "fax-devices", 0, CT_STRING, C_IGNORE }, { "modem-init", 0, CT_STRING, C_EMPTY }, *************** *** 51,68 **** { "" /* stdin */, FALSE, CT_BOOL, C_PRESET }, { "" /* rename */, FALSE, CT_BOOL, C_PRESET }, { "" /* acct_handle */, (p_int)"", CT_STRING, C_PRESET }, ! { NULL, 0, CT_STRING, C_EMPTY }}; int sendfax_parse_args _P2( (argc,argv), int argc, char ** argv ) { int opt; char * p; /* sanity check: * make sure that structs-in-struct can be handled exactly as if * packed in array (get_config relies on it!) */ - conf_data c_a[2]; if ( ( (char *)&c_a[1] - (char *)&c_a[0] ) != ( (char *)&c.ttys_0 - (char *)&c.ttys ) ) { --- 52,73 ---- { "" /* stdin */, FALSE, CT_BOOL, C_PRESET }, { "" /* rename */, FALSE, CT_BOOL, C_PRESET }, { "" /* acct_handle */, (p_int)"", CT_STRING, C_PRESET }, ! { NULL, 0, CT_STRING, C_EMPTY } ! }; ! conf_data_sendfax_t c; int sendfax_parse_args _P2( (argc,argv), int argc, char ** argv ) { int opt; char * p; + conf_data c_a[2]; + assert(sizeof(cdi) == sizeof(c)); + memcpy((char *) &c, (char *) &cdi, sizeof(c)); /* sanity check: * make sure that structs-in-struct can be handled exactly as if * packed in array (get_config relies on it!) */ if ( ( (char *)&c_a[1] - (char *)&c_a[0] ) != ( (char *)&c.ttys_0 - (char *)&c.ttys ) ) { Index: misc/mgetty/conf_sf.h diff -c misc/mgetty/conf_sf.h:1.1.1.1 misc/mgetty/conf_sf.h:1.2 *** misc/mgetty/conf_sf.h:1.1.1.1 Fri Sep 13 20:28:18 1996 --- misc/mgetty/conf_sf.h Fri Sep 27 01:21:57 1996 *************** *** 4,32 **** * It is initialized and loaded in conf_sf.c and accessed from sendfax.c */ ! extern struct conf_data_sendfax { ! struct conf_data ! ttys, ! ttys_0, /* for "ignore" */ ! modem_init, ! modem_handshake, ! modem_type, ! max_tries, ! max_tries_ctd, ! speed, ! switchbd, ! dial_prefix, ! station_id, ! poll_dir, ! normal_res, ! debug, ! verbose, ! fax_poll_wanted, /* cli only (-p) */ ! fax_page_header, ! use_stdin, /* cli only (-S) */ ! rename_files, /* cli only (-r) */ ! acct_handle, /* cli only (-A) */ ! end_of_config; } c; int sendfax_parse_args _PROTO(( int argc, char ** argv )); void sendfax_get_config _PROTO(( char * port )); --- 4,41 ---- * It is initialized and loaded in conf_sf.c and accessed from sendfax.c */ ! #define PROTO_CONF_SENDFAX_FIELDS \ ! ttys, \ ! ttys_0, /* for "ignore" */ \ ! modem_init, \ ! modem_handshake, \ ! modem_type, \ ! max_tries, \ ! max_tries_ctd, \ ! speed, \ ! switchbd, \ ! dial_prefix, \ ! station_id, \ ! poll_dir, \ ! normal_res, \ ! debug, \ ! verbose, \ ! fax_poll_wanted, /* cli only (-p) */ \ ! fax_page_header, \ ! use_stdin, /* cli only (-S) */ \ ! rename_files, /* cli only (-r) */ \ ! acct_handle, /* cli only (-A) */ \ ! end_of_config ! ! typedef struct conf_data_sendfax_i { ! struct conf_data_i PROTO_CONF_SENDFAX_FIELDS; ! } conf_data_sendfax_i; ! ! typedef struct conf_data_sendfax { ! struct conf_data PROTO_CONF_SENDFAX_FIELDS; ! } conf_data_sendfax_t; ! ! extern conf_data_sendfax_t c; int sendfax_parse_args _PROTO(( int argc, char ** argv )); void sendfax_get_config _PROTO(( char * port )); Index: misc/mgetty/config.h diff -c misc/mgetty/config.h:1.1.1.1 misc/mgetty/config.h:1.2 *** misc/mgetty/config.h:1.1.1.1 Fri Sep 13 20:28:17 1996 --- misc/mgetty/config.h Fri Sep 27 01:22:00 1996 *************** *** 12,25 **** typedef int p_int; /* an "int" is the same size as an "char *" */ #endif typedef struct conf_data { char * key; union { p_int i; void * p; } d; ! enum { CT_INT, CT_STRING, CT_CHAT, CT_BOOL, ! CT_FLOWL, CT_ACTION, CT_KEYWORD } type; ! enum { C_EMPTY, C_PRESET, C_OVERRIDE, C_CONF, ! C_IGNORE } flags; ! } conf_data; int get_config _PROTO(( char * conf_file, conf_data * cd, char * section_key, char * key_value )); --- 12,38 ---- typedef int p_int; /* an "int" is the same size as an "char *" */ #endif + typedef enum { CT_INT, CT_STRING, CT_CHAT, CT_BOOL, + CT_FLOWL, CT_ACTION, CT_KEYWORD + } ct_type_t; + + typedef enum { + C_EMPTY, C_PRESET, C_OVERRIDE, C_CONF, C_IGNORE + } c_flags_t; + + typedef struct conf_data_i { + char * key; + p_int i; + ct_type_t type; + c_flags_t flags; + } conf_data_i; + typedef struct conf_data { char * key; union { p_int i; void * p; } d; ! ct_type_t type; ! c_flags_t flags; ! } conf_data; int get_config _PROTO(( char * conf_file, conf_data * cd, char * section_key, char * key_value )); Index: misc/mgetty/mgetty.h diff -c misc/mgetty/mgetty.h:1.1.1.1 misc/mgetty/mgetty.h:1.2 *** misc/mgetty/mgetty.h:1.1.1.1 Fri Sep 13 20:28:14 1996 --- misc/mgetty/mgetty.h Fri Sep 27 01:22:02 1996 *************** *** 97,104 **** * Otherwise: barf! */ #ifdef sun ! # if !defined( sunos4 ) && !defined( solaris2 ) && !defined( solaris86 ) ! # error "Please define -Dsunos4 or -Dsolaris2 or -Dsolaris86" # endif #endif --- 97,104 ---- * Otherwise: barf! */ #ifdef sun ! # if !defined(sunos4) && !defined(solaris2) && !defined(solaris86) ! # include "Please define -Dsunos4 or -Dsolaris2 or -Dsolaris86" # endif #endif Index: misc/mgetty/callback/.cvsignore diff -c /dev/null misc/mgetty/callback/.cvsignore:1.1 *** /dev/null Sat Sep 28 00:22:00 1996 --- misc/mgetty/callback/.cvsignore Sat Sep 28 00:19:04 1996 *************** *** 0 **** --- 1,2 ---- + callback + ct Index: misc/mgetty/callback/conf_cb.c diff -c misc/mgetty/callback/conf_cb.c:1.1.1.1 misc/mgetty/callback/conf_cb.c:1.2 *** misc/mgetty/callback/conf_cb.c:1.1.1.1 Fri Sep 13 20:29:17 1996 --- misc/mgetty/callback/conf_cb.c Fri Sep 27 01:22:23 1996 *************** *** 8,13 **** --- 8,14 ---- #include #include #include + #include #include "mgetty.h" #include "policy.h" *************** *** 29,35 **** /* this is the default configuration... */ ! struct conf_data_mgetty c = { { "dialout-devices", (int)FAX_MODEM_TTYS, CT_STRING, C_PRESET }, { "dialout-devices", 0, CT_STRING, C_IGNORE }, { "delay", 20, CT_INT, C_PRESET }, --- 30,36 ---- /* this is the default configuration... */ ! static conf_data_cb_i cdi = { { "dialout-devices", (int)FAX_MODEM_TTYS, CT_STRING, C_PRESET }, { "dialout-devices", 0, CT_STRING, C_IGNORE }, { "delay", 20, CT_INT, C_PRESET }, *************** *** 45,51 **** { "", FALSE, CT_BOOL, C_PRESET }, /* nodetach */ { "debug", LOG_LEVEL, CT_INT, C_PRESET }, ! { NULL, 0, CT_STRING, C_EMPTY }}; /* * exit_usage() - exit with usage display --- 46,54 ---- { "", FALSE, CT_BOOL, C_PRESET }, /* nodetach */ { "debug", LOG_LEVEL, CT_INT, C_PRESET }, ! { NULL, 0, CT_STRING, C_EMPTY } ! }; ! conf_data_cb_t c; /* * exit_usage() - exit with usage display *************** *** 60,71 **** int callback_parse_args _P2( (argc,argv), int argc, char ** argv ) { int opt; /* sanity check: * make sure that structs-in-struct can be handled exactly as if * packed in array (get_config relies on it!) */ - conf_data c_a[2]; if ( ( (char *)&c_a[1] - (char *)&c_a[0] ) != ( (char *)&c.ttys_0 - (char *)&c.ttys ) ) { --- 63,77 ---- int callback_parse_args _P2( (argc,argv), int argc, char ** argv ) { int opt; + conf_data c_a[2]; + /* initialize a few things that can't be done statically */ + assert(sizeof(c) == sizeof(cdi)); + memcpy((char *) &c, (char *) &cdi, sizeof(c)); /* sanity check: * make sure that structs-in-struct can be handled exactly as if * packed in array (get_config relies on it!) */ if ( ( (char *)&c_a[1] - (char *)&c_a[0] ) != ( (char *)&c.ttys_0 - (char *)&c.ttys ) ) { Index: misc/mgetty/callback/conf_cb.h diff -c misc/mgetty/callback/conf_cb.h:1.1.1.1 misc/mgetty/callback/conf_cb.h:1.2 *** misc/mgetty/callback/conf_cb.h:1.1.1.1 Fri Sep 13 20:29:17 1996 --- misc/mgetty/callback/conf_cb.h Fri Sep 27 01:22:25 1996 *************** *** 3,27 **** /* all (dynamic) callback configuration is contained in this structure. * It is initialized and loaded in conf_cb.c and accessed from callback.c */ ! extern struct conf_data_mgetty { ! struct conf_data ! ttys, /* ttys */ ! ttys_0, /* for second pass, "ignore" */ ! delay, /* min. delay before first call */ ! delay_rand, /* add random time 0...dr to delay */ ! retry_time, /* time between two dialup attempts */ ! max_retry_time, /* how long to try altogether */ ! modem_init, /* modem initialization */ ! speed, /* port speed */ ! dial_prefix, /* ATDT0WP... */ ! autobauding, /* change baud rate to CONNECT "xxx" */ ! prompt_waittime, /* pause [in ms] after CONNECT */ ! nodetach, /* don't fork() */ ! debug, /* debugging */ ! end_of_config; } c; int callback_parse_args _PROTO(( int argc, char ** argv )); void callback_get_config _PROTO(( char * port )); --- 3,35 ---- /* all (dynamic) callback configuration is contained in this structure. * It is initialized and loaded in conf_cb.c and accessed from callback.c */ + #define PROTO_CONF_CB_FIELDS \ + ttys, /* ttys */ \ + ttys_0, /* for second pass, "ignore" */ \ + delay, /* min. delay before first call */ \ + delay_rand, /* add random time 0...dr to delay */ \ + retry_time, /* time between two dialup attempts */ \ + max_retry_time, /* how long to try altogether */ \ + \ + modem_init, /* modem initialization */ \ + speed, /* port speed */ \ + dial_prefix, /* ATDT0WP... */ \ + autobauding, /* change baud rate to CONNECT "xxx" */ \ + prompt_waittime, /* pause [in ms] after CONNECT */ \ + \ + nodetach, /* don't fork() */ \ + debug, /* debugging */ \ + end_of_config ! typedef struct conf_data_cb_init { ! struct conf_data_i PROTO_CONF_CB_FIELDS; ! } conf_data_cb_i; ! typedef struct conf_data_cb { ! struct conf_data PROTO_CONF_CB_FIELDS; ! } conf_data_cb_t; ! extern conf_data_cb_t c; int callback_parse_args _PROTO(( int argc, char ** argv )); void callback_get_config _PROTO(( char * port )); Index: misc/mgetty/doc/.cvsignore diff -c /dev/null misc/mgetty/doc/.cvsignore:1.1 *** /dev/null Sat Sep 28 00:22:05 1996 --- misc/mgetty/doc/.cvsignore Sat Sep 28 00:19:09 1996 *************** *** 0 **** --- 1,38 ---- + callback.8 + callback.man + coverpg.1 + coverpg.man + fax.1 + fax.man + faxq.1 + faxq.man + faxqueue.5 + faxqueue.man + faxrm.1 + faxrm.man + faxrunq.1 + faxrunq.man + faxspool.1 + faxspool.man + g3cat.1 + g3cat.man + g3topbm.1 + g3topbm.man + mgetty.8 + mgetty.asc + mgetty.dvi + mgetty.info + mgetty.info-1 + mgetty.info-2 + mgetty.info-3 + mgetty.info-4 + mgetty.man + mgetty.ms + mgetty.ps + mgetty.texi + mgettydefs.4 + mgettydefs.man + pbmtog3.1 + pbmtog3.man + sendfax.8 + sendfax.man Index: misc/mgetty/fax/.cvsignore diff -c /dev/null misc/mgetty/fax/.cvsignore:1.1 *** /dev/null Sat Sep 28 00:22:06 1996 --- misc/mgetty/fax/.cvsignore Sat Sep 28 00:19:17 1996 *************** *** 0 **** --- 1,6 ---- + faxheader + faxq + faxrm + faxrunq + faxrunqd + faxspool Index: misc/mgetty/tools/.cvsignore diff -c /dev/null misc/mgetty/tools/.cvsignore:1.1 *** /dev/null Sat Sep 28 00:22:16 1996 --- misc/mgetty/tools/.cvsignore Sat Sep 28 00:19:23 1996 *************** *** 0 **** --- 1,3 ---- + g3cat + g3topbm + pbmtog3 .