Patches by Paul Slootman
This commit is contained in:
parent
fba173d17d
commit
64d039cff4
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: isdnlog.c,v 1.15 1998/03/08 11:42:50 luethje Exp $
|
/* $Id: isdnlog.c,v 1.16 1998/03/08 12:13:38 luethje Exp $
|
||||||
*
|
*
|
||||||
* ISDN accounting for isdn4linux. (log-module)
|
* ISDN accounting for isdn4linux. (log-module)
|
||||||
*
|
*
|
||||||
|
@ -19,6 +19,9 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
*
|
*
|
||||||
* $Log: isdnlog.c,v $
|
* $Log: isdnlog.c,v $
|
||||||
|
* Revision 1.16 1998/03/08 12:13:38 luethje
|
||||||
|
* Patches by Paul Slootman
|
||||||
|
*
|
||||||
* Revision 1.15 1998/03/08 11:42:50 luethje
|
* Revision 1.15 1998/03/08 11:42:50 luethje
|
||||||
* I4L-Meeting Wuerzburg final Edition, golden code - Service Pack number One
|
* I4L-Meeting Wuerzburg final Edition, golden code - Service Pack number One
|
||||||
*
|
*
|
||||||
|
@ -83,6 +86,8 @@
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#define X_FD_ISSET(fd, mask) ((fd) >= 0 && FD_ISSET(fd,mask))
|
||||||
|
|
||||||
static void loop(void);
|
static void loop(void);
|
||||||
static void init_variables(int argc, char* argv[]);
|
static void init_variables(int argc, char* argv[]);
|
||||||
static int set_options(int argc, char* argv[]);
|
static int set_options(int argc, char* argv[]);
|
||||||
|
@ -102,6 +107,7 @@ static char options[] = "av:sp:x:m:l:rt:c:C:w:SVTDPMh:nW:H:f:bL:NFA:2:O:";
|
||||||
static char msg1[] = "%s: Can't open %s (%s)\n";
|
static char msg1[] = "%s: Can't open %s (%s)\n";
|
||||||
static char *ptty = NULL;
|
static char *ptty = NULL;
|
||||||
static section *opt_dat = NULL;
|
static section *opt_dat = NULL;
|
||||||
|
static char **hup_argv; /* args to restart with */
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
@ -116,41 +122,14 @@ static void exit_on_signal(int Sign)
|
||||||
|
|
||||||
static void hup_handler(int isig)
|
static void hup_handler(int isig)
|
||||||
{
|
{
|
||||||
print_msg(PRT_INFO, "re-reading %s\n", CONFFILE);
|
print_msg(PRT_INFO, "restarting %s\n", myname);
|
||||||
|
Exit(-9);
|
||||||
discardconfig();
|
execv(myname, hup_argv);
|
||||||
if (readconfig(myname) != 0)
|
print_msg(PRT_ERR,"Cannot restart %s: %s!\n", myname, strerror(errno));
|
||||||
Exit(41);
|
|
||||||
|
|
||||||
if (fprot != NULL && tmpout != NULL && *tmpout != '\0')
|
|
||||||
{
|
|
||||||
fclose(fprot);
|
|
||||||
|
|
||||||
if ((fprot = fopen(tmpout,"a")) == NULL)
|
|
||||||
{
|
|
||||||
print_msg(PRT_ERR,"Can not open file `%s': %s!\n",tmpout, strerror(errno));
|
|
||||||
Exit(46);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fout != NULL && outfile != NULL && *outfile != '\0')
|
|
||||||
{
|
|
||||||
fclose(fout);
|
|
||||||
|
|
||||||
if ((fout = fopen(outfile,"a")) == NULL)
|
|
||||||
{
|
|
||||||
print_msg(PRT_ERR,"Can not open file `%s': %s!\n",outfile, strerror(errno));
|
|
||||||
Exit(47);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
signal(SIGHUP, hup_handler);
|
|
||||||
} /* hup_handler */
|
} /* hup_handler */
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define X_FD_ISSET(fd, mask) ((fd) >= 0 && FD_ISSET(fd,mask))
|
|
||||||
|
|
||||||
static void loop(void)
|
static void loop(void)
|
||||||
{
|
{
|
||||||
auto fd_set readmask;
|
auto fd_set readmask;
|
||||||
|
@ -231,7 +210,6 @@ static void loop(void)
|
||||||
|
|
||||||
now();
|
now();
|
||||||
|
|
||||||
|
|
||||||
for (Cnt = first_descr; Cnt < socket_size(sockets); Cnt++) {
|
for (Cnt = first_descr; Cnt < socket_size(sockets); Cnt++) {
|
||||||
if (X_FD_ISSET(sockets[Cnt].descriptor, &exceptmask)) {
|
if (X_FD_ISSET(sockets[Cnt].descriptor, &exceptmask)) {
|
||||||
if (sockets[Cnt].fp == NULL) {
|
if (sockets[Cnt].fp == NULL) {
|
||||||
|
@ -785,6 +763,7 @@ int main(int argc, char *argv[], char *envp[])
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
set_print_fct_for_lib(print_in_modules);
|
set_print_fct_for_lib(print_in_modules);
|
||||||
|
hup_argv = argv;
|
||||||
init_variables(argc, argv);
|
init_variables(argc, argv);
|
||||||
|
|
||||||
lastarg = set_options(argc,argv);
|
lastarg = set_options(argc,argv);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: processor.c,v 1.14 1998/03/08 11:42:55 luethje Exp $
|
/* $Id: processor.c,v 1.15 1998/03/08 12:13:40 luethje Exp $
|
||||||
*
|
*
|
||||||
* ISDN accounting for isdn4linux. (log-module)
|
* ISDN accounting for isdn4linux. (log-module)
|
||||||
*
|
*
|
||||||
|
@ -19,6 +19,9 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Log: processor.c,v $
|
* $Log: processor.c,v $
|
||||||
|
* Revision 1.15 1998/03/08 12:13:40 luethje
|
||||||
|
* Patches by Paul Slootman
|
||||||
|
*
|
||||||
* Revision 1.14 1998/03/08 11:42:55 luethje
|
* Revision 1.14 1998/03/08 11:42:55 luethje
|
||||||
* I4L-Meeting Wuerzburg final Edition, golden code - Service Pack number One
|
* I4L-Meeting Wuerzburg final Edition, golden code - Service Pack number One
|
||||||
*
|
*
|
||||||
|
@ -1529,7 +1532,7 @@ static void decode(int chan, register char *p, int type, int version)
|
||||||
|
|
||||||
pd = qmsg(TYPE_ELEMENT, version, element);
|
pd = qmsg(TYPE_ELEMENT, version, element);
|
||||||
|
|
||||||
if (*pd == 'U') {
|
if (strncmp(pd, "UNKNOWN", 7) == 0) {
|
||||||
register char *p1 = p, *p2;
|
register char *p1 = p, *p2;
|
||||||
register int i, c;
|
register int i, c;
|
||||||
auto char s[LONG_STRING_SIZE];
|
auto char s[LONG_STRING_SIZE];
|
||||||
|
@ -1719,7 +1722,7 @@ static void decode(int chan, register char *p, int type, int version)
|
||||||
print_msg(PRT_DEBUG_DECODE, " DEBUG> %s: 1TR6 AOCD %i\n", st + 4, n);
|
print_msg(PRT_DEBUG_DECODE, " DEBUG> %s: 1TR6 AOCD %i\n", st + 4, n);
|
||||||
} /* if */
|
} /* if */
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
#if defined(ISDN_NL) || defined(ISDN_CH)
|
#if defined(ISDN_NL) || defined(ISDN_CH)
|
||||||
n = AOC_1TR6(l, p);
|
n = AOC_1TR6(l, p);
|
||||||
#else
|
#else
|
||||||
|
@ -1949,24 +1952,48 @@ static void decode(int chan, register char *p, int type, int version)
|
||||||
} /* if */
|
} /* if */
|
||||||
} /* else */
|
} /* else */
|
||||||
} /* if */
|
} /* if */
|
||||||
|
} /* if */
|
||||||
|
|
||||||
p += (l * 3);
|
p += (l * 3);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x29 : /* Date/Time */
|
case 0x03 : /* Date/Time 1TR6 */
|
||||||
|
case 0x29 : /* Date/Time E-DSS1 */
|
||||||
|
if ((element == 0x03) && (version == VERSION_1TR6)) {
|
||||||
|
tm.tm_mday = (strtol(p+=3,NIL,16)-'0') * 10;
|
||||||
|
tm.tm_mday += strtol(p+=3,NIL,16)-'0';
|
||||||
|
p += 3; /* skip '.' */
|
||||||
|
tm.tm_mon = (strtol(p+=3,NIL,16)-'0') * 10;
|
||||||
|
tm.tm_mon += strtol(p+=3,NIL,16)-'0' - 1;
|
||||||
|
p += 3; /* skip '.' */
|
||||||
|
tm.tm_year = (strtol(p+=3,NIL,16)-'0') * 10;
|
||||||
|
tm.tm_year += strtol(p+=3,NIL,16)-'0';
|
||||||
|
if (tm.tm_year < 70)
|
||||||
|
tm.tm_year += 100;
|
||||||
|
p += 3; /* skip '-' */
|
||||||
|
tm.tm_hour = (strtol(p+=3,NIL,16)-'0') * 10;
|
||||||
|
tm.tm_hour += strtol(p+=3,NIL,16)-'0';
|
||||||
|
p += 3; /* skip ':' */
|
||||||
|
tm.tm_min = (strtol(p+=3,NIL,16)-'0') * 10;
|
||||||
|
tm.tm_min += strtol(p+=3,NIL,16)-'0';
|
||||||
|
p += 3; /* skip ':' */
|
||||||
|
tm.tm_sec = (strtol(p+=3,NIL,16)-'0') * 10;
|
||||||
|
tm.tm_sec += strtol(p+=3,NIL,16)-'0';
|
||||||
|
}
|
||||||
|
else if ((element == 0x29) && (version != VERSION_1TR6)) {
|
||||||
tm.tm_year = strtol(p += 3, NIL, 16);
|
tm.tm_year = strtol(p += 3, NIL, 16);
|
||||||
tm.tm_mon = strtol(p += 3, NIL, 16) - 1;
|
tm.tm_mon = strtol(p += 3, NIL, 16) - 1;
|
||||||
tm.tm_mday = strtol(p += 3, NIL, 16);
|
tm.tm_mday = strtol(p += 3, NIL, 16);
|
||||||
tm.tm_hour = strtol(p += 3, NIL, 16);
|
tm.tm_hour = strtol(p += 3, NIL, 16);
|
||||||
tm.tm_min = strtol(p += 3, NIL, 16);
|
tm.tm_min = strtol(p += 3, NIL, 16);
|
||||||
|
if (l > 5)
|
||||||
if (l > 5) {
|
|
||||||
tm.tm_sec = strtol(p += 3, NIL, 16);
|
tm.tm_sec = strtol(p += 3, NIL, 16);
|
||||||
if (l > 6)
|
else
|
||||||
p += (l - 6) * 3;
|
|
||||||
} else {
|
|
||||||
tm.tm_sec = 0;
|
tm.tm_sec = 0;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
goto UNKNOWN_ELEMENT; /* no choice... */
|
||||||
|
}
|
||||||
tm.tm_wday = tm.tm_yday = 0;
|
tm.tm_wday = tm.tm_yday = 0;
|
||||||
tm.tm_isdst = -1;
|
tm.tm_isdst = -1;
|
||||||
|
|
||||||
|
@ -2811,9 +2838,9 @@ escape: for (c = 0; c <= sxp; c++)
|
||||||
|
|
||||||
|
|
||||||
default : {
|
default : {
|
||||||
register char *p1 = p, *p2 = s;
|
register char *p1, *p2;
|
||||||
register int i;
|
register int i;
|
||||||
|
UNKNOWN_ELEMENT: p1 = p; p2 = s;
|
||||||
|
|
||||||
for (i = 0; i < l; i++)
|
for (i = 0; i < l; i++)
|
||||||
p2 += sprintf(p2, "%02x ", (int)strtol(p1 += 3, NIL, 16));
|
p2 += sprintf(p2, "%02x ", (int)strtol(p1 += 3, NIL, 16));
|
||||||
|
@ -2926,7 +2953,7 @@ void dotrace(void)
|
||||||
|
|
||||||
|
|
||||||
print_msg(PRT_NORMAL, ">>>>>>> TRACE (CR=next, q=quit, d=dump, g=go):");
|
print_msg(PRT_NORMAL, ">>>>>>> TRACE (CR=next, q=quit, d=dump, g=go):");
|
||||||
gets(s);
|
fgets(s, BUFSIZ, stdin);
|
||||||
|
|
||||||
if (*s == 'q')
|
if (*s == 'q')
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: isdntools.c,v 1.16 1997/06/22 22:57:08 luethje Exp $
|
/* $Id: isdntools.c,v 1.17 1998/03/08 12:13:49 luethje Exp $
|
||||||
*
|
*
|
||||||
* ISDN accounting for isdn4linux. (Utilities)
|
* ISDN accounting for isdn4linux. (Utilities)
|
||||||
*
|
*
|
||||||
|
@ -19,6 +19,9 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Log: isdntools.c,v $
|
* $Log: isdntools.c,v $
|
||||||
|
* Revision 1.17 1998/03/08 12:13:49 luethje
|
||||||
|
* Patches by Paul Slootman
|
||||||
|
*
|
||||||
* Revision 1.16 1997/06/22 22:57:08 luethje
|
* Revision 1.16 1997/06/22 22:57:08 luethje
|
||||||
* bugfixes
|
* bugfixes
|
||||||
*
|
*
|
||||||
|
@ -176,20 +179,20 @@ static char areacodes[][2][30] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static char countrycodes[][2][30] = {
|
static char countrycodes[][2][30] = {
|
||||||
{"+30", "Greek"},
|
{"+30", "Greece"},
|
||||||
{"+31", "Nethland"},
|
{"+31", "Netherlands"},
|
||||||
{"+32", "Belgium"},
|
{"+32", "Belgium"},
|
||||||
{"+33", "France"},
|
{"+33", "France"},
|
||||||
{"+34", "Spain"},
|
{"+34", "Spain"},
|
||||||
{"+39", "Italy"},
|
{"+39", "Italy"},
|
||||||
{"+41", "Swiss"},
|
{"+41", "Switzerland"},
|
||||||
{"+43", "Austria"},
|
{"+43", "Austria"},
|
||||||
{"+44", "Great Britain"},
|
{"+44", "Great Britain"},
|
||||||
{"+45", "Danmark"},
|
{"+45", "Denmark"},
|
||||||
{"+46", "Sweden"},
|
{"+46", "Sweden"},
|
||||||
{"+47", "Norway"},
|
{"+47", "Norway"},
|
||||||
{"+49", "Germany"},
|
{"+49", "Germany"},
|
||||||
{"+352", "Luxembourg"},
|
{"+352", "Luxemburg"},
|
||||||
{"+1", "United States"},
|
{"+1", "United States"},
|
||||||
{"", ""},
|
{"", ""},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue