aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/ip/snoopy/main.c
diff options
context:
space:
mode:
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;