Skip to content

Commit

Permalink
Replace all tab characters at the beginnings of lines with 8 spaces.
Browse files Browse the repository at this point in the history
Mixed indentation annoyed my vim.
  • Loading branch information
d33tah committed Jan 5, 2014
1 parent 3570ca7 commit 4816358
Show file tree
Hide file tree
Showing 40 changed files with 1,087 additions and 1,087 deletions.
12 changes: 6 additions & 6 deletions FingerPrintResults.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ class FingerPrintResults {
virtual ~FingerPrintResults();

double accuracy[MAX_FP_RESULTS]; /* Percentage of match (1.0 == perfect
match) in same order as matches[] below */
match) in same order as matches[] below */
FingerMatch *matches[MAX_FP_RESULTS]; /* ptrs to matching references --
highest accuracy matches first */
highest accuracy matches first */
int num_perfect_matches; /* Number of 1.0 accuracy matches in matches[] */
int num_matches; /* Total number of matches in matches[] */
int overall_results; /* OSSCAN_TOOMANYMATCHES, OSSCAN_NOMATCHES,
OSSCAN_SUCCESS, etc */
OSSCAN_SUCCESS, etc */

/* Ensures that the results are available and then returns them.
You should only call this AFTER all matching has been completed
Expand All @@ -167,11 +167,11 @@ class FingerPrintResults {
const struct OS_Classification_Results *getOSClassification();

int osscan_opentcpport; /* Open TCP port used for scannig (if one found --
otherwise -1) */
otherwise -1) */
int osscan_closedtcpport; /* Closed TCP port used for scannig (if one found --
otherwise -1) */
otherwise -1) */
int osscan_closedudpport; /* Closed UDP port used for scannig (if one found --
otherwise -1) */
otherwise -1) */
int distance; /* How "far" is this FP gotten from? */
int distance_guess; /* How "far" is this FP gotten from? by guessing based on ttl. */

