summaryrefslogtreecommitdiffstats
path: root/tools/2isdndb.pm
blob: 53680870662ec4f312da8fb8596d211c338f1e84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
open F, "isdndb.txt" or die "file $file not found";
open G, ">tutu" or die "file $file not found";
foreach (<F>) {
    s/\#.*//;
#    s/\[City\]\s+National//;
    /\[Country\]\s*(.*)/ and $country = $1;
    /\[City\]\s*(.*)/ and $city = $1;
    /\[Name\]\s*(.*)/ and $name = $1;
    /\[Prefix\]\s*(.*)/ and $prefix = $1;
    /\[ISDN\]\s*(.*)/ and $isdn = $1;
    /\[Encaps\]\s*.*/ and  do { defined $dns1 and $dns2=""; };
    /\[Domain\]\s*(.*)/ and $domain = $1;
    /\[DNS\]\s*(.*)/ and ($dns1 ? $dns2 : $dns1) = $1;
    /\[End\]\s*(.*)/ and do { 	undef $name; undef $prefix; undef $isdn; undef $domain; undef $dns1; undef $dns2; };
    if ($isdn && !$prefix) { $prefix = "" }
    if (defined $name && defined $isdn && defined $domain && defined $dns1 && defined $dns2) {
	print G join("|", $country, $city, join("=>", $name, $prefix . $isdn, $domain, $dns1, $dns2)), "\n";
	undef $name;
	undef $prefix;
	undef $isdn;
	undef $domain;
	undef $dns1;
	undef $dns2;
    }
}
'>- struct vdstat *vds;
-{
- int n, error;
-
- switch (fun) {
- case VDLOAD:
- vdp->vdd_vdtab = (struct vdlinkage *) &vd;
- if (fmodsw_index >= 0)
- return EBUSY;
- for (n = 0; n < fmodcnt; ++n)
- if (fmodsw[n].f_str == 0)
- break;
- if (n >= fmodcnt)
- return ENODEV;
- strncpy(fmodsw[n].f_name, vd.Drv_name, FMNAMESZ+1);
- fmodsw[n].f_str = &if_pppinfo;
- fmodsw_index = n;
- break;
-
- case VDUNLOAD:
- if (fmodsw_index <= 0)
- return EINVAL;
- error = if_ppp_unload();
- if (error != 0)
- return error;
- fmodsw[fmodsw_index].f_name[0] = 0;
- fmodsw[fmodsw_index].f_str = 0;
- fmodsw_index = -1;
- break;
-
- case VDSTAT:
- break;
-
- default:
- return EIO;
- }
- return 0;
-}