~ubuntu-branches/ubuntu/oneiric/nmap/oneiric

« back to all changes in this revision

Viewing changes to Target.cc

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones, fyodor, Davide
  • Date: 2008-05-31 22:55:14 UTC
  • mfrom: (1.2.10 upstream) (3.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20080531225514-dej22l1clq3nj2o3
Tags: 4.62-1
[fyodor]

* new upstream release

[Davide]

* create an desktop file for zenmap.  Closes: #457799
* remove useless file /usr/bin/uninstall_zenmap.  Closes: #474511

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 * These restrictions only apply when you actually redistribute Nmap.  For *
40
40
 * example, nothing stops you from writing and selling a proprietary       *
41
41
 * front-end to Nmap.  Just distribute it by itself, and point people to   *
42
 
 * http://insecure.org/nmap/ to download Nmap.                             *
 
42
 * http://nmap.org to download Nmap.                                       *
43
43
 *                                                                         *
44
44
 * We don't consider these to be added restrictions on top of the GPL, but *
45
45
 * just a clarification of how we interpret "derived works" as it applies  *
78
78
 * Source code also allows you to port Nmap to new platforms, fix bugs,    *
79
79
 * and add new features.  You are highly encouraged to send your changes   *
80
80
 * to fyodor@insecure.org for possible incorporation into the main         *
81
 
 * distribution.  By sending these changes to Fyodor or one the            *
 
81
 * distribution.  By sending these changes to Fyodor or one of the         *
82
82
 * Insecure.Org development mailing lists, it is assumed that you are      *
83
83
 * offering Fyodor and Insecure.Com LLC the unlimited, non-exclusive right *
84
84
 * to reuse, modify, and relicense the code.  Nmap will always be          *
98
98
 *                                                                         *
99
99
 ***************************************************************************/
100
100
 
101
 
/* $Id: Target.cc 6633 2007-12-22 06:32:03Z fyodor $ */
 
101
/* $Id: Target.cc 7145 2008-04-11 03:54:44Z david $ */
102
102
 
103
103
#ifdef WIN32
104
104
#include "nmap_winconfig.h"
119
119
 
120
120
void Target::Initialize() {
121
121
  hostname = NULL;
 
122
  targetname = NULL;
122
123
  memset(&seq, 0, sizeof(seq));
123
124
  distance = -1;
124
 
  FPR1 = NULL;
125
125
  FPR = NULL;
126
126
  osscan_flag = OS_NOTPERF;
127
127
  wierd_responses = flags = 0;
169
169
  if (hostname)
170
170
    free(hostname);
171
171
 
 
172
  if (targetname)
 
173
    free(targetname);
 
174
 
172
175
  if (nameIPBuf) {
173
176
    free(nameIPBuf);
174
177
    nameIPBuf = NULL;
175
178
  }
176
179
 
177
 
  if (FPR1) delete FPR1;
178
180
  if (FPR) delete FPR;
179
181
}
180
182
 
221
223
    /* We had an old target sock, so we better blow away the hostname as
222
224
       this one may be new. */
223
225
    setHostName(NULL);
 
226
    setTargetName(NULL);
224
227
  }
225
228
  memcpy(&targetsock, ss, ss_len);
226
229
  targetsocklen = ss_len;
308
311
  }
309
312
}
310
313
 
 
314
void Target::setTargetName(char *name) {
 
315
  if (targetname) {
 
316
    free(targetname);
 
317
    targetname = NULL;
 
318
  }
 
319
  if (name) {
 
320
    targetname = strdup(name);
 
321
  }
 
322
}
 
323
 
311
324
 /* Generates a printable string consisting of the host's IP
312
325
     address and hostname (if available).  Eg "www.insecure.org
313
326
     (64.71.184.53)" or "fe80::202:e3ff:fe14:1102".  The name is