diff options
author | hm <hm@FreeBSD.org> | 1999-08-06 14:05:10 +0000 |
---|---|---|
committer | hm <hm@FreeBSD.org> | 1999-08-06 14:05:10 +0000 |
commit | c318ffb377724b7eab997d3ddd7f16e229f18e4d (patch) | |
tree | 4dd20754e94db3bc400654765c985e981925a884 /usr.sbin/i4b | |
parent | 29c67703e3751c283a1bdfe7764effe015c13b83 (diff) | |
download | FreeBSD-src-c318ffb377724b7eab997d3ddd7f16e229f18e4d.zip FreeBSD-src-c318ffb377724b7eab997d3ddd7f16e229f18e4d.tar.gz |
updating isdn4bsd to beta version 0.83
Diffstat (limited to 'usr.sbin/i4b')
-rw-r--r-- | usr.sbin/i4b/isdnd/isdnd.8 | 9 | ||||
-rw-r--r-- | usr.sbin/i4b/isdnd/isdnd.h | 8 | ||||
-rw-r--r-- | usr.sbin/i4b/isdnd/isdnd.rc.5 | 19 | ||||
-rw-r--r-- | usr.sbin/i4b/isdnd/main.c | 48 | ||||
-rw-r--r-- | usr.sbin/i4b/isdnd/monitor.c | 22 | ||||
-rw-r--r-- | usr.sbin/i4b/isdnd/msghdl.c | 17 | ||||
-rw-r--r-- | usr.sbin/i4b/isdnd/rc_config.c | 11 | ||||
-rw-r--r-- | usr.sbin/i4b/isdnd/rc_parse.y | 45 | ||||
-rw-r--r-- | usr.sbin/i4b/isdnd/rc_scan.l | 5 | ||||
-rw-r--r-- | usr.sbin/i4b/isdnd/support.c | 9 | ||||
-rw-r--r-- | usr.sbin/i4b/isdndebug/isdndebug.8 | 33 | ||||
-rw-r--r-- | usr.sbin/i4b/isdndebug/main.c | 121 | ||||
-rw-r--r-- | usr.sbin/i4b/isdndecode/main.c | 6 | ||||
-rw-r--r-- | usr.sbin/i4b/isdnmonitor/main.c | 46 | ||||
-rw-r--r-- | usr.sbin/i4b/isdnmonitor/monitor.h | 8 | ||||
-rw-r--r-- | usr.sbin/i4b/isdntel/main.c | 4 | ||||
-rw-r--r-- | usr.sbin/i4b/isdntelctl/main.c | 4 | ||||
-rw-r--r-- | usr.sbin/i4b/isdntest/main.c | 4 | ||||
-rw-r--r-- | usr.sbin/i4b/isdntrace/trace.c | 6 | ||||
-rw-r--r-- | usr.sbin/i4b/man/i4btrc.4 | 6 | ||||
-rw-r--r-- | usr.sbin/i4b/man/isic.4 | 39 |
21 files changed, 344 insertions, 126 deletions
diff --git a/usr.sbin/i4b/isdnd/isdnd.8 b/usr.sbin/i4b/isdnd/isdnd.8 index 950614c..f4141da 100644 --- a/usr.sbin/i4b/isdnd/isdnd.8 +++ b/usr.sbin/i4b/isdnd/isdnd.8 @@ -22,9 +22,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: isdnd.8,v 1.24 1999/02/23 16:25:49 hm Exp $ +.\" $Id: isdnd.8,v 1.25 1999/05/20 13:30:36 hm Exp $ .\" -.\" last edit-date: [Tue Feb 23 16:46:26 1999] +.\" last edit-date: [Thu May 20 14:37:42 1999] .\" .Dd February 23, 1999 .Dt isdnd 8 @@ -130,7 +130,10 @@ facility but instead is appended to a file. .It Fl L Specifies the name of the logfile which is used when the option .Em -l -is set. +is set. See also the keyword +.Em rotatesuffix +in the system section of +.Xr isdnd.rc 5 . .It Fl P This option prints out the parsed and verified isdnd configuration in the same format as the isdnd.rc file. This output can be used as an isdnd.rc file. This diff --git a/usr.sbin/i4b/isdnd/isdnd.h b/usr.sbin/i4b/isdnd/isdnd.h index f630a01..08b4db6 100644 --- a/usr.sbin/i4b/isdnd/isdnd.h +++ b/usr.sbin/i4b/isdnd/isdnd.h @@ -27,9 +27,9 @@ * i4b daemon - main header file * ----------------------------- * - * $Id: isdnd.h,v 1.62 1999/04/29 08:27:10 hm Exp $ + * $Id: isdnd.h,v 1.63 1999/05/20 13:30:36 hm Exp $ * - * last edit-date: [Thu Apr 29 09:35:01 1999] + * last edit-date: [Thu May 20 14:44:18 1999] * *---------------------------------------------------------------------------*/ @@ -550,6 +550,8 @@ int isdntime = 0; /* flag, log time from exchange */ char tinainitprog[MAXPATHLEN] = TINA_FILE_DEF; +char rotatesuffix[MAXPATHLEN] = ""; + #else /* !MAIN */ int isdnfd; @@ -623,6 +625,8 @@ int isdntime; char tinainitprog[MAXPATHLEN]; +char rotatesuffix[MAXPATHLEN]; + #endif /* MAIN */ char * bdrivername ( int drivertype ); diff --git a/usr.sbin/i4b/isdnd/isdnd.rc.5 b/usr.sbin/i4b/isdnd/isdnd.rc.5 index 42af1db..6cd2ca0 100644 --- a/usr.sbin/i4b/isdnd/isdnd.rc.5 +++ b/usr.sbin/i4b/isdnd/isdnd.rc.5 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: isdnd.rc.5,v 1.34 1999/05/03 08:48:25 hm Exp $ +.\" $Id: isdnd.rc.5,v 1.36 1999/07/28 14:17:45 hm Exp $ .\" -.\" last edit-date: [Thu Apr 8 18:29:22 1999] +.\" last edit-date: [Wed Jul 28 15:57:02 1999] .\" -.Dd February, 23, 1999 +.Dd May 20, 1999 .Dt isdnd.rc 5 .Sh NAME .Nm isdnd.rc @@ -91,6 +91,8 @@ Specifies the name of the accounting file which is used when the keyword .Em useacctfile (see below) is set to .Em on . +See also system keyword +.Em rotatesuffix . If this keyword is omitted the system default is used. (optional) .It Li aliasing @@ -203,6 +205,14 @@ expects to find the program below the path which is prepended to the string specified as a parameter to this keyword. (optional) +.It Li rotatesuffix +Specifies a suffix for renaming the log- and the accountingfilename. In case +rotatesuffix is used and a USR1 signal is sent to isdnd, the logfile and the +accounting file is not only closed and reopened but the old logfile is also +renamed to the former filename with the rotatesuffix string appended. +If this keyword is omitted, the logfiles are just closed and reopened; this +is also the default behaviour. (optional) + .It Li rtprio Specifies the realtime priority .Nm isdnd @@ -299,6 +309,7 @@ Normal behavior, call the remote site which is supposed to accept the call. .It Ar calledback Callback behavior, call the remote side which rejects the call and calls us back. +.El .It Li dialrandincr When dialing or re-dialing and this parameter is set to @@ -315,7 +326,7 @@ This keyword is used to configure if incoming and outgoing, incoming-only or outgoing only connections are possible. The keyword is optional, the default is .Em inout . -.El + .Pp The currently supported parameters are: .Pp diff --git a/usr.sbin/i4b/isdnd/main.c b/usr.sbin/i4b/isdnd/main.c index 95c4258..3c344f4 100644 --- a/usr.sbin/i4b/isdnd/main.c +++ b/usr.sbin/i4b/isdnd/main.c @@ -27,9 +27,9 @@ * i4b daemon - main program entry * ------------------------------- * - * $Id: main.c,v 1.4 1999/05/23 23:24:08 imp Exp $ + * $Id: main.c,v 1.41 1999/07/30 06:51:13 hm Exp $ * - * last edit-date: [Thu Apr 29 09:41:21 1999] + * last edit-date: [Fri Jul 30 08:14:10 1999] * *---------------------------------------------------------------------------*/ @@ -523,7 +523,10 @@ mloop( else if(ret == -1) { if(errno != EINTR) - log(LL_WRN, "ERROR, select error on isdn device, errno = %d!", errno); + { + log(LL_ERR, "ERROR, select error on isdn device, errno = %d!", errno); + do_exit(1); + } } /* handle timeout and recovery */ @@ -666,9 +669,8 @@ rereadconfig(int dummy) if(config_error_flag) { - log(LL_ERR, "there were %d error(s) in the configuration file, terminating!", config_error_flag); - unlink(PIDFILE); - exit(1); + log(LL_ERR, "rereadconfig: there were %d error(s) in the configuration file, terminating!", config_error_flag); + do_exit(1); } if(aliasing) @@ -687,13 +689,30 @@ reopenfiles(int dummy) { if(useacctfile) { + /* close file */ + fflush(acctfp); fclose(acctfp); + /* if user specified a suffix, rename the old file */ + + if(rotatesuffix[0] != '\0') + { + char filename[MAXPATHLEN]; + + sprintf(filename, "%s%s", acctfile, rotatesuffix); + + if((rename(acctfile, filename)) != 0) + { + log(LL_ERR, "reopenfiles: acct rename failed, cause = %s", strerror(errno)); + do_exit(1); + } + } + if((acctfp = fopen(acctfile, "a")) == NULL) { log(LL_ERR, "ERROR, can't open acctfile %s for writing, terminating!", acctfile); - exit(1); + do_exit(1); } setvbuf(acctfp, (char *)NULL, _IONBF, 0); } @@ -702,6 +721,21 @@ reopenfiles(int dummy) { finish_log(); + /* if user specified a suffix, rename the old file */ + + if(rotatesuffix[0] != '\0') + { + char filename[MAXPATHLEN]; + + sprintf(filename, "%s%s", logfile, rotatesuffix); + + if((rename(logfile, filename)) != 0) + { + log(LL_ERR, "reopenfiles: log rename failed, cause = %s", strerror(errno)); + do_exit(1); + } + } + if((logfp = fopen(logfile, "a")) == NULL) { fprintf(stderr, "ERROR, cannot open logfile %s: %s\n", diff --git a/usr.sbin/i4b/isdnd/monitor.c b/usr.sbin/i4b/isdnd/monitor.c index 9bc09f6..cb72683 100644 --- a/usr.sbin/i4b/isdnd/monitor.c +++ b/usr.sbin/i4b/isdnd/monitor.c @@ -33,9 +33,9 @@ * i4b daemon - network monitor server module * ------------------------------------------ * - * $Id: monitor.c,v 1.9 1999/05/06 08:24:45 hm Exp $ + * $Id: monitor.c,v 1.10 1999/05/30 08:32:30 hm Exp $ * - * last edit-date: [Mon Feb 15 16:42:18 1999] + * last edit-date: [Sun May 30 10:33:05 1999] * * -mh created * @@ -587,23 +587,35 @@ static int monitor_command(int con_index, int fd, int rights) ioctl(fd, FIONREAD, &u); if (u < I4B_MON_CMD_HDR) { if (u == 0) { + log(LL_ERR, "monitor #%d, read 0 bytes", con_index); /* socket closed by peer */ close(fd); return 1; } return 0; /* not enough data there yet */ } + bytes = recv(fd, cmd, I4B_MON_CMD_HDR, MSG_PEEK); + if (bytes < I4B_MON_CMD_HDR) + { + log(LL_ERR, "monitor #%d, read only %d bytes", con_index, bytes); return 0; /* errh? something must be wrong... */ + } + bytes = I4B_GET_2B(cmd, I4B_MON_CMD_LEN); - if (bytes >= sizeof cmd) { + + if (bytes >= sizeof cmd) + { close(fd); - log(LL_ERR, "garbage on monitor connection #%d, closing it", con_index); + log(LL_ERR, "monitor #%d, garbage on connection", con_index); return 1; } + /* now we know the size, it fits, so lets read it! */ - if (read(fd, cmd, bytes) <= 0) { + if (read(fd, cmd, bytes) <= 0) + { + log(LL_ERR, "monitor #%d, read <= 0", con_index); close(fd); return 1; } diff --git a/usr.sbin/i4b/isdnd/msghdl.c b/usr.sbin/i4b/isdnd/msghdl.c index 4d59c26..8f75d01 100644 --- a/usr.sbin/i4b/isdnd/msghdl.c +++ b/usr.sbin/i4b/isdnd/msghdl.c @@ -27,9 +27,9 @@ * i4b daemon - message from kernel handling routines * -------------------------------------------------- * - * $Id: msghdl.c,v 1.60 1999/05/10 19:34:54 hm Exp $ + * $Id: msghdl.c,v 1.61 1999/07/26 11:58:46 hm Exp $ * - * last edit-date: [Mon May 10 21:32:46 1999] + * last edit-date: [Mon Jul 26 13:55:57 1999] * *---------------------------------------------------------------------------*/ @@ -197,6 +197,7 @@ void msg_connect_active_ind(msg_connect_active_ind_t *mp) { cfg_entry_t *cep; + char *device; if((cep = get_cep_by_cdid(mp->header.cdid)) == NULL) { @@ -218,6 +219,8 @@ msg_connect_active_ind(msg_connect_active_ind_t *mp) cep->outbytes = INVALID; cep->hangup = 0; + device = bdrivername(cep->usrdevicename); + /* set the B-channel to active */ if((set_channel_busy(cep->isdncontrollerused, cep->isdnchannelused)) == ERROR) @@ -225,15 +228,17 @@ msg_connect_active_ind(msg_connect_active_ind_t *mp) if(cep->direction == DIR_OUT) { - log(LL_CHD, "%05d %s outgoing call active (ctl %d, ch %d)", + log(LL_CHD, "%05d %s outgoing call active (ctl %d, ch %d, %s%d)", cep->cdid, cep->name, - cep->isdncontrollerused, cep->isdnchannelused); + cep->isdncontrollerused, cep->isdnchannelused, + bdrivername(cep->usrdevicename), cep->usrdeviceunit); } else { - log(LL_CHD, "%05d %s incoming call active (ctl %d, ch %d)", + log(LL_CHD, "%05d %s incoming call active (ctl %d, ch %d, %s%d)", cep->cdid, cep->name, - cep->isdncontrollerused, cep->isdnchannelused); + cep->isdncontrollerused, cep->isdnchannelused, + bdrivername(cep->usrdevicename), cep->usrdeviceunit); } #ifdef USE_CURSES diff --git a/usr.sbin/i4b/isdnd/rc_config.c b/usr.sbin/i4b/isdnd/rc_config.c index b2861a4..455ac12 100644 --- a/usr.sbin/i4b/isdnd/rc_config.c +++ b/usr.sbin/i4b/isdnd/rc_config.c @@ -27,9 +27,9 @@ * i4b daemon - config file processing * ----------------------------------- * - * $Id: rc_config.c,v 1.42 1999/04/29 08:27:10 hm Exp $ + * $Id: rc_config.c,v 1.43 1999/05/20 13:30:36 hm Exp $ * - * last edit-date: [Thu Apr 29 08:49:46 1999] + * last edit-date: [Thu May 20 14:11:26 1999] * *---------------------------------------------------------------------------*/ @@ -141,6 +141,8 @@ set_config_defaults(void) rarr[i].re_flg = 0; } + strcpy(rotatesuffix, ""); + /* entry section cleanup */ for(i=0; i < CFG_ENTRY_MAX; i++, cep++) @@ -627,6 +629,11 @@ cfg_setval(int keyword) nregprog++; break; + case ROTATESUFFIX: + strcpy(rotatesuffix, yylval.str); + DBGL(DL_RCCF, (log(LL_DBG, "system: rotatesuffix = %s", yylval.str))); + break; + case RTPRIO: #ifdef USE_RTPRIO rt_prio = yylval.num; diff --git a/usr.sbin/i4b/isdnd/rc_parse.y b/usr.sbin/i4b/isdnd/rc_parse.y index 2c001c9..b826c39 100644 --- a/usr.sbin/i4b/isdnd/rc_parse.y +++ b/usr.sbin/i4b/isdnd/rc_parse.y @@ -30,9 +30,9 @@ * i4b daemon - runtime configuration parser * ----------------------------------------- * - * $Id: rc_parse.y,v 1.19 1999/04/29 08:27:10 hm Exp $ + * $Id: rc_parse.y,v 1.20 1999/05/20 13:30:36 hm Exp $ * - * last edit-date: [Thu Apr 29 08:46:01 1999] + * last edit-date: [Thu May 20 14:05:26 1999] * *---------------------------------------------------------------------------*/ @@ -72,67 +72,69 @@ int entrycount = -1; %token ACCTALL %token ACCTFILE %token ALERT -%token ALIASING %token ALIASFNAME +%token ALIASING %token ANSWERPROG %token B1PROTOCOL %token BEEPCONNECT %token CALLBACKWAIT %token CALLEDBACKWAIT +%token CALLIN +%token CALLOUT +%token CHANNELSTATE %token CONNECTPROG -%token DIALRETRIES -%token DIALRANDINCR %token DIALOUTTYPE +%token DIALRANDINCR +%token DIALRETRIES %token DIRECTION %token DISCONNECTPROG -%token DOWNTRIES %token DOWNTIME +%token DOWNTRIES %token EARLYHANGUP %token ENTRY +%token FULLCMD %token IDLETIME_IN %token IDLETIME_OUT %token IDLE_ALG_OUT -%token ISDNCONTROLLER %token ISDNCHANNEL +%token ISDNCONTROLLER %token ISDNTIME %token ISDNTXDELIN %token ISDNTXDELOUT %token LOCAL_PHONE_DIALOUT %token LOCAL_PHONE_INCOMING -%token MONITORSW -%token MONITORPORT +%token LOGEVENTS %token MONITOR %token MONITORACCESS -%token FULLCMD -%token RESTRICTEDCMD -%token CHANNELSTATE -%token CALLIN -%token CALLOUT -%token LOGEVENTS +%token MONITORPORT +%token MONITORSW %token NAME %token NO %token OFF %token ON %token RATESFILE -%token RATETYPE -%token REMOTE_NUMBERS_HANDLING -%token REMOTE_PHONE_INCOMING -%token REMOTE_PHONE_DIALOUT +%token RATETYPE %token REACTION %token RECOVERYTIME %token REGEXPR %token REGPROG +%token REMOTE_NUMBERS_HANDLING +%token REMOTE_PHONE_DIALOUT +%token REMOTE_PHONE_INCOMING +%token RESTRICTEDCMD +%token ROTATESUFFIX %token RTPRIO %token SYSTEM %token TINAINITPROG %token UNITLENGTH %token UNITLENGTHSRC %token USEACCTFILE +%token USEDOWN %token USRDEVICENAME %token USRDEVICEUNIT -%token USEDOWN %token YES + %token <str> NUMBERSTR %token <str> STRING @@ -303,7 +305,8 @@ sysnumkeyword: MONITORPORT { $$ = MONITORPORT; } | RTPRIO { $$ = RTPRIO; } ; -sysstrkeyword: REGEXPR { $$ = REGEXPR; } +sysstrkeyword: ROTATESUFFIX { $$ = ROTATESUFFIX; } + | REGEXPR { $$ = REGEXPR; } | REGPROG { $$ = REGPROG; } ; diff --git a/usr.sbin/i4b/isdnd/rc_scan.l b/usr.sbin/i4b/isdnd/rc_scan.l index 66512d8..c1c61e9 100644 --- a/usr.sbin/i4b/isdnd/rc_scan.l +++ b/usr.sbin/i4b/isdnd/rc_scan.l @@ -30,9 +30,9 @@ * i4b daemon - runtime configuration lexical analyzer * --------------------------------------------------- * - * $Id: rc_scan.l,v 1.23 1999/04/29 08:27:10 hm Exp $ + * $Id: rc_scan.l,v 1.24 1999/05/20 13:30:36 hm Exp $ * - * last edit-date: [Thu Apr 29 08:46:36 1999] + * last edit-date: [Thu May 20 14:04:13 1999] * *---------------------------------------------------------------------------*/ @@ -138,6 +138,7 @@ regprog { return REGPROG; } remdial-handling { return REMOTE_NUMBERS_HANDLING; } remote-phone-dialout { return REMOTE_PHONE_DIALOUT; } remote-phone-incoming { return REMOTE_PHONE_INCOMING; } +rotatesuffix { return ROTATESUFFIX; } rtprio { return RTPRIO; } system { return SYSTEM; } tinainitprog { return TINAINITPROG; } diff --git a/usr.sbin/i4b/isdnd/support.c b/usr.sbin/i4b/isdnd/support.c index 8c11259..f0a48fc 100644 --- a/usr.sbin/i4b/isdnd/support.c +++ b/usr.sbin/i4b/isdnd/support.c @@ -27,9 +27,9 @@ * i4b daemon - misc support routines * ---------------------------------- * - * $Id: support.c,v 1.56 1999/04/28 15:37:02 hm Exp $ + * $Id: support.c,v 1.59 1999/07/05 13:46:46 hm Exp $ * - * last edit-date: [Wed Apr 28 17:13:36 1999] + * last edit-date: [Mon Jul 5 15:29:22 1999] * *---------------------------------------------------------------------------*/ @@ -600,7 +600,10 @@ name_of_controller(int ctrl_type, int card_type) "ELSA MicroLink MCall", "ITK ix1 micro", "AVM Fritz!Card PCI", - "ELSA PCC-16" + "ELSA PCC-16", + "AVM Fritz!Card PnP", + "Siemens I-Surf 2.0 PnP", + "Asuscom ISDNlink 128K PnP" }; static char *daic_card[] = { diff --git a/usr.sbin/i4b/isdndebug/isdndebug.8 b/usr.sbin/i4b/isdndebug/isdndebug.8 index ccbcc90..76f19d0 100644 --- a/usr.sbin/i4b/isdndebug/isdndebug.8 +++ b/usr.sbin/i4b/isdndebug/isdndebug.8 @@ -22,19 +22,15 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: isdndebug.8,v 1.7 1999/05/03 08:48:25 hm Exp $ +.\" $Id: isdndebug.8,v 1.8 1999/05/29 09:05:30 hm Exp $ .\" -.\" last edit-date: [Mon Feb 15 17:05:41 1999] +.\" last edit-date: [Sat May 29 11:03:15 1999] .\" -.\" -hm writing manual pages -.\" -hm getting uptodate -.\" -.\" -.Dd July 9, 1998 +.Dd May, 29, 1999 .Dt isdndebug 8 .Sh NAME .Nm isdndebug -.Nd control debugging handling inside isdn4bsd kernel +.Nd display and control isdn4bsd kernel variables and statistics .Sh SYNOPSIS .Nm .Op Fl e @@ -42,20 +38,27 @@ .Op Fl h .Op Fl l Ar layer .Op Fl m +.Op Fl q .Op Fl r .Op Fl s Ar value .Op Fl u Ar unit .Op Fl z .Op Fl H +.Op Fl Q .Sh DESCRIPTION .Nm isdndebug -is part of the isdn4bsd package and is used to control debugging output -of the isdn4bsd kernel part. Every layer of the isdn4bsd kernel uses a -debugging mask which can be manipulated using this utility. +is part of the isdn4bsd package and is used to control the level of +debugging output of the isdn4bsd kernel part. +Every layer of the isdn4bsd kernel uses a debugging mask which can be +manipulated using this utility. .Pp A second usage of .Nm -is to display and reset the HSCX error counters. +is to display and reset the HSCX (the HSCX is the chip responsible for +the B-channel handling in the +.Xr isic 4 +driver) error counters and and to display and reset the D-channel layer 2 +(Q.921 LAPD protocol) statistics and error counters. .Pp The following options are available: .Bl -tag -width Ds @@ -70,6 +73,8 @@ Specify the layer for which a command applies. Default is all layers. .It Fl m Set debugging mask for the selected layer(s) to display all possible debugging messages (maximum output). +.It Fl q +Display the Q.921 (D-channel layer 2) frame receive/transmit statistics. .It Fl r Set debugging mask for the selected layer(s) to the compiled in default (reset). @@ -78,11 +83,13 @@ Set debugging mask for the selected layer(s) to value. Value can be specified in any number base supported by .Xr sscanf 3 . .It Fl u -Set the unit numbers for the -h and -H flags. +Set the unit numbers for the -h, -q, -H and -Q flags. .It Fl z Set debugging mask for the selected layer(s) to no output at all (zero). .It Fl H Reset the HSCX error counters to zero. +.It Fl Q +Reset the Q.921 (D-channel layer 2) frame receive/transmit statistics to zero. .El .Pp .Sh FILES diff --git a/usr.sbin/i4b/isdndebug/main.c b/usr.sbin/i4b/isdndebug/main.c index 2693fcd..c97c7fa 100644 --- a/usr.sbin/i4b/isdndebug/main.c +++ b/usr.sbin/i4b/isdndebug/main.c @@ -27,9 +27,9 @@ * main.c - i4b set debug options * ------------------------------ * - * $Id: main.c,v 1.4 1999/05/23 23:24:11 imp Exp $ + * $Id: main.c,v 1.22 1999/07/30 06:51:13 hm Exp $ * - * last edit-date: [Wed Apr 28 16:47:28 1999] + * last edit-date: [Fri Jul 30 08:14:34 1999] * *---------------------------------------------------------------------------*/ @@ -73,6 +73,33 @@ int opt_zero = 0; int opt_unit = 0; int opt_hscx = 0; int opt_rhscx = 0; +int opt_lapd = 0; +int opt_rlapd = 0; + +/*---------------------------------------------------------------------------* + * usage display and exit + *---------------------------------------------------------------------------*/ +static void +usage(void) +{ + fprintf(stderr, "\n"); + fprintf(stderr, "isdndebug - i4b set debug level, version %d.%d.%d, compiled %s %s\n", VERSION, REL, STEP, __DATE__, __TIME__); + fprintf(stderr, "usage: isdndebug -e -g -h -l <layer> -m -q -r -s <value> -u <unit> -z -H -Q\n"); + fprintf(stderr, " -e set error only debugging output\n"); + fprintf(stderr, " -g get current debugging values\n"); + fprintf(stderr, " -h get HSCX event counters\n"); + fprintf(stderr, " -l layer specify layer (1...4)\n"); + fprintf(stderr, " -m set maximum debugging output\n"); + fprintf(stderr, " -q get Q.921 statistics\n"); + fprintf(stderr, " -r reset values(s) to compiled in default\n"); + fprintf(stderr, " -s value set new debugging value for layer\n"); + fprintf(stderr, " -u unit unit number for -h, -q, -H and -Q commands\n"); + fprintf(stderr, " -z set zero (=no) debugging output\n"); + fprintf(stderr, " -H reset HSCX event counters to zero\n"); + fprintf(stderr, " -Q reset Q.921 statistics\n"); + fprintf(stderr, "\n"); + exit(1); +} /*---------------------------------------------------------------------------* * program entry @@ -84,7 +111,7 @@ main(int argc, char **argv) ctl_debug_t cdbg; int ret; - while ((c = getopt(argc, argv, "eghl:mrs:u:zH")) != -1) + while ((c = getopt(argc, argv, "eghl:mqrs:u:zHQ")) != -1) { switch(c) { @@ -100,6 +127,10 @@ main(int argc, char **argv) opt_hscx = 1; break; + case 'q': + opt_lapd = 1; + break; + case 'r': opt_reset = 1; break; @@ -134,6 +165,10 @@ main(int argc, char **argv) opt_rhscx = 1; break; + case 'Q': + opt_rlapd = 1; + break; + case '?': default: usage(); @@ -142,13 +177,14 @@ main(int argc, char **argv) } if(opt_get == 0 && opt_set == 0 && opt_reset == 0 && opt_max == 0 && - opt_err == 0 && opt_zero == 0 && opt_hscx == 0 && opt_rhscx == 0) + opt_err == 0 && opt_zero == 0 && opt_hscx == 0 && opt_rhscx == 0 && + opt_lapd == 0 && opt_rlapd == 0) { usage(); } if((opt_get + opt_set + opt_reset + opt_max + opt_err + opt_zero + - opt_hscx + opt_rhscx) > 1) + opt_hscx + opt_rhscx + opt_lapd + opt_rlapd) > 1) { usage(); } @@ -224,6 +260,59 @@ main(int argc, char **argv) exit(0); } + + if(opt_lapd) + { + l2stat_t l2s; + + l2s.unit = opt_unit; + + if((ret = ioctl(isdnfd, I4B_CTL_GET_LAPDSTAT, &l2s)) < 0) + { + fprintf(stderr, "ioctl I4B_CTL_GET_LAPDSTAT failed: %s", strerror(errno)); + exit(1); + } + + printf("unit %d Q.921 statistics: receive transmit\n", opt_unit); + printf("---------------------------------------------\n"); + printf("# of I-frames %12lu %12lu\n", l2s.lapdstat.rx_i, l2s.lapdstat.tx_i); + printf("# of RR-frames %12lu %12lu\n", l2s.lapdstat.rx_rr, l2s.lapdstat.tx_rr); + printf("# of RNR-frames %12lu %12lu\n", l2s.lapdstat.rx_rnr, l2s.lapdstat.tx_rnr); + printf("# of REJ-frames %12lu %12lu\n", l2s.lapdstat.rx_rej, l2s.lapdstat.tx_rej); + printf("# of SABME-frames %12lu %12lu\n", l2s.lapdstat.rx_sabme, l2s.lapdstat.tx_sabme); + printf("# of DM-frames %12lu %12lu\n", l2s.lapdstat.rx_dm, l2s.lapdstat.tx_dm); + printf("# of DISC-frames %12lu %12lu\n", l2s.lapdstat.rx_disc, l2s.lapdstat.tx_disc); + printf("# of UA-frames %12lu %12lu\n", l2s.lapdstat.rx_ua, l2s.lapdstat.tx_ua); + printf("# of FRMR-frames %12lu %12lu\n", l2s.lapdstat.rx_frmr, l2s.lapdstat.tx_frmr); + printf("# of TEI-frames %12lu %12lu\n", l2s.lapdstat.rx_tei, l2s.lapdstat.tx_tei); + printf("# of UI-frames %12lu \n", l2s.lapdstat.rx_ui); + printf("# of XID-frames %12lu \n", l2s.lapdstat.rx_xid); + printf(" errors\n"); + printf("---------------------------------------------\n"); + printf("# of frames with incorrect length%12lu\n", l2s.lapdstat.err_rx_len); + printf("# of frames with bad frame type %12lu\n", l2s.lapdstat.err_rx_badf); + printf("# of bad S frames %12lu\n", l2s.lapdstat.err_rx_bads); + printf("# of bad U frames %12lu\n", l2s.lapdstat.err_rx_badu); + printf("# of bad UI frames %12lu\n", l2s.lapdstat.err_rx_badui); + + exit(0); + } + + if(opt_rlapd) + { + int unit; + + unit = opt_unit; + + if((ret = ioctl(isdnfd, I4B_CTL_CLR_LAPDSTAT, &unit)) < 0) + { + fprintf(stderr, "ioctl I4B_CTL_CLR_LAPDSTAT failed: %s", strerror(errno)); + exit(1); + } + + printf("Q.921 statistics counters unit %d reset to zero!\n", unit); + exit(0); + } if((ret = ioctl(isdnfd, I4B_CTL_GET_DEBUG, &cdbg)) < 0) { @@ -532,27 +621,5 @@ printl4(unsigned long val) printf(" ++++-++++-++++-++++-++++-+-------------- unassigned\n"); } -/*---------------------------------------------------------------------------* - * usage display and exit - *---------------------------------------------------------------------------*/ -static void -usage(void) -{ - fprintf(stderr, "\n"); - fprintf(stderr, "isdndebug - i4b set debug level, version %d.%d.%d, compiled %s %s\n", VERSION, REL, STEP, __DATE__, __TIME__); - fprintf(stderr, "usage: isdndebug -e -h -g -l <layer> -m -r -s <value> -u <unit> -z -H\n"); - fprintf(stderr, " -e set error only debugging output\n"); - fprintf(stderr, " -g get current debugging values\n"); - fprintf(stderr, " -h get HSCX event counters\n"); - fprintf(stderr, " -l layer specify layer (1...4)\n"); - fprintf(stderr, " -m set maximum debugging output\n"); - fprintf(stderr, " -r reset values(s) to compiled in default\n"); - fprintf(stderr, " -s value set new debugging value for layer\n"); - fprintf(stderr, " -u unit unit number for -h and -H commands\n"); - fprintf(stderr, " -z set zero (=no) debugging output\n"); - fprintf(stderr, " -H reset HSCX event counters to zero\n"); - fprintf(stderr, "\n"); - exit(1); -} /* EOF */ diff --git a/usr.sbin/i4b/isdndecode/main.c b/usr.sbin/i4b/isdndecode/main.c index 7158a73..1b8eaa3 100644 --- a/usr.sbin/i4b/isdndecode/main.c +++ b/usr.sbin/i4b/isdndecode/main.c @@ -27,9 +27,9 @@ * main.c - isdndecode main program file * ------------------------------------- * - * $Id: main.c,v 1.4 1999/05/23 23:24:13 imp Exp $ + * $Id: main.c,v 1.11 1999/07/30 06:51:13 hm Exp $ * - * last edit-date: [Mon Apr 26 14:02:44 1999] + * last edit-date: [Fri Jul 30 08:14:58 1999] * *---------------------------------------------------------------------------*/ @@ -377,7 +377,7 @@ fmt_hdr(i4b_trace_hdr_t *hdr, int frm_len) static char hbuf[256]; int i = 0; - s = localtime(&(hdr->time.tv_sec)); + s = localtime((time_t *)&(hdr->time.tv_sec)); if(hdr->type == TRC_CH_I) /* Layer 1 INFO's */ { diff --git a/usr.sbin/i4b/isdnmonitor/main.c b/usr.sbin/i4b/isdnmonitor/main.c index 3bd31b1..d023f42 100644 --- a/usr.sbin/i4b/isdnmonitor/main.c +++ b/usr.sbin/i4b/isdnmonitor/main.c @@ -33,9 +33,9 @@ * i4b daemon - network monitor client * ----------------------------------- * - * $Id: main.c,v 1.12 1999/05/11 08:15:59 hm Exp $ + * $Id: main.c,v 1.14 1999/05/30 13:39:55 hm Exp $ * - * last edit-date: [Tue Apr 20 14:14:26 1999] + * last edit-date: [Sun May 30 15:19:47 1999] * * -mh created * -hm checking in @@ -88,7 +88,7 @@ static void print_disconnect(time_t tstamp, int channel); static void print_updown(time_t tstamp, int channel, int isup); static void handle_event(BYTE *msg, int len); #ifdef DEBUG -static void dump_event(BYTE *msg, int len); +static void dump_event(BYTE *msg, int len, int readflag); #endif /* @@ -115,7 +115,7 @@ int main(int argc, char **argv) int portno = DEF_MONPORT; int i; - while ((i = getopt(argc, argv, "dh:p:l:")) != EOF) + while ((i = getopt(argc, argv, "dh:p:l:")) != -1) { switch (i) { @@ -341,7 +341,7 @@ static void mloop() } #ifdef DEBUG if (dumpall) - dump_event(buf, ret); + dump_event(buf, ret, 1); #endif handle_event(buf, ret); } @@ -352,17 +352,20 @@ static void mloop() /* * Dump a complete event packet. */ -static void dump_event(BYTE *msg, int len) +static void dump_event(BYTE *msg, int len, int read) { int i; - printf("event dump:"); + if(read) + printf("read from socket:"); + else + printf("write to socket:"); for (i = 0; i < len; i++) { if (i % 8 == 0) - printf("\n%02x: ", i); - printf("%02x %c ", msg[i], isprint(msg[i]) ? msg[i] : '.'); + printf("\n%02d: ", i); + printf("0x%02x %c ", msg[i], isprint(msg[i]) ? msg[i] : '.'); } printf("\n"); } @@ -477,6 +480,11 @@ static void handle_event(BYTE *msg, int len) I4B_PUT_2B(cmd, I4B_MON_ICLIENT_VERMINOR, MPROT_REL); I4B_PUT_4B(cmd, I4B_MON_ICLIENT_EVENTS, ~0U); +#ifdef DEBUG + if (dumpall) + dump_event(cmd, sizeof cmd, 0); +#endif + write(monsock, cmd, sizeof cmd); break; @@ -621,6 +629,11 @@ static void handle_input() { BYTE cmd[I4B_MON_DUMPRIGHTS_SIZE]; I4B_PREP_CMD(cmd, I4B_MON_DUMPRIGHTS_CODE); +#ifdef DEBUG + if (dumpall) + dump_event(cmd, I4B_MON_DUMPRIGHTS_SIZE, 0); +#endif + write(monsock, cmd, I4B_MON_DUMPRIGHTS_SIZE); } break; @@ -629,6 +642,11 @@ static void handle_input() { BYTE cmd[I4B_MON_DUMPMCONS_SIZE]; I4B_PREP_CMD(cmd, I4B_MON_DUMPMCONS_CODE); +#ifdef DEBUG + if (dumpall) + dump_event(cmd, I4B_MON_DUMPMCONS_CODE, 0); +#endif + write(monsock, cmd, I4B_MON_DUMPMCONS_SIZE); } break; @@ -637,6 +655,11 @@ static void handle_input() { BYTE cmd[I4B_MON_CFGREREAD_SIZE]; I4B_PREP_CMD(cmd, I4B_MON_CFGREREAD_CODE); +#ifdef DEBUG + if (dumpall) + dump_event(cmd, I4B_MON_CFGREREAD_CODE, 0); +#endif + write(monsock, cmd, I4B_MON_CFGREREAD_SIZE); } break; @@ -649,6 +672,11 @@ static void handle_input() fgets(buf, sizeof buf, stdin); channel = atoi(buf); I4B_PUT_4B(cmd, I4B_MON_HANGUP_CHANNEL, channel); +#ifdef DEBUG + if (dumpall) + dump_event(cmd, I4B_MON_HANGUP_CHANNEL, 0); +#endif + write(monsock, cmd, I4B_MON_HANGUP_SIZE); } break; diff --git a/usr.sbin/i4b/isdnmonitor/monitor.h b/usr.sbin/i4b/isdnmonitor/monitor.h index ff192d0..47f9c8b 100644 --- a/usr.sbin/i4b/isdnmonitor/monitor.h +++ b/usr.sbin/i4b/isdnmonitor/monitor.h @@ -33,9 +33,9 @@ * i4b daemon - network monitor protocl definition * ----------------------------------------------- * - * $Id: monitor.h,v 1.5 1999/02/14 09:44:57 hm Exp $ + * $Id: monitor.h,v 1.6 1999/05/30 13:49:20 hm Exp $ * - * last edit-date: [Mon Aug 3 06:52:06 1998] + * last edit-date: [Sun May 30 15:50:10 1999] * * -mh created * -hm checking in @@ -256,8 +256,8 @@ /* put a string into recor r at offset off, make sure it's not to long * and proper terminate it */ #define I4B_PUT_STR(r, off, str) { \ - strncpy(r+off, str, I4B_MAX_MON_STRING); \ - r[off+I4B_MAX_MON_STRING-1] = (BYTE)0; } + strncpy((r)+(off), (str), I4B_MAX_MON_STRING); \ + (r)[(off)+I4B_MAX_MON_STRING-1] = (BYTE)0; } #endif /* MONITOR_H */ diff --git a/usr.sbin/i4b/isdntel/main.c b/usr.sbin/i4b/isdntel/main.c index e1ddfa6..fbc3b77 100644 --- a/usr.sbin/i4b/isdntel/main.c +++ b/usr.sbin/i4b/isdntel/main.c @@ -27,9 +27,9 @@ * isdntel - isdn4bsd telephone answering machine support * ====================================================== * - * $Id: main.c,v 1.4 1999/05/23 23:24:16 imp Exp $ + * $Id: main.c,v 1.10 1999/07/30 06:51:13 hm Exp $ * - * last edit-date: [Mon Apr 26 13:56:35 1999] + * last edit-date: [Fri Jul 30 08:16:03 1999] * *----------------------------------------------------------------------------*/ diff --git a/usr.sbin/i4b/isdntelctl/main.c b/usr.sbin/i4b/isdntelctl/main.c index 1cf32fe8..1a69dc0 100644 --- a/usr.sbin/i4b/isdntelctl/main.c +++ b/usr.sbin/i4b/isdntelctl/main.c @@ -27,9 +27,9 @@ * isdntelctl - i4b set telephone interface options * ------------------------------------------------ * - * $Id: main.c,v 1.4 1999/05/23 23:24:19 imp Exp $ + * $Id: main.c,v 1.11 1999/07/30 06:51:13 hm Exp $ * - * last edit-date: [Mon Apr 26 14:07:06 1999] + * last edit-date: [Fri Jul 30 08:16:21 1999] * *---------------------------------------------------------------------------*/ diff --git a/usr.sbin/i4b/isdntest/main.c b/usr.sbin/i4b/isdntest/main.c index 5977789..d935ba5 100644 --- a/usr.sbin/i4b/isdntest/main.c +++ b/usr.sbin/i4b/isdntest/main.c @@ -27,9 +27,9 @@ * main.c - i4b selftest utility * ----------------------------- * - * $Id: main.c,v 1.3 1999/05/20 10:14:11 hm Exp $ + * $Id: main.c,v 1.13 1999/07/30 06:51:13 hm Exp $ * - * last edit-date: [Mon Apr 26 14:08:40 1999] + * last edit-date: [Fri Jul 30 08:16:37 1999] * *---------------------------------------------------------------------------*/ diff --git a/usr.sbin/i4b/isdntrace/trace.c b/usr.sbin/i4b/isdntrace/trace.c index 0a7501a..09e42c3 100644 --- a/usr.sbin/i4b/isdntrace/trace.c +++ b/usr.sbin/i4b/isdntrace/trace.c @@ -35,9 +35,9 @@ * trace.c - print traces of D (B) channel activity for isdn4bsd * ------------------------------------------------------------- * - * $Id: trace.c,v 1.4 1999/05/23 23:24:21 imp Exp $ + * $Id: trace.c,v 1.14 1999/07/30 06:51:13 hm Exp $ * - * last edit-date: [Sun Feb 14 10:23:28 1999] + * last edit-date: [Fri Jul 30 08:16:59 1999] * * -hm rewriting for isic and new trace format * -hm new option -f, use automatic name for -o @@ -489,7 +489,7 @@ fmt_hdr(i4b_trace_hdr_t *hdr, int frm_len) static char hbuf[256]; int i = 0; - s = localtime(&(hdr->time.tv_sec)); + s = localtime((time_t *)&(hdr->time.tv_sec)); if(hdr->type == TRC_CH_I) /* Layer 1 INFO's */ { diff --git a/usr.sbin/i4b/man/i4btrc.4 b/usr.sbin/i4b/man/i4btrc.4 index f41a882..c734436 100644 --- a/usr.sbin/i4b/man/i4btrc.4 +++ b/usr.sbin/i4b/man/i4btrc.4 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: i4btrc.4,v 1.6 1999/02/14 09:45:02 hm Exp $ +.\" $Id: i4btrc.4,v 1.7 1999/07/30 07:19:17 hm Exp $ .\" -.\" last edit-date: [Sun Feb 14 10:37:15 1999] +.\" last edit-date: [Fri Jul 30 09:15:57 1999] .\" -.Dd February 3, 1998 +.Dd July 30, 1999 .Dt i4btrc 4 .Sh NAME .Nm i4btrc diff --git a/usr.sbin/i4b/man/isic.4 b/usr.sbin/i4b/man/isic.4 index e7f66ff..ea57a71 100644 --- a/usr.sbin/i4b/man/isic.4 +++ b/usr.sbin/i4b/man/isic.4 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: isic.4,v 1.18 1999/05/03 08:48:25 hm Exp $ +.\" $Id: isic.4,v 1.23 1999/07/30 07:21:19 hm Exp $ .\" -.\" last edit-date: [Tue Apr 20 14:08:35 1999] +.\" last edit-date: [Fri Jul 30 09:20:24 1999] .\" -.Dd December 22, 1998 +.Dd July 30, 1999 .Dt isic 4 .Sh NAME .Nm isic @@ -50,9 +50,14 @@ For an AVM A1 or AVM Fritz!Card classic: .Cd "device isic0 at isa? port 0x340 net irq 5 flags 4 vector isicintr" .Pp For an AVM Fritz!Card PCMCIA: +.Cd options \&"AVM_A1\&" .Cd options \&"AVM_A1_PCMCIA\&" .Cd "device isic0 at isa? port 0x340 net irq 5 flags 10 vector isicintr" .Pp +For an AVM Fritz!Card PnP: +.Cd options \&"AVM_PNP\&" +.Cd "device isic0 at isa? port ? net irq ? vector isicintr" +.Pp For a Teles S0/16.3 PnP card (PnP): .Cd options \&"TEL_S0_16_3_P\&" .Cd "device isic0 at isa? port ? net irq ? vector isicintr" @@ -89,6 +94,10 @@ For an ELSA QuickStep 1000pro PCI: .Cd options \&"ELSA_QS1PCI\&" .Cd "device isic0" .Pp +For a Siemens I-Surf 2.0 PnP: +.Cd options \&"SIEMENS_ISURF2\&" +.Cd "device isic0 at isa? port ? net irq ? vector isicintr" +.Pp .Ar FreeBSD PnP configuration: .Pp To be able to use PnP cards under FreeBSD, you have to add @@ -180,6 +189,12 @@ For an ELSA MicroLink MC/all .Cd options \&"ELSA_MCALL\&" .Cd "isic* at pcmcia? function ?" .Pp +Cards on the Amiga Zorro bus: +.Pp +For a BSC/ITH ISDN Master, ITH ISDN MasterII or VMC ISDN Blaster +.Cd "aster* at zbus?" +.Cd "isic* at aster? port ?" +.Pp .Sh DESCRIPTION The .Nm @@ -347,6 +362,21 @@ value is 18. Valid i/o port values must be in the range (<unknown>). .Pp Valid interrupt configurations are (<unknown>). +.Pp +.It Ar "BSC ISDN Master" +.It Ar "ITH ISDN MasterII" +.It Ar "VMC ISDN Blaster" +.Pp +The card addresses are auto-configured by the Zorro bus kernel subsystem. +The ISDN functions of the boards are at known (to the driver) relative +addresses. +.Pp +Note that currently, you have to jumper the card interupt for +.Em IPL 2 +instead of IPL 6 (which is used by most AmigaOS software). +.Pp +Note that the ITH ISDN MasterII doesn't work in the DraCo Zorro bus. This +is no NetBSD problem, but general. .El .Pp .Sh CAVEATS @@ -378,3 +408,6 @@ can be contacted at hm@kts.org. .Pp The complete porting to and maintenance of NetBSD was done by Martin Husemann. He can be contacted at martin@rumolt.teuto.de +.Pp +The NetBSD/Amiga ISDN Blaster/Master/MasterII driver was written by +Ignatios Souvatzis <is@netbsd.org>. |