aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/ip/snoopy/main.c
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/snoopy/main.c
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/snoopy/main.c')
-rw-r--r--[-rwxr-xr-x]src/cmd/ip/snoopy/main.c24
1 files changed, 12 insertions, 12 deletions
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;