1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

clean patches by Kris: remove c++ comments in nmapfe and nsock, and remove superscan prototype from scan_engine.h

This commit is contained in:
fyodor
2007-01-01 00:23:29 +00:00
parent 9879720d45
commit 47036bc063
5 changed files with 25 additions and 30 deletions

View File

@@ -21,7 +21,7 @@ o Fix nmap.xsl (the transform for rendering Nmap XML results as HTML)
to fix some bugs related to OS detection output. Thanks to Tom to fix some bugs related to OS detection output. Thanks to Tom
Sellers for the patch. Sellers for the patch.
o Applied more code cleanup patches from Kris Katterjohn. o Applied a bunch of code cleanup patches from Kris Katterjohn.
o Applied some internal bugfix patches from Eddie Bell. o Applied some internal bugfix patches from Eddie Bell.

View File

@@ -520,14 +520,14 @@ GtkAdjustment *adjust;
/* Scan page (first in notebook) */ /* Scan page (first in notebook) */
nblabel = gtk_label_new("Scan"); nblabel = gtk_label_new("Scan");
// nbpage = gtk_vbox_new(FALSE, 5); /* nbpage = gtk_vbox_new(FALSE, 5); */
nbpage = gtk_table_new(5, 3, TRUE); nbpage = gtk_table_new(5, 3, TRUE);
gtk_table_set_col_spacings(GTK_TABLE(nbpage), 5); gtk_table_set_col_spacings(GTK_TABLE(nbpage), 5);
gtk_table_set_row_spacings(GTK_TABLE(nbpage), 5); gtk_table_set_row_spacings(GTK_TABLE(nbpage), 5);
gtk_container_set_border_width(GTK_CONTAINER(nbpage), 5); gtk_container_set_border_width(GTK_CONTAINER(nbpage), 5);
frame = gtk_frame_new("Scan Type"); frame = gtk_frame_new("Scan Type");
// gtk_box_pack_start(GTK_BOX(nbpage), frame, FALSE, FALSE, 0); /* gtk_box_pack_start(GTK_BOX(nbpage), frame, FALSE, FALSE, 0); */
gtk_table_attach_defaults(GTK_TABLE(nbpage), frame, 0, 2, 0, 3); gtk_table_attach_defaults(GTK_TABLE(nbpage), frame, 0, 2, 0, 3);
table = gtk_table_new(2, 4, FALSE); table = gtk_table_new(2, 4, FALSE);
@@ -629,7 +629,7 @@ GtkAdjustment *adjust;
frame = gtk_frame_new("Scan Extensions"); frame = gtk_frame_new("Scan Extensions");
// gtk_box_pack_start(GTK_BOX(nbpage), frame, FALSE, FALSE, 0); /* gtk_box_pack_start(GTK_BOX(nbpage), frame, FALSE, FALSE, 0); */
gtk_table_attach_defaults(GTK_TABLE(nbpage), frame, 0, 2, 3, 5); gtk_table_attach_defaults(GTK_TABLE(nbpage), frame, 0, 2, 3, 5);
table = gtk_table_new(1, 4, FALSE); table = gtk_table_new(1, 4, FALSE);
@@ -674,20 +674,20 @@ GtkAdjustment *adjust;
/* Discover/Ping page (second in notebook) */ /* Discover/Ping page (second in notebook) */
nblabel = gtk_label_new("Discover"); nblabel = gtk_label_new("Discover");
nbpage = gtk_table_new(4, 4, FALSE); nbpage = gtk_table_new(4, 4, FALSE);
// nbpage = gtk_vbox_new(FALSE, 5); /* nbpage = gtk_vbox_new(FALSE, 5); */
gtk_container_set_border_width(GTK_CONTAINER(nbpage), 5); gtk_container_set_border_width(GTK_CONTAINER(nbpage), 5);
opt.dontPing = gtk_check_button_new_with_label("Don't Ping"); opt.dontPing = gtk_check_button_new_with_label("Don't Ping");
g_signal_connect(GTK_OBJECT(opt.dontPing), "released", g_signal_connect(GTK_OBJECT(opt.dontPing), "released",
GTK_SIGNAL_FUNC(pingButton_toggled_cb), opt.dontPing); GTK_SIGNAL_FUNC(pingButton_toggled_cb), opt.dontPing);
gtk_table_attach_defaults(GTK_TABLE(nbpage), opt.dontPing, 0, 1, 0, 1); gtk_table_attach_defaults(GTK_TABLE(nbpage), opt.dontPing, 0, 1, 0, 1);
// gtk_box_pack_start(GTK_BOX(nbpage), opt.dontPing, FALSE, FALSE, 0); /* gtk_box_pack_start(GTK_BOX(nbpage), opt.dontPing, FALSE, FALSE, 0); */
gtk_widget_show(opt.dontPing); gtk_widget_show(opt.dontPing);
frame = gtk_frame_new("Ping Types"); frame = gtk_frame_new("Ping Types");
gtk_table_attach_defaults(GTK_TABLE(nbpage), frame, 0, 3, 1, 4); gtk_table_attach_defaults(GTK_TABLE(nbpage), frame, 0, 3, 1, 4);
// gtk_box_pack_start(GTK_BOX(nbpage), frame, FALSE, FALSE, 0); /* gtk_box_pack_start(GTK_BOX(nbpage), frame, FALSE, FALSE, 0); */
table = gtk_table_new(3, 4, FALSE); table = gtk_table_new(3, 4, FALSE);
gtk_container_set_border_width(GTK_CONTAINER(table), 5); gtk_container_set_border_width(GTK_CONTAINER(table), 5);
@@ -1037,7 +1037,7 @@ GtkAdjustment *adjust;
nblabel = gtk_label_new("Files"); nblabel = gtk_label_new("Files");
nbpage = gtk_hbox_new(TRUE, 5); nbpage = gtk_hbox_new(TRUE, 5);
gtk_container_set_border_width(GTK_CONTAINER(nbpage), 5); gtk_container_set_border_width(GTK_CONTAINER(nbpage), 5);
// gtk_table_set_col_spacings(GTK_TABLE(nbpage), 5); /* gtk_table_set_col_spacings(GTK_TABLE(nbpage), 5); */
frame = gtk_frame_new("Input File"); frame = gtk_frame_new("Input File");
gtk_box_pack_start(GTK_BOX(nbpage), frame, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(nbpage), frame, TRUE, TRUE, 0);
@@ -1251,7 +1251,7 @@ GtkAdjustment *adjust;
table = gtk_table_new(4, 2, FALSE); table = gtk_table_new(4, 2, FALSE);
gtk_container_set_border_width(GTK_CONTAINER(table), 5); gtk_container_set_border_width(GTK_CONTAINER(table), 5);
// gtk_table_set_col_spacings(GTK_TABLE(table), 5); /* gtk_table_set_col_spacings(GTK_TABLE(table), 5); */
gtk_container_add(GTK_CONTAINER(frame), table); gtk_container_add(GTK_CONTAINER(frame), table);
opt.useSourceDevice = gtk_check_button_new_with_label("Device"); opt.useSourceDevice = gtk_check_button_new_with_label("Device");

