Skip to content
Browse files

Remove extraneous whitespace

  • Loading branch information...
1 parent 7ff2791 commit a4f34a00d15d811653bddf442e349ddb2fbde8a5 @jbittel committed Nov 10, 2011
View
2 doc/AUTHORS
@@ -12,7 +12,7 @@ Significant suggestions or contributions:
* Suggested source/destination port as output fields
* Provided a patch for reopening output files with SIGHUP
* Suggested line buffering for output files
-
+
Mark Carter <mark.carter@imperial.ac.uk>
* Provided a patch adding IPv6 support
View
2 doc/format-string
@@ -26,7 +26,7 @@ the format string:
Source-Port HTTP-Version
Dest-IP Status-Code
Dest-Port Reason-Phrase
- Direction
+ Direction
Most of these are fields from the header line of each request or response.
The direction field will print a chevron with '>' indicating a client request
View
2 doc/perl-tools
@@ -14,7 +14,7 @@ same directory as the plugin and named '<plugin name>.cfg'. Additionally, any
input log file needs to be a valid httpry log with the field specifier at the
start of the file.
-These non-core Perl modules must be installed to run all scripts:
+These non-core Perl modules must be installed to run all scripts:
DBI
View
4 format.c
@@ -9,7 +9,7 @@
*/
/*
- The output format data structure is stored as a hash table
+ The output format data structure is stored as a hash table
with all of the nodes additionally chained together as a linked
list. This allows insert_value() to utilize the more efficient
hash structure to find nodes, while functions that need to
@@ -130,7 +130,7 @@ FORMAT_NODE *insert_node(char *name) {
if ((node->name = (char *) malloc(strlen(name) + 1)) == NULL)
LOG_DIE("Cannot allocate memory for node name");
-
+
strcpy(node->name, name);
node->value = NULL;
node->list = NULL;
View
2 httpry.c
@@ -690,7 +690,7 @@ int main(int argc, char **argv) {
if (setvbuf(stdout, NULL, _IONBF, 0) != 0)
LOG_WARN("Cannot disable buffering on stdout");
}
-
+
if (!pid_filename) pid_filename = PID_FILENAME;
pcap_hnd = prepare_capture(interface, set_promisc, use_infile, capfilter);
View
30 methods.c
@@ -77,12 +77,12 @@ void parse_methods_string(char *str) {
int insert_method(char *method) {
METHOD_NODE **node = &methods;
int cmp;
-
+
#ifdef DEBUG
ASSERT(method);
ASSERT(strlen(method) > 0);
#endif
-
+
while (*node) {
cmp = str_compare(method, (*node)->method);
if (cmp > 0) {
@@ -91,37 +91,37 @@ int insert_method(char *method) {
node = &(*node)->left;
} else {
WARN("Method '%s' already provided", method);
-
+
return 0;
}
}
-
+
if ((*node = (METHOD_NODE *) malloc(sizeof(METHOD_NODE))) == NULL) {
LOG_DIE("Cannot allocate memory for method node");
}
-
+
if (((*node)->method = (char *) malloc(strlen(method) + 1)) == NULL) {
LOG_DIE("Cannot allocate memory for method string");
}
-
+
strcpy((*node)->method, method);
(*node)->left = (*node)->right = NULL;
-
+
return 1;
}
/* Search data structure for a matching method */
int is_request_method(const char *str) {
METHOD_NODE *node = methods;
int cmp;
-
+
#ifdef DEBUG
ASSERT(node);
ASSERT(str);
#endif
-
+
if (strlen(str) == 0) return 0;
-
+
while (node) {
cmp = str_compare(str, node->method);
if (cmp > 0) {
@@ -132,26 +132,26 @@ int is_request_method(const char *str) {
return 1;
}
}
-
+
return 0;
}
/* Wrapper function to free allocated memory at program termination */
void free_methods() {
free_node(methods);
-
+
return;
}
/* Recursively free all children of the parameter node */
void free_node(METHOD_NODE *node) {
if (!node) return;
-
+
free_node(node->left);
free_node(node->right);
-
+
free(node->method);
free(node);
-
+
return;
}
View
2 scripts/plugins/common_log.pm
@@ -16,7 +16,7 @@ use POSIX qw(strftime mktime);
my %requests = ();
my $fh;
-my @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
+my @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
# -----------------------------------------------------------------------------
# Plugin core
View
6 scripts/plugins/content_analysis.pm
@@ -118,7 +118,7 @@ sub main {
sub end {
my $ip;
-
+
foreach $ip (keys %flow) {
_flush_buffer($ip);
}
@@ -385,7 +385,7 @@ sub _write_summary_file {
# -----------------------------------------------------------------------------
# Dynamically partition scored flows into sets using the k-means clustering
# algorithm; this allows us to trim the low scoring flows off the bottom
-# without setting arbitrary thresholds or levels
+# without setting arbitrary thresholds or levels
#
# K-means code originally taken from: http://www.perlmonks.org/?node_id=541000
# Many subsequent modifications and changes have been made
@@ -444,7 +444,7 @@ sub _partition_scores() {
foreach $ip (keys %temp_flow) {
$closest = 0;
$dist = abs $temp_flow{$ip}->{"score"} - $center[$closest];
-
+
foreach (1..$#center) {
if (abs $temp_flow{$ip}->{"score"} - $center[$_] < $dist) {
$dist = abs $temp_flow{$ip}->{"score"} - $center[$_];
View
2 scripts/plugins/db_dump.mysql
@@ -1,6 +1,6 @@
--
-- MySQL databse creation script for db_dump.pm
---
+--
-- !!! Warning: This script will delete all pre-existing data !!!
--
-- This is a rather rudimentary database structure, but it ought
View
6 scripts/plugins/db_dump.pm
@@ -43,7 +43,7 @@ sub init {
$sql = qq{ DELETE FROM client_data WHERE timestamp < '$limit' };
_execute_query($dbh, $sql);
-
+
$sql = qq{ DELETE FROM server_data WHERE timestamp < '$limit' };
_execute_query($dbh, $sql);
}
@@ -61,7 +61,7 @@ sub main {
my $sql = "";
my ($year, $mon, $day, $hour, $min, $sec) = (localtime)[5,4,3,2,1,0];
my $now = ($year+1900) . "-" . ($mon+1) . "-$day $hour:$min:$sec";
-
+
if ($record->{"direction"} eq '>') {
return unless exists $record->{"host"};
return unless exists $record->{"request-uri"};
@@ -79,7 +79,7 @@ sub main {
}
_execute_query($dbh, $sql) if $sql;
-
+
return;
}
View
4 scripts/plugins/find_proxies.pm
@@ -78,7 +78,7 @@ sub main {
# search again for an embedded request
if ($request_uri =~ /(\.pl|\.php|\.asp).*=(.+?)(?:\&|\Z)/) {
$encoded_uri = $2;
-
+
$encoded_uri =~ tr|A-Za-z0-9+=/||cd;
return if (length($encoded_uri) % 4);
@@ -173,7 +173,7 @@ sub _write_output_file {
return;
}
-
+
# Reformat data hash into a formatted output hash, clustering by domain name
foreach $ip (keys %proxy_lines) {
foreach $hostname (keys %{$proxy_lines{$ip}}) {
View
4 scripts/plugins/hostnames.pm
@@ -47,7 +47,7 @@ sub main {
$hostname = $record->{"host"};
$hostname =~ s/[^\-\.:0-9A-Za-z]//g;
-
+
# Eliminate invalid hostnames and online services
return if ($hostname eq "");
return if ($hostname eq "-");
@@ -73,7 +73,7 @@ sub end {
my $host;
open OUTFILE, ">$output_file" or die "Cannot open $output_file: $!\n";
-
+
foreach $host (keys %hostnames) {
print OUTFILE "$hostnames{$host}\t$host\n";
}
View
6 scripts/plugins/log_summary.pm
@@ -47,7 +47,7 @@ sub init {
_load_config($cfg_dir);
$start_time = (times)[0];
-
+
return;
}
@@ -68,7 +68,7 @@ sub main {
$top_talkers{$record->{"source-ip"}}++ if exists $record->{"source-ip"};
if (exists $record->{"request-uri"}) {
- if (($record->{"request-uri"} =~ /\.(\w{2,5})$/) or
+ if (($record->{"request-uri"} =~ /\.(\w{2,5})$/) or
($record->{"request-uri"} =~ /\.(\w{2,5})\?/)) {
$filetypes{lc($1)}++;
$ext_cnt++;
@@ -90,7 +90,7 @@ sub main {
sub end {
$end_time = (times)[0];
-
+
_write_output_file();
return;
View
14 tcp.h
@@ -21,27 +21,27 @@
* sniffex.c
*
* Sniffer example of TCP/IP packet capture using libpcap.
- *
+ *
* Version 0.1.1 (2005-07-05)
* Copyright (c) 2005 The Tcpdump Group
*
- * This software is intended to be used as a practical example and
+ * This software is intended to be used as a practical example and
* demonstration of the libpcap library; available at:
* http://www.tcpdump.org/
*
****************************************************************************
*
* This software is a modification of Tim Carstens' "sniffer.c"
* demonstration source code, released as follows:
- *
+ *
* sniffer.c
* Copyright (c) 2002 Tim Carstens
* 2002-01-07
* Demonstration of using libpcap
* timcarst -at- yahoo -dot- com
- *
+ *
* "sniffer.c" is distributed under these terms:
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -93,7 +93,7 @@
* TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
* PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
* REPAIR OR CORRECTION.
- *
+ *
* IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
* WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
* REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
@@ -104,7 +104,7 @@
* PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
* <end of "sniffex.c" terms>
- *
+ *
*/
/* IP header */

0 comments on commit a4f34a0

Please sign in to comment.
Something went wrong with that request. Please try again.