Browse Source

Added cmd/ip programs except snoopy

Added json files

Change-Id: I5660f7dbb1539032f0eed2114373806e081aafb5
Elbing 8 years ago
parent
commit
af9cc18bbc
55 changed files with 469 additions and 508 deletions
  1. 2 2
      sys/src/cmd/cmd.json
  2. 2 2
      sys/src/cmd/ip/6in4.c
  3. 14 14
      sys/src/cmd/ip/arp.h
  4. 0 13
      sys/src/cmd/ip/dhcpclient.json
  5. 30 30
      sys/src/cmd/ip/dhcpd/dat.h
  6. 2 2
      sys/src/cmd/ip/dhcpd/dhcpd.c
  7. 14 0
      sys/src/cmd/ip/dhcpd/dhcpd.json
  8. 13 0
      sys/src/cmd/ip/dhcpd/dhcpleases.json
  9. 0 37
      sys/src/cmd/ip/dhcpd/mkfile
  10. 2 2
      sys/src/cmd/ip/ftpd.c
  11. 12 0
      sys/src/cmd/ip/ftpd.json
  12. 4 4
      sys/src/cmd/ip/ftpfs/ftpfs.c
  13. 3 3
      sys/src/cmd/ip/ftpfs/ftpfs.h
  14. 13 0
      sys/src/cmd/ip/ftpfs/ftpfs.json
  15. 0 16
      sys/src/cmd/ip/ftpfs/mkfile
  16. 2 2
      sys/src/cmd/ip/ftpfs/proto.c
  17. 8 8
      sys/src/cmd/ip/gping.c
  18. 23 0
      sys/src/cmd/ip/httpd/httpd.json
  19. 4 4
      sys/src/cmd/ip/httpd/httpsrv.h
  20. 1 1
      sys/src/cmd/ip/httpd/init.c
  21. 19 0
      sys/src/cmd/ip/httpd/libhttps.json
  22. 0 79
      sys/src/cmd/ip/httpd/mkfile
  23. 3 3
      sys/src/cmd/ip/httpd/netlib_history.c
  24. 5 5
      sys/src/cmd/ip/httpfile.c
  25. 2 2
      sys/src/cmd/ip/imap4d/fetch.c
  26. 2 2
      sys/src/cmd/ip/imap4d/fns.h
  27. 2 2
      sys/src/cmd/ip/imap4d/imap4d.c
  28. 12 12
      sys/src/cmd/ip/imap4d/imap4d.h
  29. 26 0
      sys/src/cmd/ip/imap4d/imap4d.json
  30. 2 2
      sys/src/cmd/ip/imap4d/mbox.c
  31. 0 31
      sys/src/cmd/ip/imap4d/mkfile
  32. 2 2
      sys/src/cmd/ip/imap4d/msg.c
  33. 28 1
      sys/src/cmd/ip/ip.json
  34. 2 5
      sys/src/cmd/ip/ipconfig/ipconfig.json
  35. 13 0
      sys/src/cmd/ip/ipconfig/kipconfig.json
  36. 0 37
      sys/src/cmd/ip/ipconfig/mkfile
  37. 2 2
      sys/src/cmd/ip/measure.c
  38. 42 42
      sys/src/cmd/ip/ppp/compress.c
  39. 7 7
      sys/src/cmd/ip/ppp/mppc.c
  40. 16 16
      sys/src/cmd/ip/ppp/ppp.c
  41. 59 59
      sys/src/cmd/ip/ppp/ppp.h
  42. 18 0
      sys/src/cmd/ip/ppp/ppp.json
  43. 2 2
      sys/src/cmd/ip/ppp/thw.c
  44. 1 1
      sys/src/cmd/ip/ppp/thwack.c
  45. 14 14
      sys/src/cmd/ip/ppp/thwack.h
  46. 2 2
      sys/src/cmd/ip/ppp/unthwack.c
  47. 6 6
      sys/src/cmd/ip/pptp.c
  48. 21 21
      sys/src/cmd/ip/pptpd.c
  49. 2 2
      sys/src/cmd/ip/rarpd.c
  50. 1 1
      sys/src/cmd/ip/rip.c
  51. 1 1
      sys/src/cmd/ip/telnetd.c
  52. 1 1
      sys/src/cmd/ip/tftpd.c
  53. 4 4
      sys/src/cmd/ip/traceroute.c
  54. 2 2
      sys/src/cmd/ip/wol.c
  55. 1 2
      sys/src/cmd/kcmds.json

+ 2 - 2
sys/src/cmd/cmd.json

@@ -19,7 +19,6 @@
 		"-static",
 		"-e_main",
 		"-lavl",
-		"-lbin",
 		"-lcomplete",
 		"-lcontrol",
 		"-ldisk",
@@ -28,7 +27,7 @@
 		"-lgeometry",
 		"-lhtml",
 		"-lhttpd",
-		"-lip",
+		"-lbin",
 		"-llex",
 		"-lmemdraw",
 		"-lmemlayer",
@@ -43,6 +42,7 @@
 		"-lauth",
 		"-lauthsrv",
 		"-lndb",
+		"-lip",
 		"-lsec",
 		"-lauth",
 		"-lmp",

+ 2 - 2
sys/src/cmd/ip/6in4.c

@@ -48,8 +48,8 @@ struct Iphdr
 	uint8_t	ttl;		/* Time to live */
 	uint8_t	proto;		/* Protocol */
 	uint8_t	cksum[2];	/* Header checksum */
-	uint8_t	src[4];		/* Ip source (uchar ordering unimportant) */
-	uint8_t	dst[4];		/* Ip destination (uchar ordering unimportant) */
+	uint8_t	src[4];		/* Ip source (uint8_t ordering unimportant) */
+	uint8_t	dst[4];		/* Ip destination (uint8_t ordering unimportant) */
 	uint8_t	payload[];
 };
 

+ 14 - 14
sys/src/cmd/ip/arp.h

@@ -16,26 +16,26 @@ typedef struct Arpstats	Arpstats;
 
 /* Format of ethernet arp request */
 struct Arppkt {
-	uchar	d[6];
-	uchar	s[6];
-	uchar	type[2];
-	uchar	hrd[2];
-	uchar	pro[2];
-	uchar	hln;
-	uchar	pln;
-	uchar	op[2];
-	uchar	sha[6];
-	uchar	spa[4];
-	uchar	tha[6];
-	uchar	tpa[4];
+	uint8_t	d[6];
+	uint8_t	s[6];
+	uint8_t	type[2];
+	uint8_t	hrd[2];
+	uint8_t	pro[2];
+	uint8_t	hln;
+	uint8_t	pln;
+	uint8_t	op[2];
+	uint8_t	sha[6];
+	uint8_t	spa[4];
+	uint8_t	tha[6];
+	uint8_t	tpa[4];
 	};
 
 #define ARPSIZE		42
 
 /* Format of request from starp to user level arpd */
 struct Arpentry {
-	uchar	etaddr[6];
-	uchar	ipaddr[4];
+	uint8_t	etaddr[6];
+	uint8_t	ipaddr[4];
 	};
 
 /* Arp cache statistics */

+ 0 - 13
sys/src/cmd/ip/dhcpclient.json

@@ -1,13 +0,0 @@
-{
-	"Include": [
-		"../kernel.json"
-	],
-	"Name": "dhcpclient",
-	"Post": [
-		"mv dhcpclient $HARVEY/amd64/bin/ip/"
-	],
-	"Program": "dhcpclient",
-	"SourceFiles": [
-		"dhcpclient.c"
-	]
-}

+ 30 - 30
sys/src/cmd/ip/dhcpd/dat.h

@@ -18,17 +18,17 @@ typedef struct Binding Binding;
 struct Binding
 {
 	Binding *next;
-	uchar	ip[IPaddrlen];
+	uint8_t	ip[IPaddrlen];
 
 	char	*boundto;	/* id last bound to */
 	char	*offeredto;	/* id we've offered this to */
 
-	long	lease;		/* absolute time at which binding expires */
-	long	expoffer;	/* absolute time at which offer times out */
-	long	offer;		/* lease offered */
-	long	lasttouched;	/* time this entry last assigned/unassigned */
-	long	lastcomplained;	/* last time we complained about a used but not leased */
-	long	tried;		/* last time we tried this entry */
+	int32_t	lease;		/* absolute time at which binding expires */
+	int32_t	expoffer;	/* absolute time at which offer times out */
+	int32_t	offer;		/* lease offered */
+	int32_t	lasttouched;	/* time this entry last assigned/unassigned */
+	int32_t	lastcomplained;	/* last time we complained about a used but not leased */
+	int32_t	tried;		/* last time we tried this entry */
 
 	Qid	q;		/* qid at the last syncbinding */
 };
@@ -40,15 +40,15 @@ struct Info
 	char	domain[Maxstr];	/* system domain name */
 	char	bootf[Maxstr];		/* boot file */
 	char	bootf2[Maxstr];	/* alternative boot file */
-	uchar	tftp[NDB_IPlen];	/* ip addr of tftp server */
-	uchar	tftp2[NDB_IPlen];	/* ip addr of alternate server */
-	uchar	ipaddr[NDB_IPlen];	/* ip address of system */
-	uchar	ipmask[NDB_IPlen];	/* ip network mask */
-	uchar	ipnet[NDB_IPlen];	/* ip network address (ipaddr & ipmask) */
-	uchar	etheraddr[6];		/* ethernet address */
-	uchar	gwip[NDB_IPlen];	/* gateway ip address */
-	uchar	fsip[NDB_IPlen];	/* file system ip address */
-	uchar	auip[NDB_IPlen];	/* authentication server ip address */
+	uint8_t	tftp[NDB_IPlen];	/* ip addr of tftp server */
+	uint8_t	tftp2[NDB_IPlen];	/* ip addr of alternate server */
+	uint8_t	ipaddr[NDB_IPlen];	/* ip address of system */
+	uint8_t	ipmask[NDB_IPlen];	/* ip network mask */
+	uint8_t	ipnet[NDB_IPlen];	/* ip network address (ipaddr & ipmask) */
+	uint8_t	etheraddr[6];		/* ethernet address */
+	uint8_t	gwip[NDB_IPlen];	/* gateway ip address */
+	uint8_t	fsip[NDB_IPlen];	/* file system ip address */
+	uint8_t	auip[NDB_IPlen];	/* authentication server ip address */
 	char	rootpath[Maxstr];	/* rootfs for diskless nfs clients */
 	char	dhcpgroup[Maxstr];
 	char	vendor[Maxstr];	/* vendor info */
