Skip to content

Commit

Permalink
minor style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesm committed Jan 19, 2014
1 parent e8ee855 commit deea070
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sniffer/sniffer.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,21 @@ define function main()
exception (ex :: <usage-error>)
exit-application(2);
end;

let input-stream = if (parser.read-pcap)
make(<file-stream>,
locator: parser.read-pcap,
direction: #"input")
end;

let source = if (input-stream)
make(<pcap-file-reader>,
stream: input-stream);
else
make(<ethernet-interface>,
name: parser.interface);
end if;

let output-stream = if (parser.write-pcap)
make(<file-stream>,
locator: parser.write-pcap,
Expand All @@ -71,23 +74,24 @@ define function main()
connect(fan-out, make(<pcap-file-writer>,
stream: output-stream));
end;

let output = make(if (parser.verbose?)
<verbose-printer>
else
<summary-printer>
end,
stream: *standard-output*);

if (parser.show-ethernet)
connect(fan-out, output)
else
let decapsulator = make(<decapsulator>);
connect(fan-out, decapsulator);
connect(decapsulator, output)
end;

toplevel(source);

if (input-stream)
close(input-stream);
end;
Expand Down

0 comments on commit deea070

Please sign in to comment.