Expand Down
2 changes: 1 addition & 1 deletion MACLookup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static void mac_prefix_init() {
MacTable[pfx] = cp_strdup(vendor);
} else {
if (o.debugging > 1)
error("MAC prefix %06X is duplicated in %s; ignoring duplicates.", pfx, filename);
error("MAC prefix %06X is duplicated in %s; ignoring duplicates.", pfx, filename);
}

}
Expand Down
30 changes: 15 additions & 15 deletions NmapOps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,10 @@ bool NmapOps::RawScan() {


void NmapOps::ValidateOptions() {
const char *privreq = "root privileges.";
const char *privreq = "root privileges.";
#ifdef WIN32
if (!have_pcap)
privreq = "WinPcap version 3.1 or higher and\n\
if (!have_pcap)
privreq = "WinPcap version 3.1 or higher and\n\
iphlpapi.dll. You seem to be missing one or both of these. Winpcap is\n\
available from http:https://www.winpcap.org. iphlpapi.dll comes with Win98 and\n\
later operating sytems and NT 4.0 with SP4 or greater. For previous windows\n\
Expand Down Expand Up @@ -674,17 +674,17 @@ void NmapOps::setSpoofMACAddress(u8 *mac_data) {

#ifndef NOLUA
void NmapOps::chooseScripts(char* argument) {
char *p;

for (;;) {
p = strchr(argument, ',');
if (p == NULL) {
chosenScripts.push_back(std::string(argument));
break;
} else {
chosenScripts.push_back(std::string(argument, p - argument));
argument = p + 1;
}
}
char *p;

for (;;) {
p = strchr(argument, ',');
if (p == NULL) {
chosenScripts.push_back(std::string(argument));
break;
} else {
chosenScripts.push_back(std::string(argument, p - argument));
argument = p + 1;
}
}
}
#endif
18 changes: 9 additions & 9 deletions NmapOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ class NmapOps {
void ValidateOptions(); /* Checks that the options given are
reasonable and consistant. If they aren't, the
function may bail out of Nmap or make small
adjustments (quietly or with a warning to the
user). */
adjustments (quietly or with a warning to the
user). */
int isr00t;
/* Whether we have pcap functions (can be false on Windows). */
bool have_pcap;
Expand Down Expand Up @@ -289,19 +289,19 @@ class NmapOps {
bool open_only;

int scanflags; /* if not -1, this value should dictate the TCP flags
for the core portscaning routine (eg to change a
FIN scan into a PSH scan. Sort of a hack, but can
be very useful sometimes. */
for the core portscaning routine (eg to change a
FIN scan into a PSH scan. Sort of a hack, but can
be very useful sometimes. */

int defeat_rst_ratelimit; /* Solaris 9 rate-limits RSTs so scanning is very
slow against it. If we don't distinguish between closed and filtered ports,
we can get the list of open ports very fast */

struct in_addr resume_ip; /* The last IP in the log file if user
requested --restore . Otherwise
restore_ip.s_addr == 0. Also
target_struct_get will eventually set it
to 0. */
requested --restore . Otherwise
restore_ip.s_addr == 0. Also
target_struct_get will eventually set it
to 0. */

// Version Detection Options
int override_excludeports;
Expand Down
58 changes: 29 additions & 29 deletions NmapOutputTable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ NmapOutputTable::~NmapOutputTable() {
for(col = 0; col < numColumns; col++) {
cell = getCellAddy(row, col);
if (cell->weAllocated) {
assert(cell->str);
free(cell->str);
assert(cell->str);
free(cell->str);
}
}
}
Expand All @@ -166,7 +166,7 @@ NmapOutputTable::~NmapOutputTable() {
}

void NmapOutputTable::addItem(unsigned int row, unsigned int column, bool fullrow,
bool copy, const char *item, int itemlen) {
bool copy, const char *item, int itemlen) {
struct NmapOutputTableCell *cell;
int mc = maxColLen[column];

Expand All @@ -181,7 +181,7 @@ void NmapOutputTable::addItem(unsigned int row, unsigned int column, bool fullro
}

void NmapOutputTable::addItem(unsigned int row, unsigned int column, bool copy, const char *item,
int itemlen) {
int itemlen) {
struct NmapOutputTableCell *cell;

assert(row < numRows);
Expand Down Expand Up @@ -215,9 +215,9 @@ void NmapOutputTable::addItem(unsigned int row, unsigned int column, bool copy,
}

void NmapOutputTable::addItemFormatted(unsigned int row,
unsigned int column,
bool fullrow,
const char *fmt, ...) {
unsigned int column,
bool fullrow,
const char *fmt, ...) {
struct NmapOutputTableCell *cell;
int mc = maxColLen[column];
unsigned int res;
Expand All @@ -241,20 +241,20 @@ void NmapOutputTable::addItemFormatted(unsigned int row,

/* True if every column in nrow is empty */
bool NmapOutputTable::emptyRow(unsigned int nrow) {
NmapOutputTableCell *cell;
unsigned int col;
bool isEmpty = true;
assert(nrow < numRows);

for(col = 0 ; col < numColumns; col++) {
cell = getCellAddy(nrow, col);
if(cell->strlength > 0) {
isEmpty = false;
break;
}
}
return isEmpty;
NmapOutputTableCell *cell;
unsigned int col;
bool isEmpty = true;
assert(nrow < numRows);

for(col = 0 ; col < numColumns; col++) {
cell = getCellAddy(nrow, col);
if(cell->strlength > 0) {
isEmpty = false;
break;
}
}
return isEmpty;
}

// This function sticks the entire table into a character buffer.
Expand All @@ -280,26 +280,26 @@ char *NmapOutputTable::printableTable(int *size) {
validthisrow = 0;

if(emptyRow(row))
continue;
continue;

cell = getCellAddy(row, 0);
if(cell->fullrow && cell->strlength > 0) {
/* Full rows are easy, just make sure we have the space + \n\0 */
if (cell->strlength + p + 2 > tableoutsz) {
tableoutsz = (cell->strlength + p + 2) * 2;
tableout = (char *) safe_realloc(tableout, tableoutsz);
tableoutsz = (cell->strlength + p + 2) * 2;
tableout = (char *) safe_realloc(tableout, tableoutsz);
}
memcpy(tableout + p, cell->str, cell->strlength);
p += cell->strlength;
} else {
for(col = 0; col < numColumns; col++) {
cell = getCellAddy(row, col);
clen = maxColLen[col];
/* Cells get padded with an extra space + \n\0 */
if (clen + p + 3 > tableoutsz) {
tableoutsz = (cell->strlength + p + 2) * 2;
tableout = (char *) safe_realloc(tableout, tableoutsz);
}
/* Cells get padded with an extra space + \n\0 */
if (clen + p + 3 > tableoutsz) {
tableoutsz = (cell->strlength + p + 2) * 2;
tableout = (char *) safe_realloc(tableout, tableoutsz);
}
if (cell->strlength > 0) {
memcpy(tableout + p, cell->str, cell->strlength);
p += cell->strlength;
Expand Down
2 changes: 1 addition & 1 deletion NmapOutputTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class NmapOutputTable {

// Like addItem except this version takes a printf-style format string followed by varargs
void addItemFormatted(unsigned int row, unsigned int column, bool fullrow, const char *fmt, ...)
__attribute__ ((format (printf, 5, 6))); // Offset by 1 to account for implicit "this" parameter.
__attribute__ ((format (printf, 5, 6))); // Offset by 1 to account for implicit "this" parameter.

// This function sticks the entire table into a character buffer.
// Note that the buffer is likely to be reused if you call the
Expand Down
22 changes: 11 additions & 11 deletions Target.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,11 @@ void Target::Initialize() {


const char * Target::deviceName() const {
return (devname[0] != '\0')? devname : NULL;
return (devname[0] != '\0')? devname : NULL;
}

const char * Target::deviceFullName() const {
return (devfullname[0] != '\0')? devfullname : NULL;
return (devfullname[0] != '\0')? devfullname : NULL;
}

void Target::Recycle() {
Expand Down Expand Up @@ -232,7 +232,7 @@ void Target::GenerateTargetIPString() {
#else
(char *) NULL,
#endif
targetipstring, sizeof(targetipstring)) == NULL) {
targetipstring, sizeof(targetipstring)) == NULL) {
fatal("Failed to convert target address to presentation format!?! Error: %s", strerror(socket_errno()));
}
}
Expand All @@ -252,7 +252,7 @@ void Target::GenerateSourceIPString() {
#else
(char *) NULL,
#endif
sourceipstring, sizeof(sourceipstring)) == NULL) {
sourceipstring, sizeof(sourceipstring)) == NULL) {
fatal("Failed to convert source address to presentation format!?! Error: %s", strerror(socket_errno()));
}
}
Expand Down Expand Up @@ -392,8 +392,8 @@ void Target::setHostName(const char *name) {
// I think only a-z A-Z 0-9 . and - are allowed, but I'll be a little more
// generous.
if (!isalnum((int) (unsigned char) *p) && !strchr(".-+=:_~*", *p)) {
log_write(LOG_STDOUT, "Illegal character(s) in hostname -- replacing with '*'\n");
*p = '*';
log_write(LOG_STDOUT, "Illegal character(s) in hostname -- replacing with '*'\n");
*p = '*';
}
p++;
}
Expand Down Expand Up @@ -566,14 +566,14 @@ const u8 *Target::NextHopMACAddress() const {
}

int Target::osscanPerformed(void) {
return osscan_flag;
return osscan_flag;
}

void Target::osscanSetFlag(int flag) {
if(osscan_flag == OS_PERF_UNREL)
return;
else
osscan_flag = flag;
if(osscan_flag == OS_PERF_UNREL)
return;
else
osscan_flag = flag;
}


12 changes: 6 additions & 6 deletions Target.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,17 @@
#endif

enum osscan_flags {
OS_NOTPERF=0, OS_PERF, OS_PERF_UNREL
OS_NOTPERF=0, OS_PERF, OS_PERF_UNREL
};

/* The method used to calculate the Target::distance, included in OS
fingerprints. */
enum dist_calc_method {
DIST_METHOD_NONE,
DIST_METHOD_LOCALHOST,
DIST_METHOD_DIRECT,
DIST_METHOD_ICMP,
DIST_METHOD_TRACEROUTE
DIST_METHOD_NONE,
DIST_METHOD_LOCALHOST,
DIST_METHOD_DIRECT,
DIST_METHOD_ICMP,
DIST_METHOD_TRACEROUTE
};

struct host_timeout_nfo {
Expand Down
Loading

0 comments on commit 4816358

Please sign in to comment.