@@ -56,39 +56,39 @@ struct Info
 
 
 /* from dhcp.c */
-extern int	validip(uchar*);
+extern int	validip(uint8_t*);
 extern void	warning(int, char*, ...);
 extern int	minlease;
 
 /* from db.c */
-extern char*	tohex(char*, uchar*, int);
-extern char*	toid(uchar*, int);
-extern void	initbinding(uchar*, int);
-extern Binding*	iptobinding(uchar*, int);
+extern char*	tohex(char*, uint8_t*, int);
+extern char*	toid(uint8_t*, int);
+extern void	initbinding(uint8_t*, int);
+extern Binding*	iptobinding(uint8_t*, int);
 extern Binding*	idtobinding(char*, Info*, int);
 extern Binding*	idtooffer(char*, Info*);
 extern int	commitbinding(Binding*);
 extern int	releasebinding(Binding*, char*);
-extern int	samenet(uchar *ip, Info *iip);
-extern void	mkoffer(Binding*, char*, long);
+extern int	samenet(uint8_t *ip, Info *iip);
+extern void	mkoffer(Binding*, char*, int32_t);
 extern int	syncbinding(Binding*, int);
 
 /* from ndb.c */
 extern int	lookup(Bootp*, Info*, Info*);
-extern int	lookupip(uchar*, Info*, int);
+extern int	lookupip(uint8_t*, Info*, int);
 extern void	lookupname(char*, Ndbtuple*);
-extern Iplifc*	findlifc(uchar*);
-extern int	forme(uchar*);
-extern int	lookupserver(char*, uchar**, Ndbtuple *t);
-extern Ndbtuple* lookupinfo(uchar *ipaddr, char **attr, int n);
+extern Iplifc*	findlifc(uint8_t*);
+extern int	forme(uint8_t*);
+extern int	lookupserver(char*, uint8_t**, Ndbtuple *t);
+extern Ndbtuple* lookupinfo(uint8_t *ipaddr, char **attr, int n);
 
 /* from icmp.c */
-extern int	icmpecho(uchar*);
+extern int	icmpecho(uint8_t*);
 
 extern char	*binddir;
 extern int	debug;
 extern char	*blog;
 extern Ipifc	*ipifcs;
-extern long	now;
+extern int32_t	now;
 extern char	*ndbfile;
 

+ 2 - 2
sys/src/cmd/ip/dhcpd/dhcpd.c

