aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/ndb
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-04-01 15:35:09 +0000
committerrsc <devnull@localhost>2006-04-01 15:35:09 +0000
commit226d80b8213821af0cbf092d1507c52b504fd368 (patch)
tree4254cb40557a10595ddc00c136817921ba837448 /src/cmd/ndb
parent3d038c325b6c5ac906092c81d282afa5bfefabc6 (diff)
downloadplan9port-226d80b8213821af0cbf092d1507c52b504fd368.tar.gz
plan9port-226d80b8213821af0cbf092d1507c52b504fd368.tar.bz2
plan9port-226d80b8213821af0cbf092d1507c52b504fd368.zip
c90 fixes
Diffstat (limited to 'src/cmd/ndb')
-rwxr-xr-xsrc/cmd/ndb/convDNS2M.c2
-rwxr-xr-xsrc/cmd/ndb/dblookup.c25
-rwxr-xr-xsrc/cmd/ndb/dn.c130
-rwxr-xr-xsrc/cmd/ndb/dnresolve.c2
-rwxr-xr-xsrc/cmd/ndb/dns.c8
-rwxr-xr-xsrc/cmd/ndb/dns.h5
-rwxr-xr-xsrc/cmd/ndb/dnsdebug.c2
-rwxr-xr-xsrc/cmd/ndb/dnstcp.c2
-rw-r--r--src/cmd/ndb/dntcpserver.c2
-rw-r--r--src/cmd/ndb/ndbmkdb.c2
-rw-r--r--src/cmd/ndb/ndbmkhosts.c4
11 files changed, 118 insertions, 66 deletions
diff --git a/src/cmd/ndb/convDNS2M.c b/src/cmd/ndb/convDNS2M.c
index 5ee6cadb..60fd9402 100755
--- a/src/cmd/ndb/convDNS2M.c
+++ b/src/cmd/ndb/convDNS2M.c
@@ -10,7 +10,7 @@
*/
enum
{
- Ndict= 64,
+ Ndict= 64
};
typedef struct Dict Dict;
struct Dict
diff --git a/src/cmd/ndb/dblookup.c b/src/cmd/ndb/dblookup.c
index fd0eb207..7da4db54 100755
--- a/src/cmd/ndb/dblookup.c
+++ b/src/cmd/ndb/dblookup.c
@@ -23,14 +23,23 @@ static void createptrs(void);
static int implemented[Tall] =
{
- [Ta] 1,
- [Tns] 1,
- [Tsoa] 1,
- [Tmx] 1,
- [Tptr] 1,
- [Tcname] 1,
- [Tnull] 1,
- [Ttxt] 1,
+ 0,
+ /* Ta */ 1,
+ /* Tns */ 1,
+ 0,
+ 0,
+ /* Tcname */ 1,
+ /* Tsoa */ 1,
+ 0,
+ 0,
+ 0,
+ /* Tnull */ 1,
+ 0,
+ /* Tptr */ 1,
+ 0,
+ 0,
+ /* Tmx */ 1,
+ /* Ttxt */ 1
};
static void
diff --git a/src/cmd/ndb/dn.c b/src/cmd/ndb/dn.c
index d1bfcaed..8052d582 100755
--- a/src/cmd/ndb/dn.c
+++ b/src/cmd/ndb/dn.c
@@ -25,52 +25,94 @@ static struct
} dnvars;
/* names of RR types */
-char *rrtname[] =
+char *rrtname[Tall+2] =
{
-[Ta] "ip",
-[Tns] "ns",
-[Tmd] "md",
-[Tmf] "mf",
-[Tcname] "cname",
-[Tsoa] "soa",
-[Tmb] "mb",
-[Tmg] "mg",
-[Tmr] "mr",
-[Tnull] "null",
-[Twks] "wks",
-[Tptr] "ptr",
-[Thinfo] "hinfo",
-[Tminfo] "minfo",
-[Tmx] "mx",
-[Ttxt] "txt",
-[Trp] "rp",
-[Tkey] "key",
-[Tcert] "cert",
-[Tsig] "sig",
-[Taaaa] "ipv6",
-[Tixfr] "ixfr",
-[Taxfr] "axfr",
-[Tall] "all",
- 0,
+ nil,
+ "ip",
+ "ns",
+ "md",
+ "mf",
+ "cname",
+ "soa",
+ "mb",
+ "mg",
+ "mr",
+ "null",
+ "wks",
+ "ptr",
+ "hinfo",
+ "minfo",
+ "mx",
+ "txt",
+ "rp",
+ nil,
+ nil,
+ nil,
+ nil,
+ nil,
+ nil,
+ "sig",
+ "key",
+ nil,
+ nil,
+ "aaaa",
+ nil,
+ nil,
+ nil,
+ nil,
+ nil,
+ nil,
+ nil,
+ nil,
+ "cert",
+ nil,
+ nil,
+
+/* 40 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 48 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 56 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 64 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 72 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 80 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 88 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 96 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 104 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 112 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 120 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 128 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 136 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 144 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 152 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 160 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 168 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 176 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 184 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 192 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 200 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 208 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 216 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 224 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 232 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 240 */ nil, nil, nil, nil, nil, nil, nil, nil,
+/* 248 */ nil, nil, nil,
+
+ "ixfr",
+ "axfr",
+ "mailb",
+ nil,
+ "all",
+ nil
};
/* names of response codes */
char *rname[Rmask+1] =
{
-[Rok] "ok",
-[Rformat] "format error",
-[Rserver] "server failure",
-[Rname] "bad name",
-[Runimplimented] "unimplemented",
-[Rrefused] "we don't like you",
-};
-
-/* names of op codes */
-char *opname[] =
-{
-[Oquery] "query",
-[Oinverse] "inverse",
-[Ostatus] "status",
+ "ok",
+ "format error",
+ "server failure",
+ "bad name",
+ "unimplemented",
+ "we don't like you",
};
Lock dnlock;
@@ -845,7 +887,7 @@ rrtype(char *atype)
if(rrtname[i] && strcmp(rrtname[i], atype) == 0)
return i;
- // make any a synonym for all
+ /* make any a synonym for all */
if(strcmp(atype, "any") == 0)
return Tall;
return atoi(atype);
@@ -1012,7 +1054,7 @@ rrfmt(Fmt *f)
fmtprint(&fstr, "\t%s", rp->ip->name);
break;
case Tptr:
-// fmtprint(&fstr, "\t%s(%lud)", rp->ptr->name, rp->ptr->ordinal);
+/* fmtprint(&fstr, "\t%s(%lud)", rp->ptr->name, rp->ptr->ordinal); */
fmtprint(&fstr, "\t%s", rp->ptr->name);
break;
case Tsoa:
@@ -1325,7 +1367,7 @@ sencodefmt(Fmt *f)
int ilen;
int rv;
uchar *b;
- char obuf[64]; // rsc optimization
+ char obuf[64]; /* rsc optimization */
if(!(f->flags&FmtPrec) || f->prec < 1)
goto error;
@@ -1372,7 +1414,7 @@ sencodefmt(Fmt *f)
} else
buf = obuf;
- // convert
+ /* convert */
out = buf;
switch(f->r){
case '<':
diff --git a/src/cmd/ndb/dnresolve.c b/src/cmd/ndb/dnresolve.c
index cc6aec3d..b20f325a 100755
--- a/src/cmd/ndb/dnresolve.c
+++ b/src/cmd/ndb/dnresolve.c
@@ -8,7 +8,7 @@
enum
{
Maxdest= 24, /* maximum destinations for a request message */
- Maxtrans= 3, /* maximum transmissions to a server */
+ Maxtrans= 3 /* maximum transmissions to a server */
};
static int netquery(DN*, int, RR*, Request*, int);
diff --git a/src/cmd/ndb/dns.c b/src/cmd/ndb/dns.c
index c60a574d..a7b6fd3b 100755
--- a/src/cmd/ndb/dns.c
+++ b/src/cmd/ndb/dns.c
@@ -19,7 +19,7 @@ enum
Maxfdata= 8192,
Qdir= 0,
- Qdns= 1,
+ Qdns= 1
};
typedef struct Mfile Mfile;
@@ -43,9 +43,9 @@ struct Mfile
ushort nrr; /* number of rr's */
};
-//
-// active local requests
-//
+/*
+ * active local requests
+ */
struct Job
{
Job *next;
diff --git a/src/cmd/ndb/dns.h b/src/cmd/ndb/dns.h
index 5af7a1c4..9825f0bd 100755
--- a/src/cmd/ndb/dns.h
+++ b/src/cmd/ndb/dns.h
@@ -90,7 +90,7 @@ enum
#define DNmagic 0xa110a110
/* parallelism */
- Maxactive= 32,
+ Maxactive= 32
};
typedef struct DN DN;
@@ -283,7 +283,7 @@ enum
Recurse,
Dontrecurse,
NOneg,
- OKneg,
+ OKneg
};
enum
@@ -294,7 +294,6 @@ enum
/* dn.c */
extern char *rrtname[];
extern char *rname[];
-extern char *opname[];
extern void db2cache(int);
extern void dninit(void);
extern DN* dnlookup(char*, int, int);
diff --git a/src/cmd/ndb/dnsdebug.c b/src/cmd/ndb/dnsdebug.c
index 82109c18..0818b85f 100755
--- a/src/cmd/ndb/dnsdebug.c
+++ b/src/cmd/ndb/dnsdebug.c
@@ -13,7 +13,7 @@ enum
Ncache= 8,
Maxpath= 128,
Maxreply= 512,
- Maxrrr= 16,
+ Maxrrr= 16
};
static char *servername;
diff --git a/src/cmd/ndb/dnstcp.c b/src/cmd/ndb/dnstcp.c
index 75beda8b..3d4d1e90 100755
--- a/src/cmd/ndb/dnstcp.c
+++ b/src/cmd/ndb/dnstcp.c
@@ -8,7 +8,7 @@
enum
{
- Maxpath= 128,
+ Maxpath= 128
};
char *logfile = "dns";
diff --git a/src/cmd/ndb/dntcpserver.c b/src/cmd/ndb/dntcpserver.c
index 017ab764..13161548 100644
--- a/src/cmd/ndb/dntcpserver.c
+++ b/src/cmd/ndb/dntcpserver.c
@@ -262,7 +262,7 @@ tcpproc(void *v)
}
enum {
- Maxactivetcp = 4,
+ Maxactivetcp = 4
};
static int
diff --git a/src/cmd/ndb/ndbmkdb.c b/src/cmd/ndb/ndbmkdb.c
index 7796aace..de0aa465 100644
--- a/src/cmd/ndb/ndbmkdb.c
+++ b/src/cmd/ndb/ndbmkdb.c
@@ -12,7 +12,7 @@ enum
Sys,
Dk,
Ip,
- Domain,
+ Domain
};
int
diff --git a/src/cmd/ndb/ndbmkhosts.c b/src/cmd/ndb/ndbmkhosts.c
index 46f9f978..2fc3d7f7 100644
--- a/src/cmd/ndb/ndbmkhosts.c
+++ b/src/cmd/ndb/ndbmkhosts.c
@@ -186,7 +186,8 @@ main(int argc, char *argv[])
parse(unsharp("#9/ndb/local"));
parse(unsharp("#9/ndb/friends"));
}
-
+
+/*
// sprint(fn, "/lib/ndb/hosts.%-.21s", domname);
// fd = create(fn, OWRITE, 0664);
// if(fd < 0){
@@ -197,6 +198,7 @@ main(int argc, char *argv[])
// printentry(fd, &x[i]);
// close(fd);
//
+*/
sprint(fn, "/lib/ndb/db.%-.24s", domname);
fd = create(fn, OWRITE, 0664);