isdnlog Version 3.36
- EGCS 1.1.2 bug correction from Nima <nima_ghasseminejad@public.uni-hamburg.de> - zone-1.11
This commit is contained in:
parent
d1368176bc
commit
162804642e
|
@ -1,4 +1,4 @@
|
|||
## $Id: Makefile.in,v 1.88 1999/06/21 19:32:08 akool Exp $
|
||||
## $Id: Makefile.in,v 1.89 1999/06/26 10:11:06 akool Exp $
|
||||
##
|
||||
## ISDN accounting for isdn4linux.
|
||||
##
|
||||
|
@ -19,6 +19,11 @@
|
|||
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
##
|
||||
## $Log: Makefile.in,v $
|
||||
## Revision 1.89 1999/06/26 10:11:06 akool
|
||||
## isdnlog Version 3.36
|
||||
## - EGCS 1.1.2 bug correction from Nima <nima_ghasseminejad@public.uni-hamburg.de>
|
||||
## - zone-1.11
|
||||
##
|
||||
## Revision 1.88 1999/06/21 19:32:08 akool
|
||||
## isdnlog Version 3.35
|
||||
## zone data for .nl (many thanks to Paul!)
|
||||
|
@ -692,7 +697,7 @@ SERVICEFILE = /etc/services
|
|||
# DON'T EDIT BELOW THIS LINE
|
||||
######################################################################
|
||||
|
||||
VERSION = 3.35
|
||||
VERSION = 3.36
|
||||
|
||||
MANPAGES = isdnlog/callerid.conf.5 isdnlog/isdn.conf.5 \
|
||||
isdnlog/isdnformat.5 isdnlog/isdnlog.5 isdnlog/isdnlog.8 \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: asn1.h,v 1.3 1999/05/04 19:32:32 akool Exp $
|
||||
/* $Id: asn1.h,v 1.4 1999/06/26 10:12:02 akool Exp $
|
||||
*
|
||||
* ISDN accounting for isdn4linux. (ASN.1 parser)
|
||||
*
|
||||
|
@ -21,6 +21,11 @@
|
|||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Log: asn1.h,v $
|
||||
* Revision 1.4 1999/06/26 10:12:02 akool
|
||||
* isdnlog Version 3.36
|
||||
* - EGCS 1.1.2 bug correction from Nima <nima_ghasseminejad@public.uni-hamburg.de>
|
||||
* - zone-1.11
|
||||
*
|
||||
* Revision 1.3 1999/05/04 19:32:32 akool
|
||||
* isdnlog Version 3.24
|
||||
*
|
||||
|
@ -260,7 +265,7 @@ ELEMENT_1(ParseRESInterrogateServedUserNumbers, char, );
|
|||
#define CHECK_TAG(a) \
|
||||
int elnr = 0; \
|
||||
\
|
||||
elnr = elnr; // makes lint happy \
|
||||
elnr = elnr; /* makes lint happy */ \
|
||||
if (tag == ASN1_NOT_TAGGED) { \
|
||||
if ((el.tag &~ 0x20) != (a)) { \
|
||||
print_msg(PRT_DEBUG_DECODE, " DEBUG> native tag %2x not found, %2x instead\n", \
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# for collecting and preparing most of the call charges.
|
||||
|
||||
|
||||
V:1.60-Austria [22-Jun-1999]
|
||||
V:1.61-Austria [23-Jun-1999]
|
||||
|
||||
U:%.3f öS
|
||||
|
||||
|
@ -919,13 +919,14 @@ T:E,H/*=0.936/15 Sparzeit
|
|||
A:+43717
|
||||
|
||||
P:02 UTA
|
||||
C:Fixme: Bundesland-Verzonung nicht implementiert
|
||||
C:Fixme: Bundesland-Verzonung (angrenzende) nicht implementiert
|
||||
D:uta # Verzonung
|
||||
Z:1 Bundeslandzone
|
||||
T:1-5/8-18=1.00(60)/1 Geschäftszeit
|
||||
T:1-5/18-8=0.88(60)/1 Freizeit
|
||||
T:E,H/*=0.88(60)/1 Freizeit
|
||||
Z:2 Österreichzone
|
||||
T:1-5/8-18=2.50(60)/1 Geschäftszeit
|
||||
T:1-5/8-18=1.50(60)/1 Geschäftszeit
|
||||
T:1-5/18-8=1.00(60)/1 Freizeit
|
||||
T:E,H/*=1.00(60)/1 Freizeit
|
||||
A:Österreich
|
||||
|
@ -1035,15 +1036,17 @@ A:Pakistan, Palau, Salomonen, Senegal, Seychellen, Somalia, Tokelau, Tschad
|
|||
A:Tuvalu, Vietnam, Wake-Inseln, Wallis- und Futuna-Inseln, Zaire
|
||||
|
||||
P:03 Multikom
|
||||
C:Fixme: Verify Verzonung
|
||||
D:pta # Verzonung
|
||||
Z:1 Regionalzone
|
||||
T:*/*=1.00(60)/60/1 rund um die Uhr
|
||||
Z:2 Fernzone 1
|
||||
T:*/*=1.00(60)/60/1 rund um die Uhr
|
||||
Z:3 5 Freunde
|
||||
T:*/*=1.00(60)/60/1 rund um die Uhr
|
||||
Z:4 Fernzone 2
|
||||
Z:3 Fernzone 2
|
||||
T:*/*=2.00(60)/60/1 rund um die Uhr
|
||||
A:Österreich
|
||||
Z:4 5 Freunde
|
||||
T:*/*=1.00(60)/60/1 rund um die Uhr
|
||||
Z:5 Mobilfunk
|
||||
T:*/*=3.00(60)/60/1 rund um die Uhr
|
||||
A:+43663, +43664, +43676, +43699
|
||||
|
@ -1148,6 +1151,8 @@ T:*/*=19.00(60)/60/1 rund um die Uhr
|
|||
A:+ alle übrigen Länder
|
||||
|
||||
P:07,1 European Telecom
|
||||
C:Fixme: Verify Verzonung
|
||||
D:1007 # Verzonung
|
||||
C:Tarif: 1 Jahr feste Bindung
|
||||
Z:1 Fernzone 1
|
||||
T:1-5/08-12=2.376(60)/1 Tageszeit 1
|
||||
|
@ -1278,6 +1283,8 @@ T:1-5/18-8=1.980(60)/1 Sparzeit
|
|||
T:E,H/*=1.980(60)/1 Sparzeit
|
||||
|
||||
P:07,2 European Telecom
|
||||
C:Fixme: Verify Verzonung
|
||||
D:1007 # Verzonung
|
||||
C:Tarif: 14-tägig kündbar
|
||||
Z:1 Fernzone 1
|
||||
T:1-5/08-12=2.532(60)/1 Tageszeit 1
|
||||
|
@ -1408,6 +1415,7 @@ T:1-5/18-8=2.112(60)/1 Sparzeit
|
|||
T:E,H/*=2.112(60)/1 Sparzeit
|
||||
|
||||
P:11 RSL COM
|
||||
D:1012 # Verzonung
|
||||
Z:1 Bundesland
|
||||
T:1-5/8-18=1.00(60)/1 Tag
|
||||
T:1-5/18-8=0.88(60)/1 Nacht
|
||||
|
@ -1550,6 +1558,7 @@ A:+ alle
|
|||
|
||||
P:24 Telepassport
|
||||
C:Fixme: International D: Zentral- und Südamerika nicht implementiert
|
||||
D:1024 # Verzonung
|
||||
Z:1 Regionalzone
|
||||
T:1-5/8-18=0.98(60)/1 Tag
|
||||
T:1-5/18-8=0.88(60)/1 Nacht
|
||||
|
@ -1559,9 +1568,9 @@ T:1-5/8-18=1.28(60)/1 Tag
|
|||
T:1-5/18-8=1.18(60)/1 Nacht
|
||||
T:E,H/*=1.18(60)/1 Weekend
|
||||
Z:3 Österreich
|
||||
T:1-5/8-18=2.48(60)/1 Tag
|
||||
T:1-5/18-8=1.48(60)/1 Nacht
|
||||
T:E,H/*=1.48(60)/1 Weekend
|
||||
T:1-5/8-18=1.98(60)/1 Tag
|
||||
T:1-5/18-8=1.18(60)/1 Nacht
|
||||
T:E,H/*=1.18(60)/1 Weekend
|
||||
A:Österreich
|
||||
Z:4 Deutschland, Schweiz
|
||||
T:*/*=3.98(60)/1 rund um die Uhr
|
||||
|
@ -1685,13 +1694,14 @@ Z:9 International
|
|||
A:+ alle übrigen Länder
|
||||
|
||||
P:44 Citykom
|
||||
D:1012 # Verzonung
|
||||
C:Fixme: internationale Zonen nicht implementiert
|
||||
Z:1 Regional
|
||||
T:*/*=1.20(60)/1 rund um die Uhr
|
||||
T:*/*=0.72(60)/1 rund um die Uhr
|
||||
Z:2 Österreich
|
||||
T:1-5/8-18=2.16(60)/1 Tag
|
||||
T:1-5/18-8=2.70(60)/1 Nacht
|
||||
T:E,H/*=2.70(60)/1 Weekend
|
||||
T:1-5/8-18=1.44(60)/1 Tag
|
||||
T:1-5/18-8=0.72(60)/1 Nacht
|
||||
T:E,H/*=0.72(60)/1 Weekend
|
||||
A:Österreich
|
||||
Z:3 Mobilfunk
|
||||
T:*/*=4.20(60)/1 rund um die Uhr
|
||||
|
@ -1700,6 +1710,8 @@ Z:4 Ausland
|
|||
A:+ alle übrigen Länder
|
||||
|
||||
P:66 MIT 1066
|
||||
D:1066 # Verzonung
|
||||
C:Fixme Verzonung -50/+50 verifizieren
|
||||
Z:1 Regionalzone
|
||||
T:1-5/8-18=0.96(60)/18.75/1 Tag
|
||||
T:1-5/18-8=0.80(60)/22.50/1 Nacht
|
||||
|
|
|
@ -253,7 +253,7 @@ void rate_1002(void) {
|
|||
{ "Welt 5", "Afghanistan, Amerikanisch-Samoa, Antigua & Barbuda, Ascension, Bangladesch, Burkina Faso, Cook-Inseln, Diego Garcia, El Salvador, Eritrea, Falklandinseln, Guam, Guantanamo, Guatemala, Haiti, Kamerun, Kongo, Madagaskar, Honduras, Jemen, Kambodscha, Kamerun, Kap Verde, Kongo, Madagaskar, Mali, Marshallinseln, Midway-Inseln, Mikronesien, Montserrat, Pakistan, Palau, Salomonen, Senegal, Seychellen, Somalia, Tokelau, Tschad, Tuvalu, Vietnam, Wake-Inseln, Wallis- und Futuna-Inseln, Zaire" }};
|
||||
|
||||
double Tarif[][2] = {{ 1.00, 0.88 },
|
||||
{ 2.50, 1.00 },
|
||||
{ 1.50, 1.00 },
|
||||
{ 1.80, 0.88 },
|
||||
{ 4.20, 2.88 },
|
||||
{ 1.00, 1.00 },
|
||||
|
@ -274,7 +274,8 @@ void rate_1002(void) {
|
|||
|
||||
printf ("\n");
|
||||
rprintf ("UTA", "P:02");
|
||||
rprintf ("Bundesland-Verzonung nicht implementiert", "C:Fixme:");
|
||||
rprintf ("Bundesland-Verzonung (angrenzende) nicht implementiert", "C:Fixme:");
|
||||
rprintf ("# Verzonung", "D:uta");
|
||||
for (z=0; z<COUNT(Zone); z++) {
|
||||
rprintf (Zone[z][0], "Z:%d", z+1);
|
||||
rprintf ("Geschäftszeit", "T:1-5/8-18=%.2f(60)/1", Tarif[z][0]);
|
||||
|
@ -288,8 +289,8 @@ void rate_1003(void) {
|
|||
|
||||
char *Zone[][2] = {{ "Regionalzone", "" },
|
||||
{ "Fernzone 1", "" },
|
||||
{ "5 Freunde", "" },
|
||||
{ "Fernzone 2", "Österreich" },
|
||||
{ "5 Freunde", "" },
|
||||
{ "Mobilfunk", "+43663,+43664,+43676,+43699" },
|
||||
{ "Deutschland spezial", "Deutschland" },
|
||||
{ "Europa spezial", "Belgien, Frankreich, Großbritannien" },
|
||||
|
@ -305,9 +306,9 @@ void rate_1003(void) {
|
|||
{ "Ausland Zone 10", "Afghanistan, American Samoa, Anguilla, Antigua & Barbuda, Bangladesh, British Virgin Isles, Cambodia, Cayman Islands, Congo, Cook Islands, Dominica, Eritrea, Falkland Islands, Grenada, Guam, Guantanamo, Nordkorea, Madagascar, Marshall Islands, Montserrat, Niger, Palau, Paraguay, Pitcairn Islands, Tuvalu, Uruguay, Vietnam, Wake Island" }};
|
||||
|
||||
double Tarif[][2] = {{ 1.0, 1.0},
|
||||
{ 1.0, 1.0},
|
||||
{ 1.0, 1.0},
|
||||
{ 2.0, 2.0},
|
||||
{ 1.0, 1.0},
|
||||
{ 3.0, 3.0},
|
||||
{ 3.0, 3.0},
|
||||
{ 4.0, 4.0},
|
||||
|
@ -326,6 +327,8 @@ void rate_1003(void) {
|
|||
|
||||
printf ("\n");
|
||||
rprintf ("Multikom", "P:03");
|
||||
rprintf ("Verify Verzonung", "C:Fixme:");
|
||||
rprintf ("# Verzonung", "D:pta");
|
||||
for (z=0; z<COUNT(Zone); z++) {
|
||||
rprintf (Zone[z][0], "Z:%d", z+1);
|
||||
if (Tarif[z][0]==Tarif[z][1])
|
||||
|
@ -432,6 +435,8 @@ void rate_1007(void) {
|
|||
for (t=0; t<2; t++) {
|
||||
printf ("\n");
|
||||
rprintf ("European Telecom", "P:07,%d", t+1);
|
||||
rprintf ("Verify Verzonung", "C:Fixme:");
|
||||
rprintf ("# Verzonung", "D:1007");
|
||||
rprintf (Name[t], "C:Tarif:");
|
||||
for (z=0; z<COUNT(Zone); z++) {
|
||||
rprintf (Zone[z][0], "Z:%d", z+1);
|
||||
|
@ -509,6 +514,7 @@ void rate_1011(void) {
|
|||
|
||||
printf ("\n");
|
||||
rprintf ("RSL COM", "P:11");
|
||||
rprintf ("# Verzonung", "D:1012");
|
||||
for (z=0; z<COUNT(Zone); z++) {
|
||||
rprintf (Zone[z][0], "Z:%d", z+1);
|
||||
if (Tarif[z][0]==Tarif[z][1]) {
|
||||
|
@ -580,7 +586,7 @@ void rate_1024(void) {
|
|||
|
||||
double Tarif[][2] = {{ 0.98, 0.88},
|
||||
{ 1.28, 1.18},
|
||||
{ 2.48, 1.48},
|
||||
{ 1.98, 1.18},
|
||||
{ 3.98, 3.98},
|
||||
{ 3.48, 3.48},
|
||||
{ 3.98, 3.98},
|
||||
|
@ -595,6 +601,7 @@ void rate_1024(void) {
|
|||
printf ("\n");
|
||||
rprintf ("Telepassport", "P:24");
|
||||
rprintf ("International D: Zentral- und Südamerika nicht implementiert", "C:Fixme:");
|
||||
rprintf ("# Verzonung", "D:1024");
|
||||
for (z=0; z<COUNT(Zone); z++) {
|
||||
rprintf (Zone[z][0], "Z:%d", z+1);
|
||||
if (Tarif[z][0]==Tarif[z][1]) {
|
||||
|
@ -690,8 +697,8 @@ void rate_1044(void) {
|
|||
{ "Mobilfunk", "+43663,+43664,+43676,+43699" },
|
||||
{ "Ausland", "+" }};
|
||||
|
||||
double Tarif[][2] = {{ 1.20, 1.20 },
|
||||
{ 2.16, 2.70 },
|
||||
double Tarif[][2] = {{ 0.72, 0.72 },
|
||||
{ 1.44, 0.72 },
|
||||
{ 4.20, 4.20 },
|
||||
{ 0.00, 0.00 }};
|
||||
|
||||
|
@ -699,6 +706,7 @@ void rate_1044(void) {
|
|||
|
||||
printf ("\n");
|
||||
rprintf ("Citykom", "P:44");
|
||||
rprintf ("# Verzonung", "D:1012");
|
||||
rprintf ("internationale Zonen nicht implementiert", "C:Fixme:");
|
||||
for (z=0; z<COUNT(Zone); z++) {
|
||||
rprintf (Zone[z][0], "Z:%d", z+1);
|
||||
|
@ -801,6 +809,8 @@ void rate_1066(void) {
|
|||
|
||||
printf ("\n");
|
||||
rprintf ("MIT 1066", "P:66");
|
||||
rprintf ("# Verzonung", "D:1066");
|
||||
rprintf ("Verzonung -50/+50 verifizieren", "C:Fixme");
|
||||
for (z=0; z<COUNT(Zone); z++) {
|
||||
rprintf (Zone[z][0], "Z:%d", z+1);
|
||||
if (Tarif[z][0]==Tarif[z][1]) {
|
||||
|
@ -846,7 +856,7 @@ void rate_1069(void) {
|
|||
}
|
||||
|
||||
|
||||
void main (int argc, char *argv[])
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
printf ("# created by rate-at.c\n\n");
|
||||
printf ("# The information herein was machine-generated,\n");
|
||||
|
@ -856,7 +866,7 @@ void main (int argc, char *argv[])
|
|||
printf ("# Many thanks to Daniela Bruder <dbruder@sime.com>\n");
|
||||
printf ("# for collecting and preparing most of the call charges.\n\n\n");
|
||||
|
||||
printf ("V:1.60-Austria [22-Jun-1999]\n\n");
|
||||
printf ("V:1.61-Austria [23-Jun-1999]\n\n");
|
||||
printf ("U:%%.3f öS\n");
|
||||
|
||||
#if 0
|
||||
|
@ -875,5 +885,5 @@ void main (int argc, char *argv[])
|
|||
rate_1066();
|
||||
rate_1069();
|
||||
#endif
|
||||
|
||||
return(EXIT_SUCCESS);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: rate.c,v 1.25 1999/06/22 19:41:23 akool Exp $
|
||||
/* $Id: rate.c,v 1.26 1999/06/26 10:12:12 akool Exp $
|
||||
*
|
||||
* Tarifdatenbank
|
||||
*
|
||||
|
@ -19,6 +19,11 @@
|
|||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Log: rate.c,v $
|
||||
* Revision 1.26 1999/06/26 10:12:12 akool
|
||||
* isdnlog Version 3.36
|
||||
* - EGCS 1.1.2 bug correction from Nima <nima_ghasseminejad@public.uni-hamburg.de>
|
||||
* - zone-1.11
|
||||
*
|
||||
* Revision 1.25 1999/06/22 19:41:23 akool
|
||||
* zone-1.1 fixes
|
||||
*
|
||||
|
@ -594,7 +599,7 @@ int initRate(char *conf, char *dat, char *dom, char **msg)
|
|||
break;
|
||||
|
||||
case 'P': /* P:nn[,v] Bezeichnung */
|
||||
if (prefix!=UNKNOWN && !ignore && !domestic)
|
||||
if (zone!=UNKNOWN && !ignore && !domestic)
|
||||
warning (dat, "Provider %d has no default domestic zone (missing 'A:%s')", prefix, mycountry);
|
||||
v = UNKNOWN;
|
||||
zone = UNKNOWN;
|
||||
|
@ -1060,7 +1065,7 @@ int initRate(char *conf, char *dat, char *dom, char **msg)
|
|||
}
|
||||
fclose(stream);
|
||||
|
||||
if (prefix!=UNKNOWN && !domestic)
|
||||
if (zone!=UNKNOWN && !domestic)
|
||||
warning (dat, "Provider %d has no default domestic zone (missing 'A:%s')", prefix, mycountry);
|
||||
|
||||
if (!*Format) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: zone.c,v 1.7 1999/06/22 19:41:28 akool Exp $
|
||||
/* $Id: zone.c,v 1.8 1999/06/26 10:12:14 akool Exp $
|
||||
*
|
||||
* Zonenberechnung
|
||||
*
|
||||
|
@ -19,6 +19,11 @@
|
|||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Log: zone.c,v $
|
||||
* Revision 1.8 1999/06/26 10:12:14 akool
|
||||
* isdnlog Version 3.36
|
||||
* - EGCS 1.1.2 bug correction from Nima <nima_ghasseminejad@public.uni-hamburg.de>
|
||||
* - zone-1.11
|
||||
*
|
||||
* Revision 1.7 1999/06/22 19:41:28 akool
|
||||
* zone-1.1 fixes
|
||||
*
|
||||
|
@ -97,7 +102,7 @@ struct sth {
|
|||
|
||||
static struct sth *sthp;
|
||||
static int count;
|
||||
static char version[] = "1.10";
|
||||
static char version[] = "1.11";
|
||||
static bool area_read = false;
|
||||
|
||||
#define LINK 127
|
||||
|
@ -197,20 +202,20 @@ int initZone(int provider, char *path, char **msg)
|
|||
file = path;
|
||||
}
|
||||
else {
|
||||
if ((dir = strdup(path)) == 0) {
|
||||
if (msg)
|
||||
snprintf (message, LENGTH,
|
||||
"Zone V%s: Error: Out of mem 10", version);
|
||||
return res;
|
||||
}
|
||||
p = strrchr(dir, '/');
|
||||
if ((file = strdup(p+1)) == 0) {
|
||||
if (msg)
|
||||
snprintf (message, LENGTH,
|
||||
"Zone V%s: Error: Out of mem 11", version);
|
||||
return res;
|
||||
}
|
||||
p[1] = '\0';
|
||||
if ((dir = strdup(path)) == 0) {
|
||||
if (msg)
|
||||
snprintf (message, LENGTH,
|
||||
"Zone V%s: Error: Out of mem 10", version);
|
||||
return res;
|
||||
}
|
||||
p = strrchr(dir, '/');
|
||||
if ((file = strdup(p+1)) == 0) {
|
||||
if (msg)
|
||||
snprintf (message, LENGTH,
|
||||
"Zone V%s: Error: Out of mem 11", version);
|
||||
return res;
|
||||
}
|
||||
p[1] = '\0';
|
||||
}
|
||||
if ((dp = opendir(dir)) == 0) {
|
||||
if (msg)
|
||||
|
@ -233,8 +238,8 @@ int initZone(int provider, char *path, char **msg)
|
|||
}
|
||||
closedir(dp);
|
||||
if ((p = strrchr(path, '/')) != 0) {
|
||||
free(dir);
|
||||
free(file);
|
||||
free(dir);
|
||||
free(file);
|
||||
}
|
||||
if (msg && strlen(message) < LENGTH-5) {
|
||||
strcat(message, " - ");
|
||||
|
@ -269,6 +274,7 @@ static int _initZone(int provider, char *path, char **msg, bool area_only)
|
|||
if (msg)
|
||||
snprintf (message, LENGTH,
|
||||
"Zone V%s: Error: Out of mem 0", version);
|
||||
count--;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -286,6 +292,7 @@ static int _initZone(int provider, char *path, char **msg, bool area_only)
|
|||
if (msg)
|
||||
snprintf (message, LENGTH,
|
||||
"Zone V%s: Error: Out of mem 1", version);
|
||||
count--;
|
||||
return -1;
|
||||
}
|
||||
sthp = newsthp;
|
||||
|
@ -334,6 +341,7 @@ static int _initZone(int provider, char *path, char **msg, bool area_only)
|
|||
snprintf (message, LENGTH,
|
||||
"Zone V%s: Error: gdbm_open '%s': '%s'",
|
||||
version, path, GET_ERR);
|
||||
count--;
|
||||
return -1;
|
||||
}
|
||||
/* read info */
|
||||
|
@ -415,7 +423,7 @@ static int _initZone(int provider, char *path, char **msg, bool area_only)
|
|||
if (area_only) {
|
||||
if (sthp[ocount].cc == 0)
|
||||
_exitZone(provider); /* discard this one */
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
/* alloc & read table */
|
||||
if ( (sthp[ocount].table = calloc(csize > 256 ? 256 : csize,
|
||||
|
@ -550,7 +558,6 @@ static int _getAreacode(struct sth *sthp, char *from, char **text) {
|
|||
_DB fh = sthp->fh;
|
||||
datum key, value;
|
||||
static char newfrom[LENGTH];
|
||||
bool found = false;
|
||||
int len;
|
||||
strncpy(newfrom, from, sthp->numlen);
|
||||
newfrom[sthp->numlen] = '\0';
|
||||
|
@ -558,7 +565,7 @@ static int _getAreacode(struct sth *sthp, char *from, char **text) {
|
|||
UL lifrom = (UL) atol(newfrom); /* keys could be long */
|
||||
US ifrom = (US) lifrom;
|
||||
if (sthp->pack_key == 2) {
|
||||
if (lifrom >= 0x10000) { /* can't be, so cut a dig */
|
||||
if (lifrom >= 0x10000) { /* can't be, so cut a dig */
|
||||
newfrom[strlen(newfrom)-1] = '\0';
|
||||
continue;
|
||||
}
|
||||
|
@ -611,16 +618,31 @@ static int checkZone(char *zf, char* df,int num1,int num2, bool verbose)
|
|||
int z, ret=0;
|
||||
char from[10];
|
||||
char to[10];
|
||||
int cc;
|
||||
if (initZone(1, df, &msg)) {
|
||||
fprintf(stderr,"%s\n", msg);
|
||||
exit(1);
|
||||
}
|
||||
cc = sthp[0].cc;
|
||||
if(verbose)
|
||||
printf("%s\n", msg);
|
||||
if (num1 && num2) {
|
||||
char *ort1, *ort2;
|
||||
snprintf(from, 9, "%d",num1);
|
||||
snprintf(to, 9, "%d",num2);
|
||||
ret = getZone(1, from, to);
|
||||
if (cc) {
|
||||
if (getAreacode(cc, from, &ort1) >0 &&
|
||||
getAreacode(cc, to, &ort2) >0) {
|
||||
printf("%s(%s) %s(%s) = %d\n", from, ort1, to, ort2, ret);
|
||||
free(ort1);
|
||||
free(ort2);
|
||||
}
|
||||
else
|
||||
goto no_ort;
|
||||
}
|
||||
else
|
||||
no_ort:
|
||||
printf("%s %s = %d\n", from, to, ret);
|
||||
}
|
||||
else {
|
||||
|
@ -639,7 +661,8 @@ static int checkZone(char *zf, char* df,int num1,int num2, bool verbose)
|
|||
fprintf(stderr,"%d\r",n);
|
||||
fflush(stderr);
|
||||
}
|
||||
fgets(line, 39, fp);
|
||||
if (!fgets(line, 39, fp))
|
||||
break;
|
||||
p=line;
|
||||
q=from;
|
||||
if (!isdigit(*p))
|
||||
|
@ -693,23 +716,89 @@ static int checkArea(char *df, int cc, char *from, int verbose) {
|
|||
exitZone(1);
|
||||
return ret;
|
||||
}
|
||||
static int checkAllArea(char *df, char *cf, int cc, int verbose) {
|
||||
char *msg;
|
||||
int ret=0;
|
||||
FILE *fp;
|
||||
char line[BUFSIZ];
|
||||
char from[20];
|
||||
char *ort;
|
||||
char *p, *q;
|
||||
int i, n, len, olen;
|
||||
int ifrom;
|
||||
|
||||
if (initZone(1, df, &msg)) {
|
||||
fprintf(stderr,"%s\n", msg);
|
||||
exit(1);
|
||||
}
|
||||
if(verbose)
|
||||
printf("%s\n", msg);
|
||||
if ((fp = fopen(cf, "r")) == 0) {
|
||||
fprintf(stderr, "Can't read %s\n", cf);
|
||||
exitZone(1);
|
||||
exit(1);
|
||||
}
|
||||
n=0;
|
||||
while (!feof(fp)) {
|
||||
if (!fgets(line, BUFSIZ, fp))
|
||||
break;
|
||||
line[strlen(line)-1] = '\0';
|
||||
p=line;
|
||||
q=from;
|
||||
if (!isdigit(*p))
|
||||
continue;
|
||||
i=0;
|
||||
while (isdigit(*p) && ++i<9) {
|
||||
*q++ = *p++;
|
||||
}
|
||||
*q = '\0';
|
||||
/* append some randoms */
|
||||
olen = strlen(from);
|
||||
p++;
|
||||
ifrom=atol(from);
|
||||
for (i=0; i< 20; i++) {
|
||||
sprintf(from, "%d%d%d", ifrom, i, rand() % 999999);
|
||||
if((++n % 1000) == 0 && verbose) {
|
||||
fprintf(stderr,"%d\r",n);
|
||||
fflush(stderr);
|
||||
}
|
||||
len = getAreacode(cc, from, &ort);
|
||||
if (olen != len || strcmp(ort, p)) {
|
||||
fprintf(stderr, "Err: %s:%s not %s Len %d\n", from, p, ort, len);
|
||||
free(ort);
|
||||
ret = 1;
|
||||
break;
|
||||
}
|
||||
free(ort);
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
exitZone(1);
|
||||
if (verbose)
|
||||
printf("'%s' verified %s.\n", df, ret==0? "Ok": "NoNo");
|
||||
free(cf);
|
||||
free(df);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
int verbose=false;
|
||||
char *df=0;
|
||||
char *zf=0;
|
||||
char *cf=0;
|
||||
int c;
|
||||
int num1=0, num2=0;
|
||||
int cc=0;
|
||||
char snum1[LENGTH];
|
||||
while ( (c=getopt(argc, argv, "vVd:z:a:")) != EOF) {
|
||||
while ( (c=getopt(argc, argv, "vVd:z:a:c:")) != EOF) {
|
||||
switch (c) {
|
||||
case 'v' : verbose = true; break;
|
||||
case 'V' : printf("%s: V%s\n", basename(argv[0]), version); exit(1);
|
||||
case 'd' : df = strdup(optarg); break;
|
||||
case 'z' : zf = strdup(optarg); break;
|
||||
case 'a' : cc = atoi(optarg); break;
|
||||
case 'c' : cf = strdup(optarg); break;
|
||||
}
|
||||
}
|
||||
while (optind < argc) {
|
||||
|
@ -730,8 +819,11 @@ int main (int argc, char *argv[])
|
|||
return checkZone(zf, df, num1, num2, verbose);
|
||||
if (df && num1 && cc)
|
||||
return checkArea(df, cc, snum1, verbose);
|
||||
if (df && cf && cc)
|
||||
return checkAllArea(df, cf, cc, verbose);
|
||||
fprintf(stderr, "Usage:\n%s -d DBfile -v -V { -z Zonefile | num1 num2 | -a cc num}\n", basename(argv[0]));
|
||||
fprintf(stderr, "\t-d DBfile -v -V num1\n");
|
||||
fprintf(stderr, "\t-d DBfile -v -V -a CC num1 \n");
|
||||
fprintf(stderr, "\t-d DBfile -c Codefile -a CC -v -V\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Makefile for mkzonedb (borrowed from iMON)
|
||||
# Makefile for mkzonedb (parts borrowed from iMON)
|
||||
#
|
||||
# (C) 1999 l.toetsch <lt@toetsch.at>
|
||||
#
|
||||
|
@ -10,6 +10,7 @@ INCLUDES =
|
|||
LDFLAGS = @DBMLIB@
|
||||
DBEXT = @DBEXT@
|
||||
RDBEXT = @RDBEXT@
|
||||
BIGENDIAN = @WORDS_BIGENDIAN@
|
||||
PROGRAM = mkzonedb
|
||||
MODULES = $(PROGRAM).o
|
||||
MANPAGE = $(PROGRAM).8
|
||||
|
@ -18,19 +19,25 @@ MANDIR = @CONFIG_MANDIR@
|
|||
SBINDIR = @CONFIG_SBINDIR@
|
||||
MAN8DIR = $(MANDIR)/man8
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = $(INSTALL) -o 0 -g 0 -m 0750
|
||||
INSTALL_PROGRAM = $(INSTALL) -o 0 -g 0 -m 0750
|
||||
INSTALL_MAN = $(INSTALL) -o 0 -g 0 -m 0644
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
CC = @CC@
|
||||
CC = @CC@
|
||||
ifeq ($(BIGENDIAN), yes)
|
||||
ZONEFILES=zonefiles
|
||||
endif
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o
|
||||
|
||||
.PHONY: all config zonefiles AT DE NL distclean dist test install uninstall
|
||||
|
||||
%.o: %.c Makefile
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
|
||||
|
||||
all: $(PROGRAM) zone
|
||||
# $(ZONEFILES) should propably go to pre-install
|
||||
all: $(PROGRAM) zone $(ZONEFILES)
|
||||
|
||||
config:
|
||||
@./configure
|
||||
|
@ -50,7 +57,7 @@ $(PROGRAM): $(MODULES)
|
|||
$(CC) $(CFLAGS) $? $(LDFLAGS) -o $@
|
||||
|
||||
zone: ../zone.c $(HEADERS) Makefile
|
||||
$(CC) -DSTANDALONE -g ../zone.c $(LDFLAGS) -o $@
|
||||
$(CC) -DSTANDALONE -DZONETEST $(CFLAGS) ../zone.c $(LDFLAGS) -o $@
|
||||
|
||||
install-man: $(PROGRAM).man
|
||||
mkdir -p $(DESTDIR)$(MAN8DIR)
|
||||
|
@ -72,10 +79,11 @@ distclean: clean
|
|||
rm -f config.h config.status config.cache config.log *.man Makefile configure
|
||||
|
||||
test:
|
||||
./$(PROGRAM) -d zone-at-pta$(DBEXT) -r at/pta/zred.pta -c at/code -a43 -v
|
||||
$(BZIP2) -d at/pta/zred.pta.bz2
|
||||
$(BZIP2) -d at/pta/zoneall.pta.bz2
|
||||
./$(PROGRAM) -d zone-at-pta$(DBEXT) -r at/pta/zred.pta -c at/code -a43 -v
|
||||
./zone -d zone-at-pta$(RDBEXT) -z at/pta/zoneall.pta -v
|
||||
./zone -d zone-at-pta$(RDBEXT) -c at/code -v
|
||||
$(BZIP2) -9 at/pta/zred.pta
|
||||
$(BZIP2) -9 at/pta/zoneall.pta
|
||||
|
||||
|
@ -85,21 +93,45 @@ test:
|
|||
#
|
||||
zonefiles: AT DE NL
|
||||
|
||||
AT:
|
||||
./$(PROGRAM) -d ../../zone-at-1012$(DBEXT) -r at/1012/zred-at-1012 -c at/code -v -l4
|
||||
$(BZIP2) -d at/uta/zred.uta.bz2
|
||||
./$(PROGRAM) -d ../../zone-at-uta$(DBEXT) -r at/uta/zred.uta -c at/code -v
|
||||
$(BZIP2) -9 at/uta/zred.uta
|
||||
AT: AT-pta AT-1002 AT-1007 AT-1012 AT-1024 AT-1066
|
||||
.PHONY: AT-pta AT-1002 AT-1007 AT-1012 AT-1024 AT-1066
|
||||
|
||||
AT-pta:
|
||||
$(BZIP2) -d at/pta/zred.pta.bz2
|
||||
./$(PROGRAM) -d ../../zone-at-pta$(DBEXT) -r at/pta/zred.pta -c at/code -a43 -v
|
||||
$(BZIP2) -9 at/pta/zred.pta
|
||||
|
||||
DE:
|
||||
AT-1002:
|
||||
$(BZIP2) -d at/uta/zred.uta.bz2
|
||||
./$(PROGRAM) -d ../../zone-at-uta$(DBEXT) -r at/uta/zred.uta -c at/code -v
|
||||
$(BZIP2) -9 at/uta/zred.uta
|
||||
AT-1007:
|
||||
$(BZIP2) -d at/1007/zred.bz2
|
||||
./$(PROGRAM) -d ../../zone-at-1007$(DBEXT) -r at/1007/zred -c at/code -v
|
||||
$(BZIP2) -9 at/1007/zred
|
||||
AT-1012:
|
||||
./$(PROGRAM) -d ../../zone-at-1012$(DBEXT) -r at/1012/zred-at-1012 -c at/code -v -l4
|
||||
AT-1024:
|
||||
$(BZIP2) -d at/1024/zred.bz2
|
||||
./$(PROGRAM) -d ../../zone-at-1024$(DBEXT) -r at/1024/zred -c at/code -v -l4
|
||||
$(BZIP2) -9 at/1024/zred
|
||||
AT-1066:
|
||||
$(BZIP2) -d at/1066/zred.bz2
|
||||
./$(PROGRAM) -d ../../zone-at-1066$(DBEXT) -r at/1066/zred -c at/code -v
|
||||
$(BZIP2) -9 at/1066/zred
|
||||
|
||||
DE: DE-dtag
|
||||
.PHONY: DE-dtag
|
||||
|
||||
DE-dtag:
|
||||
$(BZIP2) -d de/01033/zred.dtag.bz2
|
||||
./$(PROGRAM) -d ../../zone-de-dtag$(DBEXT) -r de/01033/zred.dtag -c de/code -a49 -v
|
||||
$(BZIP2) -9 de/01033/zred.dtag
|
||||
|
||||
NL:
|
||||
NL: NL-kpn
|
||||
.PHONY: NL-kpn
|
||||
|
||||
NL-kpn:
|
||||
$(BZIP2) -d nl/kpn/zred.bz2
|
||||
./$(PROGRAM) -d ../../zone-nl-kpn$(DBEXT) -r nl/kpn/zred -c nl/code -a31 -v -o3
|
||||
$(BZIP2) -9 nl/kpn/zred
|
||||
|
|
|
@ -7,7 +7,7 @@ erzeugt zoneall.uta
|
|||
# ../../redzone -z zoneall.uta -r zred.uta -n
|
||||
generiert die reduzierte Verzonung
|
||||
|
||||
# ../../mkzonedb -r zred.uta -d ../../../../zone-at-uta.gdbm
|
||||
# ../../mkzonedb -r zred.uta -d ../../../../zone-at-uta.gdbm -c ../code
|
||||
die Datenbank.
|
||||
|
||||
leo
|
||||
leo
|
||||
|
|
|
@ -14,7 +14,9 @@ foreach $a (@a) {
|
|||
$nb = substr($nb,1);
|
||||
if (($bla eq $blb) ||
|
||||
($bla eq 'W' && $blb =~ /^N/) ||
|
||||
($blb eq 'W' && $bla =~ /^N/)) {
|
||||
($blb eq 'W' && $bla =~ /^N/) ||
|
||||
($na =~ /^5/ && $nb =~ /^5/) # Tirol=Vorarlb
|
||||
) {
|
||||
print OUT "$na $nb 1\n";
|
||||
}
|
||||
else {
|
||||
|
@ -23,4 +25,4 @@ foreach $a (@a) {
|
|||
}
|
||||
}
|
||||
close(OUT);
|
||||
system('sort <zoneall.uta.temp|uniq>zoneall.uta && rm zoneall.uta.temp');
|
||||
system('sort <zoneall.uta.temp|uniq>zoneall.uta && rm zoneall.uta.temp');
|
||||
|
|
Binary file not shown.
|
@ -1335,16 +1335,109 @@ cat >> confdefs.h <<EOF
|
|||
EOF
|
||||
|
||||
|
||||
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
|
||||
echo "configure:1340: checking whether byte ordering is bigendian" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
ac_cv_c_bigendian=unknown
|
||||
# See if sys/param.h defines the BYTE_ORDER macro.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1347 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
int main() {
|
||||
|
||||
#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
|
||||
bogus endian macros
|
||||
#endif
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1358: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
# It does; now see whether it defined to BIG_ENDIAN or not.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1362 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
int main() {
|
||||
|
||||
#if BYTE_ORDER != BIG_ENDIAN
|
||||
not big endian
|
||||
#endif
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_c_bigendian=yes
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
ac_cv_c_bigendian=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
fi
|
||||
rm -f conftest*
|
||||
if test $ac_cv_c_bigendian = unknown; then
|
||||
if test "$cross_compiling" = yes; then
|
||||
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1393 "configure"
|
||||
#include "confdefs.h"
|
||||
main () {
|
||||
/* Are we little or big endian? From Harbison&Steele. */
|
||||
union
|
||||
{
|
||||
long l;
|
||||
char c[sizeof (long)];
|
||||
} u;
|
||||
u.l = 1;
|
||||
exit (u.c[sizeof (long) - 1] == 1);
|
||||
}
|
||||
EOF
|
||||
if { (eval echo configure:1406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
|
||||
then
|
||||
ac_cv_c_bigendian=no
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -fr conftest*
|
||||
ac_cv_c_bigendian=yes
|
||||
fi
|
||||
rm -fr conftest*
|
||||
fi
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$ac_t""$ac_cv_c_bigendian" 1>&6
|
||||
if test $ac_cv_c_bigendian = yes; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define WORDS_BIGENDIAN 1
|
||||
EOF
|
||||
|
||||
fi
|
||||
|
||||
if test $ac_cv_c_bigendian = yes; then
|
||||
WORDS_BIGENDIAN=yes
|
||||
fi
|
||||
|
||||
for ac_func in strdup strtoul
|
||||
do
|
||||
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
||||
echo "configure:1343: checking for $ac_func" >&5
|
||||
echo "configure:1436: checking for $ac_func" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1348 "configure"
|
||||
#line 1441 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char $ac_func(); below. */
|
||||
|
@ -1367,7 +1460,7 @@ $ac_func();
|
|||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_$ac_func=yes"
|
||||
else
|
||||
|
@ -1542,6 +1635,7 @@ s%@RDBEXT@%$RDBEXT%g
|
|||
s%@INSTALL@%$INSTALL%g
|
||||
s%@CONFIG_SBINDIR@%$CONFIG_SBINDIR%g
|
||||
s%@CONFIG_MANDIR@%$CONFIG_MANDIR%g
|
||||
s%@WORDS_BIGENDIAN@%$WORDS_BIGENDIAN%g
|
||||
|
||||
CEOF
|
||||
EOF
|
||||
|
|
|
@ -30,6 +30,10 @@ AC_CHECK_SIZEOF(char,1)
|
|||
AC_CHECK_SIZEOF(short,2)
|
||||
AC_CHECK_SIZEOF(long,4)
|
||||
AC_CHECK_SIZEOF(int,4)
|
||||
AC_C_BIGENDIAN
|
||||
if test $ac_cv_c_bigendian = yes; then
|
||||
WORDS_BIGENDIAN=yes
|
||||
fi
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_CHECK_FUNCS(strdup strtoul)
|
||||
|
@ -41,5 +45,5 @@ AC_SUBST(CC)
|
|||
AC_SUBST(INSTALL)
|
||||
AC_SUBST(CONFIG_SBINDIR)
|
||||
AC_SUBST(CONFIG_MANDIR)
|
||||
|
||||
AC_SUBST(WORDS_BIGENDIAN)
|
||||
AC_OUTPUT(Makefile)
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue