aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/ip
diff options
context:
space:
mode:
authorDan Cross <cross@gajendra.net>2020-01-10 14:44:21 +0000
committerDan Cross <cross@gajendra.net>2020-01-10 14:54:30 +0000
commitfa325e9b42b0bdfb48857d1958d9fb7ceac55151 (patch)
tree81d26256d152435135bcb1ae43121979a49f5f2b /src/cmd/ip
parent77a0a5b5194d4441c86de097f2aae297cb75e2c2 (diff)
downloadplan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.tar.gz
plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.tar.bz2
plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.zip
Trivial changes: whitespace and modes.
Remote whitespace at the ends of lines. Remove blank lines from the ends of files. Change modes on source files so that they are not executable. Signed-off-by: Dan Cross <cross@gajendra.net>
Diffstat (limited to 'src/cmd/ip')
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/dhcp.h4
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/dhcpd/dat.h1
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/dhcpd/db.c4
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/dhcpd/dhcpd.c8
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/dhcpd/dhcpleases.c2
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/dhcpd/ndb.c2
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/dhcpd/ping.c0
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/dhcpd/testlook.c2
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/dhcpd/testlookup.c0
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/dhcpd/testping.c0
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/arp.c2
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/bootp.c2
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/dat.h2
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/dhcp.c5
-rw-r--r--src/cmd/ip/snoopy/dns.c12
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/dump.c2
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/ether.c2
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/gre.c4
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/hdlc.c0
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/icmp.c2
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/icmp6.c20
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/il.c8
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/ip.c2
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/ip6.c8
-rw-r--r--src/cmd/ip/snoopy/llc.c10
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/main.c24
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/ninep.c0
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/ospf.c12
-rw-r--r--src/cmd/ip/snoopy/p80211.c22
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/ppp.c24
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/ppp_ccp.c0
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/ppp_chap.c0
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/ppp_comp.c0
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/ppp_ipcp.c0
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/ppp_lcp.c0
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/pppoe_disc.c3
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/pppoe_sess.c0
-rw-r--r--src/cmd/ip/snoopy/radiotap.c2
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/rarp.c0
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/rtcp.c4
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/rtp.c0
-rw-r--r--src/cmd/ip/snoopy/snap.c4
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/tcp.c2
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/udp.c2
44 files changed, 100 insertions, 103 deletions
diff --git a/src/cmd/ip/dhcp.h b/src/cmd/ip/dhcp.h
index 0ca5084f..d07a2e8a 100755..100644
--- a/src/cmd/ip/dhcp.h
+++ b/src/cmd/ip/dhcp.h
@@ -74,7 +74,7 @@ enum
OBtcpka= 38,
OBtcpkag= 39,
OBnisdomain= 40,
- OBniserver= 41,
+ OBniserver= 41,
OBntpserver= 42,
OBvendorinfo= 43, /* 0x2b */
OBnetbiosns= 44,
@@ -127,7 +127,7 @@ enum {
Sbound,
Srenewing,
Srebinding
-};
+};
typedef struct Bootp Bootp;
struct Bootp
diff --git a/src/cmd/ip/dhcpd/dat.h b/src/cmd/ip/dhcpd/dat.h
index aa64deeb..c69f9f38 100755..100644
--- a/src/cmd/ip/dhcpd/dat.h
+++ b/src/cmd/ip/dhcpd/dat.h
@@ -82,4 +82,3 @@ extern char *blog;
extern Ipifc *ipifcs;
extern long now;
extern char *ndbfile;
-
diff --git a/src/cmd/ip/dhcpd/db.c b/src/cmd/ip/dhcpd/db.c
index f4b48552..cf245efe 100755..100644
--- a/src/cmd/ip/dhcpd/db.c
+++ b/src/cmd/ip/dhcpd/db.c
@@ -405,7 +405,7 @@ commitbinding(Binding *b)
}
setbinding(b, b->offeredto, now + b->offer);
b->lasttouched = now;
-
+
if(writebinding(fd, b) < 0){
close(fd);
return -1;
@@ -434,7 +434,7 @@ releasebinding(Binding *b, char *id)
}
b->lease = 0;
b->expoffer = 0;
-
+
if(writebinding(fd, b) < 0){
close(fd);
return -1;
diff --git a/src/cmd/ip/dhcpd/dhcpd.c b/src/cmd/ip/dhcpd/dhcpd.c
index e28bf3cb..c5fb06bf 100755..100644
--- a/src/cmd/ip/dhcpd/dhcpd.c
+++ b/src/cmd/ip/dhcpd/dhcpd.c
@@ -67,7 +67,7 @@ int pptponly; /* only answer request that came from the pptp server */
int mute;
int minlease = MinLease;
-ulong start;
+ulong start;
/* option magic */
char plan9opt[4] = { 'p', '9', ' ', ' ' };
@@ -502,7 +502,7 @@ rcvrequest(Req *rp)
sendnak(rp, "no offer for you");
return;
}
-
+
/* if not for me, retract offer */
if(!forme(rp->server)){
b->expoffer = 0;
@@ -1040,7 +1040,7 @@ parseoptions(Req *rp)
p += n;
if(p > rp->e)
return;
-
+
switch(code){
case ODipaddr: /* requested ip address */
if(n == IPv4addrlen)
@@ -1506,7 +1506,7 @@ arpenter(uchar *ip, uchar *ether)
{
int pid;
char xip[100], xether[100];
-
+
switch(pid=fork()){
case -1:
break;
diff --git a/src/cmd/ip/dhcpd/dhcpleases.c b/src/cmd/ip/dhcpd/dhcpleases.c
index 71719649..a99b9218 100755..100644
--- a/src/cmd/ip/dhcpd/dhcpleases.c
+++ b/src/cmd/ip/dhcpd/dhcpleases.c
@@ -39,5 +39,5 @@ main(void)
continue;
if(b.lease > now)
print("%I leased by %s until %s", b.ip, b.boundto, ctime(b.lease));
- }
+ }
}
diff --git a/src/cmd/ip/dhcpd/ndb.c b/src/cmd/ip/dhcpd/ndb.c
index 53ffb58f..97b2284f 100755..100644
--- a/src/cmd/ip/dhcpd/ndb.c
+++ b/src/cmd/ip/dhcpd/ndb.c
@@ -108,7 +108,7 @@ lookupip(uchar *ipaddr, Info *iip, int gate)
t = ndbipinfo(db, "ip", ip, attrs, p - attrs);
if(t == nil)
return -1;
-
+
for(nt = t; nt != nil; nt = nt->entry){
if(strcmp(nt->attr, "ip") == 0)
setipaddr(iip->ipaddr, nt->val);
diff --git a/src/cmd/ip/dhcpd/ping.c b/src/cmd/ip/dhcpd/ping.c
index 666bcc41..666bcc41 100755..100644
--- a/src/cmd/ip/dhcpd/ping.c
+++ b/src/cmd/ip/dhcpd/ping.c
diff --git a/src/cmd/ip/dhcpd/testlook.c b/src/cmd/ip/dhcpd/testlook.c
index 4937e55b..ac3f44f8 100755..100644
--- a/src/cmd/ip/dhcpd/testlook.c
+++ b/src/cmd/ip/dhcpd/testlook.c
@@ -188,7 +188,7 @@ ipinfo(Ndb *db, char *etherin, char *ipin, char *name, Ipinfo *iip)
recursesubnet(db, classmask[CLASS(iip->ipaddr)], iip, fsname, gwname, auname);
/* lookup fs's and gw's ip addresses */
-
+
if(fsname[0])
lookupip(db, fsname, iip->fsip, iip);
if(gwname[0])
diff --git a/src/cmd/ip/dhcpd/testlookup.c b/src/cmd/ip/dhcpd/testlookup.c
index c69624c5..c69624c5 100755..100644
--- a/src/cmd/ip/dhcpd/testlookup.c
+++ b/src/cmd/ip/dhcpd/testlookup.c
diff --git a/src/cmd/ip/dhcpd/testping.c b/src/cmd/ip/dhcpd/testping.c
index b5ca90c5..b5ca90c5 100755..100644
--- a/src/cmd/ip/dhcpd/testping.c
+++ b/src/cmd/ip/dhcpd/testping.c
diff --git a/src/cmd/ip/snoopy/arp.c b/src/cmd/ip/snoopy/arp.c
index d317c1bb..7b7fa318 100755..100644
--- a/src/cmd/ip/snoopy/arp.c
+++ b/src/cmd/ip/snoopy/arp.c
@@ -34,7 +34,7 @@ enum
Opa
};
-static Field p_fields[] =
+static Field p_fields[] =
{
{"spa", Fv4ip, Ospa, "protocol source", } ,
{"tpa", Fv4ip, Otpa, "protocol target", } ,
diff --git a/src/cmd/ip/snoopy/bootp.c b/src/cmd/ip/snoopy/bootp.c
index e7ead863..18350081 100755..100644
--- a/src/cmd/ip/snoopy/bootp.c
+++ b/src/cmd/ip/snoopy/bootp.c
@@ -55,7 +55,7 @@ enum
Ot
};
-static Field p_fields[] =
+static Field p_fields[] =
{
{"ca", Fv4ip, Oca, "client IP addr", } ,
{"sa", Fv4ip, Osa, "server IP addr", } ,
diff --git a/src/cmd/ip/snoopy/dat.h b/src/cmd/ip/snoopy/dat.h
index ba3e446d..0ac054c7 100755..100644
--- a/src/cmd/ip/snoopy/dat.h
+++ b/src/cmd/ip/snoopy/dat.h
@@ -60,7 +60,7 @@ struct Msg
char *e; /* buffer end */
int needroot; /* pr is root, need to see in expression */
- Proto *pr; /* current/next protocol */
+ Proto *pr; /* current/next protocol */
};
enum
diff --git a/src/cmd/ip/snoopy/dhcp.c b/src/cmd/ip/snoopy/dhcp.c
index cd976ec0..bab0cf82 100755..100644
--- a/src/cmd/ip/snoopy/dhcp.c
+++ b/src/cmd/ip/snoopy/dhcp.c
@@ -61,7 +61,7 @@ enum
OBtcpka= 38,
OBtcpkag= 39,
OBnisdomain= 40,
- OBniserver= 41,
+ OBniserver= 41,
OBntpserver= 42,
OBvendorinfo= 43, /* 0x2b */
OBnetbiosns= 44,
@@ -232,7 +232,7 @@ p_seprint(Msg *m)
ps += n;
if(ps > m->pe)
break;
-
+
switch(code){
case ODipaddr: /* requested ip address */
p = pserver(p, e, "ipaddr", o, n);
@@ -473,4 +473,3 @@ Proto dhcp =
nil,
defaultframer
};
-
diff --git a/src/cmd/ip/snoopy/dns.c b/src/cmd/ip/snoopy/dns.c
index 144a4949..c115df17 100644
--- a/src/cmd/ip/snoopy/dns.c
+++ b/src/cmd/ip/snoopy/dns.c
@@ -32,7 +32,7 @@ enum
/* query types (all RR types are also queries) */
Tixfr= 251, /* incremental zone transfer */
Taxfr= 252, /* zone transfer */
- Tmailb= 253, /* { Tmb, Tmg, Tmr } */
+ Tmailb= 253, /* { Tmb, Tmg, Tmr } */
Tall= 255, /* all records */
/* classes */
@@ -87,7 +87,7 @@ getstr(uchar **pp, int *len, uchar *ep)
{
uchar *p;
int n;
-
+
p = *pp;
n = *p++;
if(p+n > ep)
@@ -215,7 +215,7 @@ cname(int class)
if(class == Cin)
return "";
-
+
snprint(buf, sizeof buf, "class=%d", class);
return buf;
}
@@ -236,7 +236,7 @@ p_seprint(Msg *m)
char *sym1, *sym2, *sep;
int type;
static int first = 1;
-
+
if(first){
first = 0;
quotefmtinstall();
@@ -388,7 +388,7 @@ p_seprint(Msg *m)
NetS(p), p[3], p[4], rlen-4, p+4);
p += rlen;
break;
-
+
case Tsig:
if(rlen < 18)
goto error;
@@ -408,7 +408,7 @@ p_seprint(Msg *m)
}
if(p != ep)
goto error;
- }
+ }
return 0;
error:
diff --git a/src/cmd/ip/snoopy/dump.c b/src/cmd/ip/snoopy/dump.c
index ec2a3ce7..3d9451da 100755..100644
--- a/src/cmd/ip/snoopy/dump.c
+++ b/src/cmd/ip/snoopy/dump.c
@@ -55,7 +55,7 @@ p_seprint(Msg *m)
for(i = 0; i < n && p+1<e; i++){
c = ps[i];
*p++ = tohex[c>>4];
- *p++ = tohex[c&0xf];
+ *p++ = tohex[c&0xf];
}
}
diff --git a/src/cmd/ip/snoopy/ether.c b/src/cmd/ip/snoopy/ether.c
index 9e16579a..2b33106e 100755..100644
--- a/src/cmd/ip/snoopy/ether.c
+++ b/src/cmd/ip/snoopy/ether.c
@@ -35,7 +35,7 @@ enum
Ot, /* type */
};
-static Field p_fields[] =
+static Field p_fields[] =
{
{"s", Fether, Os, "source address", } ,
{"d", Fether, Od, "destination address", } ,
diff --git a/src/cmd/ip/snoopy/gre.c b/src/cmd/ip/snoopy/gre.c
index 6808293b..2e744940 100755..100644
--- a/src/cmd/ip/snoopy/gre.c
+++ b/src/cmd/ip/snoopy/gre.c
@@ -36,7 +36,7 @@ sprintgre(void *a, char *buf, int len)
uchar *p = a;
chksum = offset = key = seq = ack = 0;
-
+
flag = NetS(p);
prot = NetS(p+2);
p += 4; len -= 4;
@@ -78,6 +78,6 @@ sprintgre(void *a, char *buf, int len)
n += sprintppp(p, buf+n, len);
else
n += sprintx(p, buf+n, len);
-
+
return n;
}
diff --git a/src/cmd/ip/snoopy/hdlc.c b/src/cmd/ip/snoopy/hdlc.c
index e7bf3739..e7bf3739 100755..100644
--- a/src/cmd/ip/snoopy/hdlc.c
+++ b/src/cmd/ip/snoopy/hdlc.c
diff --git a/src/cmd/ip/snoopy/icmp.c b/src/cmd/ip/snoopy/icmp.c
index 8e528dc9..f798e42a 100755..100644
--- a/src/cmd/ip/snoopy/icmp.c
+++ b/src/cmd/ip/snoopy/icmp.c
@@ -23,7 +23,7 @@ enum
Op, /* next protocol */
};
-static Field p_fields[] =
+static Field p_fields[] =
{
{"t", Fnum, Ot, "type", } ,
{0}
diff --git a/src/cmd/ip/snoopy/icmp6.c b/src/cmd/ip/snoopy/icmp6.c
index 9ba74939..9ede92a5 100755..100644
--- a/src/cmd/ip/snoopy/icmp6.c
+++ b/src/cmd/ip/snoopy/icmp6.c
@@ -22,14 +22,14 @@ enum
Ot, /* type */
Op, /* next protocol */};
-static Field p_fields[] =
+static Field p_fields[] =
{
{"t", Fnum, Ot, "type", } ,
{0}
};
enum
-{
+{
/* ICMPv6 types */
EchoReply = 0,
UnreachableV6 = 1,
@@ -114,7 +114,7 @@ static char *parpcode[] =
[2] "unrecognized IPv6 option encountered",
[3] "icmp par prob: unknown code"
};
-enum
+enum
{
sll = 1,
tll = 2,
@@ -123,7 +123,7 @@ enum
mtu = 5
};
-static char *icmp6opts[256] =
+static char *icmp6opts[256] =
{
[0] "unknown opt",
[1] "sll_addr",
@@ -206,7 +206,7 @@ opt_seprint(Msg *m)
case sll:
case tll:
- if ((pktsz < osz) || (osz != 8)) {
+ if ((pktsz < osz) || (osz != 8)) {
p = seprint(p, e, "\n option=%s bad size=%d", opt, osz);
m->pr = &dump;
return p;
@@ -217,7 +217,7 @@ opt_seprint(Msg *m)
break;
case pref:
- if ((pktsz < osz) || (osz != 32)) {
+ if ((pktsz < osz) || (osz != 32)) {
p = seprint(p, e, "\n option=%s: bad size=%d", opt, osz);
m->pr = &dump;
return p;
@@ -235,11 +235,11 @@ opt_seprint(Msg *m)
NetL(a+12)!=0);
pktsz -= osz;
- a += osz;
+ a += osz;
break;
case redir:
- if (pktsz < osz) {
+ if (pktsz < osz) {
p = seprint(p, e, "\n option=%s: bad size=%d", opt, osz);
m->pr = &dump;
return p;
@@ -248,11 +248,11 @@ opt_seprint(Msg *m)
p = seprint(p, e, "\n option=%s len %d", opt, osz);
a += osz;
m->ps = a;
- return p;
+ return p;
break;
case mtu:
- if ((pktsz < osz) || (osz != 8)) {
+ if ((pktsz < osz) || (osz != 8)) {
p = seprint(p, e, "\n option=%s: bad size=%d", opt, osz);
m->pr = &dump;
return p;
diff --git a/src/cmd/ip/snoopy/il.c b/src/cmd/ip/snoopy/il.c
index a4ff60eb..35c43a24 100755..100644
--- a/src/cmd/ip/snoopy/il.c
+++ b/src/cmd/ip/snoopy/il.c
@@ -29,7 +29,7 @@ enum
Osd
};
-static Field p_fields[] =
+static Field p_fields[] =
{
{"s", Fnum, Os, "source port", } ,
{"d", Fnum, Od, "dest port", } ,
@@ -88,9 +88,9 @@ p_filter(Filter *f, Msg *m)
return 0;
}
-char *pktnames[] =
+char *pktnames[] =
{
- "Sync",
+ "Sync",
"Data",
"Dataquery",
"Ack",
@@ -103,7 +103,7 @@ static char*
pkttype(int t)
{
static char b[10];
-
+
if(t > 6){
sprint(b, "%d", t);
return b;
diff --git a/src/cmd/ip/snoopy/ip.c b/src/cmd/ip/snoopy/ip.c
index 234ca85f..04589778 100755..100644
--- a/src/cmd/ip/snoopy/ip.c
+++ b/src/cmd/ip/snoopy/ip.c
@@ -135,7 +135,7 @@ enum
Ot, /* type */
};
-static Field p_fields[] =
+static Field p_fields[] =
{
{"s", Fv4ip, Os, "source address", } ,
{"d", Fv4ip, Od, "destination address", } ,
diff --git a/src/cmd/ip/snoopy/ip6.c b/src/cmd/ip/snoopy/ip6.c
index 7187cda7..ba9be993 100755..100644
--- a/src/cmd/ip/snoopy/ip6.c
+++ b/src/cmd/ip/snoopy/ip6.c
@@ -132,7 +132,7 @@ enum
Ot, /* type */
};
-static Field p_fields[] =
+static Field p_fields[] =
{
{"s", Fv6ip, Os, "source address", } ,
{"d", Fv6ip, Od, "destination address", } ,
@@ -167,7 +167,7 @@ v6hdrlen(Hdr *h)
int pktlen = IP6HDR + NetS(h->length);
uchar nexthdr = h->proto;
uchar *pkt = (uchar*) h;
-
+
pkt += len;
plen = len;
@@ -176,7 +176,7 @@ v6hdrlen(Hdr *h)
if (nexthdr == FRAG_HDR)
len = FRAG_HSZ;
- else
+ else
len = ( ((int) *(pkt+1)) + 1) * 8;
if (plen + len > pktlen)
@@ -226,7 +226,7 @@ v6hdr_seprint(Msg *m)
int pktlen = IP6HDR + NetS(h->length);
uchar nexthdr = h->proto;
int plen;
-
+
pkt += len;
plen = len;
diff --git a/src/cmd/ip/snoopy/llc.c b/src/cmd/ip/snoopy/llc.c
index bbc21986..09cf022d 100644
--- a/src/cmd/ip/snoopy/llc.c
+++ b/src/cmd/ip/snoopy/llc.c
@@ -1,4 +1,4 @@
-/*
+/*
* LLC. Only enough to dispatch to SNAP and IP.
*/
@@ -17,7 +17,7 @@ enum
UPoll = 0x10,
IsPoll = 0x100,
XidFi = 0x81,
-
+
SapNull = 0,
SapGlobal = 0xff,
Sap8021BI = 0x02,
@@ -40,7 +40,7 @@ static Mux p_mux[] =
// Linux gives llc -> snap not llc -> ip.
// If we don't tell snoopy about llc -> ip, then the default patterns
// like snoopy -h radiotap -f dns work better.
-// { "ip", SapIP },
+// { "ip", SapIP },
{ "snap", SapSnap },
{ 0 }
};
@@ -138,7 +138,7 @@ static int
p_seprint(Msg *m)
{
Hdr h;
-
+
memset(&h, 0, sizeof h);
if(unpackhdr(m->ps, m->pe, &h) < 0)
return -1;
@@ -156,7 +156,7 @@ p_seprint(Msg *m)
m->pr = &snap;
break;
}
- }
+ }
return 0;
}
diff --git a/src/cmd/ip/snoopy/main.c b/src/cmd/ip/snoopy/main.c
index 9c2dad2e..6902797e 100755..100644
--- a/src/cmd/ip/snoopy/main.c
+++ b/src/cmd/ip/snoopy/main.c
@@ -290,14 +290,14 @@ struct pcap_file_header {
};
/*
- * pcap trace header
+ * pcap trace header
*/
void
pcaphdr(int fd)
{
if(tiflag){
struct pcap_file_header hdr;
-
+
if(readn(fd, &hdr, sizeof hdr) != sizeof hdr)
sysfatal("short header");
if(hdr.magic != TCPDUMP_MAGIC)
@@ -309,16 +309,16 @@ pcaphdr(int fd)
}
if(toflag){
struct pcap_file_header hdr;
-
+
hdr.magic = TCPDUMP_MAGIC;
hdr.version_major = PCAP_VERSION_MAJOR;
hdr.version_minor = PCAP_VERSION_MINOR;
-
+
hdr.thiszone = 0;
hdr.snaplen = 1500;
hdr.sigfigs = 0;
hdr.linktype = 1;
-
+
write(1, &hdr, sizeof(hdr));
}
}
@@ -682,7 +682,7 @@ _compile(Filter *f, Proto *last)
case '=':
if(last == nil)
sysfatal("internal error: compilewalk: badly formed tree");
-
+
if(last->compile == nil)
sysfatal("unknown %s field: %s", f->pr->name, f->s);
(*last->compile)(f);
@@ -840,7 +840,7 @@ cat(void)
{
char buf[1024];
int n;
-
+
while((n = read(0, buf, sizeof buf)) > 0)
write(1, buf, n);
}
@@ -850,10 +850,10 @@ void
startmc(void)
{
int p[2];
-
+
if(fd1 == -1)
fd1 = dup(1, -1);
-
+
if(pipe(p) < 0)
return;
switch(fork()){
@@ -892,7 +892,7 @@ printhelp(char *name)
Mux *m;
Field *f;
char fmt[40];
-
+
if(name == nil){
print("protocols:\n");
startmc();
@@ -901,13 +901,13 @@ printhelp(char *name)
stopmc();
return;
}
-
+
pr = findproto(name);
if(pr == nil){
print("unknown protocol %s\n", name);
return;
}
-
+
if(pr->field){
print("%s's filter attributes:\n", pr->name);
len = 0;
diff --git a/src/cmd/ip/snoopy/ninep.c b/src/cmd/ip/snoopy/ninep.c
index eb3eab39..eb3eab39 100755..100644
--- a/src/cmd/ip/snoopy/ninep.c
+++ b/src/cmd/ip/snoopy/ninep.c
diff --git a/src/cmd/ip/snoopy/ospf.c b/src/cmd/ip/snoopy/ospf.c
index bb4cd893..d5871dd9 100755..100644
--- a/src/cmd/ip/snoopy/ospf.c
+++ b/src/cmd/ip/snoopy/ospf.c
@@ -22,7 +22,7 @@ struct Ospfpkt
uchar auth[8];
uchar data[1];
};
-#define OSPF_HDRSIZE 24
+#define OSPF_HDRSIZE 24
enum
{
@@ -62,15 +62,15 @@ ospfauth(Ospfpkt *ospf)
case 0:
return "no authentication";
case 1:
- sprint(auth, "password(%8.8ux %8.8ux)", NetL(ospf->auth),
+ sprint(auth, "password(%8.8ux %8.8ux)", NetL(ospf->auth),
NetL(ospf->auth+4));
break;
case 2:
- sprint(auth, "crypto(plen %d id %d dlen %d)", NetS(ospf->auth),
+ sprint(auth, "crypto(plen %d id %d dlen %d)", NetS(ospf->auth),
ospf->auth[2], ospf->auth[3]);
break;
default:
- sprint(auth, "auth%d(%8.8ux %8.8ux)", NetS(ospf->autype), NetL(ospf->auth),
+ sprint(auth, "auth%d(%8.8ux %8.8ux)", NetS(ospf->autype), NetL(ospf->auth),
NetL(ospf->auth+4));
}
return auth;
@@ -156,7 +156,7 @@ struct Ospfrt {
uchar typ;
uchar numtos;
uchar metric[2];
-
+
};
struct OspfrtLSA {
@@ -348,7 +348,7 @@ p_seprint(Msg *m)
x -= OSPF_HDRSIZE;
p = seprint(p, e, "ver=%d type=%d len=%d r=%V a=%V c=%4.4ux %s ",
- ospf->version, ospf->type, x,
+ ospf->version, ospf->type, x,
ospf->router, ospf->area, NetS(ospf->sum),
ospfauth(ospf));
diff --git a/src/cmd/ip/snoopy/p80211.c b/src/cmd/ip/snoopy/p80211.c
index 92ed8aba..49fe0245 100644
--- a/src/cmd/ip/snoopy/p80211.c
+++ b/src/cmd/ip/snoopy/p80211.c
@@ -1,4 +1,4 @@
-/*
+/*
* IEEE 802.11.
*/
@@ -29,7 +29,7 @@ enum
NodataCfAck,
NodataCfPoll,
NodataCfAckPoll,
-
+
FlagTods = 0x1,
FlagFromds = 0x2,
FlagMoreflag = 0x4,
@@ -38,7 +38,7 @@ enum
FlagMoreData = 0x20,
FlagWep = 0x40,
FlagOrder = 0x80,
-
+
ProtoNone = 0,
ProtoLlc,
};
@@ -85,7 +85,7 @@ unpackhdr(uchar *p, uchar *ep, Hdr *h)
if(h->vers != 0)
return 0;
-
+
switch(h->type){
case Tmgmt:
// fc dur da sa bssid seq
@@ -98,7 +98,7 @@ unpackhdr(uchar *p, uchar *ep, Hdr *h)
memmove(h->bssid, p+16, 6);
h->seq = LittleS(p+22);
break;
-
+
case Tctl:
switch(h->subtype){
case CtlPoll:
@@ -110,7 +110,7 @@ unpackhdr(uchar *p, uchar *ep, Hdr *h)
memmove(h->bssid, p+4, 6);
memmove(h->ta, p+10, 6);
break;
-
+
case CtlRts:
// fc dur ra ta
if(p+2+2+6+6 > ep)
@@ -120,7 +120,7 @@ unpackhdr(uchar *p, uchar *ep, Hdr *h)
memmove(h->ra, p+4, 6);
memmove(h->ta, p+10, 6);
break;
-
+
case CtlCts:
case CtlAck:
// fc dur ra
@@ -130,7 +130,7 @@ unpackhdr(uchar *p, uchar *ep, Hdr *h)
h->dur = LittleS(p+2);
memmove(h->ra, p+4, 6);
break;
-
+
case CtlCfEnd:
case CtlCfEndAck:
// fc dur ra bssid
@@ -143,7 +143,7 @@ unpackhdr(uchar *p, uchar *ep, Hdr *h)
break;
}
break;
-
+
case Tdata:
if(p+24 > ep)
return -1;
@@ -183,7 +183,7 @@ unpackhdr(uchar *p, uchar *ep, Hdr *h)
h->proto = ProtoLlc;
break;
}
- return 0;
+ return 0;
}
enum
@@ -284,7 +284,7 @@ static int
p_seprint(Msg *m)
{
Hdr h;
-
+
memset(&h, 0, sizeof h);
if(unpackhdr(m->ps, m->pe, &h) < 0)
return -1;
diff --git a/src/cmd/ip/snoopy/ppp.c b/src/cmd/ip/snoopy/ppp.c
index 9319cdae..453f711d 100755..100644
--- a/src/cmd/ip/snoopy/ppp.c
+++ b/src/cmd/ip/snoopy/ppp.c
@@ -192,7 +192,7 @@ p_seprint(Msg *m)
proto = *m->ps++;
if((proto&1) == 0)
proto = (proto<<8) | *m->ps++;
-
+
m->p = seprint(m->p, m->e, "pr=%ud len=%d", proto, len);
demux(p_mux, proto, proto, m, &dump);
@@ -384,25 +384,25 @@ seprintipcpopt(char *p, char *e, void *a, int len)
default:
p = seprint(p, e, " (type=%d len=%d)", o->type, o->len);
break;
- case Oipaddrs:
+ case Oipaddrs:
p = seprint(p, e, " ipaddrs(deprecated)");
break;
case Oipcompress:
p = seprint(p, e, " ipcompress");
break;
- case Oipaddr:
+ case Oipaddr:
p = seprint(p, e, " ipaddr=%V", o->data);
break;
- case Oipdns:
+ case Oipdns:
p = seprint(p, e, " dnsaddr=%V", o->data);
break;
- case Oipwins:
+ case Oipwins:
p = seprint(p, e, " winsaddr=%V", o->data);
break;
- case Oipdns2:
+ case Oipdns2:
p = seprint(p, e, " dns2addr=%V", o->data);
break;
- case Oipwins2:
+ case Oipwins2:
p = seprint(p, e, " wins2addr=%V", o->data);
break;
}
@@ -430,7 +430,7 @@ p_seprintipcp(Msg *m)
m->pe = m->ps+len;
else if(m->ps+len > m->pe)
return -1;
-
+
p = seprint(p, e, "id=%d code=%d", lcp->id, lcp->code);
switch(lcp->code) {
default:
@@ -467,13 +467,13 @@ seprintccpopt(char *p, char *e, void *a, int len)
p = seprint(p, e, " bad opt len %ux", o->type);
return p;
}
-
+
switch(o->type){
default:
p = seprint(p, e, " type=%d ", o->type);
break;
case 0:
- p = seprint(p, e, " OUI=(%d %.2ux%.2ux%.2ux) ", o->type,
+ p = seprint(p, e, " OUI=(%d %.2ux%.2ux%.2ux) ", o->type,
o->data[0], o->data[1], o->data[2]);
break;
case 17:
@@ -507,7 +507,7 @@ p_seprintccp(Msg *m)
m->pe = m->ps+len;
else if(m->ps+len > m->pe)
return -1;
-
+
p = seprint(p, e, "id=%d code=%d", lcp->id, lcp->code);
switch(lcp->code) {
default:
@@ -528,7 +528,7 @@ p_seprintccp(Msg *m)
break;
}
m->p = seprint(p, e, " len=%d", len);
-
+
return 0;
}
diff --git a/src/cmd/ip/snoopy/ppp_ccp.c b/src/cmd/ip/snoopy/ppp_ccp.c
index dab65f8f..dab65f8f 100755..100644
--- a/src/cmd/ip/snoopy/ppp_ccp.c
+++ b/src/cmd/ip/snoopy/ppp_ccp.c
diff --git a/src/cmd/ip/snoopy/ppp_chap.c b/src/cmd/ip/snoopy/ppp_chap.c
index dab65f8f..dab65f8f 100755..100644
--- a/src/cmd/ip/snoopy/ppp_chap.c
+++ b/src/cmd/ip/snoopy/ppp_chap.c
diff --git a/src/cmd/ip/snoopy/ppp_comp.c b/src/cmd/ip/snoopy/ppp_comp.c
index dab65f8f..dab65f8f 100755..100644
--- a/src/cmd/ip/snoopy/ppp_comp.c
+++ b/src/cmd/ip/snoopy/ppp_comp.c
diff --git a/src/cmd/ip/snoopy/ppp_ipcp.c b/src/cmd/ip/snoopy/ppp_ipcp.c
index dab65f8f..dab65f8f 100755..100644
--- a/src/cmd/ip/snoopy/ppp_ipcp.c
+++ b/src/cmd/ip/snoopy/ppp_ipcp.c
diff --git a/src/cmd/ip/snoopy/ppp_lcp.c b/src/cmd/ip/snoopy/ppp_lcp.c
index dab65f8f..dab65f8f 100755..100644
--- a/src/cmd/ip/snoopy/ppp_lcp.c
+++ b/src/cmd/ip/snoopy/ppp_lcp.c
diff --git a/src/cmd/ip/snoopy/pppoe_disc.c b/src/cmd/ip/snoopy/pppoe_disc.c
index 058f059d..ceb84d57 100755..100644
--- a/src/cmd/ip/snoopy/pppoe_disc.c
+++ b/src/cmd/ip/snoopy/pppoe_disc.c
@@ -30,7 +30,7 @@ enum
Osess
};
-static Field p_fields[] =
+static Field p_fields[] =
{
{"v", Fnum, Overs, "version", } ,
{"t", Fnum, Otype, "type", } ,
@@ -171,4 +171,3 @@ Proto pppoe_sess =
p_fields,
defaultframer
};
-
diff --git a/src/cmd/ip/snoopy/pppoe_sess.c b/src/cmd/ip/snoopy/pppoe_sess.c
index 0472a907..0472a907 100755..100644
--- a/src/cmd/ip/snoopy/pppoe_sess.c
+++ b/src/cmd/ip/snoopy/pppoe_sess.c
diff --git a/src/cmd/ip/snoopy/radiotap.c b/src/cmd/ip/snoopy/radiotap.c
index 889dc8ab..7fa7cc41 100644
--- a/src/cmd/ip/snoopy/radiotap.c
+++ b/src/cmd/ip/snoopy/radiotap.c
@@ -93,7 +93,7 @@ static int
p_seprint(Msg *m)
{
Hdr h;
-
+
memset(&h, 0, sizeof h);
if(unpackhdr(m->ps, m->pe, &h) < 0)
return -1;
diff --git a/src/cmd/ip/snoopy/rarp.c b/src/cmd/ip/snoopy/rarp.c
index 149c8207..149c8207 100755..100644
--- a/src/cmd/ip/snoopy/rarp.c
+++ b/src/cmd/ip/snoopy/rarp.c
diff --git a/src/cmd/ip/snoopy/rtcp.c b/src/cmd/ip/snoopy/rtcp.c
index 29745d65..e764063d 100755..100644
--- a/src/cmd/ip/snoopy/rtcp.c
+++ b/src/cmd/ip/snoopy/rtcp.c
@@ -55,7 +55,7 @@ p_seprint(Msg *m)
(NetS(h->len) + 1) * 4);
for(i = 0; i < rc; i++){
- r = (Report*)m->ps;
+ r = (Report*)m->ps;
m->ps += REPORTLEN;
frac = (int)(((float)r->lost[0] * 100.) / 256.);
@@ -64,7 +64,7 @@ p_seprint(Msg *m)
m->p = seprint(m->p, m->e, "\n\trr(csrc=%8ux frac=%3d%% cumu=%10d seqhi=%10ud jitter=%10d lsr=%8ux dlsr=%f)",
NetL(r->ssrc), frac, NetL(r->lost), NetL(r->seqhi),
- NetL(r->jitter), NetL(r->lsr),
+ NetL(r->jitter), NetL(r->lsr),
dlsr);
}
m->pr = nil;
diff --git a/src/cmd/ip/snoopy/rtp.c b/src/cmd/ip/snoopy/rtp.c
index 1aef15fa..1aef15fa 100755..100644
--- a/src/cmd/ip/snoopy/rtp.c
+++ b/src/cmd/ip/snoopy/rtp.c
diff --git a/src/cmd/ip/snoopy/snap.c b/src/cmd/ip/snoopy/snap.c
index 1854d1d6..78a3be09 100644
--- a/src/cmd/ip/snoopy/snap.c
+++ b/src/cmd/ip/snoopy/snap.c
@@ -1,4 +1,4 @@
-/*
+/*
* SNAP.
*/
@@ -12,7 +12,7 @@ enum
{
Oorg,
Oet,
-
+
OuiEther = 0,
OuiCisco = 0xc,
OuiCisco90 = 0xf8,
diff --git a/src/cmd/ip/snoopy/tcp.c b/src/cmd/ip/snoopy/tcp.c
index b8ea7e40..0afbd545 100755..100644
--- a/src/cmd/ip/snoopy/tcp.c
+++ b/src/cmd/ip/snoopy/tcp.c
@@ -39,7 +39,7 @@ enum
Osd
};
-static Field p_fields[] =
+static Field p_fields[] =
{
{"s", Fnum, Os, "source port", } ,
{"d", Fnum, Od, "dest port", } ,
diff --git a/src/cmd/ip/snoopy/udp.c b/src/cmd/ip/snoopy/udp.c
index 3d81f33d..da9510f6 100755..100644
--- a/src/cmd/ip/snoopy/udp.c
+++ b/src/cmd/ip/snoopy/udp.c
@@ -26,7 +26,7 @@ enum
Osetport
};
-static Field p_fields[] =
+static Field p_fields[] =
{
{"s", Fnum, Os, "source port", } ,
{"d", Fnum, Od, "dest port", } ,