@@ -227,7 +227,7 @@ void
 main(int argc, char **argv)
 {
 	int i, n, fd;
-	uchar ip[IPaddrlen];
+	uint8_t ip[IPaddrlen];
 	Req r;
 
 	setnetmtpt(net, sizeof net, nil);
@@ -1676,7 +1676,7 @@ logdhcpout(Req *rp, char *type)
  *  So dump all but the last message in the queue.
  */
 void
-ding(void*, char *msg)
+ding(void *v, char *msg)
 {
 	if(strstr(msg, "alarm"))
 		noted(NCONT);

+ 14 - 0
sys/src/cmd/ip/dhcpd/dhcpd.json

@@ -0,0 +1,14 @@
+{
+	"Include": [
+		"/sys/src/cmd/cmd.json"
+	],
+	"Install": "/$ARCH/bin/ip",
+	"Name": "dhcpd",
+	"Program": "dhcpd",
+	"SourceFiles": [
+		"dhcpd.c",
+		"db.c",
+		"ndb.c",
+		"ping.c"
+	]
+}

+ 13 - 0
sys/src/cmd/ip/dhcpd/dhcpleases.json

@@ -0,0 +1,13 @@
+{
+	"Include": [
+		"/sys/src/cmd/cmd.json"
+	],
+	"Install": "/$ARCH/bin/ip",
+	"Name": "dhcpleases",
+	"Program": "dhcpleases",
+	"SourceFiles": [
+		"dhcpleases.c",
+		"db.c",
+		"ping.c"
+	]
+}

+ 0 - 37
sys/src/cmd/ip/dhcpd/mkfile

@@ -1,37 +0,0 @@
-</$objtype/mkfile
-
-TARG=dhcpd\
-	dhcpleases\
-
-DOFILES=\
-	dhcpd.$O\
-	db.$O\
-	ndb.$O\
-	ping.$O\
-
-IOFILES=\
-	dhcpleases.$O\
-	db.$O\
-	ping.$O\
-
-HFILES=dat.h ../dhcp.h ../icmp.h
-
-BIN=/$objtype/bin/ip
-
-UPDATE=\
-	mkfile\
-	$HFILES\
-	${DOFILES:%.$O=%.c}\
-	${IOFILES:%.$O=%.c}\
-
-</sys/src/cmd/mkmany
-
-$O.dhcpd: $DOFILES
-	$LD -o $target $DOFILES
-
-$O.dhcpleases: $IOFILES
-	$LD -o $target $IOFILES
-
-$O.testping: testping.$O ping.$O
-	$LD -o $target $prereq
-

+ 2 - 2
sys/src/cmd/ip/ftpd.c

@@ -270,7 +270,7 @@ main(int argc, char **argv)
 		/*
 		 *  get rid of telnet control sequences (we don't need them)
 		 */
-		while(*cmd && (uchar)*cmd == Iac){
+		while(*cmd && (uint8_t)*cmd == Iac){
 			cmd++;
 			if(*cmd)
 				cmd++;
@@ -1027,7 +1027,7 @@ list(char *arg, int lflag)
 	char *alist[Narg];
 	char **argv;
 	Biobufhdr bh;
-	uchar buf[512];
+	uint8_t buf[512];
 	char *p, *s;
 
 	if(arg == 0)

+ 12 - 0
sys/src/cmd/ip/ftpd.json

@@ -0,0 +1,12 @@
+{
+	"Include": [
+		"/sys/src/cmd/cmd.json"
+	],
+	"Install": "/$ARCH/bin/ip",
+	"Name": "ftpd",
+	"Program": "ftpd",
+	"SourceFiles": [
+		"ftpd.c",
+		"glob.c"
+	]
+}

+ 4 - 4
sys/src/cmd/ip/ftpfs/ftpfs.c

@@ -81,7 +81,7 @@ OS oslist[] = {
 	{ MVS,		"MVS", },
 	{ NetWare,	"NetWare", },
 	{ NetWare,	"NETWARE", },
-	{ OS½,		"OS/2", },
+	{ OS2,		"OS/2", },
 	{ TSO,		"TSO", },
 	{ NT,		"Windows_NT", },	/* DOS like interface */
 	{ NT,		"WINDOWS_NT", },	/* Unix like interface */
@@ -311,7 +311,7 @@ rnop(Fid *f)
 }
 
 char*
-rversion(Fid*)
+rversion(Fid *f)
 {
 	if(thdr.msize > sizeof(mdata))
 		rhdr.msize = messagesize;
@@ -326,13 +326,13 @@ rversion(Fid*)
 }
 
 char*
-rflush(Fid*)
+rflush(Fid *f)
 {
 	return 0;
 }
 
 char*
-rauth(Fid*)
+rauth(Fid *f)
 {
 	return "auth unimplemented";
 }

+ 3 - 3
sys/src/cmd/ip/ftpfs/ftpfs.h

@@ -42,7 +42,7 @@ enum
 	VMS=		5,
 	MVS=		6,
 	NetWare=	7,
-	OS½=		8,
+	OS2=		8,
 	TSO=		9,
 	NT=		10,
 	Unknown=	11,
@@ -57,8 +57,8 @@ extern OS oslist[];
 
 /* temporary files */
 void	filefree(Node*);
-int	fileread(Node*, char*, long, int);
-int	filewrite(Node*, char*, long, int);
+int	fileread(Node*, char*, int32_t, int);
+int	filewrite(Node*, char*, int32_t, int);
 void	filedirty(Node*);
 void	fileclean(Node*);
 int	fileisdirty(Node*);

+ 13 - 0
sys/src/cmd/ip/ftpfs/ftpfs.json

@@ -0,0 +1,13 @@
+{
+	"Include": [
+		"/sys/src/cmd/cmd.json"
+	],
+	"Install": "/$ARCH/bin/ip",
+	"Name": "ftpfs",
+	"Program": "ftpfs",
+	"SourceFiles": [
+		"ftpfs.c",
+		"proto.c",
+		"file.c"
+	]
+}

+ 0 - 16
sys/src/cmd/ip/ftpfs/mkfile

@@ -1,16 +0,0 @@
-</$objtype/mkfile
-
-TARG=ftpfs
-HFILES=ftpfs.h
-OFILES=ftpfs.$O\
-	proto.$O\
-	file.$O\
-
-BIN=/$objtype/bin
-
-UPDATE=\
-	mkfile\
-	$HFILES\
-	${OFILES:%.$O=%.c}\
-
-</sys/src/cmd/mkone

+ 2 - 2
sys/src/cmd/ip/ftpfs/proto.c

@@ -541,9 +541,9 @@ crackdir(char *p, String **remname)
 		d.length = 0;
 		d.atime = 0;
 		break;
-	case OS½:
+	case OS2:
 		s = s_copy(field[n-1]);
-		d.uid = "OS½";
+		d.uid = "OS2";
 		d.gid = d.uid;
 		d.mode = 0666;
 		switch(n){

+ 8 - 8
sys/src/cmd/ip/gping.c

@@ -69,15 +69,15 @@ struct Machine
 	int	nproc;
 
 	int	rttmsgs;
-	ulong	rttsum;
-	ulong	lastrtt;
+	uintptr	rttsum;
+	uintptr	lastrtt;
 
 	int	lostmsgs;
 	int	rcvdmsgs;
-	ulong	lostavg;
+	uintptr	lostavg;
 	int	unreachable;
 
-	ushort	seq;
+	uint16_t	seq;
 	Req	*first;
 	Req	*last;
 	Req	*rcvd;
@@ -448,7 +448,7 @@ update1(Graph *g, int32_t v, int32_t vmax, int32_t mark)
 }
 
 void
-pinglost(Machine *m, Req*)
+pinglost(Machine *m, Req *r)
 {
 	m->lostmsgs++;
 }
@@ -466,7 +466,7 @@ pingreply(Machine *m, Req *r)
 
 
 void
-pingclean(Machine *m, uint16_t seq, int64_t now, int)
+pingclean(Machine *m, uint16_t seq, int64_t now, int i)
 {
 	Req **l, *r;
 	int64_t x, y;
@@ -957,7 +957,7 @@ dobutton1(Mouse *m)
 }
 
 void
-mouseproc(void*)
+mouseproc(void *v)
 {
 	Mouse mouse;
 
@@ -996,7 +996,7 @@ void
 main(int argc, char *argv[])
 {
 	int i, j;
-	long v, vmax, mark;
+	int32_t v, vmax, mark;
 	char flags[10], *f, *p;
 
 	fmtinstall('V', eipfmt);

+ 23 - 0
sys/src/cmd/ip/httpd/httpd.json

@@ -0,0 +1,23 @@
+{
+	"Include": [
+		"/sys/src/cmd/cmd.json"
+	],
+	"Projects": [
+		"libhttps.json"
+	],
+	"Install": "/$ARCH/bin/ip",
+	"Name": "httpdcmds",
+	"SourceFilesCmd": [
+		"httpd.c",
+		"imagemap.c",
+		"man2html.c",
+		"save.c",
+		"netlib_find.c",
+		"netlib_history.c",
+		"webls.c",
+		"wikipost.c"
+	],
+	"Oflags": [
+		"libhttps.a"
+	]
+}

+ 4 - 4
sys/src/cmd/ip/httpd/httpsrv.h

@@ -40,13 +40,13 @@ extern	char*		netdir;
 
 /* emem.c */
 char			*estrdup(char*);
-void*			ezalloc(ulong);
+void*			ezalloc(uint32_t);
 
 /* sendfd.c */
 int			authcheck(HConnect *c);
-int			checkreq(HConnect *c, HContent *type, HContent *enc, long mtime, char *etag);
+int			checkreq(HConnect *c, HContent *type, HContent *enc, int32_t mtime, char *etag);
 int			etagmatch(int, HETag*, char*);
-HRange			*fixrange(HRange *h, long length);
+HRange			*fixrange(HRange *h, int32_t length);
 int			sendfd(HConnect *c, int fd, Dir *dir, HContent *type, HContent *enc);
 
 /* content.c */
@@ -67,7 +67,7 @@ void			urlinit(void);
 /* init.c */
 HConnect*		init(int, char**);
 
-vlong			Bfilelen(void*);
+int64_t			Bfilelen(void*);
 
 /* redirect.c */
 void			redirectinit(void);

+ 1 - 1
sys/src/cmd/ip/httpd/init.c

@@ -115,7 +115,7 @@ init(int argc, char **argv)
 	connect.req.uri = argv[2];
 	connect.req.search = argv[3];
 	connect.head.closeit = 1;
-	connect.hpos = (uchar*)strchr((char*)connect.header, '\0');
+	connect.hpos = (uint8_t*)strchr((char*)connect.header, '\0');
 	connect.hstop = connect.hpos;
 	connect.reqtime = time(nil);	/* not quite right, but close enough */
 	return &connect;

+ 19 - 0
sys/src/cmd/ip/httpd/libhttps.json

@@ -0,0 +1,19 @@
+{
+	"Include": [
+		"../../../lib.json"
+	],
+	"Install": "/sys/src/cmd/ip/httpd/",
+	"Library": "libhttps.a",
+	"Name": "libhttps",
+	"SourceFiles": [
+		"anonymous.c",
+		"content.c",
+		"emem.c",
+		"hints.c",
+		"init.c",
+		"log.c",
+		"redirect.c",
+		"sendfd.c",
+		"authorize.c"
+	]
+}

+ 0 - 79
sys/src/cmd/ip/httpd/mkfile

@@ -1,79 +0,0 @@
-</$objtype/mkfile
-
-HFILES=\
-	/sys/include/httpd.h\
-	httpsrv.h\
-
-TARG=\
-	httpd\
-	imagemap\
-	man2html\
-	save\
-	netlib_find\
-	netlib_history\
-	webls\
-	wikipost\
-
-XTARG=\
-	httpd\
-	imagemap\
-	netlib_find\
-	netlib_history\
-	man2html\
-	save\
-	wikipost\
-
-LIB=libhttps.a$O
-
-LIBS=libhttps.a$O
-LIBSOFILES=\
-	anonymous.$O\
-	content.$O\
-	emem.$O\
-	hints.$O\
-	init.$O\
-	log.$O\
-	redirect.$O\
-	sendfd.$O\
-	authorize.$O\
-
-BIN=/$objtype/bin/ip/httpd
-
-UPDATE=\
-	$HFILES\
-	${LIBSOFILES:%.$O=%.c}\
-	${XTARG:%=%.c}\
-
-</sys/src/cmd/mkmany
-
-trial: $O.netlib_history
-	# should first   mount -b /srv/histnetlib /usr/web/historic
-	echo '
-	' | $O.netlib_history GET HTTP/1.0 xxx 'file=fp%2Fdtoa.c.gz'
-
-trial2: $O.netlib_find
-	echo "\n" | $O.netlib_find GET HTTP/1.0 xxx 'db=1&pat=Hearing' > /tmp/search
-	sed 17q /tmp/search
-
-$LIBS:	$LIBSOFILES
-	ar rv $LIBS $newprereq
-	rm $newprereq
-	# rm $newmember - cannot do this because of mk race
-
-
-re:N: v.re
-	v.re redirect.urls
-
-none:VQ:
-	echo usage: mk all, install, installall, '$O'.cmd, cmd.install, or cmd.installall
-	echo usage: mk safeinstall, safeinstallall, cmd.safeinstallall, or cmd.safeinstallall
-
-$O.9down: 9down.$O whois.$O classify.$O $LIB
-	$LD -o $target $prereq
-
-$O.test9down: 9down4e.$O whois.$O classify.$O $LIB
-	$LD -o $target $prereq
-
-$O.testclassify: testclassify.$O whois.$O classify.$O $LIB
-	$LD -o $target $prereq
-

+ 3 - 3
sys/src/cmd/ip/httpd/netlib_history.c

@@ -19,12 +19,12 @@ int diffb;
 enum{ DAY = 24*60*60 };
 
 void
-lastbefore(ulong t, char *f, char *b)
+lastbefore(uint32_t t, char *f, char *b)
 {
 	Tm *tm;
 	Dir *dir;
 	int try;
-	ulong t0, mtime;
+	uint32_t t0, mtime;
 
 	t0 = t;
 	for(try=0; try<10; try++) {
@@ -76,7 +76,7 @@ netlibhistory(char *file)
 	char buf[500], pair[2][500], tmpf[2][30], *f;
 	int toggle = 0, started = 0, limit;
 	Dir *dir;
-	ulong otime, dt;
+	uint32_t otime, dt;
 	int i, fd, tmpcnt;
 
 	if(strncmp(file, "../", 3) == 0 || strstr(file, "/../") ||

+ 5 - 5
sys/src/cmd/ip/httpfile.c

@@ -182,7 +182,7 @@ readfrom(Req *r, Block *b)
 }
 
 void
-hangupclient(Srv*)
+hangupclient(Srv *s)
 {
 	if(debug)
 		print("Hangup.\n");
@@ -309,7 +309,7 @@ getrange(Block *b)
 }
 
 void
-httpfilereadproc(void*)
+httpfilereadproc(void *v)
 {
 	Block *b;
 
@@ -377,7 +377,7 @@ fsstat(Req *r)
 }
 
 static int
-rootgen(int i, Dir *d, void*)
+rootgen(int i, Dir *d, void *v)
 {
 	i += Qroot + 1;
 	if(i <= Qfile){
@@ -483,7 +483,7 @@ fsopen(Req *r)
 }
 
 void
-finishthread(void*)
+finishthread(void *v)
 {
 	Block *b;
 	Req *r, *nextr;
@@ -509,7 +509,7 @@ finishthread(void*)
 }
 
 void
-fsnetproc(void*)
+fsnetproc(void *v)
 {
 	Req *r;
 	Block *b;

+ 2 - 2
sys/src/cmd/ip/imap4d/fetch.c

@@ -61,7 +61,7 @@ breakout:
  *	body[id] === body[id.header] + body[id.text]
 */
 int
-fetchMsg(Box *, Msg *m, int uids, void *vf)
+fetchMsg(Box *b, Msg *m, int uids, void *vf)
 {
 	Tm tm;
 	Fetch *f;
@@ -412,7 +412,7 @@ findMsgSect(Msg *m, NList *sect)
 				break;
 		}
 		/* end of HACK */
-#endif HACK
+#endif
 		for(m = m->kids; m != nil; m = m->next)
 			if(m->id == id)
 				break;

+ 2 - 2
sys/src/cmd/ip/imap4d/fns.h

@@ -18,7 +18,7 @@ int	Bimapaddr(Biobuf *b, MAddr *a);
 int	Bimapdate(Biobuf *b, Tm *tm);
 int	Bimapstr(Biobuf *b, char *s);
 int	Brfc822date(Biobuf *b, Tm *tm);
-int	appendSave(char *mbox, int flags, char *head, Biobuf *b, long n);
+int	appendSave(char *mbox, int flags, char *head, Biobuf *b, int32_t n);
 void	bye(char *fmt, ...);
 int	cdCreate(char *dir, char *file, int mode, uint32_t perm);
 int	cdExists(char *dir, char *file);
@@ -111,7 +111,7 @@ NList	*revNList(NList *s);
 SList	*revSList(SList *s);
 int	rfc822date(char *s, int n, Tm *tm);
 int	searchMsg(Msg *m, Search *s);
-long	selectFields(char *dst, long n, char *hdr, SList *fields, int matches);
+int32_t	selectFields(char *dst, int32_t n, char *hdr, SList *fields, int matches);
 void	sendFlags(Box *box, int uids);
 void	setFlags(Box *box, Msg *m, int f);
 void	setupuser(AuthInfo*);

+ 2 - 2
sys/src/cmd/ip/imap4d/imap4d.c

@@ -1879,7 +1879,7 @@ seqNo(void)
 {
 	if(peekc() == '*'){
 		getc();
-		return ~0UL;
+		return ~0UL&0xFF;
 	}
 	return number(1);
 }
@@ -1889,7 +1889,7 @@ uidNo(void)
 {
 	if(peekc() == '*'){
 		getc();
-		return ~0UL;
+		return ~0UL&0xFF;
 	}
 	return number(0);
 }

+ 12 - 12
sys/src/cmd/ip/imap4d/imap4d.h

@@ -60,9 +60,9 @@ struct Box
 	char	*fs;		/* fs name of mailbox */
 	char	*fsDir;		/* /mail/fs/box->fs */
 	char	*imp;		/* path name of .imp file */
-	uchar	writable;	/* can write back messages? */
-	uchar	dirtyImp;	/* .imp file needs to be written? */
-	uchar	sendFlags;	/* need flags update */
+	uint8_t	writable;	/* can write back messages? */
+	uint8_t	dirtyImp;	/* .imp file needs to be written? */
+	uint8_t	sendFlags;	/* need flags update */
 	Qid	qid;		/* qid of fs mailbox */
 	Qid	impQid;		/* qid of .imp when last synched */
 	long	mtime;		/* file mtime when last read */
@@ -131,10 +131,10 @@ struct Msg
 	Header	head;		/* message header */
 	Header	mime;		/* mime header from enclosing multipart spec */
 	int	flags;
-	uchar	sendFlags;	/* flags value needs to be sent to client */
-	uchar	expunged;	/* message actually expunged, but not yet reported to client */
-	uchar	matched;	/* search succeeded? */
-	uchar	bogus;		/* implies the message is invalid, ie contains nulls; see flags above */
+	uint8_t	sendFlags;	/* flags value needs to be sent to client */
+	uint8_t	expunged;	/* message actually expunged, but not yet reported to client */
+	uint8_t	matched;	/* search succeeded? */
+	uint8_t	bogus;		/* implies the message is invalid, ie contains nulls; see flags above */
 	uint32_t	uid;		/* imap unique identifier */
 	uint32_t	seq;		/* position in box; 1 is oldest */
 	uint32_t	id;		/* number of message directory in upas/fs */
@@ -244,9 +244,9 @@ enum
 
 struct Fetch
 {
-	uchar	op;		/* F.* operator */
-	uchar	part;		/* FP.* subpart for body[] & body.peek[]*/
-	uchar	partial;	/* partial fetch? */
+	uint8_t	op;		/* F.* operator */
+	uint8_t	part;		/* FP.* subpart for body[] & body.peek[]*/
+	uint8_t	partial;	/* partial fetch? */
 	long	start;		/* partial fetch amounts */
 	long	size;
 	NList	*sect;
@@ -278,8 +278,8 @@ enum
 
 struct Store
 {
-	uchar	sign;
-	uchar	op;
+	uint8_t	sign;
+	uint8_t	op;
 	int	flags;
 };
 

+ 26 - 0
sys/src/cmd/ip/imap4d/imap4d.json

@@ -0,0 +1,26 @@
+{
+	"Include": [
+		"/sys/src/cmd/cmd.json"
+	],
+	"Install": "/$ARCH/bin/ip",
+	"Name": "imap4d",
+	"Program": "imap4d",
+	"SourceFiles": [
+		"auth.c",
+		"copy.c",
+		"csquery.c",
+		"date.c",
+		"fetch.c",
+		"imap4d.c",
+		"list.c",
+		"mbox.c",
+		"msg.c",
+		"mutf7.c",
+		"nodes.c",
+		"folder.c",
+		"search.c",
+		"store.c",
+		"utils.c",
+		"debug.c"
+	]
+}

+ 2 - 2
sys/src/cmd/ip/imap4d/mbox.c

@@ -267,8 +267,8 @@ readBox(Box *box)
 			m->fsDir = box->fsDir;
 			m->fs = emalloc(2 * (MsgNameLen + 1));
 			m->efs = seprint(m->fs, m->fs + (MsgNameLen + 1), "%lud/", id);
-			m->size = ~0UL;
-			m->lines = ~0UL;
+			m->size = ~0UL&0xFF;
+			m->lines = ~0UL&0xFF;
 			m->prev = last;
 			m->flags = MRecent;
 			if(!msgInfo(m))

+ 0 - 31
sys/src/cmd/ip/imap4d/mkfile

@@ -1,31 +0,0 @@
-</$objtype/mkfile
-
-OFILES=\
-	auth.$O\
-	copy.$O\
-	csquery.$O\
-	date.$O\
-	fetch.$O\
-	imap4d.$O\
-	list.$O\
-	mbox.$O\
-	msg.$O\
-	mutf7.$O\
-	nodes.$O\
-	folder.$O\
-	search.$O\
-	store.$O\
-	utils.$O\
-	debug.$O\
-
-HFILES=imap4d.h\
-	fns.h\
-
-TARG=imap4d
-BIN=/$objtype/bin/ip
-UPDATE=\
-	mkfile\
-	$HFILES\
-	${OFILES:%.$O=%.c}\
-
-</sys/src/cmd/mkone

+ 2 - 2
sys/src/cmd/ip/imap4d/msg.c

@@ -480,8 +480,8 @@ msgStruct(Msg *m, int top)
 			k->fs = emalloc(ns + 2 * (MsgNameLen + 1));
 			k->efs = seprint(k->fs, k->fs + ns + (MsgNameLen + 1), "%s%lud/", m->fs, id);
 			k->prev = last;
-			k->size = ~0UL;
-			k->lines = ~0UL;
+			k->size = ~0UL&0xFF;
+			k->lines = ~0UL&0xFF;
 			last->next = k;
 			last = k;
 		}

+ 28 - 1
sys/src/cmd/ip/ip.json

@@ -6,6 +6,33 @@
 	"Name": "ipcmds",
 	"SourceFilesCmd": [
 		"ping.c",
-		"dhcpclient.c"
+		"dhcpclient.c",
+		"gping.c",
+		"hogports.c",
+		"httpfile.c",
+		"linklocal.c",
+		"pppoe.c",
+		"pptp.c",
+		"pptpd.c",
+		"rarpd.c",
+		"rexexec.c",
+		"rip.c",
+		"rlogind.c",
+		"telnet.c",
+		"telnetd.c",
+		"tftpd.c",
+		"traceroute.c",
+		"udpecho.c",
+		"wol.c"
+	],
+	"Projects": [
+		"ftpd.json",
+		"dhcpd/dhcpd.json",
+		"dhcpd/dhcpleases.json",
+		"ftpfs/ftpfs.json",
+		"httpd/httpd.json",
+		"imap4d/imap4d.json",
+		"ipconfig/ipconfig.json",
+		"ppp/ppp.json"
 	]
 }

+ 2 - 5
sys/src/cmd/ip/ipconfig/ipconfig.json

@@ -1,12 +1,9 @@
 {
 	"Include": [
-		"../../kernel.json"
+		"../../cmd.json"
 	],
+	"Install": "/$ARCH/bin/ip",
 	"Name": "ipconfig",
-	"Post": [
-		"[ -d $HARVEY/amd64/bin/ip ] || mkdir $HARVEY/amd64/bin/ip",
-		"mv ipconfig $HARVEY/amd64/bin/ip/ipconfig"
-	],
 	"Program": "ipconfig",
 	"SourceFiles": [
 		"ipv6.c",

+ 13 - 0
sys/src/cmd/ip/ipconfig/kipconfig.json

@@ -0,0 +1,13 @@
+{
+	"Include": [
+		"../../kernel.json"
+	],
+	"Install": "/$ARCH/bin/ip",
+	"Name": "ipconfig",
+	"Program": "ipconfig",
+	"SourceFiles": [
+		"ipv6.c",
+		"main.c",
+		"ppp.c"
+	]
+}

+ 0 - 37
sys/src/cmd/ip/ipconfig/mkfile

@@ -1,37 +0,0 @@
-</$objtype/mkfile
-
-TARG=ipconfig\
-
-OFILES=\
-	main.$O\
-	ipv6.$O\
-	ppp.$O\
-
-HFILES=\
-	../dhcp.h\
-	../icmp.h\
-	ipconfig.h\
-	/sys/include/ip.h\
-
-BIN=/$objtype/bin/ip
-
-UPDATE=\
-	mkfile\
-	$HFILES\
-	${OFILES:%.$O=%.c}\
-
-</sys/src/cmd/mkone
-
-safeinstall:V: $O.out
-	if(test -e $BIN/___ipconfig)
-		mv $BIN/___ipconfig $BIN/____ipconfig
-	if(test -e $BIN/__ipconfig)
-		mv $BIN/__ipconfig $BIN/___ipconfig
-	if(test -e $BIN/_ipconfig)
-		mv $BIN/_ipconfig $BIN/__ipconfig
-	mv $BIN/ipconfig $BIN/_ipconfig
-	cp $O.out $BIN/ipconfig
-
-safeinstallall:V:
-	for (objtype in $CPUS)
-		mk safeinstall

+ 2 - 2
sys/src/cmd/ip/measure.c

@@ -103,9 +103,9 @@ main(int argc, char *argv[])
 	int ts, len, t;
 	long start;
 	int delta;
-	uchar target[6];
+	uint8_t target[6];
 	char buf[256];
-	ulong samples;
+	uintptr samples;
 
 	samples = -1;
 	ARGBEGIN{

+ 42 - 42
sys/src/cmd/ip/ppp/compress.c

@@ -16,41 +16,41 @@
 typedef struct Iphdr Iphdr;
 struct Iphdr
 {
-	uchar	vihl;		/* Version and header length */
-	uchar	tos;		/* Type of service */
-	uchar	length[2];	/* packet length */
-	uchar	id[2];		/* Identification */
-	uchar	frag[2];	/* Fragment information */
-	uchar	ttl;		/* Time to live */
-	uchar	proto;		/* Protocol */
-	uchar	cksum[2];	/* Header checksum */
-	uint32_t	src;		/* Ip source (uchar ordering unimportant) */
-	uint32_t	dst;		/* Ip destination (uchar ordering unimportant) */
+	uint8_t	vihl;		/* Version and header length */
+	uint8_t	tos;		/* Type of service */
+	uint8_t	length[2];	/* packet length */
+	uint8_t	id[2];		/* Identification */
+	uint8_t	frag[2];	/* Fragment information */
+	uint8_t	ttl;		/* Time to live */
+	uint8_t	proto;		/* Protocol */
+	uint8_t	cksum[2];	/* Header checksum */
+	uint32_t	src;		/* Ip source (uint8_t ordering unimportant) */
+	uint32_t	dst;		/* Ip destination (uint8_t ordering unimportant) */
 };
 
 typedef struct Tcphdr Tcphdr;
 struct Tcphdr
 {
-	uint32_t	ports;		/* defined as a ulong to make comparisons easier */
-	uchar	seq[4];
-	uchar	ack[4];
-	uchar	flag[2];
-	uchar	win[2];
-	uchar	cksum[2];
-	uchar	urg[2];
+	uint32_t	ports;		/* defined as a uint32_t to make comparisons easier */
+	uint8_t	seq[4];
+	uint8_t	ack[4];
+	uint8_t	flag[2];
+	uint8_t	win[2];
+	uint8_t	cksum[2];
+	uint8_t	urg[2];
 };
 
 typedef struct Ilhdr Ilhdr;
 struct Ilhdr
 {
-	uchar	sum[2];	/* Checksum including header */
-	uchar	len[2];	/* Packet length */
-	uchar	type;		/* Packet type */
-	uchar	spec;		/* Special */
-	uchar	src[2];	/* Src port */
-	uchar	dst[2];	/* Dst port */
-	uchar	id[4];	/* Sequence id */
-	uchar	ack[4];	/* Acked sequence */
+	uint8_t	sum[2];	/* Checksum including header */
+	uint8_t	len[2];	/* Packet length */
+	uint8_t	type;		/* Packet type */
+	uint8_t	spec;		/* Special */
+	uint8_t	src[2];	/* Src port */
+	uint8_t	dst[2];	/* Dst port */
+	uint8_t	id[4];	/* Sequence id */
+	uint8_t	ack[4];	/* Acked sequence */
 };
 
 enum
@@ -72,7 +72,7 @@ enum
 typedef struct Hdr Hdr;
 struct Hdr
 {
-	uchar	buf[128];
+	uint8_t	buf[128];
 	Iphdr	*ip;
 	Tcphdr	*tcp;
 	int	len;
@@ -81,11 +81,11 @@ struct Hdr
 typedef struct Tcpc Tcpc;
 struct Tcpc
 {
-	uchar	lastrecv;
-	uchar	lastxmit;
-	uchar	basexmit;
-	uchar	err;
-	uchar	compressid;
+	uint8_t	lastrecv;
+	uint8_t	lastxmit;
+	uint8_t	basexmit;
+	uint8_t	err;
+	uint8_t	compressid;
 	Hdr	t[MAX_STATES];
 	Hdr	r[MAX_STATES];
 };
@@ -111,7 +111,7 @@ enum
 int
 encode(void *p, uint32_t n)
 {
-	uchar	*cp;
+	uint8_t	*cp;
 
 	cp = p;
 	if(n >= 256 || n == 0) {
@@ -146,11 +146,11 @@ tcpcompress(Tcpc *comp, Block *b, int *protop)
 {
 	Iphdr	*ip;		/* current packet */
 	Tcphdr	*tcp;		/* current pkt */
-	uint32_t 	iplen, tcplen, hlen;	/* header length in uchars */
+	uint32_t 	iplen, tcplen, hlen;	/* header length in uint8_ts */
 	uint32_t 	deltaS, deltaA;	/* general purpose temporaries */
 	uint32_t 	changes;	/* change mask */
-	uchar 	new_seq[16];	/* changes from last to current */
-	uchar 	*cp;
+	uint8_t 	new_seq[16];	/* changes from last to current */
+	uint8_t 	*cp;
 	Hdr	*h;		/* last packet */
 	int 	i, j;
 
@@ -286,10 +286,10 @@ found:
 
 	/*
 	 * We want to use the original packet as our compressed packet. (cp -
-	 * new_seq) is the number of uchars we need for compressed sequence
-	 * numbers. In addition we need one uchar for the change mask, one
+	 * new_seq) is the number of uint8_ts we need for compressed sequence
+	 * numbers. In addition we need one uint8_t for the change mask, one
 	 * for the connection id and two for the tcp checksum. So, (cp -
-	 * new_seq) + 4 uchars of header are needed. hlen is how many uchars
+	 * new_seq) + 4 uint8_ts of header are needed. hlen is how many uint8_ts
 	 * of the original packet to toss so subtract the two to get the new
 	 * packet size. The temporaries are gross -egs.
 	 */
@@ -329,7 +329,7 @@ rescue:
 Block*
 tcpuncompress(Tcpc *comp, Block *b, int type)
 {
-	uchar	*cp, changes;
+	uint8_t	*cp, changes;
 	int	i;
 	int	iplen, len;
 	Iphdr	*ip;
@@ -442,11 +442,11 @@ tcpuncompress(Tcpc *comp, Block *b, int type)
 		hnputs(ip->id, nhgets(ip->id) + 1);
 
 	/*
-	 *  At this point, cp points to the first uchar of data in the packet.
+	 *  At this point, cp points to the first uint8_t of data in the packet.
 	 *  Back up cp by the TCP/IP header length to make room for the
 	 *  reconstructed header.
 	 *  We assume the packet we were handed has enough space to prepend
-	 *  up to 128 uchars of header.
+	 *  up to 128 uint8_ts of header.
 	 */
 	b->rptr = cp;
 	if(b->rptr - b->base < len){
@@ -519,7 +519,7 @@ compress(Tcpc *tcp, Block *b, int *protop)
 }
 
 int
-compress_negotiate(Tcpc *tcp, uchar *data)
+compress_negotiate(Tcpc *tcp, uint8_t *data)
 {
 	if(data[0] != MAX_STATES - 1)
 		return -1;

+ 7 - 7
sys/src/cmd/ip/ppp/mppc.c

@@ -36,7 +36,7 @@ struct Cstate
 	int	count;
 	int	reset;		/* compressor has been reset */
 	int	front;		/* move to begining of history */
-	ulong	sreg;		/* output shift reg */
+	uint32_t	sreg;		/* output shift reg */
 	int	bits;		/* number of bits in sreg */
 	Block	*b; 		/* output block */
 
@@ -46,14 +46,14 @@ struct Cstate
 	Carena	arenas[2];
 	Carena	*hist;
 	Carena	*ohist;
-	ulong	hash[Cnhash];
+	uint32_t	hash[Cnhash];
 	int	h;
-	ulong	me;
-	ulong	split;
+	uint32_t	me;
+	uint32_t	split;
 
 	int	encrypt;
-	uchar	startkey[16];
-	uchar	key[16];
+	uint8_t	startkey[16];
+	uint8_t	key[16];
 	RC4state rc4key;
 };
 
@@ -725,7 +725,7 @@ netlog("*****bad history\n");
 }
 
 static	void
-uncresetack(void*, Block*)
+uncresetack(void *v, Block *b)
 {
 }
 

+ 16 - 16
sys/src/cmd/ip/ppp/ppp.c

@@ -93,7 +93,7 @@ static char *snames[] =
 static	void		authtimer(PPP*);
 static	void		chapinit(PPP*);
 static	void		config(PPP*, Pstate*, int);
-static	uint8_t*		escapeuchar(PPP*, uint32_t, uint8_t*,
+static	uint8_t*		escapeuint8_t(PPP*, uint32_t, uint8_t*,
 						uint16_t*);
 static	void		getchap(PPP*, Block*);
 static	Block*		getframe(PPP*, int*);
@@ -414,7 +414,7 @@ getframe(PPP *ppp, int *protop)
 			return nil;
 		}
 
-		ppp->in.uchars += n;
+		ppp->in.uint8_ts += n;
 		ppp->in.packets++;
 		*protop = proto;
 		netlog("getframe 0x%x\n", proto);
@@ -423,7 +423,7 @@ getframe(PPP *ppp, int *protop)
 
 	buf = ppp->inbuf;
 	for(;;){
-		/* read till we hit a frame uchar or run out of room */
+		/* read till we hit a frame uint8_t or run out of room */
 		for(p = buf->rptr; buf->wptr < buf->lim;){
 			for(; p < buf->wptr; p++)
 				if(*p == HDLC_frame)
@@ -473,7 +473,7 @@ getframe(PPP *ppp, int *protop)
 			if((proto & 0x1) == 0)
 				proto = (proto<<8) | *b->rptr++;
 			if(b->rptr < b->wptr){
-				ppp->in.uchars += n;
+				ppp->in.uint8_ts += n;
 				ppp->in.packets++;
 				*protop = proto;
 				netlog("getframe 0x%x\n", proto);
@@ -590,7 +590,7 @@ putframe(PPP *ppp, int proto, Block *b)
 		qunlock(&ppp->outlock);
 		return -1;
 	}
-	ppp->out.uchars += BLEN(buf);
+	ppp->out.uint8_ts += BLEN(buf);
 
 	qunlock(&ppp->outlock);
 	return 0;
@@ -1674,7 +1674,7 @@ Again:
 				break;
 			ppp->stat.uncompin += len;
 			ppp->stat.uncompout += BLEN(b);
-/* netlog("ppp: uncompressed frame %ux %d %d (%d uchars)\n", proto, b->rptr[0], b->rptr[1], BLEN(b)); /* */
+/* netlog("ppp: uncompressed frame %ux %d %d (%d uint8_ts)\n", proto, b->rptr[0], b->rptr[1], BLEN(b)); */
 			goto Again;	
 		default:
 			syslog(0, LOG, "unknown proto %ux", proto);
@@ -1775,8 +1775,8 @@ struct Iphdr
 	uint8_t	ttl;		/* Time to live */
 	uint8_t	proto;		/* Protocol */
 	uint8_t	cksum[2];	/* Header checksum */
-	uint8_t	src[4];		/* Ip source (uchar ordering unimportant) */
-	uint8_t	dst[4];		/* Ip destination (uchar ordering unimportant) */
+	uint8_t	src[4];		/* Ip source (uint8_t ordering unimportant) */
+	uint8_t	dst[4];		/* Ip destination (uint8_t ordering unimportant) */
 };
 
 static void
@@ -1806,7 +1806,7 @@ ipinproc(PPP *ppp)
 }
 
 static void
-catchdie(void*, char *msg)
+catchdie(void *v, char *msg)
 {
 	if(strstr(msg, "die") != nil)
 		noted(NCONT);
@@ -1882,8 +1882,8 @@ mediainproc(PPP *ppp)
 	netlog(": remote=%I: ppp shutting down\n", ppp->remote);
 	syslog(0, LOG, ": remote=%I: ppp shutting down", ppp->remote);
 	syslog(0, LOG, "\t\tppp send = %lud/%lud recv= %lud/%lud",
-		ppp->out.packets, ppp->out.uchars,
-		ppp->in.packets, ppp->in.uchars);
+		ppp->out.packets, ppp->out.uint8_ts,
+		ppp->in.packets, ppp->in.uint8_ts);
 	syslog(0, LOG, "\t\tip send=%lud", ppp->stat.ipsend);
 	syslog(0, LOG, "\t\tip recv=%lud notup=%lud badsrc=%lud",
 		ppp->stat.iprecv, ppp->stat.iprecvnotup, ppp->stat.iprecvbadsrc);
@@ -1909,12 +1909,12 @@ getlqm(PPP *ppp, Block *b)
 		ppp->in.reports++;
 		ppp->pout.reports = nhgetl(p->peeroutreports);
 		ppp->pout.packets = nhgetl(p->peeroutpackets);
-		ppp->pout.uchars = nhgetl(p->peeroutuchars);
+		ppp->pout.uint8_ts = nhgetl(p->peeroutuint8_ts);
 		ppp->pin.reports = nhgetl(p->peerinreports);
 		ppp->pin.packets = nhgetl(p->peerinpackets);
 		ppp->pin.discards = nhgetl(p->peerindiscards);
 		ppp->pin.errors = nhgetl(p->peerinerrors);
-		ppp->pin.uchars = nhgetl(p->peerinuchars);
+		ppp->pin.uint8_ts = nhgetl(p->peerinuint8_ts);
 
 		/* save our numbers at time of reception */
 		memmove(&ppp->sin, &ppp->in, sizeof(Qualstats));
@@ -1940,19 +1940,19 @@ putlqm(PPP *ppp)
 	/* heresay (what he last told us) */
 	hnputl(p->lastoutreports, ppp->pout.reports);
 	hnputl(p->lastoutpackets, ppp->pout.packets);
-	hnputl(p->lastoutuchars, ppp->pout.uchars);
+	hnputl(p->lastoutuint8_ts, ppp->pout.uint8_ts);
 
 	/* our numbers at time of last reception */
 	hnputl(p->peerinreports, ppp->sin.reports);
 	hnputl(p->peerinpackets, ppp->sin.packets);
 	hnputl(p->peerindiscards, ppp->sin.discards);
 	hnputl(p->peerinerrors, ppp->sin.errors);
-	hnputl(p->peerinuchars, ppp->sin.uchars);
+	hnputl(p->peerinuint8_ts, ppp->sin.uint8_ts);
 
 	/* our numbers now */
 	hnputl(p->peeroutreports, ppp->out.reports+1);
 	hnputl(p->peeroutpackets, ppp->out.packets+1);
-	hnputl(p->peeroutuchars, ppp->out.uchars+53/*hack*/);
+	hnputl(p->peeroutuint8_ts, ppp->out.uint8_ts+53/*hack*/);
 
 	putframe(ppp, Plqm, b);
 	freeb(b);

+ 59 - 59
sys/src/cmd/ip/ppp/ppp.h

@@ -19,7 +19,7 @@ typedef struct Lcpopt Lcpopt;
 typedef struct Qualpkt Qualpkt;
 typedef struct Block Block;
 
-typedef uchar Ipaddr[IPaddrlen];	
+typedef uint8_t Ipaddr[IPaddrlen];	
 
 #pragma incomplete Tcpc
 
@@ -31,11 +31,11 @@ struct Block
 	Block	*next;
 	Block	*flist;
 	Block	*list;			/* chain of block lists */
-	uchar	*rptr;			/* first unconsumed uchar */
-	uchar	*wptr;			/* first empty uchar */
-	uchar	*lim;			/* 1 past the end of the buffer */
-	uchar	*base;			/* start of the buffer */
-	uchar	flags;
+	uint8_t	*rptr;			/* first unconsumed uint8_t */
+	uint8_t	*wptr;			/* first empty uint8_t */
+	uint8_t	*lim;			/* 1 past the end of the buffer */
+	uint8_t	*base;			/* start of the buffer */
+	uint8_t	flags;
 	void	*flow;
 	uint32_t	pc;
 	uint32_t	bsz;
@@ -213,11 +213,11 @@ struct Pstate
 	int	timeout;	/* for current state */
 	int	rxtimeout;	/* for current retransmit */
 	uint32_t	flags;		/* options received */
-	uchar	id;		/* id of current message */
-	uchar	confid;		/* id of current config message */
-	uchar	termid;		/* id of current termination message */
-	uchar	rcvdconfid;	/* id of last conf message received */
-	uchar	state;		/* PPP link state */
+	uint8_t	id;		/* id of current message */
+	uint8_t	confid;		/* id of current config message */
+	uint8_t	termid;		/* id of current termination message */
+	uint8_t	rcvdconfid;	/* id of last conf message received */
+	uint8_t	state;		/* PPP link state */
 	uint32_t	optmask;	/* which options to request */
 	int	echoack;	/* recieved echo ack */
 	int	echotimeout;	/* echo timeout */
@@ -228,7 +228,7 @@ struct Chap
 {
 	int	proto;		/* chap proto */
 	int	state;		/* chap state */
-	uchar	id;		/* id of current message */
+	uint8_t	id;		/* id of current message */
 	int	timeout;	/* for current state */
 	Chalstate *cs;
 };
@@ -237,7 +237,7 @@ struct Qualstats
 {
 	uint32_t	reports;
 	uint32_t	packets;
-	uint32_t	uchars;
+	uint32_t	uint8_ts;
 	uint32_t	discards;
 	uint32_t	errors;
 };
@@ -245,7 +245,7 @@ struct Qualstats
 struct Comptype
 {
 	void*		(*init)(PPP*);
-	Block*		(*compress)(PPP*, ushort, Block*, int*);
+	Block*		(*compress)(PPP*, uint16_t, Block*, int*);
 	Block*		(*resetreq)(void*, Block*);
 	void		(*fini)(void*);
 };
@@ -281,17 +281,17 @@ struct PPP
 	Block*		inbuf;		/* input buffer */
 	Block*		outbuf;		/* output buffer */
 	QLock		outlock;	/*  and its lock */
-	ulong		magic;		/* magic number to detect loop backs */
-	ulong		rctlmap;	/* map of chars to ignore in rcvr */
-	ulong		xctlmap;	/* map of chars to excape in xmit */
+	uint32_t		magic;		/* magic number to detect loop backs */
+	uint32_t		rctlmap;	/* map of chars to ignore in rcvr */
+	uint32_t		xctlmap;	/* map of chars to excape in xmit */
 	int		phase;		/* PPP phase */
 	Pstate*		lcp;		/* lcp state */
 	Pstate*		ccp;		/* ccp state */
 	Pstate*		ipcp;		/* ipcp state */
 	Chap*		chap;		/* chap state */
 	Tcpc*		ctcp;		/* tcp compression state */
-	ulong		mtu;		/* maximum xmit size */
-	ulong		mru;		/* maximum recv size */
+	uint32_t		mtu;		/* maximum xmit size */
+	uint32_t		mru;		/* maximum recv size */
 
 	/* data compression */
 	int		ctries;		/* number of negotiation tries */
@@ -301,7 +301,7 @@ struct PPP
 	void		*uncstate;	/* uncompression state */
 	
 	/* encryption key */
-	uchar		key[16];
+	uint8_t		key[16];
 	int		sendencrypted;
 
 	/* authentication */
@@ -318,21 +318,21 @@ struct PPP
 	Qualstats	sin;	/* saved */
 
 	struct {
-		ulong	ipsend;
-		ulong	iprecv;
-		ulong	iprecvbadsrc;
-		ulong	iprecvnotup;
-		ulong	comp;
-		ulong	compin;
-		ulong	compout;
-		ulong	compreset;
-		ulong	uncomp;
-		ulong	uncompin;
-		ulong	uncompout;
-		ulong	uncompreset;
-		ulong	vjin;
-		ulong	vjout;
-		ulong	vjfail;
+		uint32_t	ipsend;
+		uint32_t	iprecv;
+		uint32_t	iprecvbadsrc;
+		uint32_t	iprecvnotup;
+		uint32_t	comp;
+		uint32_t	compin;
+		uint32_t	compout;
+		uint32_t	compreset;
+		uint32_t	uncomp;
+		uint32_t	uncompin;
+		uint32_t	uncompout;
+		uint32_t	uncompreset;
+		uint32_t	vjin;
+		uint32_t	vjout;
+		uint32_t	vjfail;
 	} stat;
 };
 
@@ -342,46 +342,46 @@ extern void	pppopen(PPP*, int, int, char*, Ipaddr, Ipaddr, int, int);
 
 struct Lcpmsg
 {
-	uchar	code;
-	uchar	id;
-	uchar	len[2];
-	uchar	data[1];
+	uint8_t	code;
+	uint8_t	id;
+	uint8_t	len[2];
+	uint8_t	data[1];
 };
 
 struct Lcpopt
 {
-	uchar	type;
-	uchar	len;
-	uchar	data[1];
+	uint8_t	type;
+	uint8_t	len;
+	uint8_t	data[1];
 };
 
 struct Qualpkt
 {
-	uchar	magic[4];
-
-	uchar	lastoutreports[4];
-	uchar	lastoutpackets[4];
-	uchar	lastoutuchars[4];
-	uchar	peerinreports[4];
-	uchar	peerinpackets[4];
-	uchar	peerindiscards[4];
-	uchar	peerinerrors[4];
-	uchar	peerinuchars[4];
-	uchar	peeroutreports[4];
-	uchar	peeroutpackets[4];
-	uchar	peeroutuchars[4];
+	uint8_t	magic[4];
+
+	uint8_t	lastoutreports[4];
+	uint8_t	lastoutpackets[4];
+	uint8_t	lastoutuint8_ts[4];
+	uint8_t	peerinreports[4];
+	uint8_t	peerinpackets[4];
+	uint8_t	peerindiscards[4];
+	uint8_t	peerinerrors[4];
+	uint8_t	peerinuint8_ts[4];
+	uint8_t	peeroutreports[4];
+	uint8_t	peeroutpackets[4];
+	uint8_t	peeroutuint8_ts[4];
 };
 
 extern Block*	compress(Tcpc*, Block*, int*);
 extern void	compress_error(Tcpc*);
 extern Tcpc*	compress_init(Tcpc*);
-extern int	compress_negotiate(Tcpc*, uchar*);
+extern int	compress_negotiate(Tcpc*, uint8_t*);
 extern Block*	tcpcompress(Tcpc*, Block*, int*);
 extern Block*	tcpuncompress(Tcpc*, Block*, int);
 extern Block*	alloclcp(int, int, int, Lcpmsg**);
-extern ushort	ptclcsum(Block*, int, int);
-extern ushort	ptclbsum(uchar*, int);
-extern ushort	ipcsum(uchar*);
+extern uint16_t	ptclcsum(Block*, int, int);
+extern uint16_t	ptclbsum(uint8_t*, int);
+extern uint16_t	ipcsum(uint8_t*);
 
 extern	Comptype	cmppc;
 extern	Uncomptype	uncmppc;

+ 18 - 0
sys/src/cmd/ip/ppp/ppp.json

@@ -0,0 +1,18 @@
+{
+	"Include": [
+		"../../cmd.json"
+	],
+	"Install": "/$ARCH/bin/ip",
+	"Name": "ppp",
+	"Program": "ppp",
+	"SourceFiles": [
+		"ppp.c",
+		"compress.c",
+		"block.c",
+		"mppc.c",
+		"ipaux.c",
+		"thw.c",
+		"thwack.c",
+		"unthwack.c"
+	]
+}

+ 2 - 2
sys/src/cmd/ip/ppp/thw.c

@@ -73,7 +73,7 @@ Uncomptype uncthwack = {
 };
 
 static void *
-compinit(PPP *)
+compinit(PPP *p)
 {
 	Cstate *cs;
 
@@ -205,7 +205,7 @@ comp(PPP *ppp, uint16_t proto, Block *b, int *protop)
 }
 
 static	void *
-uncinit(PPP *)
+uncinit(PPP *p)
 {
 	Uncstate *s;
 

+ 1 - 1
sys/src/cmd/ip/ppp/thwack.c

@@ -182,7 +182,7 @@ thwmatch(ThwBlock *b, ThwBlock *eblocks, uint8_t **ss, uint8_t *esrc,
  * and might be faster on some machines
  */
 /*
-#define hashit(c)	(((ulong)(c) * 0x6b43a9) >> (24 - HashLog))
+#define hashit(c)	(((uint32_t)(c) * 0x6b43a9) >> (24 - HashLog))
 */
 #define hashit(c)	((((uint32_t)(c) & 0xffffff) * 0x6b43a9b5) >> (32 - HashLog))
 

+ 14 - 14
sys/src/cmd/ip/ppp/thwack.h

@@ -40,12 +40,12 @@ enum
 struct ThwBlock
 {
 	uint32_t	seq;			/* sequence number for this data */
-	uchar	acked;			/* ok to use this block; the decoder has it */
-	ushort	begin;			/* time of first byte in hash */
-	uchar	*edata;			/* last byte of valid data */
-	ushort	maxoff;			/* time of last valid hash entry */
-	ushort	*hash;
-	uchar	*data;
+	uint8_t	acked;			/* ok to use this block; the decoder has it */
+	uint16_t	begin;			/* time of first byte in hash */
+	uint8_t	*edata;			/* last byte of valid data */
+	uint16_t	maxoff;			/* time of last valid hash entry */
+	uint16_t	*hash;
+	uint8_t	*data;
 };
 
 struct Thwack
@@ -53,15 +53,15 @@ struct Thwack
 	QLock		acklock;	/* locks slot, blocks[].(acked|seq) */
 	int		slot;		/* next block to use */
 	ThwBlock	blocks[EWinBlocks];
-	ushort		hash[EWinBlocks][HashSize];
+	uint16_t		hash[EWinBlocks][HashSize];
 	Block		*data[EWinBlocks];
 };
 
 struct UnthwBlock
 {
 	uint32_t	seq;			/* sequence number for this data */
-	ushort	maxoff;			/* valid data in each block */
-	uchar	*data;
+	uint16_t	maxoff;			/* valid data in each block */
+	uint8_t	*data;
 };
 
 struct Unthwack
@@ -69,16 +69,16 @@ struct Unthwack
 	int		slot;		/* next block to use */
 	char		err[ThwErrLen];
 	UnthwBlock	blocks[DWinBlocks];
-	uchar		data[DWinBlocks][ThwMaxBlock];
+	uint8_t		data[DWinBlocks][ThwMaxBlock];
 };
 
 void	thwackinit(Thwack*);
 void	thwackcleanup(Thwack *tw);
 void	unthwackinit(Unthwack*);
-int	thwack(Thwack*, int mustadd, uchar *dst, int ndst, Block *bsrc,
+int	thwack(Thwack*, int mustadd, uint8_t *dst, int ndst, Block *bsrc,
 		  uint32_t seq, uint32_t stats[ThwStats]);
 void	thwackack(Thwack*, uint32_t seq, uint32_t mask);
-int	unthwack(Unthwack*, uchar *dst, int ndst, uchar *src, int nsrc,
+int	unthwack(Unthwack*, uint8_t *dst, int ndst, uint8_t *src, int nsrc,
 		    uint32_t seq);
-uint32_t	unthwackstate(Unthwack *ut, uchar *mask);
-int	unthwackadd(Unthwack *ut, uchar *src, int nsrc, uint32_t seq);
+uint32_t	unthwackstate(Unthwack *ut, uint8_t *mask);
+int	unthwackadd(Unthwack *ut, uint8_t *src, int nsrc, uint32_t seq);

+ 2 - 2
sys/src/cmd/ip/ppp/unthwack.c

@@ -73,7 +73,7 @@ unthwackstate(Unthwack *ut, uint8_t *mask)
 	uint32_t bseq, seq;
 	int slot, m;
 
-	seq = ~0UL;
+	seq = ~0UL&0xFF;
 	m = 0;
 	slot = ut->slot;
 	for(;;){
@@ -127,7 +127,7 @@ unthwackinsert(Unthwack *ut, int len, uint32_t seq)
 	if(ut->slot >= DWinBlocks)
 		ut->slot = 0;
 
-	ut->blocks[ut->slot].seq = ~0UL;
+	ut->blocks[ut->slot].seq = ~0UL&0xFF;
 	ut->blocks[ut->slot].maxoff = 0;
 
 	return tslot;

+ 6 - 6
sys/src/cmd/ip/pptp.c

@@ -196,7 +196,7 @@ sendecho(void)
 }
 
 void
-pptpctlproc(void*)
+pptpctlproc(void *v)
 {
 	uint8_t pkt[1600], *p;
 	int len;
@@ -256,7 +256,7 @@ enum {
 };
 
 void
-grereadproc(void*)
+grereadproc(void *v)
 {
 	int datoff, flags, len, n, pass;
 	uint8_t pkt[1600];
@@ -313,7 +313,7 @@ grereadproc(void*)
 }
 
 void
-pppreadproc(void*)
+pppreadproc(void *v)
 {
 	int n, myrseq;
 	uint8_t pkt[1600];
@@ -406,7 +406,7 @@ schedack(int n, uint8_t *dat, int len)
 }
 
 void
-gretimeoutproc(void*)
+gretimeoutproc(void *v)
 {
 	for(;;){
 		sleep(Tick);
@@ -521,7 +521,7 @@ tcallout(void)
 void
 tcallreq(void)
 {
-	uchar pkt[200], *rpkt;
+	uint8_t pkt[200], *rpkt;
 
 	pid = getpid();
 
@@ -552,7 +552,7 @@ tcallreq(void)
 void
 acallcon(void)
 {
-	uchar pkt[200];
+	uint8_t pkt[200];
 
 	memset(pkt, 0, sizeof pkt);
 	hnputs(pkt+0, 28);

+ 21 - 21
sys/src/cmd/ip/pptpd.c

@@ -161,7 +161,7 @@ double	drop;
 
 void	myfatal(char *fmt, ...);
 
-#define	PSHORT(p, v)		((p)[0]=((v)>>8), (p)[1]=(v))
+#define	PSHORT(p, v)		((p)[0]=(((v)>>8)&0xFF), (p)[1]=((v)&0xFF))
 #define	PLONG(p, v)		(PSHORT(p, (v)>>16), PSHORT(p+2, (v)))
 #define	PSTRING(d,s,n)		strncpy((char*)(d), s, n)
 #define	GSHORT(p)		(((p)[0]<<8) | ((p)[1]<<0))
@@ -342,11 +342,11 @@ serve(void)
 }
 
 int
-sstart(uchar *p, int n)
+sstart(uint8_t *p, int n)
 {
 	int ver, frame, bearer, maxchan, firm;
 	char host[64], vendor[64], *sysname;
-	uchar buf[156];
+	uint8_t buf[156];
 
 	if(n < 156)
 		return 0;
@@ -398,10 +398,10 @@ sstart(uchar *p, int n)
 }
 
 int
-sstop(uchar *p, int n)
+sstop(uint8_t *p, int n)
 {
 	int reason;
-	uchar buf[16];
+	uint8_t buf[16];
 
 	if(n < 16)
 		return 0;
@@ -423,10 +423,10 @@ sstop(uchar *p, int n)
 }
 
 int
-secho(uchar *p, int n)
+secho(uint8_t *p, int n)
 {
 	int id;
-	uchar buf[20];
+	uint8_t buf[20];
 
 	if(n < 16)
 		return 0;
@@ -449,7 +449,7 @@ secho(uchar *p, int n)
 }
 
 int
-scallout(uchar *p, int n)
+scallout(uint8_t *p, int n)
 {
 	int id, serial;
 	int minbps, maxbps, bearer, frame;
@@ -525,11 +525,11 @@ scallcon(uint8_t *p, int n)
 }
 
 int
-scallclear(uchar *p, int n)
+scallclear(uint8_t *p, int n)
 {
 	Call *c;
 	int id;
-	uchar buf[148];
+	uint8_t buf[148];
 
 	if(n < 16)
 		return 0;
@@ -557,7 +557,7 @@ scallclear(uchar *p, int n)
 }
 
 int
-scalldis(uchar *p, int n)
+scalldis(uint8_t *p, int n)
 {
 	Call *c;
 	int id, res;
@@ -578,7 +578,7 @@ scalldis(uchar *p, int n)
 }
 
 int
-swaninfo(uchar *p, int n)
+swaninfo(uint8_t *p, int n)
 {
 	Call *c;
 	int id;
@@ -606,7 +606,7 @@ swaninfo(uchar *p, int n)
 }
 
 int
-slinkinfo(uchar *p, int n)
+slinkinfo(uint8_t *p, int n)
 {
 	Call *c;
 	int id;
@@ -845,12 +845,12 @@ greinit(void)
 }
 
 void
-greread(void *)
+greread(void *v)
 {
-	uchar buf[Pktsize], *p;
+	uint8_t buf[Pktsize], *p;
 	int n, i;
 	int flag, prot, len, callid;
-	uchar src[IPaddrlen], dst[IPaddrlen];
+	uint8_t src[IPaddrlen], dst[IPaddrlen];
 	uint rseq, ack;
 	Call *c;
 	static double t, last;
@@ -979,7 +979,7 @@ srv.remote, realtime(), c->id, rseq, len EDB
 void
 greack(Call *c)
 {
-	uchar buf[20];
+	uint8_t buf[20];
 
 	c->stat.sendack++;
 
@@ -1022,9 +1022,9 @@ void
 pppread(void *a)
 {
 	Call *c;
-	uchar buf[2000], *p;
+	uint8_t buf[2000], *p;
 	int n;
-	ulong tick;
+	uintptr tick;
 
 	c = a;
 	for(;;) {
@@ -1081,7 +1081,7 @@ SDB "%I: %.3f: gre %d: send s=%ux a=%ux len=%d\n", srv.remote, realtime(),
 }
 
 void
-timeoutthread(void*)
+timeoutthread(void *v)
 {
 	for(;;) {
 		sleep(30*1000);
@@ -1100,7 +1100,7 @@ myfatal(char *fmt, ...)
 {
 	char sbuf[512];
 	va_list arg;
-	uchar buf[16];
+	uint8_t buf[16];
 
 	/* NT don't seem to like us just going away */
 	memset(buf, 0, sizeof(buf));

+ 2 - 2
sys/src/cmd/ip/rarpd.c

@@ -61,7 +61,7 @@ void
 main(int argc, char *argv[])
 {
 	int edata, ectl;
-	uchar buf[2048];
+	uint8_t buf[2048];
 	long n;
 	Rarp *rp;
 	char ebuf[16];
@@ -95,7 +95,7 @@ main(int argc, char *argv[])
 		setnetmtpt(net, sizeof(net), p);
 		break;
 	}ARGEND
-	USED(argc, argv);
+	USED(argc); USED(argv);
 
 	fmtinstall('E', eipfmt);
 	fmtinstall('I', eipfmt);

+ 1 - 1
sys/src/cmd/ip/rip.c

@@ -214,7 +214,7 @@ main(int argc, char *argv[])
 	long diff;
 	char *p;
 	char buf[2*1024];
-	uchar raddr[Pasize];
+	uint8_t raddr[Pasize];
 	Bnet *bn, **l;
 	Udphdr *up;
 	Rip *r;

+ 1 - 1
sys/src/cmd/ip/telnetd.c

@@ -52,7 +52,7 @@ int	xlocchange(Biobuf*, int);
 int	xlocsub(Biobuf*, uint8_t*, int);
 int	challuser(char*);
 int	noworldlogin(char*);
-void*	share(ulong);
+void*	share(uint32_t);
 int	doauth(char*);
 
 #define TELNETLOG "telnet"

+ 1 - 1
sys/src/cmd/ip/tftpd.c

@@ -86,7 +86,7 @@ static Opt option[] = {
 	"timeout",	&timeout,	1,	255,
 	/* see "hack" below */
 	"blksize",	&blksize,	8,	Maxsegsize,
-	"tsize",	&tsize,		0,	~0UL >> 1,
+	"tsize",	&tsize,		0,	(~0UL >> 1)&0xFF,
 };
 
 void	sendfile(int, char*, char*, int);

+ 4 - 4
sys/src/cmd/ip/traceroute.c

@@ -188,7 +188,7 @@ udpprobe(int cfd, int dfd, char *dest, int interval)
 }
 
 #define MSG "traceroute probe"
-#define MAGIC 0xdead
+#define MAGIC (0xdead)&0xFF
 
 /* ICMPv4 only */
 static int
@@ -343,8 +343,8 @@ void
 main(int argc, char **argv)
 {
 	int buckets, ttl, j, done, tries, notranslate;
-	long lo, hi, sum, x;
-	long *t;
+	uintptr lo, hi, sum, x;
+	int32_t *t;
 	char *net, *p;
 	char clone[Maxpath], dest[Maxstring], hop[Maxstring], dom[Maxstring];
 	char err[Maxstring];
@@ -381,7 +381,7 @@ main(int argc, char **argv)
 	if(argc < 1)
 		usage();
 
-	t = malloc(tries*sizeof(ulong));
+	t = malloc(tries*sizeof(uintptr));
 
 	dial_string_parse(argv[0], &ds);
 

+ 2 - 2
sys/src/cmd/ip/wol.c

@@ -59,9 +59,9 @@ main(int argc, char* argv[])
 {
 	int fd, nw;
 	char *argmac, *pass, *address;
-	uchar mac[Eaddrlen];
+	uint8_t mac[Eaddrlen];
 	static Wolpack w = {
-		.magic { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, }
+		.magic = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, }
 	};
 
 	address = pass = nil;

+ 1 - 2
sys/src/cmd/kcmds.json

@@ -14,8 +14,7 @@
 	],
 	"Projects": [
 		"/sys/src/cmd/rc/rc.json",
-		"/sys/src/cmd/ip/ipconfig/ipconfig.json",
-		"/sys/src/cmd/ip/dhcpclient.json"
+		"/sys/src/cmd/ip/ipconfig/kipconfig.json"
 	],
 	"SourceFilesCmd": [
 		"bind.c",