Browse Source

Initial import of knmap 2.1 sources

tags/r14.0.0
Timothy Pearson 5 years ago
commit
066bae76e9
100 changed files with 20603 additions and 0 deletions
  1. 1
    0
      AUTHORS
  2. 340
    0
      COPYING
  3. 36
    0
      ChangeLog
  4. 178
    0
      INSTALL
  5. 22
    0
      Makefile.am
  6. 10
    0
      Makefile.cvs
  7. 0
    0
      NEWS
  8. 4
    0
      README
  9. 0
    0
      TODO
  10. 11207
    0
      acinclude.m4
  11. 219
    0
      config.h.in
  12. 2
    0
      configure.files
  13. 82
    0
      configure.in
  14. 6
    0
      configure.in.in
  15. 6
    0
      doc/Makefile.am
  16. 3
    0
      doc/en/Makefile.am
  17. BIN
      doc/en/button_bar.png
  18. BIN
      doc/en/common_options.png
  19. BIN
      doc/en/compound_options.png
  20. BIN
      doc/en/demo.png
  21. 784
    0
      doc/en/index.docbook
  22. BIN
      doc/en/logging_options.png
  23. BIN
      doc/en/man_page.png
  24. BIN
      doc/en/man_page_full.png
  25. BIN
      doc/en/new_scan.png
  26. BIN
      doc/en/output_full.png
  27. BIN
      doc/en/ping_and_scan_options.png
  28. BIN
      doc/en/profile_dlg.png
  29. BIN
      doc/en/simple_options.png
  30. BIN
      doc/en/timing_options.png
  31. 1
    0
      po/Makefile.am
  32. 46
    0
      src/Makefile.am
  33. 655
    0
      src/commonwidget.cpp
  34. 140
    0
      src/commonwidget.h
  35. 682
    0
      src/compoundwidget.cpp
  36. 192
    0
      src/compoundwidget.h
  37. 60
    0
      src/global.h
  38. BIN
      src/hi16-app-knmap.png
  39. BIN
      src/hi16-app-knmapman.png
  40. BIN
      src/hi16-app-localman.png
  41. BIN
      src/hi16-app-manpage.png
  42. BIN
      src/hi16-app-manstylesheet.png
  43. BIN
      src/hi16-app-profilecopy.png
  44. BIN
      src/hi16-app-profiledelete.png
  45. BIN
      src/hi16-app-profileload.png
  46. BIN
      src/hi16-app-profilerename.png
  47. BIN
      src/hi16-app-profilesave.png
  48. BIN
      src/hi16-app-profilesaveas.png
  49. BIN
      src/hi16-app-scanclose.png
  50. BIN
      src/hi16-app-scanduplicate.png
  51. BIN
      src/hi16-app-scannew.png
  52. BIN
      src/hi16-app-scanrename.png
  53. BIN
      src/hi16-app-zoomcustom.png
  54. BIN
      src/hi16-app-zoomin.png
  55. BIN
      src/hi16-app-zoomout.png
  56. BIN
      src/hi32-app-knmap.png
  57. BIN
      src/hi32-app-knmapman.png
  58. BIN
      src/hi32-app-localman.png
  59. BIN
      src/hi32-app-manpage.png
  60. BIN
      src/hi32-app-manstylesheet.png
  61. BIN
      src/hi32-app-profilecopy.png
  62. BIN
      src/hi32-app-profiledelete.png
  63. BIN
      src/hi32-app-profileload.png
  64. BIN
      src/hi32-app-profilerename.png
  65. BIN
      src/hi32-app-profilesave.png
  66. BIN
      src/hi32-app-profilesaveas.png
  67. BIN
      src/hi32-app-scanclose.png
  68. BIN
      src/hi32-app-scanduplicate.png
  69. BIN
      src/hi32-app-scannew.png
  70. BIN
      src/hi32-app-scanrename.png
  71. BIN
      src/hi32-app-zoomcustom.png
  72. BIN
      src/hi32-app-zoomin.png
  73. BIN
      src/hi32-app-zoomout.png
  74. 366
    0
      src/htmlwidget.cpp
  75. 95
    0
      src/htmlwidget.h
  76. 273
    0
      src/indexwidget.cpp
  77. 75
    0
      src/indexwidget.h
  78. 405
    0
      src/knmap.cpp
  79. 42
    0
      src/knmap.desktop
  80. 81
    0
      src/knmap.h
  81. 38
    0
      src/knmapui.rc
  82. 460
    0
      src/loggingoptions.cpp
  83. 141
    0
      src/loggingoptions.h
  84. 78
    0
      src/main.cpp
  85. 463
    0
      src/mainwidget.cpp
  86. 111
    0
      src/mainwidget.h
  87. 1176
    0
      src/nmap_manpage.html
  88. 557
    0
      src/nmap_manpage.html.diff
  89. 41
    0
      src/nmapoutputbuffer.cpp
  90. 50
    0
      src/nmapoutputbuffer.h
  91. 174
    0
      src/outputwidget.cpp
  92. 79
    0
      src/outputwidget.h
  93. 415
    0
      src/pandsoptions.cpp
  94. 153
    0
      src/pandsoptions.h
  95. 325
    0
      src/profiledialog.cpp
  96. 90
    0
      src/profiledialog.h
  97. 139
    0
      src/scanmonitor.cpp
  98. 68
    0
      src/scanmonitor.h
  99. 32
    0
      src/scanmonitorevent.cpp
  100. 0
    0
      src/scanmonitorevent.h

+ 1
- 0
AUTHORS View File

@@ -0,0 +1 @@
1
+Kevin Gilbert <kev.gilbert@cdu.edu.au>

+ 340
- 0
COPYING View File

@@ -0,0 +1,340 @@
1
+		    GNU GENERAL PUBLIC LICENSE
2
+		       Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+			    Preamble
10
+
11
+  The licenses for most software are designed to take away your
12
+freedom to share and change it.  By contrast, the GNU General Public
13
+License is intended to guarantee your freedom to share and change free
14
+software--to make sure the software is free for all its users.  This
15
+General Public License applies to most of the Free Software
16
+Foundation's software and to any other program whose authors commit to
17
+using it.  (Some other Free Software Foundation software is covered by
18
+the GNU Library General Public License instead.)  You can apply it to
19
+your programs, too.
20
+
21
+  When we speak of free software, we are referring to freedom, not
22
+price.  Our General Public Licenses are designed to make sure that you
23
+have the freedom to distribute copies of free software (and charge for
24
+this service if you wish), that you receive source code or can get it
25
+if you want it, that you can change the software or use pieces of it
26
+in new free programs; and that you know you can do these things.
27
+
28
+  To protect your rights, we need to make restrictions that forbid
29
+anyone to deny you these rights or to ask you to surrender the rights.
30
+These restrictions translate to certain responsibilities for you if you
31
+distribute copies of the software, or if you modify it.
32
+
33
+  For example, if you distribute copies of such a program, whether
34
+gratis or for a fee, you must give the recipients all the rights that
35
+you have.  You must make sure that they, too, receive or can get the
36
+source code.  And you must show them these terms so they know their
37
+rights.
38
+
39
+  We protect your rights with two steps: (1) copyright the software, and
40
+(2) offer you this license which gives you legal permission to copy,
41
+distribute and/or modify the software.
42
+
43
+  Also, for each author's protection and ours, we want to make certain
44
+that everyone understands that there is no warranty for this free
45
+software.  If the software is modified by someone else and passed on, we
46
+want its recipients to know that what they have is not the original, so
47
+that any problems introduced by others will not reflect on the original
48
+authors' reputations.
49
+
50
+  Finally, any free program is threatened constantly by software
51
+patents.  We wish to avoid the danger that redistributors of a free
52
+program will individually obtain patent licenses, in effect making the
53
+program proprietary.  To prevent this, we have made it clear that any
54
+patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+  The precise terms and conditions for copying, distribution and
57
+modification follow.
58
+
59
+		    GNU GENERAL PUBLIC LICENSE
60
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+  0. This License applies to any program or other work which contains
63
+a notice placed by the copyright holder saying it may be distributed
64
+under the terms of this General Public License.  The "Program", below,
65
+refers to any such program or work, and a "work based on the Program"
66
+means either the Program or any derivative work under copyright law:
67
+that is to say, a work containing the Program or a portion of it,
68
+either verbatim or with modifications and/or translated into another
69
+language.  (Hereinafter, translation is included without limitation in
70
+the term "modification".)  Each licensee is addressed as "you".
71
+
72
+Activities other than copying, distribution and modification are not
73
+covered by this License; they are outside its scope.  The act of
74
+running the Program is not restricted, and the output from the Program
75
+is covered only if its contents constitute a work based on the
76
+Program (independent of having been made by running the Program).
77
+Whether that is true depends on what the Program does.
78
+
79
+  1. You may copy and distribute verbatim copies of the Program's
80
+source code as you receive it, in any medium, provided that you
81
+conspicuously and appropriately publish on each copy an appropriate
82
+copyright notice and disclaimer of warranty; keep intact all the
83
+notices that refer to this License and to the absence of any warranty;
84
+and give any other recipients of the Program a copy of this License
85
+along with the Program.
86
+
87
+You may charge a fee for the physical act of transferring a copy, and
88
+you may at your option offer warranty protection in exchange for a fee.
89
+
90
+  2. You may modify your copy or copies of the Program or any portion
91
+of it, thus forming a work based on the Program, and copy and
92
+distribute such modifications or work under the terms of Section 1
93
+above, provided that you also meet all of these conditions:
94
+
95
+    a) You must cause the modified files to carry prominent notices
96
+    stating that you changed the files and the date of any change.
97
+
98
+    b) You must cause any work that you distribute or publish, that in
99
+    whole or in part contains or is derived from the Program or any
100
+    part thereof, to be licensed as a whole at no charge to all third
101
+    parties under the terms of this License.
102
+
103
+    c) If the modified program normally reads commands interactively
104
+    when run, you must cause it, when started running for such
105
+    interactive use in the most ordinary way, to print or display an
106
+    announcement including an appropriate copyright notice and a
107
+    notice that there is no warranty (or else, saying that you provide
108
+    a warranty) and that users may redistribute the program under
109
+    these conditions, and telling the user how to view a copy of this
110
+    License.  (Exception: if the Program itself is interactive but
111
+    does not normally print such an announcement, your work based on
112
+    the Program is not required to print an announcement.)
113
+
114
+These requirements apply to the modified work as a whole.  If
115
+identifiable sections of that work are not derived from the Program,
116
+and can be reasonably considered independent and separate works in
117
+themselves, then this License, and its terms, do not apply to those
118
+sections when you distribute them as separate works.  But when you
119
+distribute the same sections as part of a whole which is a work based
120
+on the Program, the distribution of the whole must be on the terms of
121
+this License, whose permissions for other licensees extend to the
122
+entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+Thus, it is not the intent of this section to claim rights or contest
125
+your rights to work written entirely by you; rather, the intent is to
126
+exercise the right to control the distribution of derivative or
127
+collective works based on the Program.
128
+
129
+In addition, mere aggregation of another work not based on the Program
130
+with the Program (or with a work based on the Program) on a volume of
131
+a storage or distribution medium does not bring the other work under
132
+the scope of this License.
133
+
134
+  3. You may copy and distribute the Program (or a work based on it,
135
+under Section 2) in object code or executable form under the terms of
136
+Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+    a) Accompany it with the complete corresponding machine-readable
139
+    source code, which must be distributed under the terms of Sections
140
+    1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+    b) Accompany it with a written offer, valid for at least three
143
+    years, to give any third party, for a charge no more than your
144
+    cost of physically performing source distribution, a complete
145
+    machine-readable copy of the corresponding source code, to be
146
+    distributed under the terms of Sections 1 and 2 above on a medium
147
+    customarily used for software interchange; or,
148
+
149
+    c) Accompany it with the information you received as to the offer
150
+    to distribute corresponding source code.  (This alternative is
151
+    allowed only for noncommercial distribution and only if you
152
+    received the program in object code or executable form with such
153
+    an offer, in accord with Subsection b above.)
154
+
155
+The source code for a work means the preferred form of the work for
156
+making modifications to it.  For an executable work, complete source
157
+code means all the source code for all modules it contains, plus any
158
+associated interface definition files, plus the scripts used to
159
+control compilation and installation of the executable.  However, as a
160
+special exception, the source code distributed need not include
161
+anything that is normally distributed (in either source or binary
162
+form) with the major components (compiler, kernel, and so on) of the
163
+operating system on which the executable runs, unless that component
164
+itself accompanies the executable.
165
+
166
+If distribution of executable or object code is made by offering
167
+access to copy from a designated place, then offering equivalent
168
+access to copy the source code from the same place counts as
169
+distribution of the source code, even though third parties are not
170
+compelled to copy the source along with the object code.
171
+
172
+  4. You may not copy, modify, sublicense, or distribute the Program
173
+except as expressly provided under this License.  Any attempt
174
+otherwise to copy, modify, sublicense or distribute the Program is
175
+void, and will automatically terminate your rights under this License.
176
+However, parties who have received copies, or rights, from you under
177
+this License will not have their licenses terminated so long as such
178
+parties remain in full compliance.
179
+
180
+  5. You are not required to accept this License, since you have not
181
+signed it.  However, nothing else grants you permission to modify or
182
+distribute the Program or its derivative works.  These actions are
183
+prohibited by law if you do not accept this License.  Therefore, by
184
+modifying or distributing the Program (or any work based on the
185
+Program), you indicate your acceptance of this License to do so, and
186
+all its terms and conditions for copying, distributing or modifying
187
+the Program or works based on it.
188
+
189
+  6. Each time you redistribute the Program (or any work based on the
190
+Program), the recipient automatically receives a license from the
191
+original licensor to copy, distribute or modify the Program subject to
192
+these terms and conditions.  You may not impose any further
193
+restrictions on the recipients' exercise of the rights granted herein.
194
+You are not responsible for enforcing compliance by third parties to
195
+this License.
196
+
197
+  7. If, as a consequence of a court judgment or allegation of patent
198
+infringement or for any other reason (not limited to patent issues),
199
+conditions are imposed on you (whether by court order, agreement or
200
+otherwise) that contradict the conditions of this License, they do not
201
+excuse you from the conditions of this License.  If you cannot
202
+distribute so as to satisfy simultaneously your obligations under this
203
+License and any other pertinent obligations, then as a consequence you
204
+may not distribute the Program at all.  For example, if a patent
205
+license would not permit royalty-free redistribution of the Program by
206
+all those who receive copies directly or indirectly through you, then
207
+the only way you could satisfy both it and this License would be to
208
+refrain entirely from distribution of the Program.
209
+
210
+If any portion of this section is held invalid or unenforceable under
211
+any particular circumstance, the balance of the section is intended to
212
+apply and the section as a whole is intended to apply in other
213
+circumstances.
214
+
215
+It is not the purpose of this section to induce you to infringe any
216
+patents or other property right claims or to contest validity of any
217
+such claims; this section has the sole purpose of protecting the
218
+integrity of the free software distribution system, which is
219
+implemented by public license practices.  Many people have made
220
+generous contributions to the wide range of software distributed
221
+through that system in reliance on consistent application of that
222
+system; it is up to the author/donor to decide if he or she is willing
223
+to distribute software through any other system and a licensee cannot
224
+impose that choice.
225
+
226
+This section is intended to make thoroughly clear what is believed to
227
+be a consequence of the rest of this License.
228
+
229
+  8. If the distribution and/or use of the Program is restricted in
230
+certain countries either by patents or by copyrighted interfaces, the
231
+original copyright holder who places the Program under this License
232
+may add an explicit geographical distribution limitation excluding
233
+those countries, so that distribution is permitted only in or among
234
+countries not thus excluded.  In such case, this License incorporates
235
+the limitation as if written in the body of this License.
236
+
237
+  9. The Free Software Foundation may publish revised and/or new versions
238
+of the General Public License from time to time.  Such new versions will
239
+be similar in spirit to the present version, but may differ in detail to
240
+address new problems or concerns.
241
+
242
+Each version is given a distinguishing version number.  If the Program
243
+specifies a version number of this License which applies to it and "any
244
+later version", you have the option of following the terms and conditions
245
+either of that version or of any later version published by the Free
246
+Software Foundation.  If the Program does not specify a version number of
247
+this License, you may choose any version ever published by the Free Software
248
+Foundation.
249
+
250
+  10. If you wish to incorporate parts of the Program into other free
251
+programs whose distribution conditions are different, write to the author
252
+to ask for permission.  For software which is copyrighted by the Free
253
+Software Foundation, write to the Free Software Foundation; we sometimes
254
+make exceptions for this.  Our decision will be guided by the two goals
255
+of preserving the free status of all derivatives of our free software and
256
+of promoting the sharing and reuse of software generally.
257
+
258
+			    NO WARRANTY
259
+
260
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
262
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
266
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
267
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+REPAIR OR CORRECTION.
269
+
270
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+POSSIBILITY OF SUCH DAMAGES.
279
+
280
+		     END OF TERMS AND CONDITIONS
281
+
282
+	    How to Apply These Terms to Your New Programs
283
+
284
+  If you develop a new program, and you want it to be of the greatest
285
+possible use to the public, the best way to achieve this is to make it
286
+free software which everyone can redistribute and change under these terms.
287
+
288
+  To do so, attach the following notices to the program.  It is safest
289
+to attach them to the start of each source file to most effectively
290
+convey the exclusion of warranty; and each file should have at least
291
+the "copyright" line and a pointer to where the full notice is found.
292
+
293
+    <one line to give the program's name and a brief idea of what it does.>
294
+    Copyright (C) <year>  <name of author>
295
+
296
+    This program is free software; you can redistribute it and/or modify
297
+    it under the terms of the GNU General Public License as published by
298
+    the Free Software Foundation; either version 2 of the License, or
299
+    (at your option) any later version.
300
+
301
+    This program is distributed in the hope that it will be useful,
302
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
304
+    GNU General Public License for more details.
305
+
306
+    You should have received a copy of the GNU General Public License
307
+    along with this program; if not, write to the Free Software
308
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
309
+
310
+
311
+Also add information on how to contact you by electronic and paper mail.
312
+
313
+If the program is interactive, make it output a short notice like this
314
+when it starts in an interactive mode:
315
+
316
+    Gnomovision version 69, Copyright (C) year name of author
317
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
318
+    This is free software, and you are welcome to redistribute it
319
+    under certain conditions; type `show c' for details.
320
+
321
+The hypothetical commands `show w' and `show c' should show the appropriate
322
+parts of the General Public License.  Of course, the commands you use may
323
+be called something other than `show w' and `show c'; they could even be
324
+mouse-clicks or menu items--whatever suits your program.
325
+
326
+You should also get your employer (if you work as a programmer) or your
327
+school, if any, to sign a "copyright disclaimer" for the program, if
328
+necessary.  Here is a sample; alter the names:
329
+
330
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
331
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
332
+
333
+  <signature of Ty Coon>, 1 April 1989
334
+  Ty Coon, President of Vice
335
+
336
+This General Public License does not permit incorporating your program into
337
+proprietary programs.  If your program is a subroutine library, you may
338
+consider it more useful to permit linking proprietary applications with the
339
+library.  If this is what you want to do, use the GNU Library General
340
+Public License instead of this License.