View File

@@ -201,7 +201,7 @@ main (int argc,
return 0; return 0;
} }
// tokensz is the total size of token in characters /* tokensz is the total size of token in characters */
static char *next_token(char *buf, char *token, int tokensz) static char *next_token(char *buf, char *token, int tokensz)
{ {
if ((buf != NULL) && (token != NULL)) { if ((buf != NULL) && (token != NULL)) {
@@ -238,15 +238,16 @@ static char *build_command()
static char *command = NULL; static char *command = NULL;
int command_size = 2560; int command_size = 2560;
/* Find how much to malloc() */ /* Find how much to malloc()
// size = strlen(gtk_entry_get_text(GTK_ENTRY(opt.range_text))) + * size = strlen(gtk_entry_get_text(GTK_ENTRY(opt.range_text))) +
// strlen(gtk_entry_get_text(GTK_ENTRY(opt.Decoy))) + * strlen(gtk_entry_get_text(GTK_ENTRY(opt.Decoy))) +
// strlen(gtk_entry_get_text(GTK_ENTRY(opt.inputFilename))) + * strlen(gtk_entry_get_text(GTK_ENTRY(opt.inputFilename))) +
// strlen(gtk_entry_get_text(GTK_ENTRY(opt.SourceDevice)))+ * strlen(gtk_entry_get_text(GTK_ENTRY(opt.SourceDevice)))+
// strlen(gtk_entry_get_text(GTK_ENTRY(opt.scanRelay)))+ * strlen(gtk_entry_get_text(GTK_ENTRY(opt.scanRelay)))+
// strlen(gtk_entry_get_text(GTK_ENTRY(opt.targetHost))) + * strlen(gtk_entry_get_text(GTK_ENTRY(opt.targetHost))) +
// 2560; * 2560;
/* We get 60 from the chars required for each option */ * We get 60 from the chars required for each option
*/
if (!command) if (!command)
command = safe_malloc(command_size); command = safe_malloc(command_size);
@@ -713,7 +714,7 @@ static char *next_line(char *buf, int bufsz, char *line)
if (eol != NULL) { if (eol != NULL) {
char *bol = buf; char *bol = buf;
int linelen = MIN(bufsz - 1, eol - buf + 1); // we can't exceed buffer size int linelen = MIN(bufsz - 1, eol - buf + 1); /* we can't exceed buffer size */
/* copy line including \n to line */ /* copy line including \n to line */
memcpy(line, buf, linelen); memcpy(line, buf, linelen);
@@ -1014,13 +1015,13 @@ void scanType_cb
opt.scanValue = user[k].scantype; opt.scanValue = user[k].scantype;
if ((opt.scanValue == PING_SCAN) || (opt.scanValue == LIST_SCAN)) { if ((opt.scanValue == PING_SCAN) || (opt.scanValue == LIST_SCAN)) {
// gtk_widget_set_sensitive(GTK_WIDGET(opt.protportFrame), FALSE); /* gtk_widget_set_sensitive(GTK_WIDGET(opt.protportFrame), FALSE); */
gtk_widget_set_sensitive(GTK_WIDGET(opt.protportType), FALSE); gtk_widget_set_sensitive(GTK_WIDGET(opt.protportType), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(opt.protportLabel), FALSE); gtk_widget_set_sensitive(GTK_WIDGET(opt.protportLabel), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(opt.protportRange), FALSE); gtk_widget_set_sensitive(GTK_WIDGET(opt.protportRange), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(opt.OSInfo), FALSE); gtk_widget_set_sensitive(GTK_WIDGET(opt.OSInfo), FALSE);
} else { } else {
// gtk_widget_set_sensitive(GTK_WIDGET(opt.protportFrame), TRUE); /* gtk_widget_set_sensitive(GTK_WIDGET(opt.protportFrame), TRUE); */
gtk_widget_set_sensitive(GTK_WIDGET(opt.protportType), TRUE); gtk_widget_set_sensitive(GTK_WIDGET(opt.protportType), TRUE);
gtk_widget_set_sensitive(GTK_WIDGET(opt.protportLabel), gtk_widget_set_sensitive(GTK_WIDGET(opt.protportLabel),
(opt.protportValue == GIVEN_PROTPORT)); (opt.protportValue == GIVEN_PROTPORT));

View File

@@ -1,7 +1,7 @@
/*************************************************************************** /***************************************************************************
* scanengine.cc -- Includes much of the "engine" functions for scanning, * * scanengine.cc -- Includes much of the "engine" functions for scanning, *
* such as pos_scan and super_scan. It also includes dependant functions * * such as pos_scan and ultra_scan. It also includes dependant functions *
* such as those for collectiong SYN/connect scan responses. * * such as those for collectiong SYN/connect scan responses. *
* * * *
***********************IMPORTANT NMAP LICENSE TERMS************************ ***********************IMPORTANT NMAP LICENSE TERMS************************

View File

@@ -1,7 +1,7 @@
/*************************************************************************** /***************************************************************************
* scanengine.h -- Includes much of the "engine" functions for scanning, * * scanengine.h -- Includes much of the "engine" functions for scanning, *
* such as pos_scan and super_scan. It also includes dependant functions * * such as pos_scan and ultra_scan. It also includes dependant functions *
* such as those for collectiong SYN/connect scan responses. * * such as those for collectiong SYN/connect scan responses. *
* * * *
***********************IMPORTANT NMAP LICENSE TERMS************************ ***********************IMPORTANT NMAP LICENSE TERMS************************
@@ -122,12 +122,6 @@ void pos_scan(Target *target, u16 *portarray, int numports, stype scantype);
void bounce_scan(Target *target, u16 *portarray, int numports, void bounce_scan(Target *target, u16 *portarray, int numports,
struct ftpinfo *ftp); struct ftpinfo *ftp);
/* Handles the scan types where no positive-acknowledgement of open
port is received (those scans are in pos_scan). Super_scan
includes scans such as FIN/XMAS/NULL/Maimon/UDP and IP Proto scans */
void super_scan(Target *target, u16 *portarray, int numports,
stype scantype);
/* Determines an ideal number of hosts to be scanned (port scan, os /* Determines an ideal number of hosts to be scanned (port scan, os
scan, version detection, etc.) in parallel after the ping scan is scan, version detection, etc.) in parallel after the ping scan is
completed. This is a balance between efficiency (more hosts in completed. This is a balance between efficiency (more hosts in