- assign a separate debugging flag for debugging messages regarding the
valid keyword handling and the holiday file processing - don't issue a warning in case the holiday file is not found - enable inclusion of ../Makefile.inc to reenable compiling-in monitor support into isdnd - update manual page, add a comma and correct authors mail address
This commit is contained in:
parent
78626e2382
commit
84937f2402
@ -17,6 +17,8 @@ COPTS += -DUSE_RTPRIO
|
||||
|
||||
MAN = isdnd.rc.5 isdnd.rates.5 isdnd.acct.5 isdnd.8
|
||||
|
||||
.include "${.CURDIR}/../Makefile.inc"
|
||||
|
||||
.if !defined(I4B_WITHOUT_CURSES)
|
||||
COPTS += -DUSE_CURSES
|
||||
DPADD = ${LIBCURSES}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, Hellmuth Michaelis. All rights reserved.
|
||||
* Copyright (c) 2000, 2001 Hellmuth Michaelis. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@ -27,11 +27,9 @@
|
||||
* isdnd - holiday file handling
|
||||
* =============================
|
||||
*
|
||||
* $Id: holiday.c,v 1.1 2000/10/09 11:17:07 hm Exp $
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
* last edit-date: [Tue Oct 10 15:24:49 2000]
|
||||
* last edit-date: [Wed May 2 09:42:56 2001]
|
||||
*
|
||||
* Format:
|
||||
*
|
||||
@ -43,8 +41,6 @@
|
||||
* 23.4.2000 Ostersonntag
|
||||
* 3.10 Tag der deutschen Einheit
|
||||
*
|
||||
*
|
||||
*
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "isdnd.h"
|
||||
@ -79,7 +75,7 @@ init_holidays(char *filename)
|
||||
|
||||
if((fp = fopen(filename, "r")) == NULL)
|
||||
{
|
||||
log(LL_WRN, "init_holiday: error opening holidayfile %s: %s!", filename, strerror(errno));
|
||||
DBGL(DL_VALID, (log(LL_DBG, "init_holiday: error opening holidayfile %s: %s!", filename, strerror(errno))));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -112,11 +108,11 @@ init_holidays(char *filename)
|
||||
|
||||
if(year)
|
||||
{
|
||||
DBGL(DL_MSG, (log(LL_DBG, "init_holidays: add %d.%d.%d", day, month, year)));
|
||||
DBGL(DL_VALID, (log(LL_DBG, "init_holidays: add %d.%d.%d", day, month, year)));
|
||||
}
|
||||
else
|
||||
{
|
||||
DBGL(DL_MSG, (log(LL_DBG, "init_holidays: add %d.%d", day, month)));
|
||||
DBGL(DL_VALID, (log(LL_DBG, "init_holidays: add %d.%d", day, month)));
|
||||
}
|
||||
|
||||
newh->day = day;
|
||||
@ -181,12 +177,12 @@ isholiday(int d, int m, int y)
|
||||
{
|
||||
if(ch->year == 0)
|
||||
{
|
||||
DBGL(DL_MSG, (log(LL_DBG, "isholiday: %d.%d is a holiday!", d, m)));
|
||||
DBGL(DL_VALID, (log(LL_DBG, "isholiday: %d.%d is a holiday!", d, m)));
|
||||
return(1);
|
||||
}
|
||||
else if(ch->year == y)
|
||||
{
|
||||
DBGL(DL_MSG, (log(LL_DBG, "isholiday: %d.%d.%d is a holiday!", d, m, y)));
|
||||
DBGL(DL_VALID, (log(LL_DBG, "isholiday: %d.%d.%d is a holiday!", d, m, y)));
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
.\"
|
||||
.\" Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
|
||||
.\" Copyright (c) 1997, 2001 Hellmuth Michaelis. All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
@ -26,9 +26,9 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.\" last edit-date: [Tue May 2 13:45:12 2000]
|
||||
.\" last edit-date: [Wed May 2 10:48:30 2001]
|
||||
.\"
|
||||
.Dd May 2, 2000
|
||||
.Dd May 2, 2001
|
||||
.Dt ISDND 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -93,6 +93,8 @@ controller and channel busy/free messages.
|
||||
isdnd.rc configuration file processing.
|
||||
.It Ar 0x400
|
||||
outgoing call budget handling.
|
||||
.It Ar 0x800
|
||||
valid keyword and holiday file processing.
|
||||
.El
|
||||
.Pp
|
||||
The value can be specified in any number base supported by the
|
||||
@ -409,7 +411,7 @@ Exit status is 0 on success, 1 on error.
|
||||
.Xr isdnd.rc 5 ,
|
||||
.Xr isdnd.rates 5 ,
|
||||
.Xr i4bisppp 4 ,
|
||||
.Xr i4bipr 4
|
||||
.Xr i4bipr 4 ,
|
||||
.Xr i4bing 4
|
||||
.Sh BUGS
|
||||
Still one or more left.
|
||||
@ -417,4 +419,4 @@ Still one or more left.
|
||||
The
|
||||
.Nm
|
||||
daemon and this manual page were written by
|
||||
.An Hellmuth Michaelis Aq hm@kts.org .
|
||||
.An Hellmuth Michaelis Aq hm@freebsd.org .
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
|
||||
* Copyright (c) 1997, 2001 Hellmuth Michaelis. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@ -27,11 +27,9 @@
|
||||
* i4b daemon - main header file
|
||||
* -----------------------------
|
||||
*
|
||||
* $Id: isdnd.h,v 1.82 2000/10/09 11:17:07 hm Exp $
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
* last edit-date: [Wed Oct 4 14:11:46 2000]
|
||||
* last edit-date: [Wed May 2 09:34:44 2001]
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -103,6 +101,7 @@
|
||||
#define DL_CNST 0x0100 /* messages related to controller state */
|
||||
#define DL_RCCF 0x0200 /* messages related to isdnd.rc at boot */
|
||||
#define DL_BDGT 0x0400 /* messages related to budgets */
|
||||
#define DL_VALID 0x0800 /* messages related to valid keyword */
|
||||
|
||||
#ifdef DEBUG
|
||||
#define DBGL(cond, dolog) if(cond & debug_flags) dolog
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
|
||||
* Copyright (c) 1997, 2001 Hellmuth Michaelis. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@ -27,11 +27,9 @@
|
||||
* i4b daemon - main program entry
|
||||
* -------------------------------
|
||||
*
|
||||
* $Id: main.c,v 1.54 2000/10/09 12:53:29 hm Exp $
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
* last edit-date: [Mon Oct 2 22:57:08 2000]
|
||||
* last edit-date: [Wed May 2 10:05:55 2001]
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -89,8 +87,8 @@ usage(void)
|
||||
fprintf(stderr, " -d <level> set debug flag bits:\n");
|
||||
fprintf(stderr, " general = 0x%04x, rates = 0x%04x, timing = 0x%04x\n", DL_MSG, DL_RATES, DL_TIME);
|
||||
fprintf(stderr, " state = 0x%04x, retry = 0x%04x, dial = 0x%04x\n", DL_STATE, DL_RCVRY, DL_DIAL);
|
||||
fprintf(stderr, " process = 0x%04x, kernio = 0x%04x ctrlstat = 0x%04x\n", DL_PROC, DL_DRVR, DL_CNST);
|
||||
fprintf(stderr, " rc-file = 0x%04x, budget = 0x%04x\n", DL_RCCF, DL_BDGT);
|
||||
fprintf(stderr, " process = 0x%04x, kernio = 0x%04x, ctrlstat = 0x%04x\n", DL_PROC, DL_DRVR, DL_CNST);
|
||||
fprintf(stderr, " rc-file = 0x%04x, budget = 0x%04x, valid = 0x%04x\n", DL_RCCF, DL_BDGT, DL_VALID);
|
||||
fprintf(stderr, " -dn no debug output on fullscreen display\n");
|
||||
#endif
|
||||
fprintf(stderr, " -f fullscreen status display\n");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
|
||||
* Copyright (c) 1997, 2001 Hellmuth Michaelis. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@ -27,11 +27,9 @@
|
||||
* i4b daemon - misc support routines
|
||||
* ----------------------------------
|
||||
*
|
||||
* $Id: support.c,v 1.66 2000/10/09 11:17:07 hm Exp $
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
* last edit-date: [Tue Jan 16 14:07:12 2001]
|
||||
* last edit-date: [Wed May 2 09:36:02 2001]
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -954,14 +952,14 @@ isvalidtime(cfg_entry_t *cep)
|
||||
{
|
||||
if(isholiday(tp->tm_mday, (tp->tm_mon)+1, (tp->tm_year)+1900))
|
||||
{
|
||||
DBGL(DL_MSG, (log(LL_DBG, "isvalidtime: holiday %d.%d.%d", tp->tm_mday, (tp->tm_mon)+1, (tp->tm_year)+1900)));
|
||||
DBGL(DL_VALID, (log(LL_DBG, "isvalidtime: holiday %d.%d.%d", tp->tm_mday, (tp->tm_mon)+1, (tp->tm_year)+1900)));
|
||||
goto dayok;
|
||||
}
|
||||
}
|
||||
|
||||
if(cep->day & (1 << tp->tm_wday))
|
||||
{
|
||||
DBGL(DL_MSG, (log(LL_DBG, "isvalidtime: day match")));
|
||||
DBGL(DL_VALID, (log(LL_DBG, "isvalidtime: day match")));
|
||||
goto dayok;
|
||||
}
|
||||
|
||||
@ -970,7 +968,7 @@ isvalidtime(cfg_entry_t *cep)
|
||||
dayok:
|
||||
if(cep->fromhr==0 && cep->frommin==0 && cep->tohr==0 && cep->tomin==0)
|
||||
{
|
||||
DBGL(DL_MSG, (log(LL_DBG, "isvalidtime: no time specified, match!")));
|
||||
DBGL(DL_VALID, (log(LL_DBG, "isvalidtime: no time specified, match!")));
|
||||
return(1);
|
||||
}
|
||||
|
||||
@ -981,7 +979,7 @@ isvalidtime(cfg_entry_t *cep)
|
||||
if( (tp->tm_hour > cep->fromhr) ||
|
||||
(tp->tm_hour == cep->fromhr && tp->tm_min > cep->frommin) )
|
||||
{
|
||||
DBGL(DL_MSG, (log(LL_DBG, "isvalidtime: t<f-1, spec=%02d:%02d-%02d:%02d, curr=%02d:%02d, match!",
|
||||
DBGL(DL_VALID, (log(LL_DBG, "isvalidtime: t<f-1, spec=%02d:%02d-%02d:%02d, curr=%02d:%02d, match!",
|
||||
cep->fromhr, cep->frommin,
|
||||
cep->tohr, cep->tomin,
|
||||
tp->tm_hour, tp->tm_min)));
|
||||
@ -994,7 +992,7 @@ isvalidtime(cfg_entry_t *cep)
|
||||
if( (tp->tm_hour < cep->tohr) ||
|
||||
(tp->tm_hour == cep->tohr && tp->tm_min < cep->tomin) )
|
||||
{
|
||||
DBGL(DL_MSG, (log(LL_DBG, "isvalidtime: t<f-2, spec=%02d:%02d-%02d:%02d, curr=%02d:%02d, match!",
|
||||
DBGL(DL_VALID, (log(LL_DBG, "isvalidtime: t<f-2, spec=%02d:%02d-%02d:%02d, curr=%02d:%02d, match!",
|
||||
cep->fromhr, cep->frommin,
|
||||
cep->tohr, cep->tomin,
|
||||
tp->tm_hour, tp->tm_min)));
|
||||
@ -1006,7 +1004,7 @@ isvalidtime(cfg_entry_t *cep)
|
||||
{
|
||||
if(tp->tm_min >= cep->frommin && tp->tm_min < cep->tomin)
|
||||
{
|
||||
DBGL(DL_MSG, (log(LL_DBG, "isvalidtime: f=t, spec=%02d:%02d-%02d:%02d, curr=%02d:%02d, match!",
|
||||
DBGL(DL_VALID, (log(LL_DBG, "isvalidtime: f=t, spec=%02d:%02d-%02d:%02d, curr=%02d:%02d, match!",
|
||||
cep->fromhr, cep->frommin,
|
||||
cep->tohr, cep->tomin,
|
||||
tp->tm_hour, tp->tm_min)));
|
||||
@ -1020,14 +1018,14 @@ isvalidtime(cfg_entry_t *cep)
|
||||
(tp->tm_hour == cep->fromhr && tp->tm_min >= cep->frommin) ||
|
||||
(tp->tm_hour == cep->tohr && tp->tm_min < cep->tomin) )
|
||||
{
|
||||
DBGL(DL_MSG, (log(LL_DBG, "isvalidtime: t>f, spec=%02d:%02d-%02d:%02d, curr=%02d:%02d, match!",
|
||||
DBGL(DL_VALID, (log(LL_DBG, "isvalidtime: t>f, spec=%02d:%02d-%02d:%02d, curr=%02d:%02d, match!",
|
||||
cep->fromhr, cep->frommin,
|
||||
cep->tohr, cep->tomin,
|
||||
tp->tm_hour, tp->tm_min)));
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
DBGL(DL_MSG, (log(LL_DBG, "isvalidtime: spec=%02d:%02d-%02d:%02d, curr=%02d:%02d, no match!",
|
||||
DBGL(DL_VALID, (log(LL_DBG, "isvalidtime: spec=%02d:%02d-%02d:%02d, curr=%02d:%02d, no match!",
|
||||
cep->fromhr, cep->frommin,
|
||||
cep->tohr, cep->tomin,
|
||||
tp->tm_hour, tp->tm_min)));
|
||||
|
Loading…
Reference in New Issue
Block a user