+ 36
- 0
ChangeLog View File

@@ -0,0 +1,36 @@
1
+2.1
2
+===
3
+
4
+* If root-only options are selected by a 'normal' user,
5
+  the 'kdesu' facility is envoked to run nmap as root
6
+
7
+* Previously all nmap output was "wrapped", this is now
8
+  an option. The default is to wrap long lines.
9
+
10
+2.0
11
+===
12
+
13
+* Minor syntax corrections
14
+* No major changes since 2.0-beta-1
15
+
16
+2.0-beta-1
17
+==========
18
+
19
+* Added support for multiple concurrent scans
20
+
21
+1.0
22
+===
23
+
24
+* Added support for the "-6" and "-A' nmap options
25
+
26
+* Changes to the docbook documentation for the "-6"
27
+  and "-A" option support and other small changes.
28
+
29
+1.0-beta-1
30
+==========
31
+
32
+* This is a completely new program!
33
+
34
+  There was a prior Knmap - the last version was 0.9
35
+  but that version does not compile under the current
36
+  Qt / KDE environments.

+ 178
- 0
INSTALL View File

@@ -0,0 +1,178 @@
1
+For the impatient
2
+=================
3
+
4
+	./configure
5
+	make
6
+	make install
7
+
8
+	Dont blame me if your impatience f**ks up your machine. But
9
+please email me with your tale of woe. I always enjoy a good belly
10
+laugh! ;)
11
+
12
+Basic Installation
13
+==================
14
+
15
+   These are generic installation instructions.
16
+
17
+   The `configure' shell script attempts to guess correct values for
18
+various system-dependent variables used during compilation.  It uses
19
+those values to create a `Makefile' in each directory of the package.
20
+It may also create one or more `.h' files containing system-dependent
21
+definitions.  Finally, it creates a shell script `config.status' that
22
+you can run in the future to recreate the current configuration, a file
23
+`config.cache' that saves the results of its tests to speed up
24
+reconfiguring, and a file `config.log' containing compiler output
25
+(useful mainly for debugging `configure').
26
+
27
+   If you need to do unusual things to compile the package, please try
28
+to figure out how `configure' could check whether to do them, and mail
29
+diffs or instructions to the address given in the `README' so they can
30
+be considered for the next release.  If at some point `config.cache'
31
+contains results you don't want to keep, you may remove or edit it.
32
+
33
+   The file `configure.in' is used to create `configure' by a program
34
+called `autoconf'.  You only need `configure.in' if you want to change
35
+it or regenerate `configure' using a newer version of `autoconf'.
36
+
37
+The simplest way to compile this package is:
38
+
39
+  1. `cd' to the directory containing the package's source code and type
40
+     `./configure' to configure the package for your system.  If you're
41
+     using `csh' on an old version of System V, you might need to type
42
+     `sh ./configure' instead to prevent `csh' from trying to execute
43
+     `configure' itself.
44
+
45
+     Running `configure' takes a while.  While running, it prints some
46
+     messages telling which features it is checking for.
47
+
48
+  2. Type `make' to compile the package.
49
+
50
+  3. Type `make install' to install the programs and any data files and
51
+     documentation.
52
+
53
+  4. You can remove the program binaries and object files from the
54
+     source code directory by typing `make clean'.  
55
+
56
+Compilers and Options
57
+=====================
58
+
59
+   Some systems require unusual options for compilation or linking that
60
+the `configure' script does not know about.  You can give `configure'
61
+initial values for variables by setting them in the environment.  Using
62
+a Bourne-compatible shell, you can do that on the command line like
63
+this:
64
+     CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
65
+
66
+Or on systems that have the `env' program, you can do it like this:
67
+     env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
68
+
69
+Compiling For Multiple Architectures
70
+====================================
71
+
72
+   You can compile the package for more than one kind of computer at the
73
+same time, by placing the object files for each architecture in their
74
+own directory.  To do this, you must use a version of `make' that
75
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
76
+directory where you want the object files and executables to go and run
77
+the `configure' script.  `configure' automatically checks for the
78
+source code in the directory that `configure' is in and in `..'.
79
+
80
+   If you have to use a `make' that does not supports the `VPATH'
81
+variable, you have to compile the package for one architecture at a time
82
+in the source code directory.  After you have installed the package for
83
+one architecture, use `make distclean' before reconfiguring for another
84
+architecture.
85
+
86
+Installation Names
87
+==================
88
+
89
+   By default, `make install' will install the package's files in
90
+`/usr/local/bin', `/usr/local/man', etc.  You can specify an
91
+installation prefix other than `/usr/local' by giving `configure' the
92
+option `--prefix=PATH'.
93
+
94
+   You can specify separate installation prefixes for
95
+architecture-specific files and architecture-independent files.  If you
96
+give `configure' the option `--exec-prefix=PATH', the package will use
97
+PATH as the prefix for installing programs and libraries.
98
+Documentation and other data files will still use the regular prefix.
99
+
100
+   If the package supports it, you can cause programs to be installed
101
+with an extra prefix or suffix on their names by giving `configure' the
102
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
103
+
104
+Optional Features
105
+=================
106
+
107
+   Some packages pay attention to `--enable-FEATURE' options to
108
+`configure', where FEATURE indicates an optional part of the package.
109
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
110
+is something like `gnu-as' or `x' (for the X Window System).  The
111
+`README' should mention any `--enable-' and `--with-' options that the
112
+package recognizes.
113
+
114
+   For packages that use the X Window System, `configure' can usually
115
+find the X include and library files automatically, but if it doesn't,
116
+you can use the `configure' options `--x-includes=DIR' and
117
+`--x-libraries=DIR' to specify their locations.
118
+
119
+Specifying the System Type
120
+==========================
121
+
122
+   There may be some features `configure' can not figure out
123
+automatically, but needs to determine by the type of host the package
124
+will run on.  Usually `configure' can figure that out, but if it prints
125
+a message saying it can not guess the host type, give it the
126
+`--host=TYPE' option.  TYPE can either be a short name for the system
127
+type, such as `sun4', or a canonical name with three fields:
128
+     CPU-COMPANY-SYSTEM
129
+
130
+See the file `config.sub' for the possible values of each field.  If
131
+`config.sub' isn't included in this package, then this package doesn't
132
+need to know the host type.
133
+
134
+   If you are building compiler tools for cross-compiling, you can also
135
+use the `--target=TYPE' option to select the type of system they will
136
+produce code for and the `--build=TYPE' option to select the type of
137
+system on which you are compiling the package.
138
+
139
+Sharing Defaults
140
+================
141
+
142
+   If you want to set default values for `configure' scripts to share,
143
+you can create a site shell script called `config.site' that gives
144
+default values for variables like `CC', `cache_file', and `prefix'.
145
+`configure' looks for `PREFIX/share/config.site' if it exists, then
146
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
147
+`CONFIG_SITE' environment variable to the location of the site script.
148
+A warning: not all `configure' scripts look for a site script.
149
+
150
+Operation Controls
151
+==================
152
+
153
+   `configure' recognizes the following options to control how it
154
+operates.
155
+
156
+`--cache-file=FILE'
157
+     Use and save the results of the tests in FILE instead of
158
+     `./config.cache'.  Set FILE to `/dev/null' to disable caching, for
159
+     debugging `configure'.
160
+
161
+`--help'
162
+     Print a summary of the options to `configure', and exit.
163
+
164
+`--quiet'
165
+`--silent'
166
+`-q'
167
+     Do not print messages saying which checks are being made.
168
+
169
+`--srcdir=DIR'
170
+     Look for the package's source code in directory DIR.  Usually
171
+     `configure' can determine that directory automatically.
172
+
173
+`--version'
174
+     Print the version of Autoconf used to generate the `configure'
175
+     script, and exit.
176
+
177
+`configure' also accepts some other, not widely useful, options.
178
+

+ 22
- 0
Makefile.am View File

@@ -0,0 +1,22 @@
1
+SUBDIRS = $(TOPSUBDIRS)
2
+
3
+$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs
4
+	cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ;
5
+
6
+$(top_srcdir)/subdirs:
7
+	cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs
8
+
9
+$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in
10
+	@cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4
11
+
12
+MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files 
13
+
14
+package-messages:
15
+	cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common package-messages
16
+	$(MAKE) -C po merge
17
+
18
+EXTRA_DIST = admin COPYING configure.in.in
19
+
20
+dist-hook:
21
+	cd $(top_distdir) && perl admin/am_edit -padmin
22
+	cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs

+ 10
- 0
Makefile.cvs View File

@@ -0,0 +1,10 @@
1
+all: 
2
+	@echo "This Makefile is only for the CVS repository"
3
+	@echo "This will be deleted before making the distribution"
4
+	@echo ""
5
+	$(MAKE) -f admin/Makefile.common cvs
6
+
7
+dist:
8
+	$(MAKE) -f admin/Makefile.common dist
9
+
10
+.SILENT:

+ 0
- 0
NEWS View File


+ 4
- 0
README View File

@@ -0,0 +1,4 @@
1
+If you've got time to read this file you've got
2
+too much time on your hands.
3
+
4
+Go get a life!

+ 0
- 0
TODO View File


+ 11207
- 0
acinclude.m4
File diff suppressed because it is too large
View File


+ 219
- 0
config.h.in View File

@@ -0,0 +1,219 @@
1
+/* config.h.in.  Generated from configure.in by autoheader.  */
2
+
3
+/* Define if you have the CoreAudio API */
4
+#undef HAVE_COREAUDIO
5
+
6
+/* Define to 1 if you have the <crt_externs.h> header file. */
7
+#undef HAVE_CRT_EXTERNS_H
8
+
9
+/* Defines if your system has the crypt function */
10
+#undef HAVE_CRYPT
11
+
12
+/* Define to 1 if you have the <dlfcn.h> header file. */
13
+#undef HAVE_DLFCN_H
14
+
15
+/* Define to 1 if you have the <inttypes.h> header file. */
16
+#undef HAVE_INTTYPES_H
17
+
18
+/* Define if you have libjpeg */
19
+#undef HAVE_LIBJPEG
20
+
21
+/* Define if you have libpng */
22
+#undef HAVE_LIBPNG
23
+
24
+/* Define if you have a working libpthread (will enable threaded code) */
25
+#undef HAVE_LIBPTHREAD
26
+
27
+/* Define if you have libz */
28
+#undef HAVE_LIBZ
29
+
30
+/* Define to 1 if you have the <memory.h> header file. */
31
+#undef HAVE_MEMORY_H
32
+
33
+/* Define if your system needs _NSGetEnviron to set up the environment */
34
+#undef HAVE_NSGETENVIRON
35
+
36
+/* Define if you have the res_init function */
37
+#undef HAVE_RES_INIT
38
+
39
+/* Define if you have a STL implementation by SGI */
40
+#undef HAVE_SGI_STL
41
+
42
+/* Define to 1 if you have the `snprintf' function. */
43
+#undef HAVE_SNPRINTF
44
+
45
+/* Define to 1 if you have the <stdint.h> header file. */
46
+#undef HAVE_STDINT_H
47
+
48
+/* Define to 1 if you have the <stdlib.h> header file. */
49
+#undef HAVE_STDLIB_H
50
+
51
+/* Define to 1 if you have the <strings.h> header file. */
52
+#undef HAVE_STRINGS_H
53
+
54
+/* Define to 1 if you have the <string.h> header file. */
55
+#undef HAVE_STRING_H
56
+
57
+/* Define if you have strlcat */
58
+#undef HAVE_STRLCAT
59
+
60
+/* Define if you have the strlcat prototype */
61
+#undef HAVE_STRLCAT_PROTO
62
+
63
+/* Define if you have strlcpy */
64
+#undef HAVE_STRLCPY
65
+
66
+/* Define if you have the strlcpy prototype */
67
+#undef HAVE_STRLCPY_PROTO
68
+
69
+/* Define to 1 if you have the <sys/stat.h> header file. */
70
+#undef HAVE_SYS_STAT_H
71
+
72
+/* Define to 1 if you have the <sys/types.h> header file. */
73
+#undef HAVE_SYS_TYPES_H
74
+
75
+/* Define to 1 if you have the <unistd.h> header file. */
76
+#undef HAVE_UNISTD_H
77
+
78
+/* Define to 1 if you have the `vsnprintf' function. */
79
+#undef HAVE_VSNPRINTF
80
+
81
+/* Suffix for lib directories */
82
+#undef KDELIBSUFF
83
+
84
+/* Define a safe value for MAXPATHLEN */
85
+#undef KDEMAXPATHLEN
86
+
87
+/* Name of package */
88
+#undef PACKAGE
89
+
90
+/* Define to the address where bug reports for this package should be sent. */
91
+#undef PACKAGE_BUGREPORT
92
+
93
+/* Define to the full name of this package. */
94
+#undef PACKAGE_NAME
95
+
96
+/* Define to the full name and version of this package. */
97
+#undef PACKAGE_STRING
98
+
99
+/* Define to the one symbol short name of this package. */
100
+#undef PACKAGE_TARNAME
101
+
102
+/* Define to the version of this package. */
103
+#undef PACKAGE_VERSION
104
+
105
+/* The size of a `char *', as computed by sizeof. */
106
+#undef SIZEOF_CHAR_P
107
+
108
+/* The size of a `int', as computed by sizeof. */
109
+#undef SIZEOF_INT
110
+
111
+/* The size of a `long', as computed by sizeof. */
112
+#undef SIZEOF_LONG
113
+
114
+/* The size of a `short', as computed by sizeof. */
115
+#undef SIZEOF_SHORT
116
+
117
+/* The size of a `size_t', as computed by sizeof. */
118
+#undef SIZEOF_SIZE_T
119
+
120
+/* The size of a `unsigned long', as computed by sizeof. */
121
+#undef SIZEOF_UNSIGNED_LONG
122
+
123
+/* Define to 1 if you have the ANSI C header files. */
124
+#undef STDC_HEADERS
125
+
126
+/* Version number of package */
127
+#undef VERSION
128
+
129
+/* Define to 1 if your processor stores words with the most significant byte
130
+   first (like Motorola and SPARC, unlike Intel and VAX). */
131
+#undef WORDS_BIGENDIAN
132
+
133
+/*
134
+ * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
135
+ * headers and I'm too lazy to write a configure test as long as only
136
+ * unixware is related
137
+ */
138
+#ifdef _UNIXWARE
139
+#define HAVE_BOOLEAN
140
+#endif
141
+
142
+
143
+
144
+/*
145
+ * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
146
+ * that defines bzero.
147
+ */
148
+
149
+#if defined(_AIX)
150
+#include <strings.h>
151
+#endif
152
+
153
+
154
+
155
+#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
156
+# include <sys/time.h>
157
+# include <crt_externs.h>
158
+# define environ (*_NSGetEnviron())
159
+#endif
160
+
161
+
162
+
163
+#if !defined(HAVE_STRLCAT_PROTO)
164
+#ifdef __cplusplus
165
+extern "C" {
166
+#endif
167
+unsigned long strlcat(char*, const char*, unsigned long);
168
+#ifdef __cplusplus
169
+}
170
+#endif
171
+#endif
172
+
173
+
174
+
175
+#if !defined(HAVE_STRLCPY_PROTO)
176
+#ifdef __cplusplus
177
+extern "C" {
178
+#endif
179
+unsigned long strlcpy(char*, const char*, unsigned long);
180
+#ifdef __cplusplus
181
+}
182
+#endif
183
+#endif
184
+
185
+
186
+
187
+/*
188
+ * On HP-UX, the declaration of vsnprintf() is needed every time !
189
+ */
190
+
191
+#if !defined(HAVE_VSNPRINTF) || defined(hpux)
192
+#if __STDC__
193
+#include <stdarg.h>
194
+#include <stdlib.h>
195
+#else
196
+#include <varargs.h>
197
+#endif
198
+#ifdef __cplusplus
199
+extern "C"
200
+#endif
201
+int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
202
+#ifdef __cplusplus
203
+extern "C"
204
+#endif
205
+int snprintf(char *str, size_t n, char const *fmt, ...);
206
+#endif
207
+
208
+
209
+
210
+#if defined(__SVR4) && !defined(__svr4__)
211
+#define __svr4__ 1
212
+#endif
213
+
214
+
215
+/* Compatibility define */
216
+#undef ksize_t
217
+
218
+/* Define the real type of socklen_t */
219
+#undef socklen_t

+ 2
- 0
configure.files View File

@@ -0,0 +1,2 @@
1
+./admin/configure.in.min
2
+configure.in.in

+ 82
- 0
configure.in View File

@@ -0,0 +1,82 @@
1
+dnl    This file is part of the KDE libraries/packages
2
+dnl    Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
3
+ 
4
+dnl    This file is free software; you can redistribute it and/or
5
+dnl    modify it under the terms of the GNU Library General Public
6
+dnl    License as published by the Free Software Foundation; either
7
+dnl    version 2 of the License, or (at your option) any later version.
8
+ 
9
+dnl    This library is distributed in the hope that it will be useful,
10
+dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
+dnl    Library General Public License for more details.
13
+ 
14
+dnl    You should have received a copy of the GNU Library General Public License
15
+dnl    along with this library; see the file COPYING.LIB.  If not, write to
16
+dnl    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
+dnl    Boston, MA 02111-1307, USA.
18
+
19
+# Original Author was Kalle@kde.org
20
+# I lifted it in some mater. (Stephan Kulow)
21
+# I used much code from Janos Farkas
22
+
23
+dnl Process this file with autoconf to produce a configure script.
24
+
25
+AC_INIT(acinclude.m4) dnl a source file from your sub dir
26
+
27
+dnl This is so we can use kde-common
28
+AC_CONFIG_AUX_DIR(admin)
29
+
30
+dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
31
+unset CDPATH
32
+
33
+dnl Checking host/target/build systems, for make, install etc.
34
+AC_CANONICAL_SYSTEM 
35
+dnl Perform program name transformation
36
+AC_ARG_PROGRAM
37
+
38
+dnl Automake doc recommends to do this only here. (Janos)
39
+AM_INIT_AUTOMAKE(knmap, 0.1) dnl searches for some needed programs
40
+
41
+KDE_SET_PREFIX
42
+
43
+dnl generate the config header
44
+AM_CONFIG_HEADER(config.h) dnl at the distribution this done
45
+
46
+dnl Checks for programs.
47
+AC_CHECK_COMPILERS
48
+AC_ENABLE_SHARED(yes)
49
+AC_ENABLE_STATIC(no)
50
+KDE_PROG_LIBTOOL
51
+
52
+dnl for NLS support. Call them in this order!
53
+dnl WITH_NLS is for the po files
54
+AM_KDE_WITH_NLS
55
+
56
+KDE_USE_QT(3.2.0)
57
+AC_PATH_KDE
58
+#MIN_CONFIG(3.2.0)
59
+
60
+dnl PACKAGE set before
61
+AC_C_BIGENDIAN
62
+AC_CHECK_KDEMAXPATHLEN
63
+
64
+KDE_CREATE_SUBDIRSLIST
65
+AC_CONFIG_FILES([ Makefile ])
66
+AC_CONFIG_FILES([ doc/Makefile ])
67
+AC_CONFIG_FILES([ doc/en/Makefile ])
68
+AC_CONFIG_FILES([ po/Makefile ])
69
+AC_CONFIG_FILES([ src/Makefile ])
70
+AC_OUTPUT
71
+if test "$all_tests" = "bad"; then
72
+  if test ! "$cache_file" = "/dev/null"; then
73
+    echo ""    
74
+    echo "Please remove the file $cache_file after changing your setup"
75
+    echo "so that configure will find the changes next time."
76
+    echo ""
77
+  fi
78
+else
79
+  echo ""
80
+  echo "Good - your configure finished. Start make now"
81
+  echo ""
82
+fi

+ 6
- 0
configure.in.in View File

@@ -0,0 +1,6 @@
1
+#MIN_CONFIG(3.2.0)
2
+
3
+AM_INIT_AUTOMAKE(knmap, 0.1)
4
+AC_C_BIGENDIAN
5
+AC_CHECK_KDEMAXPATHLEN
6
+

+ 6
- 0
doc/Makefile.am View File

@@ -0,0 +1,6 @@
1
+# the SUBDIRS is filled automatically by am_edit. If files are 
2
+# in this directory they are installed into the english dir
3
+
4
+KDE_LANG = en
5
+KDE_DOCS = knmap
6
+SUBDIRS = $(AUTODIRS)  

+ 3
- 0
doc/en/Makefile.am View File

@@ -0,0 +1,3 @@
1
+KDE_DOCS = knmap
2
+KDE_LANG = en
3
+kde_docs_KDEDOCS = new_scan.png

BIN
doc/en/button_bar.png View File


BIN
doc/en/common_options.png View File


BIN
doc/en/compound_options.png View File


BIN
doc/en/demo.png View File


+ 784
- 0
doc/en/index.docbook View File

@@ -0,0 +1,784 @@
1
+<?xml version="1.0" ?>
2
+
3
+<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
4
+  <!ENTITY knmap "<application>Knmap</application>">
5
+  <!ENTITY kappname "&knmap;">
6
+  <!ENTITY package "kde-module"><!-- kdebase, kdeadmin, etc -->
7
+  <!ENTITY % addindex "IGNORE">
8
+  <!ENTITY % English "INCLUDE">
9
+]>
10
+
11
+<book lang="&language;">
12
+<bookinfo>
13
+	<title>The &knmap; Handbook</title>
14
+	
15
+	<authorgroup>
16
+		<author>
17
+			<firstname>Kevin</firstname>
18
+			<othername></othername>
19
+			<surname>Gilbert</surname>
20
+			<affiliation>
21
+				<address><email>kev.gilbert@cdu.edu.au</email></address>
22
+			</affiliation>
23
+		</author>
24
+	</authorgroup>
25
+	
26
+	<copyright>
27
+		<year>2005</year>
28
+		<year>2006</year>
29
+		<holder>Kevin Gilbert</holder>
30
+	</copyright>
31
+	
32
+	<legalnotice>&FDLNotice;</legalnotice>
33
+	<date>2006-01-17</date>
34
+	<releaseinfo>2.1</releaseinfo>
35
+	
36
+	<abstract>
37
+		<para>
38
+		&knmap; is a graphical front end to the <computeroutput>nmap</computeroutput> "Network exploration tool and security scanner".
39
+		</para>
40
+	</abstract>
41
+	
42
+	<keywordset>
43
+		<keyword>KDE</keyword>
44
+		<keyword>Knmap</keyword>
45
+		<keyword>nmap</keyword>
46
+	</keywordset>
47
+</bookinfo>
48
+
49
+<chapter id="introduction">
50
+	<title>Introduction</title>
51
+	
52
+	<para>
53
+	This program is a complete re-write of one by the same name written by Alexandre Sagala. The last version of that program was 0.9 which was released on 2003-03-09 and targeted the KDE 2.2 and QT 2.3 environments. Unfortunately it does not compile on today's KDE / QT environments.
54
+	</para>
55
+	
56
+	<para>
57
+	Not to mention that it did not cater for the full set of <computeroutput>nmap</computeroutput> options. Or, perhaps, <computeroutput>nmap</computeroutput> progressed whilst that version of Knmap languished.
58
+	</para>
59
+
60
+	<para>
61
+	The icons used in this application are from the Open Clip Art Library. I am indebted to those damn fine folk as my artistic ability is zero - which is marginally above my programming ability.  :-(
62
+	</para>
63
+
64
+	<para>
65
+	Version 1.0 of &knmap; was merely a re-write of the original. Version 2.0 adds the extra functionality of multiple concurrent <computeroutput>nmap</computeroutput> scans from within the one instance of &knmap;. Version 2.1 allows a normal (non-root) user to use the privileged nmap functions via to 'kdesu' utility. (Previously, the privileged options were only available if &knmap; was run by root.)
66
+	</para>
67
+</chapter>
68
+
69
+<chapter id="using-knmap">
70
+	<title>Using &knmap;</title>
71
+	<para>
72
+	It is assumed that you are familiar with the operation of <computeroutput>nmap</computeroutput>.
73
+	</para>
74
+
75
+	<para>
76
+	If your aren't, then please refer to <computeroutput>nmap(1)</computeroutput> or any other resource you can lay your hands on. This document is all about how to use &knmap; as a front end to <computeroutput>nmap</computeroutput>.
77
+	</para>
78
+
79
+	<para>
80
+	This following screenshot shows an actual run of <computeroutput>nmap</computeroutput> under the control of &knmap;. The main &knmap; window is divided into two partitions - the Index Window on the left and (a stack of) Scan Windows on the right. Each Scan Window is composed of three partitions - from top to bottom: the Options Window, the Button Bar, and the Output Window.
81
+
82
+	<screenshot>
83
+		<mediaobject>
84
+			<imageobject>
85
+				<imagedata fileref="demo.png" format="PNG"/>
86
+			</imageobject>
87
+		</mediaobject>
88
+	</screenshot>
89
+	</para>
90
+
91
+	<para>
92
+	The following sections contain screenshots that describe the contents of the various components of &knmap;'s main window. In the main, the contents of the Scan Window should be self-explanatory for readers familiar with <computeroutput>nmap</computeroutput>
93
+	</para>
94
+
95
+	<sect1 id="index_window">
96
+		<title>Index Window</title>
97
+		<para>
98
+		This window contains the names of all Scan Windows - with the current entry highlighted (in the KDE "Alternate Background in Lists" colour). When a scan is active, the entry for that scan will flash. When the scan has completed, if that scan is not the current entry, then the entry will be highlighted in the KDE "Selected Background" colour.
99
+		</para>
100
+
101
+		<para>
102
+		Left clicking on an entry will display the Scan Window for that scan. The caption of the &knmap; main window will be updated to show the name of the scan and its associated profile.
103
+		</para>
104
+
105
+		<para>
106
+		Entries can be manipulated via options in the "File" menu and via a RMB Context Menu. The order of the entries can be changed by dragging individual entries (multiple entries cannot be dragged concurrently).
107
+		</para>
108
+
109
+		<para>
110
+		Scans for which the "Use target host name" property is active will have an asterisk displayed before their name.
111
+		</para>
112
+	</sect1>
113
+
114
+	<sect1 id="output_window">
115
+		<title>Output Window</title>
116
+		<para>
117
+		As its name implies, this window displays the output of an <computeroutput>nmap</computeroutput> scan. As can be seen from the previous screenshot, the text appearance varies. The following list explains how each type of output is displayed.
118
+		</para>
119
+
120
+		<para>
121
+		<variablelist>
122
+			<varlistentry>
123
+				<term>Standard Input</term>
124
+				<listitem>
125
+					<para>
126
+					No font modifiers.
127
+					</para>
128
+				</listitem>
129
+			</varlistentry>
130
+
131
+			<varlistentry>
132
+				<term>Standard Output</term>
133
+				<listitem>
134
+					<para>
135
+					Text is displayed in bold-face font.
136
+					</para>
137
+				</listitem>
138
+			</varlistentry>
139
+
140
+			<varlistentry>
141
+				<term>Standard Error</term>
142
+				<listitem>
143
+					<para>
144
+					Text is displayed in bold-face, italic font.
145
+					</para>
146
+				</listitem>
147
+			</varlistentry>
148
+		</variablelist>
149
+		</para>
150
+	</sect1>
151
+
152
+	<sect1 id="button_bar">
153
+		<title>Button Bar</title>
154
+		<para>
155
+		This row of buttons control the operation of &knmap;. The following screenshot shows the button row in its normal state.
156
+
157
+		<screenshot>
158
+			<mediaobject>
159
+				<imageobject>
160
+					<imagedata fileref="button_bar.png" format="PNG"/>
161
+				</imageobject>
162
+			</mediaobject>
163
+		</screenshot>
164
+		</para>
165
+
166
+		<para>
167
+		The <computeroutput>Start nmap</computeroutput> and <computeroutput>Stop nmap</computeroutput> buttons should require no explanation. (No - I wont now launch into a multi-thousand word explanation of the bloody obvious.)
168
+		</para>
169
+
170
+		<para>
171
+		The <computeroutput>Clear output</computeroutput> button does just that - deletes all the text in the Output Window.
172
+		</para>
173
+
174
+		<para>
175
+		The <computeroutput>Hide options</computeroutput> button can be used to enlarge the Output Window so as to reduce scrolling as shown in the following screenshot. The text of the button reflects the state of the Options Window.
176
+
177
+		<screenshot>
178
+			<mediaobject>
179
+				<imageobject>
180
+					<imagedata fileref="output_full.png" format="PNG"/>
181
+				</imageobject>
182
+			</mediaobject>
183
+		</screenshot>
184
+		</para>
185
+	</sect1>
186
+
187
+	<sect1 id="common_options">
188
+		<title>Common Options</title>
189
+		<para>
190
+			<screenshot>
191
+				<mediaobject>
192
+					<imageobject>
193
+						<imagedata fileref="common_options.png" format="PNG"/>
194
+					</imageobject>
195
+				</mediaobject>
196
+			</screenshot>
197
+	
198
+		This screenshot shows the <computeroutput>nmap</computeroutput> options that are common to most network scans.
199
+		</para>
200
+
201
+		<para>
202
+		<variablelist>
203
+			<varlistentry>
204
+				<term>New data range</term>
205
+				<listitem>
206
+					<para>
207
+					The range of ports are entered here in the format specified in the <computeroutput>nmap</computeroutput> man page for the <computeroutput>-p</computeroutput> parametere, BUT without the protocol specifier.
208
+					</para>
209
+				</listitem>
210
+			</varlistentry>
211
+
212
+			<varlistentry>
213
+				<term>Protocol</term>
214
+				<listitem>
215
+					<para>
216
+					Select the protocol(s) for the port list shown in the input area. Note that the list of ports can contain a combination of protocols. &knmap; will ensure that the port ranges do not overlap.
217
+					</para>
218
+				</listitem>
219
+			</varlistentry>
220
+
221
+			<varlistentry>
222
+				<term>Add</term>
223
+				<listitem>
224
+					<para>
225
+					As soon as data has been entered in the input area, the <computeroutput>Add</computeroutput> button will be activated. Pressing this button will cause &knmap; to read the input and, if, valid, add it to the list of existing port ranges.
226
+					</para>
227
+				</listitem>
228
+			</varlistentry>
229
+
230
+			<varlistentry>
231
+				<term>Delete</term>
232
+				<listitem>
233
+					<para>
234
+					To delete a port range, double click on the entry in the list. That entry will be copied to the input area, the <computeroutput>Protocol</computeroutput> combo box updated to reflect the selected entry and the <computeroutput>Delete</computeroutput> button will be activated.
235
+					</para>
236
+
237
+					<para>
238
+					If the button is then pressed, the input area will NOT be cleared and the <computeroutput>Add</computeroutput> button will be activated. The allows for the port range to be added back into the list if the deletion was performed in error.
239
+					</para>
240
+				</listitem>
241
+			</varlistentry>
242
+		</variablelist>
243
+		</para>
244
+	</sect1>
245
+
246
+	<sect1 id="compound_options">
247
+		<title>Compound Options</title>
248
+		<para>
249
+			<screenshot>
250
+				<mediaobject>
251
+					<imageobject>
252
+						<imagedata fileref="compound_options.png" format="PNG"/>
253
+					</imageobject>
254
+				</mediaobject>
255
+			</screenshot>
256
+	
257
+		This screenshot shows those <computeroutput>nmap</computeroutput> options that require a value. The associated input area is activated when the option is activated. Options preceded by a hash (#) require root privileges. When the "Start nmap" button is pressed, the 'kdesu' facility will be invoked to run nmap as the super user.
258
+		</para>
259
+	</sect1>
260
+
261
+	<sect1 id="logging_options">
262
+		<title>Logging Options</title>
263
+		<para>
264
+			<screenshot>
265
+				<mediaobject>
266
+					<imageobject>
267
+						<imagedata fileref="logging_options.png" format="PNG"/>
268
+					</imageobject>
269
+				</mediaobject>
270
+			</screenshot>
271
+	
272
+		This screenshot shows the <computeroutput>nmap</computeroutput> options that relate to logging.
273
+		</para>
274
+
275
+		<para>
276
+		&knmap; considers the <computeroutput>--resume</computeroutput> option to be a logging option as its use requires that logging was enabled in the interrupted scan.
277
+		</para>
278
+	</sect1>
279
+
280
+	<sect1 id="man_page">
281
+		<title><computeroutput>man</computeroutput> Page</title>
282
+		<para>
283
+			<screenshot>
284
+				<mediaobject>
285
+					<imageobject>
286
+						<imagedata fileref="man_page.png" format="PNG"/>
287
+					</imageobject>
288
+				</mediaobject>
289
+			</screenshot>
290
+	
291
+		&knmap; comes packaged with the <computeroutput>man</computeroutput> page for <computeroutput>nmap</computeroutput>  version 3.93 in HTML format. See the Settings -> <computeroutput>man</computeroutput> page stylesheet... menu option for how to control the appearance of this documentation and the Settings -> Zoom in / out / custom options for controlling the size..
292
+		</para>
293
+	</sect1>
294
+
295
+	<sect1 id="ping_and_scan_options">
296
+		<title>Ping and Scan Options</title>
297
+		<para>
298
+			<screenshot>
299
+				<mediaobject>
300
+					<imageobject>
301
+						<imagedata fileref="ping_and_scan_options.png" format="PNG"/>
302
+					</imageobject>
303
+				</mediaobject>
304
+			</screenshot>
305
+	
306
+		This screenshot shows the <computeroutput>nmap</computeroutput> options that control the types of ping and scans that will be performed. Options preceded by a hash (#) require root privileges. When the "Start nmap" button is pressed, the 'kdesu' facility will be invoked to run nmap as the super user.
307
+		</para>
308
+	</sect1>
309
+
310
+	<sect1 id="simple_options">
311
+		<title>Simple Options</title>
312
+		<para>
313
+			<screenshot>
314
+				<mediaobject>
315
+					<imageobject>
316
+						<imagedata fileref="simple_options.png" format="PNG"/>
317
+					</imageobject>
318
+				</mediaobject>
319
+			</screenshot>
320
+	
321
+		This screenshot shows the boolean <computeroutput>nmap</computeroutput> options, i.e., those options that do not require a value. Options preceded by a hash (#) require root privileges. When the "Start nmap" button is pressed, the 'kdesu' facility will be invoked to run nmap as the super user.
322
+		</para>
323
+	</sect1>
324
+
325
+	<sect1 id="timing_options">
326
+		<title>Timing Options</title>
327
+		<para>
328
+			<screenshot>
329
+				<mediaobject>
330
+					<imageobject>
331
+						<imagedata fileref="timing_options.png" format="PNG"/>
332
+					</imageobject>
333
+				</mediaobject>
334
+			</screenshot>
335
+	
336
+		This screenshot shows the <computeroutput>nmap</computeroutput> options that control the timing of network activity. Note that the <computeroutput>Default</computeroutput> does nothing. It is provided as a means to disable the other timing options.
337
+		</para>
338
+	</sect1>
339
+</chapter>
340
+
341
+<chapter id="commands">
342
+	<title>Command Reference</title>
343
+	<sect1 id="knmap_menu_options">
344
+	<title>The &knmap; Menu Options</title>
345
+		<sect2>
346
+			<title>The File Menu</title>
347
+			<para>
348
+			<variablelist>
349
+				<varlistentry>
350
+					<term><menuchoice>
351
+						<shortcut>
352
+							<keycombo action="simul">&Ctrl;<keycap>S</keycap></keycombo>
353
+						</shortcut>
354
+						<guimenu>File</guimenu>
355
+						<guimenuitem>Save</guimenuitem>
356
+					</menuchoice></term>
357
+					<listitem>
358
+						<para>
359
+							<action>
360
+							Saves the current content of the Output Window. Note, however, that all text formatting is lost. If you don't like this - tough. Go tell someone that gives a shit!
361
+							</action>
362
+						</para>
363
+					</listitem>
364
+				</varlistentry>
365
+
366
+				<varlistentry>
367
+					<term><menuchoice>
368
+						<guimenu>File</guimenu>
369
+						<guimenuitem>Save As...</guimenuitem>
370
+					</menuchoice></term>
371
+					<listitem>
372
+						<para>
373
+							<action>
374
+							Given the above explanation of what "File -> Save" does, this option should need no further explanation.
375
+							</action>
376
+						</para>
377
+					</listitem>
378
+				</varlistentry>
379
+
380
+				<varlistentry>
381
+					<term><menuchoice>
382
+						<shortcut>
383
+							<keycombo action="simul">&Ctrl;<keycap>N</keycap></keycombo>
384
+						</shortcut>
385
+						<guimenu>File</guimenu>
386
+						<guimenuitem>New scan...</guimenuitem>
387
+					</menuchoice></term>
388
+					<listitem>
389
+						<para>
390
+							<action>
391
+							Creates a new Scan Window. The dialog box shown below will be displayed to allow the name of the scan to be entered. The "Use target host name" option allows the name of the scan to automatically track the target of the nmap scan. If that option is not selected, the name of the scan can be entered in the edit window - which is activated when the "Use target host name" option is unchecked.
392
+							</action>
393
+						</para>
394
+					</listitem>
395
+				</varlistentry>
396
+
397
+				<varlistentry>
398
+					<term><menuchoice>
399
+						<shortcut>
400
+							<keycombo action="simul">&Ctrl;<keycap>C</keycap></keycombo>
401
+						</shortcut>
402
+						<guimenu>File</guimenu>
403
+						<guimenuitem>Duplicate scan</guimenuitem>
404
+					</menuchoice></term>
405
+					<listitem>
406
+						<para>
407
+							<action>
408
+							As the name imples, the current scan is duplicated. Unusual / unfortunate and / or strange behaviour may / will result if the name of the scan is not changed but a different profile is associated with the duplicated scan (name).
409
+							</action>
410
+						</para>
411
+					</listitem>
412
+				</varlistentry>
413
+
414
+				<varlistentry>
415
+					<term><menuchoice>
416
+						<shortcut>
417
+							<keycombo action="simul"><keycap>F2</keycap></keycombo>
418
+						</shortcut>
419
+						<guimenu>File</guimenu>
420
+						<guimenuitem>Rename scan...</guimenuitem>
421
+					</menuchoice></term>
422
+					<listitem>
423
+						<para>
424
+							<action>
425
+							Obvious - but it is also possible to select the "Use target host name" property via this menu item.
426
+							</action>
427
+						</para>
428
+					</listitem>
429
+				</varlistentry>
430
+
431
+				<varlistentry>
432
+					<term><menuchoice>
433
+						<shortcut>
434
+							<keycombo action="simul"><keycap>F2</keycap></keycombo>
435
+						</shortcut>
436
+						<guimenu>File</guimenu>
437
+						<guimenuitem>Use target host name</guimenuitem>
438
+					</menuchoice></term>
439
+					<listitem>
440
+						<para>
441
+							<action>
442
+							This is a toggle item that causes the name of the scan to automatically track the target of the nmap scan.
443
+							</action>
444
+						</para>
445
+					</listitem>
446
+				</varlistentry>
447
+
448
+				<varlistentry>
449
+					<term><menuchoice>
450
+						<shortcut>
451
+							<keycombo action="simul">&Ctrl;<keycap>W</keycap></keycombo>
452
+						</shortcut>
453
+						<guimenu>File</guimenu>
454
+						<guimenuitem>Close scan</guimenuitem>
455
+					</menuchoice></term>
456
+					<listitem>
457
+						<para>
458
+							<action>
459
+							Obvious - but if the profile has been updated you will be asked whether it should be saved.
460
+							</action>
461
+						</para>
462
+					</listitem>
463
+				</varlistentry>
464
+
465
+				<varlistentry>
466
+					<term><menuchoice>
467
+						<shortcut>
468
+							<keycombo action="simul">&Ctrl;<keycap>Q</keycap></keycombo>
469
+						</shortcut>
470
+						<guimenu>File</guimenu>
471
+						<guimenuitem>Quit</guimenuitem>
472
+					</menuchoice></term>
473
+					<listitem><para><action>Quits</action> &knmap;</para></listitem>
474
+				</varlistentry>
475
+			</variablelist>
476
+			</para>
477
+
478
+			<para>
479
+			<screenshot>
480
+				<mediaobject>
481
+					<imageobject>
482
+						<imagedata fileref="new_scan.png" format="PNG"/>
483
+					</imageobject>
484
+				</mediaobject>
485
+			</screenshot>
486
+			</para>
487
+		</sect2>
488
+
489
+		<sect2>
490
+			<title>The Profiles Menu</title>
491
+			<para>
492
+			Before launching into the explanation of the items under this menu, it is necessary to define what a "Profile" is.
493
+			</para>
494
+
495
+			<para>
496
+			Quite simply, a Profile is the set of values of all the <computeroutput>nmap</computeroutput> options supported by &knmap; and some &knmap;-specific data (e.g., the order of the tabs in the Options Window and the current options tab).
497
+			</para>
498
+
499
+			<para>
500
+			The status of the Hide / Show buttons is not saved. All windows are shown on &knmap; startup regrardless of their status at the time a Profile saved.
501
+			</para>
502
+
503
+			<para>
504
+			Having the same profile associated with multiple scans is not recommended - unusual / unfortunate and / or strange behaviour may / will result.
505
+			</para>
506
+
507
+			<para>
508
+			The following screenshot shows the dialog window that controls all options in this menu.
509
+			<screenshot>
510
+				<mediaobject>
511
+					<imageobject>
512
+						<imagedata fileref="profile_dlg.png" format="PNG"/>
513
+					</imageobject>
514
+				</mediaobject>
515
+			</screenshot>
516
+			The top window is used for the entry of new names for the copy and rename functions. The lower window lists all known profiles. (For the technically minded, the profiles are stored in the standard KDE <computeroutput>knmaprc</computeroutput> configuration file - but with the name "Knmap_&lt;profile name>".)
517
+			</para>
518
+
519
+			<para>
520
+			The copy, delete and rename functions available in this menu are also available when a profile name is right-clicked in the list window.
521
+			</para>
522
+
523
+			<para>
524
+			<variablelist>
525
+				<varlistentry>
526
+					<term><menuchoice>
527
+						<guimenu>Profiles</guimenu>
528
+						<guimenuitem>Load profile...</guimenuitem>
529
+					</menuchoice></term>
530
+					<listitem>
531
+						<para>
532
+							<action>
533
+							Equivalent to a "File -> Open" in your favourite editor. If the current profile has been modified you will be asked if you want to save it prior to loading the new profile.
534
+							</action>
535
+						</para>
536
+					</listitem>
537
+				</varlistentry>
538
+
539
+				<varlistentry>
540
+					<term><menuchoice>
541
+						<guimenu>Profiles</guimenu>
542
+						<guimenuitem>Save profile...</guimenuitem>
543
+					</menuchoice></term>
544
+					<listitem>
545
+						<para>
546
+							<action>
547
+							Equivalent to a "File -> Save" in your favourite editor.
548
+							</action>
549
+						</para>
550
+					</listitem>
551
+				</varlistentry>
552
+
553
+				<varlistentry>
554
+					<term><menuchoice>
555
+						<guimenu>Profiles</guimenu>
556
+						<guimenuitem>Save profile as...</guimenuitem>
557
+					</menuchoice></term>
558
+					<listitem>
559
+						<para>
560
+							<action>
561
+							Equivilent to a "File -> Save" as in your favourite editor.
562
+							</action>
563
+						</para>
564
+					</listitem>
565
+				</varlistentry>
566
+
567
+				<varlistentry>
568
+					<term><menuchoice>
569
+						<guimenu>Profiles</guimenu>
570
+						<guimenuitem>Copy profile...</guimenuitem>
571
+					</menuchoice></term>
572
+					<listitem>
573
+						<para>
574
+							<action>
575
+							The selected profile is copied, the name of the new profile is entered in the upper input window.
576
+							</action>
577
+						</para>
578
+					</listitem>
579
+				</varlistentry>
580
+
581
+				<varlistentry>
582
+					<term><menuchoice>
583
+						<guimenu>Profiles</guimenu>
584
+						<guimenuitem>Delete profile...</guimenuitem>
585
+					</menuchoice></term>
586
+					<listitem>
587
+						<para>
588
+							<action>
589
+							Bloody obvious.
590
+							</action>
591
+						</para>
592
+					</listitem>
593
+				</varlistentry>
594
+
595
+				<varlistentry>
596
+					<term><menuchoice>
597
+						<guimenu>Profiles</guimenu>
598
+						<guimenuitem>Rename profile...</guimenuitem>
599
+					</menuchoice></term>
600
+					<listitem>
601
+						<para>
602
+							<action>
603
+							The name of the selected profile is changed to the name entered in the upper input window.
604
+							</action>
605
+						</para>
606
+					</listitem>
607
+				</varlistentry>
608
+			</variablelist>
609
+			</para>
610
+		</sect2>
611
+
612
+		<sect2>
613
+			<title>The Settings Menu</title>
614
+			<para>
615
+			<variablelist>
616
+				<varlistentry>
617
+					<term><menuchoice>
618
+						<guimenu>Settings</guimenu>
619
+						<guimenuitem>Wrap text</guimenuitem>
620
+					</menuchoice></term>
621
+					<listitem>
622
+						<para>
623
+							<action>
624
+							Selects whether the nmap output should be word-wrapped at the windows right-border.
625
+							</action>
626
+						</para>
627
+					</listitem>
628
+				</varlistentry>
629
+
630
+				<varlistentry>
631
+					<term><menuchoice>
632
+						<guimenu>Settings</guimenu>
633
+						<guimenuitem>'man' page stylesheet...</guimenuitem>
634
+					</menuchoice></term>
635
+					<listitem>
636
+						<para>
637
+							<action>
638
+							Allows for the selection of the stylesheet to be used when the nmap man page is displayed.
639
+							</action>
640
+						</para>
641
+					</listitem>
642
+				</varlistentry>
643
+
644
+				<varlistentry>
645
+					<term><menuchoice>
646
+						<guimenu>Settings</guimenu>
647
+						<guimenuitem>Use local 'man' page</guimenuitem>
648
+					</menuchoice></term>
649
+					<listitem>
650
+						<para>
651
+							<action>
652
+							This is a toggle action, the text changes depending upon its state. If the &knmap; nmap man page is being displayed, this option allows for the >man page stored on the local machine to be displayed. This is useful when the local version of the nmap man page differs from the version distrubuted with &knmap;.
653
+							</action>
654
+						</para>
655
+
656
+						<para>
657
+							<action>
658
+							When the local man page is being displayed, this option allows for the &knmap; version to be displayed.
659
+							</action>
660
+						</para>
661
+					</listitem>
662
+				</varlistentry>
663
+
664
+				<varlistentry>
665
+					<term><menuchoice>
666
+						<guimenu>Settings</guimenu>
667
+						<guimenuitem>Zoom in</guimenuitem>
668
+					</menuchoice></term>
669
+					<listitem>
670
+						<para>
671
+							<action>
672
+							Increases the font size in the man page window by 25% - limits are 20% - 300%.
673
+							</action>
674
+						</para>
675
+					</listitem>
676
+				</varlistentry>
677
+
678
+				<varlistentry>
679
+					<term><menuchoice>
680
+						<guimenu>Settings</guimenu>
681
+						<guimenuitem>Zoom out</guimenuitem>
682
+					</menuchoice></term>
683
+					<listitem>
684
+						<para>
685
+							<action>
686
+							Decreases the font size in the man page window by 25% - limits are 20% - 300%.
687
+							</action>
688
+						</para>
689
+					</listitem>
690
+				</varlistentry>
691
+
692
+				<varlistentry>
693
+					<term><menuchoice>
694
+						<guimenu>Settings</guimenu>
695
+						<guimenuitem>Zoom custom</guimenuitem>
696
+					</menuchoice></term>
697
+					<listitem>
698
+						<para>
699
+							<action>
700
+							Allows manual control of the font size - limits are 20% - 300%.
701
+							</action>
702
+						</para>
703
+					</listitem>
704
+				</varlistentry>
705
+			</variablelist>
706
+			</para>
707
+
708
+			<para>
709
+			The remaining options in this menu are standard KDE options.
710
+			</para>
711
+		</sect2>
712
+
713
+		<sect2>
714
+			<title>The Help Menu</title>
715
+			<para>
716
+			&help.menu.documentation;
717
+			</para>
718
+		</sect2>
719
+	</sect1>
720
+</chapter>
721
+
722
+<chapter id="developers">
723
+	<title>Developer's Guide to &knmap;</title>
724
+	<para>
725
+	The only item worthy of mention here is the file <computeroutput>nmap_manpage.html.diff</computeroutput>. This file contains a <computeroutput>diff</computeroutput> of the <computeroutput>nmap</computeroutput> version 3.93 HTML formatted <computeroutput>man</computeroutput> page and that distributed with &knmap;. You can use this to update your version of that <computeroutput>man</computeroutput> page.
726
+	</para>
727
+</chapter>
728
+
729
+<chapter id="credits">
730
+	<title>Credits and License</title>
731
+	<para>
732
+	&knmap;
733
+	</para>
734
+
735
+	<para>
736
+	Program copyright 2005, 2006 Kevin Gilbert <email>kev.gilbert@cdu.edu.au</email>
737
+	</para>
738
+	
739
+	<para>
740
+	Documentation copyright 2005, 2006 Kevin Gilbert <email>kev.gilbert@cdu.edu.au</email>
741
+	</para>
742
+	
743
+	&underFDL;
744
+	&underGPL;
745
+</chapter>
746
+
747
+<appendix id="installation">
748
+	<title>Installation</title>
749
+
750
+	<sect1 id="getting-knmap">
751
+	<title>How to obtain &knmap;</title>
752
+
753
+	<para>
754
+	Now let me see... You're reading this documentation - which come packaged with &knmap;, which means that you have &knmap; installed, which means that you have somehow obtained &knmap;, and now you want to know how to obtain &knmap;?
755
+	</para>
756
+
757
+	<para>
758
+	You have _way_ too much time on your hands! ;-)
759
+	</para>
760
+
761
+	<para>
762
+	Okay, Okay. Go to <ulink url="http://sourceforge.net/projects/knmap">http://sourceforge.net/projects/knmap</ulink> and follow the download links.
763
+	</para>
764
+	</sect1>
765
+
766
+	<sect1 id="requirements">
767
+		<title>Requirements</title>
768
+		<para>
769
+		&knmap; was developed and tested under Qt 3.3.4 / KDE 3.4 &amp; 3.5. YMMV vary if your configuration differs from this.
770
+		</para>
771
+
772
+		<para>
773
+		And, of course, you will need <computeroutput>nmap</computeroutput>. Go to <ulink url="http://www.insecure.org/nmap">http://www.insecure.org/nmap</ulink> for details on how to download <computeroutput>nmap</computeroutput>.
774
+		</para>
775
+	</sect1>
776
+
777
+	<sect1 id="compilation">
778
+		<title>Compilation and Installation</title>
779
+		&install.compile.documentation;
780
+	</sect1>
781
+</appendix>
782
+
783
+	&documentation.index;
784
+</book>

BIN
doc/en/logging_options.png View File


BIN
doc/en/man_page.png View File


BIN
doc/en/man_page_full.png View File


BIN
doc/en/new_scan.png View File


BIN
doc/en/output_full.png View File


BIN
doc/en/ping_and_scan_options.png View File


BIN
doc/en/profile_dlg.png View File


BIN
doc/en/simple_options.png View File


BIN
doc/en/timing_options.png View File


+ 1
- 0
po/Makefile.am View File

@@ -0,0 +1 @@
1
+POFILES = AUTO

+ 46
- 0
src/Makefile.am View File

@@ -0,0 +1,46 @@
1
+# set the include path for X, qt and KDE
2
+INCLUDES = $(all_includes)
3
+
4
+# these are the headers for your project
5
+noinst_HEADERS = knmap.h global.h mainwidget.h outputwidget.h commonwidget.h \
6
+					timingwidget.h compoundwidget.h htmlwidget.h stylesheetdialog.h profiledialog.h \
7
+					loggingoptions.h simpleoptions.h pandsoptions.h whatsthis.h tabwidgetptrlist.h \
8
+					tabwidgetdata.h scanwidget.h indexwidget.h scannamedialog.h scanstack.h scanmonitor.h \
9
+	scanmonitorevent.h nmapoutputbuffer.h
10
+
11
+# let automoc handle all of the meta source files (moc)
12
+METASOURCES = AUTO
13
+
14
+messages: rc.cpp
15
+	$(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
16
+	$(XGETTEXT) *.cpp -o $(podir)/knmap.pot
17
+
18
+KDE_ICON = AUTO
19
+
20
+#########################################################################
21
+# APPLICATION SECTION
22
+#########################################################################
23
+# this is the program that gets installed.  it's name is used for all
24
+# of the other Makefile.am variables
25
+bin_PROGRAMS = knmap
26
+
27
+# the application source, library search path, and link libraries
28
+knmap_SOURCES = main.cpp knmap.cpp mainwidget.cpp outputwidget.cpp \
29
+					commonwidget.cpp timingwidget.cpp compoundwidget.cpp htmlwidget.cpp stylesheetdialog.cpp \
30
+					profiledialog.cpp loggingoptions.cpp simpleoptions.cpp pandsoptions.cpp whatsthis.cpp \
31
+					tabwidgetptrlist.cpp tabwidgetdata.cpp scanwidget.cpp indexwidget.cpp scannamedialog.cpp \
32
+			scanstack.cpp scanmonitor.cpp scanmonitorevent.cpp nmapoutputbuffer.cpp
33
+knmap_LDFLAGS = $(KDE_RPATH) $(all_libraries)
34
+knmap_LDADD = $(LIB_KIO) $(LIB_KHTML)
35
+
36
+# this is where the desktop file will go 
37
+shelldesktopdir   = $(kde_appsdir)/Utilities
38
+shelldesktop_DATA = knmap.desktop
39
+
40
+# this is where the shell's XML-GUI resource file goes
41
+shellrcdir   = $(kde_datadir)/knmap
42
+shellrc_DATA = knmapui.rc nmap_manpage.html nmap_manpage.html.diff
43
+
44
+kde_icon_KDEICON = hi16-app-scanclose.png hi32-app-scanclose.png \
45
+		hi16-app-scannew.png hi32-app-scannew.png hi16-app-scanrename.png hi32-app-scanrename.png \
46
+		hi16-app-scanduplicate.png hi32-app-scanduplicate.png hi16-app-manpage.png hi32-app-manpage.png

+ 655
- 0
src/commonwidget.cpp View File

@@ -0,0 +1,655 @@
1
+/***************************************************************************
2
+ *                                                                         *
3
+ *   Copyright (C) 2005, 2006 by Kevin Gilbert                             *
4
+ *   kev.gilbert@cdu.edu.au                                                *
5
+ *                                                                         *
6
+ *   This program is free software; you can redistribute it and/or modify  *
7
+ *   it under the terms of the GNU General Public License as published by  *
8
+ *   the Free Software Foundation; either version 2 of the License, or     *
9
+ *   (at your option) any later version.                                   *
10
+ *                                                                         *
11
+ *   This program is distributed in the hope that it will be useful,       *
12
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
13
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
14
+ *   GNU General Public License for more details.                          *
15
+ *                                                                         *
16
+ *   You should have received a copy of the GNU General Public License     *
17
+ *   along with this program; if not, write to the                         *
18
+ *   Free Software Foundation, Inc.,                                       *
19
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
20
+ *                                                                         *
21
+ ***************************************************************************/
22
+
23
+#include <qbuttongroup.h>
24
+#include <qcheckbox.h>
25
+#include <qcombobox.h>
26
+#include <qlabel.h>
27
+#include <qlayout.h>
28
+#include <qlineedit.h>
29
+#include <qlistbox.h>
30
+#include <qpushbutton.h>
31
+#include <qradiobutton.h>
32
+#include <qstringlist.h>
33
+#include <qvalidator.h>
34
+
35
+#include <kconfig.h>
36
+#include <kdebug.h>
37
+#include <kglobal.h>
38
+#include <kiconloader.h>
39
+#include <klocale.h>
40
+#include <kmessagebox.h>
41
+
42
+#include "commonwidget.h"
43
+#include "whatsthis.h"
44
+
45
+//	constructor
46
+//	===========
47
+
48
+CommonWidget::CommonWidget( QWidget* parent, const char* name )
49
+: QWidget( parent, name ),
50
+  m_hosts( NULL ),
51
+  m_portRangeIgnoreChange( false ),
52
+  m_portRanges( NULL )
53
+{	createLayout( );
54
+	m_portRangeAddButton->setEnabled( false );
55
+	m_portRangeDeleteButton->setEnabled( false );
56
+}
57
+
58
+//	destructor
59
+//	==========
60
+
61
+CommonWidget::~CommonWidget( )
62
+{	if( m_hosts != NULL )
63
+		delete m_hosts;
64
+
65
+	if( m_portRanges != NULL )
66
+		delete m_portRanges;
67
+}
68
+
69
+//	buildPortRangesTables
70
+//	=====================
71
+
72
+bool CommonWidget::buildPortRangesTables( const boolPtr tcpPorts, const boolPtr udpPorts )
73
+{	memset( tcpPorts, 0, 64 * 1024 );
74
+	memset( udpPorts, 0, 64 * 1024 );
75
+
76
+	QStringList portRanges;
77
+	getPortRanges( &portRanges );
78
+
79
+	for( QStringList::Iterator it = portRanges.begin( ); it != portRanges.end( ); ++it )
80
+	{	QString portRange = *it;
81
+		bool    tcp       = false;
82
+		bool    udp       = false;
83
+
84
+		if( portRange[ 0 ].isDigit( ))
85
+		{	tcp = true;
86
+			udp = true;
87
+		}
88
+		else
89
+		if( portRange[ 0 ].lower( ) == 't' )
90
+		{	tcp = true;
91
+			portRange = portRange.right( portRange.length( ) - 2 );
92
+		}
93
+		else
94
+		if( portRange[ 0 ].lower( ) == 'u' )
95
+		{	udp = true;
96
+			portRange = portRange.right( portRange.length( ) - 2 );
97
+		}
98
+		else
99
+		{	KMessageBox::error( this, i18n( QString( "Internal error - Unknown Port Range protocol '%1'" ).arg( portRange[ 0 ])), i18n( "Internal error" ));
100
+			return false;
101
+		}
102
+
103
+		QStringList ports = QStringList::split( "-", portRange );
104
+
105
+		if( ports.count( ) > 2 )
106
+		{	KMessageBox::error( this, i18n( "Internal error - Illegal Port Range encountered" ), i18n( "Internal error" ));
107
+			return false;
108
+		}
109
+
110
+		ushort portFirst = ports.front( ).toUShort( );
111
+		ushort portLast  = portFirst;
112
+
113
+		if( ports.count( ) > 1 )
114
+			portLast = ports.back( ).toUShort( );
115
+
116
+		for( uint port = portFirst; port <= portLast; port++ )
117
+		{	if( tcp )
118
+				tcpPorts[ port ] = true;
119
+
120
+			if( udp )
121
+				udpPorts[ port ] = true;
122
+		}
123
+	}
124
+
125
+	return true;
126
+}
127
+
128
+//	createLayout
129
+//	============
130
+
131
+void CommonWidget::createLayout( )
132
+{	QGridLayout* gridLayout        = new QGridLayout( this );
133
+	KIconLoader* iconLoader        = KGlobal::iconLoader( );
134
+	QIconSet     clearRightIconSet = iconLoader->loadIconSet( "locationbar_erase", KIcon::Small );
135
+
136
+ 	byte row = 1;
137
+	m_hostButton   = new QPushButton( clearRightIconSet, NULL, this, "host button" );
138
+	m_hostComboBox = new QComboBox( true, this, "target hosts combobox" );
139
+	QHBoxLayout* hostLayout = new QHBoxLayout( );
140
+
141
+	byte col = 0;
142
+	hostLayout->insertStretch( col++, 0 );
143
+	hostLayout->insertWidget(  col++, new QLabel( i18n( "Target host(s)" ), this, "target hosts label" ), 0 );
144
+	hostLayout->insertStretch( col++, 1 );
145
+	hostLayout->insertWidget(  col++, m_hostButton, 0 );
146
+	hostLayout->insertStretch( col++, 1 );
147
+	hostLayout->insertWidget(  col++, m_hostComboBox, 100 );
148
+	hostLayout->insertStretch( col++, 0 );
149
+	gridLayout->addMultiCellLayout( hostLayout, row, row, 1, 5 );
150
+
151
+	QButtonGroup* resloveGroup = new QButtonGroup( 3, Qt::Vertical, i18n( "Resolve names" ), this, "resolve names group" );
152
+	m_resovleDefaultRadio      = new QRadioButton( i18n( "Default"     ), resloveGroup, "default resolve radio" );
153
+	m_resovleAlwaysRadio       = new QRadioButton( i18n( "Always (-R)" ), resloveGroup, "always resolve radio"  );
154
+	m_resovleNeverRadio        = new QRadioButton( i18n( "Never (-n)"  ), resloveGroup, "never resolve radio"   );
155
+
156
+	row = 4;
157
+	gridLayout->addMultiCellWidget( resloveGroup, row, row + 3, 1, 1 );
158
+	byte rowBlock1 = ++row;
159
+
160
+	m_portRangeAddButton    = new QPushButton( i18n( "Add" ),    this, "add port range button" );
161
+	m_portRangeDeleteButton = new QPushButton( i18n( "Delete" ), this, "delete port range button" );
162
+	m_portRangeComboBox     = new QComboBox( this, "port range combobox" );
163
+	m_portRangeLineEdit     = new QLineEdit( this, "port range line edit" );
164
+	m_portRangeListBox      = new QListBox( this, "port range listbox" );
165
+	m_portRangesCheckBox    = new QCheckBox( i18n( "Port ranges (-p <port ranges>)" ), this, "port ranges checkbox" );
166
+
167
+	m_portRangeComboBox->insertItem( i18n( "Both" ), BothProtocol );
168
+	m_portRangeComboBox->insertItem( i18n( "TCP"  ), TCPProtocol  );
169
+	m_portRangeComboBox->insertItem( i18n( "UDP"  ), UDPProtocol  );
170
+
171
+	m_portRangeLineEdit->setValidator( new QRegExpValidator( QRegExp( "^\\d{1,5}-{1}\\d{1,5}$" ), this, "port range regx" ));
172
+
173
+	row = 3;
174
+	gridLayout->addMultiCellWidget( m_portRangesCheckBox, row, row, 3, 5, Qt::AlignCenter );
175
+	row++;
176
+
177
+	m_portRangeButton = new QPushButton( clearRightIconSet, NULL, this, "host button" );
178
+	QHBoxLayout* portRangeLayout = new QHBoxLayout( );
179
+
180
+	col = 0;
181
+	portRangeLayout->insertStretch( col++, 0 );
182
+	portRangeLayout->insertWidget(  col++, new QLabel( i18n( "New range data: " ), this, "new range data label" ), 0 );
183
+	portRangeLayout->insertStretch( col++, 1 );
184
+	portRangeLayout->insertWidget(  col++, m_portRangeButton, 0 );
185
+	portRangeLayout->insertStretch( col++, 1 );
186
+	portRangeLayout->insertWidget(  col++, m_portRangeLineEdit, 100 );
187
+	portRangeLayout->insertStretch( col++, 0 );
188
+	gridLayout->addMultiCellLayout( portRangeLayout, row, row, 3, 5 );
189
+
190
+	gridLayout->addWidget( new QLabel( i18n( "Protocol" ), this, "protocol label" ), row + 1, 3 );
191
+	gridLayout->addWidget( m_portRangeComboBox,     row + 2, 3 );
192
+	gridLayout->addWidget( m_portRangeAddButton,    row + 4, 3 );
193
+	gridLayout->addWidget( m_portRangeDeleteButton, row + 5, 3 );
194
+	byte rowBlock2 = _max_( row + 5, rowBlock1 );
195
+	gridLayout->addMultiCellWidget( m_portRangeListBox,  row + 1, rowBlock2, 5, 5 );
196
+
197
+	gridLayout->setColStretch(  0,  4 );
198
+	gridLayout->setColStretch(  2,  2 );
199
+	gridLayout->setColStretch(  5, 10 );
200
+	gridLayout->setColStretch(  6,  4 );
201
+
202
+	gridLayout->setRowStretch( 0, 10 );
203
+	gridLayout->setRowStretch( 2, 10 );
204
+	gridLayout->setRowStretch( rowBlock2 + 1, 10 );
205
+}
206
+
207
+//	enablePortRangeWidgets
208
+//	======================
209
+
210
+void CommonWidget::enablePortRangeWidgets( )
211
+{	bool portRangesState = m_portRangesCheckBox->isChecked( );
212
+
213
+	m_portRangeAddButton->setEnabled( false );
214
+	m_portRangeDeleteButton->setEnabled( false );
215
+	m_portRangeButton->setEnabled( portRangesState );
216
+	m_portRangeLineEdit->setEnabled( portRangesState );
217
+	m_portRangeLineEdit->clear( );
218
+	m_portRangeComboBox->setEnabled( portRangesState );
219
+	m_portRangeListBox->setEnabled( portRangesState );
220
+
221
+	if( portRangesState )
222
+		emit( disableFastScan( ));
223
+}
224
+
225
+//	finaliseInitialisation
226
+//	======================
227
+
228
+void CommonWidget::finaliseInitialisation( )
229
+{	WhatsThis* whatsThis = new WhatsThis( this );
230
+
231
+	connect( m_hostButton,             SIGNAL( clicked( )),                     SLOT( slotHostButtonClicked( )));
232
+	connect( m_hostComboBox,           SIGNAL( activated( int )),               SLOT( slotHostActivated( int )));
233
+	connect( m_hostComboBox,           SIGNAL( textChanged( const QString& )),  SLOT( slotHostTextChanged( const QString& )));
234
+	connect( m_portRangeAddButton,     SIGNAL( clicked( )),                     SLOT( slotPortRangeAddClicked( )));
235
+	connect( m_portRangeButton,        SIGNAL( clicked( )),                     SLOT( slotPortRangeButtonClicked( )));
236
+	connect( m_portRangeDeleteButton,  SIGNAL( clicked( )),                     SLOT( slotPortRangeDeleteClicked( )));
237
+	connect( m_portRangeComboBox,      SIGNAL( activated( int )),               SLOT( slotPortRangeActivated( int )));
238
+	connect( m_portRangeLineEdit,      SIGNAL( textChanged( const QString& )),  SLOT( slotPortRangeTextChanged( const QString& )));
239
+	connect( m_portRangeListBox,       SIGNAL( doubleClicked( QListBoxItem* )), SLOT( slotPortRangeDoubleClicked( QListBoxItem* )));
240
+	connect( m_portRangeListBox,       SIGNAL( highlighted( int )),             SLOT( slotPortRangeHighlighted( )));
241
+	connect( m_portRangesCheckBox,     SIGNAL( clicked( )),                     SLOT( slotPortRangesClicked( )));
242
+	connect( whatsThis,                SIGNAL( clicked( )),                     SLOT( slotWhatsThisClicked( )));
243
+
244
+	connect( m_hostButton,             SIGNAL( clicked( )),                     SIGNAL( optionsDirty( )));
245
+	connect( m_hostComboBox,           SIGNAL( activated ( int )),              SIGNAL( optionsDirty( )));
246
+	connect( m_hostComboBox,           SIGNAL( textChanged( const QString& )),  SIGNAL( optionsDirty( )));
247
+	connect( m_portRangeAddButton,     SIGNAL( clicked( )),                     SIGNAL( optionsDirty( )));
248
+	connect( m_portRangeButton,        SIGNAL( clicked( )),                     SIGNAL( optionsDirty( )));
249
+	connect( m_portRangeComboBox,      SIGNAL( activated( int )),               SIGNAL( optionsDirty( )));
250
+	connect( m_portRangeDeleteButton,  SIGNAL( clicked( )),                     SIGNAL( optionsDirty( )));
251
+	connect( m_portRangeLineEdit,      SIGNAL( textChanged( const QString& )),  SIGNAL( optionsDirty( )));
252
+	connect( m_portRangeListBox,       SIGNAL( doubleClicked( QListBoxItem* )), SIGNAL( optionsDirty( )));
253
+	connect( m_portRangeListBox,       SIGNAL( highlighted ( int )),            SIGNAL( optionsDirty( )));
254
+	connect( m_portRangesCheckBox,     SIGNAL( clicked( )),                     SIGNAL( optionsDirty( )));
255
+	connect( m_resovleAlwaysRadio,     SIGNAL( clicked( )),                     SIGNAL( optionsDirty( )));
256
+	connect( m_resovleDefaultRadio,    SIGNAL( clicked( )),                     SIGNAL( optionsDirty( )));
257
+	connect( m_resovleNeverRadio,      SIGNAL( clicked( )),                     SIGNAL( optionsDirty( )));
258
+
259
+	emit( targetChanged( m_hostComboBox->currentText( )));
260
+}
261
+QString CommonWidget::getHostName( ) const
262
+{	return m_hostComboBox->currentText( );
263
+}
264
+
265
+//	getHosts
266
+//	========
267
+
268
+void CommonWidget::getHosts( QStringList* hosts )
269
+{	hosts->clear( );
270
+
271
+	for( ushort i = 0; i < m_hostComboBox->count( ); i++ )
272
+		hosts->append( m_hostComboBox->text( i ));
273
+}
274
+
275
+//	getOptions
276
+//	==========
277
+
278
+bool CommonWidget::getOptions( )
279
+{	QStringList portRanges;
280
+	getPortRanges( &portRanges );
281
+
282
+	bool portRangesState = m_portRangesCheckBox->isChecked( );
283
+
284
+	if( portRangesState && portRanges.isEmpty( ))
285
+	{	KMessageBox::error( this, i18n( QString( "Port ranges not specified" )), i18n( "Port ranges error" ));
286
+		return false;
287
+	}
288
+
289
+	m_host                 = m_hostComboBox->currentText( );
290
+	m_hostCurrentItem      = m_hostComboBox->currentItem( );
291
+	m_portRangeCurrentItem = m_portRangeComboBox->currentItem( );
292
+	m_portRangesState      = portRangesState;
293
+	m_resovleAlwaysState   = m_resovleAlwaysRadio->isChecked( );
294
+	m_resovleDefaultState  = m_resovleDefaultRadio->isChecked( );
295
+	m_resovleNeverState    = m_resovleNeverRadio->isChecked( );
296
+
297
+	if( m_portRanges != NULL )
298
+		delete m_portRanges;
299
+
300
+	m_portRanges = new QStringList( portRanges );
301
+	getHosts( m_hosts );
302
+
303
+	disconnect( m_hostComboBox, SIGNAL( activated( int )),              this, SLOT( slotHostActivated( int )));
304
+	disconnect( m_hostComboBox, SIGNAL( textChanged( const QString& )), this, SLOT( slotHostTextChanged( const QString& )));
305
+
306
+	disconnect( m_hostComboBox, SIGNAL( activated ( int )),             this, SIGNAL( optionsDirty( )));
307
+	disconnect( m_hostComboBox, SIGNAL( textChanged( const QString& )), this, SIGNAL( optionsDirty( )));
308
+
309
+	byte i;
310
+	QStringList::Iterator it;
311
+
312
+	for( i = 0, it = m_hosts->begin( ); it != m_hosts->end( ); i++, ++it )
313
+		if( *it == m_host )
314
+			break;
315
+
316
+	if( it != m_hosts->end( ))
317
+	{	m_hostComboBox->removeItem( i );
318
+		m_hosts->remove( it );
319
+	}
320
+	else
321
+		while( m_hostComboBox->count( ) > MAX_HOST_HISTORY - 1 )
322
+		{	m_hostComboBox->removeItem( MAX_HOST_HISTORY - 1 );
323
+			m_hosts->pop_back( );
324
+		}
325
+
326
+	m_hostComboBox->insertItem( m_host, 0 );
327
+	m_hostComboBox->setCurrentItem( 0 );
328
+	m_hosts->prepend( m_host );
329
+
330
+	connect( m_hostComboBox, SIGNAL( activated( int )),              SLOT( slotHostActivated( int )));
331
+	connect( m_hostComboBox, SIGNAL( textChanged( const QString& )), SLOT( slotHostTextChanged( const QString& )));
332
+
333
+	connect( m_hostComboBox, SIGNAL( activated ( int )),             SIGNAL( optionsDirty( )));
334
+	connect( m_hostComboBox, SIGNAL( textChanged( const QString& )), SIGNAL( optionsDirty( )));
335
+
336
+	return true;
337
+}
338
+
339
+//	getPortRanges
340
+//	=============
341
+
342
+void CommonWidget::getPortRanges( QStringList* portRanges )
343
+{	portRanges->clear( );
344
+
345
+	for( ushort i = 0; i < m_portRangeListBox->count( ); i++ )
346
+		portRanges->append( m_portRangeListBox->text( i ));
347
+}
348
+
349
+//	portRangesOverlapping
350
+//	=====================
351
+
352
+bool CommonWidget::portRangesOverlapping( const ushort portFirst, const ushort portLast )
353
+{	boolPtr tcpPorts = new bool[ 64 * 1024 ];
354
+	boolPtr udpPorts = new bool[ 64 * 1024 ];
355
+
356
+	if( !buildPortRangesTables( tcpPorts, udpPorts ))
357
+	{	delete [] tcpPorts;
358
+		delete [] udpPorts;
359
+		return false;
360
+	}
361
+
362
+	bool tcp = false;
363
+	bool udp = false;
364
+
365
+	switch( m_portRangeComboBox->currentItem( ))
366
+	{	case 0: tcp = udp = true; break;
367
+		case 1: tcp = true;       break;
368
+		case 2: udp = true;       break;
369
+
370
+		default:
371
+			kdDebug( ) << i18n( "unknown value in Port Range Protocol combo box" ) << endl;
372
+			ASSERT( false );
373
+			delete [] tcpPorts;
374
+			delete [] udpPorts;
375
+			return false;
376
+	}
377
+
378
+	uint    port;
379
+	QString protocol;
380
+
381
+	for( port = portFirst; port <= portLast; port++ )
382
+	{	if( tcp && tcpPorts[ port ])
383
+		{	protocol = "TCP";
384
+			break;
385
+		}
386
+
387
+		if( udp && udpPorts[ port ])
388
+		{	protocol = "UDP";
389
+			break;
390
+		}
391
+	}
392
+
393
+	if( port <= portLast )
394
+	{	KMessageBox::sorry( this, i18n( "Overlapping Port Range - %1 port %2" ).arg( protocol ).arg( QString::number( port )), i18n( "Overlapping Port Range" ));
395
+		delete [] tcpPorts;
396
+		delete [] udpPorts;
397
+		return false;
398
+	}
399
+
400
+	delete [] tcpPorts;
401
+	delete [] udpPorts;
402
+	return true;
403
+}
404
+
405
+//	readProfile
406
+//	===========
407
+
408
+void CommonWidget::readProfile( KConfig* config )
409
+{	m_hostCurrentItem      = config->readNumEntry(  "hostCurrentItem"      );
410
+	m_portRangeCurrentItem = config->readNumEntry(  "portRangeCurrentItem" );
411
+	m_portRangesState      = config->readBoolEntry( "portRangesState"      );
412
+	m_resovleAlwaysState   = config->readBoolEntry( "resovleAlwaysState"   );
413
+	m_resovleDefaultState  = config->readBoolEntry( "resovleDefaultState"  );
414
+	m_resovleNeverState    = config->readBoolEntry( "resovleNeverState"    );
415
+
416
+	m_hosts      = new QStringList( config->readListEntry( "hosts"      ));
417
+	m_portRanges = new QStringList( config->readListEntry( "portRanges" ));
418
+}
419
+
420
+//	saveProfile
421
+//	===========
422
+
423
+void CommonWidget::saveProfile( KConfig* config )
424
+{	config->writeEntry( "hostCurrentItem",      m_hostCurrentItem      );
425
+	config->writeEntry( "hosts",               *m_hosts                );
426
+	config->writeEntry( "portRanges",          *m_portRanges           );
427
+	config->writeEntry( "portRangeCurrentItem", m_portRangeCurrentItem );
428
+	config->writeEntry( "portRangesState",      m_portRangesState      );
429
+	config->writeEntry( "resovleAlwaysState",   m_resovleAlwaysState   );
430
+	config->writeEntry( "resovleDefaultState",  m_resovleDefaultState  );
431
+	config->writeEntry( "resovleNeverState",    m_resovleNeverState    );
432
+}
433
+
434
+//	setInitialValues
435
+//	================
436
+
437
+void CommonWidget::setInitialValues( )
438
+{	m_hostComboBox->clear( );
439
+	m_hostComboBox->insertStringList( *m_hosts );
440
+	m_portRangeListBox->insertStringList( *m_portRanges );
441
+	m_portRangeComboBox->setCurrentItem( m_portRangeCurrentItem );
442
+	m_portRangesCheckBox->setChecked( m_portRangesState );
443
+	m_resovleAlwaysRadio->setChecked( m_resovleAlwaysState );
444
+	m_resovleDefaultRadio->setChecked( m_resovleDefaultState );
445
+	m_resovleNeverRadio->setChecked( m_resovleNeverState );
446
+
447
+	if( m_hostComboBox->count( ))
448
+		m_hostComboBox->setCurrentItem( m_hostCurrentItem );
449
+
450
+	enablePortRangeWidgets( );
451
+}
452
+
453
+//	slotDisablePortRanges
454
+//	=====================
455
+
456
+void CommonWidget::slotDisablePortRanges( )
457
+{	m_portRangesCheckBox->setChecked( false );
458
+	slotPortRangesClicked( );
459
+}
460
+
461
+//	slotHostActivated
462
+//	=================
463
+
464
+void CommonWidget::slotHostActivated( int /* index */)
465
+{	emit( targetChanged( m_hostComboBox->currentText( )));
466
+}
467
+
468
+//	slotHostButtonClicked
469
+//	=====================
470
+
471
+void CommonWidget::slotHostButtonClicked( )
472
+{	m_hostComboBox->clearEdit( );
473
+}
474
+
475
+//	slotHostTextChanged
476
+//	===================
477
+
478
+void CommonWidget::slotHostTextChanged( const QString& text )
479
+{	emit( targetChanged( text ));
480
+}
481
+
482
+//	slotPortRangeAddClicked
483
+//	=======================
484
+
485
+void CommonWidget::slotPortRangeAddClicked( )
486
+{	QString text;
487
+
488
+	if( !validatePortRange( text ))
489
+		return;
490
+
491
+	switch( m_portRangeComboBox->currentItem( ))
492
+	{	case BothProtocol:                     break;
493
+		case TCPProtocol: text = "T:" + text; break;
494
+		case UDPProtocol: text = "U:" + text; break;
495
+
496
+		default:
497
+			kdDebug( ) << i18n( "unknown value in Port Range Protocol combo box" ) << endl;
498
+			ASSERT( false );
499
+	}
500
+
501
+	m_portRangeAddButton->setEnabled( false );
502
+	emit( optionsDirty( ));
503
+	m_portRangeLineEdit->clear( );
504
+	m_portRangeListBox->insertItem( text );
505
+}
506
+
507
+//	slotPortRangeDeleteClicked
508
+//	==========================
509
+
510
+void CommonWidget::slotPortRangeDeleteClicked( )
511
+{	m_portRangeIgnoreChange = true;
512
+	m_portRangeListBox->removeItem( m_portRangeListBox->currentItem( ));
513
+	m_portRangeAddButton->setEnabled( true );
514
+	m_portRangeDeleteButton->setEnabled( false );
515
+	emit( optionsDirty( ));
516
+}
517
+
518
+//	slotPortRangeActivated
519
+//	======================
520
+
521
+void CommonWidget::slotPortRangeActivated( int /* index */)
522
+{	m_portRangeAddButton->setEnabled( true );
523
+}
524
+
525
+//	slotPortRangeActivated
526
+//	======================
527
+
528
+void CommonWidget::slotPortRangeButtonClicked( )
529
+{	m_portRangeAddButton->setEnabled( false );
530
+	m_portRangeDeleteButton->setEnabled( false );
531
+	m_portRangeLineEdit->clear( );
532
+}
533
+
534
+//	slotPortRangeDoubleClicked
535
+//	==========================
536
+
537
+void CommonWidget::slotPortRangeDoubleClicked( QListBoxItem* item )
538
+{	if( item == NULL )
539
+		return;
540
+
541
+	QString text = item->text( );
542
+
543
+	if( text[ 0 ].isDigit( ))
544
+		m_portRangeComboBox->setCurrentItem( BothProtocol ); 
545
+	else
546
+	{	switch( text[ 0 ].latin1( ))
547
+		{	case 'T': m_portRangeComboBox->setCurrentItem( TCPProtocol ); break;
548
+			case 'U': m_portRangeComboBox->setCurrentItem( UDPProtocol ); break;
549
+
550
+			default:
551
+				kdDebug( ) << i18n( "unknown value in Port Range Protocol" ) << endl;
552
+				ASSERT( false );
553
+				m_portRangeComboBox->setCurrentItem( BothProtocol ); 
554
+		}
555
+
556
+		text = text.right( text.length( ) - 2 );
557
+	}
558
+
559
+	m_portRangeIgnoreChange = true;
560
+	m_portRangeLineEdit->setText( text );
561
+	m_portRangeDeleteButton->setEnabled( true );
562
+}
563
+
564
+//	slotPortRangeHighlighted
565
+//	========================
566
+
567
+void CommonWidget::slotPortRangeHighlighted( )
568
+{	if( m_portRangeIgnoreChange )
569
+		m_portRangeIgnoreChange = false;
570
+	else
571
+	{	m_portRangeAddButton->setEnabled( false );
572
+		m_portRangeDeleteButton->setEnabled( false );
573
+		m_portRangeLineEdit->clear( );
574
+	}
575
+}
576
+
577
+//	slotPortRangesClicked
578
+//	=====================
579
+
580
+void CommonWidget::slotPortRangesClicked( )
581
+{	enablePortRangeWidgets( );
582
+}
583
+
584
+//	slotPortRangeTextChanged
585
+//	========================
586
+
587
+void CommonWidget::slotPortRangeTextChanged( const QString& /* text */)
588
+{	if( m_portRangeIgnoreChange )
589
+		m_portRangeIgnoreChange = false;
590
+	else
591
+		m_portRangeAddButton->setEnabled( m_portRangeLineEdit->text( ).length( ));
592
+}
593
+
594
+//	slotWhatsThisClicked
595
+//	====================
596
+
597
+void CommonWidget::slotWhatsThisClicked( )
598
+{		 if( m_hostButton->hasMouse( ))            emit( displayHelp( "target" ));
599
+	else if( m_hostComboBox->hasMouse( ))          emit( displayHelp( "target" ));
600
+	else if( m_portRangeAddButton->hasMouse( ))    emit( displayDocBook( "common_options" ));
601
+	else if( m_portRangeButton->hasMouse( ))       emit( displayDocBook( "common_options" ));
602
+	else if( m_portRangeComboBox->hasMouse( ))     emit( displayDocBook( "common_options" ));
603
+	else if( m_portRangeDeleteButton->hasMouse( )) emit( displayDocBook( "common_options" ));
604
+	else if( m_portRangeLineEdit->hasMouse( ))     emit( displayDocBook( "common_options" ));
605
+	else if( m_portRangeListBox->hasMouse( ))      emit( displayDocBook( "common_options" ));
606
+	else if( m_portRangesCheckBox->hasMouse( ))    emit( displayHelp( "-p" ));
607
+	else if( m_resovleAlwaysRadio->hasMouse( ))    emit( displayHelp( "-R" ));
608
+	else if( m_resovleDefaultRadio->hasMouse( ))   emit( displayDocBook( "common_options" ));
609
+	else if( m_resovleNeverRadio->hasMouse( ))     emit( displayHelp( "-n" ));
610
+	else emit( displayUnknown( ));
611
+}
612
+
613
+//	validatePortRange
614
+//	=================
615
+
616
+bool CommonWidget::validatePortRange( QString& text )
617
+{	uint portFirst;
618
+	uint portLast;
619
+
620
+	if( !validatePortRangeText( text, portFirst, portLast ))
621
+		return false;
622
+
623
+	if( !portRangesOverlapping( portFirst, portLast ))
624
+		return false;
625
+
626
+	return true;
627
+}
628
+
629
+//	validatePortRangeText
630
+//	=====================
631
+
632
+bool CommonWidget::validatePortRangeText( QString& text, uint& portFirst, uint& portLast )
633
+{	text = m_portRangeLineEdit->text( );
634
+	QStringList ports = QStringList::split( "-", text );
635
+
636
+	if( ports.count( ) > 2 )
637
+	{	KMessageBox::error( this, i18n( "Internal error - you seem to have been allowed to entered an illegal Port Range" ), i18n( "Internal error" ));
638
+		return false;
639
+	}
640
+
641
+	portFirst = ports.front( ).toUInt( );
642
+	portLast  = portFirst;
643
+
644
+	if( ports.count( ) > 1 )
645
+		portLast  = ports.back( ).toUInt( );
646
+
647
+	if( !portFirst || portFirst > 65535 || !portLast || portLast > 65535 || portFirst > portLast )
648
+	{	KMessageBox::sorry( this,
649
+							i18n( "Ports must be in the range 1 to 65,535 and ranges must be in ascending order" ),
650
+							i18n( "Invalid Port Range" ));
651
+		return false;
652
+	}
653
+
654
+	return true;
655
+}

+ 140
- 0
src/commonwidget.h View File

@@ -0,0 +1,140 @@
1
+/***************************************************************************
2
+ *                                                                         *
3
+ *   Copyright (C) 2005, 2006 by Kevin Gilbert                             *
4
+ *   kev.gilbert@cdu.edu.au                                                *
5
+ *                                                                         *
6
+ *   This program is free software; you can redistribute it and/or modify  *
7
+ *   it under the terms of the GNU General Public License as published by  *
8
+ *   the Free Software Foundation; either version 2 of the License, or     *
9
+ *   (at your option) any later version.                                   *
10
+ *                                                                         *
11
+ *   This program is distributed in the hope that it will be useful,       *
12
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
13
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
14
+ *   GNU General Public License for more details.                          *
15
+ *                                                                         *
16
+ *   You should have received a copy of the GNU General Public License     *
17
+ *   along with this program; if not, write to the                         *
18
+ *   Free Software Foundation, Inc.,                                       *
19
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
20
+ *                                                                         *
21
+ ***************************************************************************/
22
+
23
+#ifndef _COMMONWIDGET_H_
24
+#define _COMMONWIDGET_H_
25
+
26
+#ifdef HAVE_CONFIG_H
27
+#	include <config.h>
28
+#endif
29
+
30
+#include <qwidget.h>
31
+#include "global.h"
32
+
33
+//	forward class definitions
34
+//	=========================
35
+
36
+class KConfig;
37
+class QCheckBox;
38
+class QComboBox;
39
+class QLineEdit;
40
+class QListBox;
41
+class QListBoxItem;
42
+class QPushButton;
43
+class QRadioButton;
44
+class QStringList;
45
+