diff --git a/FPEngine.cc b/FPEngine.cc index da1651473..d5a97b07e 100644 --- a/FPEngine.cc +++ b/FPEngine.cc @@ -1848,7 +1848,7 @@ int FPHost6::build_probe_list() { i++; /* Set untimed TCP probes */ - for ( ; i < NUM_FP_PROBES_IPv6_TCP; i++) { + for (; i < NUM_FP_PROBES_IPv6_TCP; i++) { /* If the probe is targeted to a TCP port and we don't have * any port number for that particular state, skip the probe. */ if (TCP_DESCS[i].dstport == OPEN && this->open_port_tcp < 0) diff --git a/TargetGroup.cc b/TargetGroup.cc index 5f3f02a1f..45a7a265f 100644 --- a/TargetGroup.cc +++ b/TargetGroup.cc @@ -535,7 +535,7 @@ static void make_ipv6_netmask(struct in6_addr *mask, int bits) { i = 0; /* 0 < bits <= 128, so this loop goes at most 15 times. */ - for ( ; bits > 8; bits -= 8) + for (; bits > 8; bits -= 8) mask->s6_addr[i++] = 0xFF; mask->s6_addr[i] = 0xFF << (8 - bits); } diff --git a/idle_scan.cc b/idle_scan.cc index ce67ef651..4ef3d986e 100644 --- a/idle_scan.cc +++ b/idle_scan.cc @@ -219,7 +219,7 @@ int ipv6_get_fragment_id(const struct ip6_hdr *ip6, unsigned int len) { p += (*(p + 1) + 1) * 8; } - if ( hdr != IP_PROTO_FRAGMENT || (p + 2 + sizeof(ip6_ext_data_fragment)) > end) + if (hdr != IP_PROTO_FRAGMENT || (p + 2 + sizeof(ip6_ext_data_fragment)) > end) return -1; frag_header = (struct ip6_ext_data_fragment *)( p + 2 ); @@ -1081,7 +1081,7 @@ static int idlescan_countopen2(struct idle_proxy_info *proxy, but doing it the straightforward way (using the same decoys as we use in probing the proxy box is risky. I'll have to think about this more. */ - if ( o.af() == AF_INET ) { + if (o.af() == AF_INET ) { send_tcp_raw(proxy->rawsd, eth.ethsd ? ð : NULL, proxy->host.v4hostip(), target->v4hostip(), o.ttl, false, diff --git a/main.cc b/main.cc index 09ec82621..d1d384758 100644 --- a/main.cc +++ b/main.cc @@ -142,10 +142,10 @@ struct Library *SocketBase = NULL, *MiamiBase = NULL, *MiamiBPFBase = NULL, *Mia static const char ver[] = "$VER:" NMAP_NAME " v"NMAP_VERSION " [Amiga.sf]"; static void CloseLibs(void) { - if ( MiamiPCapBase ) CloseLibrary( MiamiPCapBase ); - if ( MiamiBPFBase ) CloseLibrary( MiamiBPFBase ); - if ( SocketBase ) CloseLibrary( SocketBase ); - if ( MiamiBase ) CloseLibrary( MiamiBase ); + if (MiamiPCapBase ) CloseLibrary( MiamiPCapBase ); + if (MiamiBPFBase ) CloseLibrary( MiamiBPFBase ); + if ( SocketBase ) CloseLibrary( SocketBase ); + if ( MiamiBase ) CloseLibrary( MiamiBase ); } static BOOL OpenLibs(void) { diff --git a/nmap.cc b/nmap.cc index 1df768d4a..ab7529d60 100644 --- a/nmap.cc +++ b/nmap.cc @@ -948,7 +948,7 @@ void parse_options(int argc, char **argv) { fatal("--top-ports should be an integer 1 or greater"); } else if (optcmp(long_options[option_index].name, "ip-options") == 0) { o.ipoptions = (u8*) safe_malloc(4 * 10 + 1); - if ( (o.ipoptionslen = parse_ip_options(optarg, o.ipoptions, 4 * 10 + 1, &o.ipopt_firsthop, &o.ipopt_lasthop, errstr, sizeof(errstr))) == OP_FAILURE) + if ((o.ipoptionslen = parse_ip_options(optarg, o.ipoptions, 4 * 10 + 1, &o.ipopt_firsthop, &o.ipopt_lasthop, errstr, sizeof(errstr))) == OP_FAILURE) fatal("%s", errstr); if (o.ipoptionslen > 4 * 10) fatal("Ip options can't be more than 40 bytes long"); diff --git a/nmap_amigaos.h b/nmap_amigaos.h index de46d20df..7606c247b 100644 --- a/nmap_amigaos.h +++ b/nmap_amigaos.h @@ -142,14 +142,14 @@ //Pcap functions replacement using miamipcap.library (MiamiSDK v2.11) #define pcap_open_live(a, b, c, d...) MiamiPCapOpenLive(a, b, 0, d) -#define pcap_filter(args...) MiamiPCapFilter( args) -#define pcap_close(args...) MiamiPCapClose( args) -#define pcap_datalink(args...) MiamiPCapDatalink( args) -#define pcap_geterr(args...) MiamiPCapGeterr( args) -#define pcap_next(args...) MiamiPCapNext( args) -#define pcap_lookupnet(args...) MiamiPCapLookupnet( args) -#define pcap_compile(args...) MiamiPCapCompile( args) -#define pcap_setfilter(args...) MiamiPCapSetfilter( args) +#define pcap_filter(args...) MiamiPCapFilter(args) +#define pcap_close(args...) MiamiPCapClose(args) +#define pcap_datalink(args...) MiamiPCapDatalink(args) +#define pcap_geterr(args...) MiamiPCapGeterr(args) +#define pcap_next(args...) MiamiPCapNext(args) +#define pcap_lookupnet(args...) MiamiPCapLookupnet(args) +#define pcap_compile(args...) MiamiPCapCompile(args) +#define pcap_setfilter(args...) MiamiPCapSetfilter(args) #ifndef DLT_MIAMI #define DLT_MIAMI 100 diff --git a/nmap_ftp.cc b/nmap_ftp.cc index 942251e2a..402f99d8c 100644 --- a/nmap_ftp.cc +++ b/nmap_ftp.cc @@ -131,7 +131,7 @@ extern NmapOps o; struct ftpinfo get_default_ftpinfo(void) { -#if (defined(IN_ADDR_DEEPSTRUCT) || defined( SOLARIS)) +#if (defined(IN_ADDR_DEEPSTRUCT) || defined(SOLARIS)) /* Note that struct in_addr in solaris is 3 levels deep just to store an * unsigned int! */ struct ftpinfo ftp = { FTPUSER, FTPPASS, "", { { { 0 } } } , 21, 0}; diff --git a/nse_openssl.cc b/nse_openssl.cc index 66a8e5530..eeb8f4474 100644 --- a/nse_openssl.cc +++ b/nse_openssl.cc @@ -459,7 +459,7 @@ static int l_DES_string_to_key(lua_State *L) /** DES_string_to_key( string data { size_t len; const unsigned char *data = (unsigned char *) luaL_checklstring( L, 1, &len ); - if ( len != 7 ) + if (len != 7 ) return luaL_error( L, "String must have length of 7 bytes." ); DES_cblock key; diff --git a/osscan2.cc b/osscan2.cc index 732d24f22..89d5c4e4b 100644 --- a/osscan2.cc +++ b/osscan2.cc @@ -2449,7 +2449,7 @@ void HostOsScan::makeTSeqFP(HostOsScanStats *hss) { seq_AVs.push_back(AV); /* SS: Shared IP ID sequence boolean */ - if ( (tcp_ipid_seqclass == IPID_SEQ_INCR || + if ((tcp_ipid_seqclass == IPID_SEQ_INCR || tcp_ipid_seqclass == IPID_SEQ_BROKEN_INCR || tcp_ipid_seqclass == IPID_SEQ_RPI) && (icmp_ipid_seqclass == IPID_SEQ_INCR || @@ -2459,7 +2459,7 @@ void HostOsScan::makeTSeqFP(HostOsScanStats *hss) { are in the same sequence. */ AV.attribute = "SS"; u32 avg = (hss->ipid.tcp_ipids[good_tcp_ipid_num - 1] - hss->ipid.tcp_ipids[0]) / (good_tcp_ipid_num - 1); - if ( hss->ipid.icmp_ipids[0] < hss->ipid.tcp_ipids[good_tcp_ipid_num - 1] + 3 * avg) { + if (hss->ipid.icmp_ipids[0] < hss->ipid.tcp_ipids[good_tcp_ipid_num - 1] + 3 * avg) { AV.value = "S"; } else { AV.value = "O"; diff --git a/output.cc b/output.cc index e92fed058..d827c5ec6 100644 --- a/output.cc +++ b/output.cc @@ -2335,7 +2335,7 @@ static void printtraceroute_normal(Target *currenths) { /* The beginning and end of timeout consolidation. */ int begin_ttl, end_ttl; begin_ttl = end_ttl = it->ttl; - for ( ; it != currenths->traceroute_hops.end() && it->timedout; it++) + for (; it != currenths->traceroute_hops.end() && it->timedout; it++) end_ttl = it->ttl; if (begin_ttl == end_ttl) Tbl.addItem(row, RTT_COL, false, "..."); diff --git a/scan_engine.cc b/scan_engine.cc index 3120319ae..ccab7a86b 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -1928,7 +1928,7 @@ int UltraScanInfo::removeCompletedHosts() { /* We don't want to run this all of the time */ TIMEVAL_MSEC_ADD(compare, lastCompletedHostRemoval, completedHostLifetime / 2); - if ( TIMEVAL_AFTER(now, compare) ) { + if (TIMEVAL_AFTER(now, compare) ) { for (hostI = completedHosts.begin(); hostI != completedHosts.end(); hostI = nxt) { nxt = hostI; nxt++; @@ -1939,7 +1939,7 @@ int UltraScanInfo::removeCompletedHosts() { continue; TIMEVAL_MSEC_ADD(compare, hss->completiontime, completedHostLifetime); - if ( TIMEVAL_AFTER(now, compare) ) { + if (TIMEVAL_AFTER(now, compare) ) { completedHosts.erase(hostI); hostsRemoved++; } diff --git a/service_scan.cc b/service_scan.cc index 970dac325..9143ee393 100644 --- a/service_scan.cc +++ b/service_scan.cc @@ -1650,7 +1650,7 @@ void ServiceNFO::addToServiceFingerprint(const char *probeName, const u8 *resp, // Now for the probe response itself ... for(srcidx=0; srcidx < respused; srcidx++) { // A run of this can take up to 8 chars: "\n \x20" - assert( servicefpalloc - servicefplen > 8); + assert(servicefpalloc - servicefplen > 8); if (isalnum((int)resp[srcidx])) addServiceChar((char) resp[srcidx], servicewrap); @@ -2262,7 +2262,7 @@ static void servicescan_connect_handler(nsock_pool nsp, nsock_event nse, void *m #if HAVE_OPENSSL // Snag our SSL_SESSION from the nsi for use in subsequent connections. if (nsi_checkssl(nsi)) { - if ( svc->ssl_session ) { + if (svc->ssl_session ) { if (svc->ssl_session == (SSL_SESSION *)(nsi_get0_ssl_session(nsi))) { //nada } else { diff --git a/tcpip.h b/tcpip.h index 139faca11..1357dc5d9 100644 --- a/tcpip.h +++ b/tcpip.h @@ -356,7 +356,7 @@ u8 *build_tcp_raw_ipv6(const struct in6_addr *source, /* Build and send a raw tcp packet. If TTL is -1, a partially random (but likely large enough) one is chosen */ -int send_tcp_raw( int sd, const struct eth_nfo *eth, +int send_tcp_raw(int sd, const struct eth_nfo *eth, const struct in_addr *source, const struct in_addr *victim, int ttl, bool df, u8* ipopt, int ipoptlen, @@ -365,7 +365,7 @@ int send_tcp_raw( int sd, const struct eth_nfo *eth, u8 *options, int optlen, const char *data, u16 datalen); -int send_tcp_raw_decoys( int sd, const struct eth_nfo *eth, +int send_tcp_raw_decoys(int sd, const struct eth_nfo *eth, const struct in_addr *victim, int ttl, bool df, u8* ipopt, int ipoptlen, @@ -392,14 +392,14 @@ u8 *build_udp_raw_ipv6(const struct in6_addr *source, u8 hoplimit, u16 sport, u16 dport, const char *data, u16 datalen, u32 *packetlen); -int send_udp_raw( int sd, const struct eth_nfo *eth, +int send_udp_raw(int sd, const struct eth_nfo *eth, struct in_addr *source, const struct in_addr *victim, int ttl, u16 ipid, u8* ipopt, int ipoptlen, u16 sport, u16 dport, const char *data, u16 datalen); -int send_udp_raw_decoys( int sd, const struct eth_nfo *eth, +int send_udp_raw_decoys(int sd, const struct eth_nfo *eth, const struct in_addr *victim, int ttl, u16 ipid, u8* ipops, int ip, diff --git a/traceroute.cc b/traceroute.cc index e7507b803..19a840daa 100644 --- a/traceroute.cc +++ b/traceroute.cc @@ -1081,7 +1081,7 @@ static Hop *merge_hops(const struct sockaddr_storage *tag, Hop *a, Hop *b) { p->parent = a; else if (b != NULL) p->parent = b; - for ( ; p != NULL; p = p->parent) + for (; p != NULL; p = p->parent) p->tag = *tag; return head.parent;