Merge pull request #11353 from kvuorine/fwknop-fixes
[feed/packages.git] / net / nmap / patches / 010-Avoid-using-namespace-std-causing-name-conflicts.patch
1 From ea4e2d6657103a2c3d6f543a1a8619eb4d4472c8 Mon Sep 17 00:00:00 2001
2 From: dmiller <dmiller@e0a8ed71-7df4-0310-8962-fdc924857419>
3 Date: Mon, 30 Dec 2019 04:03:03 +0000
4 Subject: [PATCH] Avoid 'using namespace std' causing name conflicts. Fixes
5 #1363, fixes #1867
6
7 ---
8 CHANGELOG | 4 ++++
9 nping/EchoServer.cc | 2 +-
10 nping/EchoServer.h | 4 +---
11 nping/NEPContext.h | 3 +--
12 nping/NpingTargets.h | 4 +---
13 nping/ProbeMode.h | 2 --
14 nping/nping.cc | 1 -
15 nping/utils.h | 2 --
16 8 files changed, 8 insertions(+), 14 deletions(-)
17
18 diff --git a/nping/EchoServer.cc b/nping/EchoServer.cc
19 index ccdcf9c2d0..a824340cd2 100644
20 --- a/nping/EchoServer.cc
21 +++ b/nping/EchoServer.cc
22 @@ -199,7 +199,7 @@ NEPContext *EchoServer::getClientContext(nsock_iod iod){
23 * the context could not be found. */
24 int EchoServer::destroyClientContext(clientid_t clnt){
25 bool deleted=false;
26 - vector<NEPContext>::iterator it;
27 + std::vector<NEPContext>::iterator it;
28 /* Iterate through the context array and delete the one that belongs to clnt */
29 for ( it=this->client_ctx.begin(); it<this->client_ctx.end(); it++){
30 if(it->getIdentifier()==clnt){
31 diff --git a/nping/EchoServer.h b/nping/EchoServer.h
32 index c3dece6341..c9fee6de9e 100644
33 --- a/nping/EchoServer.h
34 +++ b/nping/EchoServer.h
35 @@ -136,15 +136,13 @@
36 #include <vector>
37 #include "NEPContext.h"
38
39 -using namespace std;
40 -
41 #define LISTEN_QUEUE_SIZE 10
42
43 class EchoServer {
44
45 private:
46 /* Attributes */
47 - vector<NEPContext> client_ctx;
48 + std::vector<NEPContext> client_ctx;
49 clientid_t client_id_count;
50
51 /* Methods */
52 diff --git a/nping/NEPContext.h b/nping/NEPContext.h
53 index 5e470d7551..32b8be48d6 100644
54 --- a/nping/NEPContext.h
55 +++ b/nping/NEPContext.h
56 @@ -135,7 +135,6 @@
57 #include "nsock.h"
58 #include "EchoHeader.h"
59 #include <vector>
60 -using namespace std;
61
62 /* SERVER STATE MACHINE */
63 /* _ */
64 @@ -204,7 +203,7 @@ class NEPContext {
65 u8 client_nonce[NONCE_LEN];
66 bool server_nonce_set;
67 bool client_nonce_set;
68 - vector<fspec_t> fspecs;
69 + std::vector<fspec_t> fspecs;
70 struct sockaddr_storage clnt_addr;
71
72 u8 *generateKey(int key_type, size_t *final_len);
73 diff --git a/nping/NpingTargets.h b/nping/NpingTargets.h
74 index 61bb356f39..3a9a2145af 100644
75 --- a/nping/NpingTargets.h
76 +++ b/nping/NpingTargets.h
77 @@ -137,8 +137,6 @@
78 #include "NpingTarget.h"
79 #include <vector>
80
81 -using namespace std;
82 -
83 #define MAX_NPING_HOSTNAME_LEN 512 /**< Max length for named hosts */
84
85 class NpingTargets {
86 @@ -176,7 +174,7 @@ class NpingTargets {
87
88 /* TODO: Make private */
89 NpingTarget *currenths;
90 - vector<NpingTarget *> Targets;
91 + std::vector<NpingTarget *> Targets;
92
93 }; /* End of class NpingTargets */
94
95 diff --git a/nping/ProbeMode.h b/nping/ProbeMode.h
96 index aa86939e02..313776d862 100644
97 --- a/nping/ProbeMode.h
98 +++ b/nping/ProbeMode.h
99 @@ -135,11 +135,9 @@
100
101 #include "nping.h"
102 #include "nsock.h"
103 -#include <vector>
104 #include "NpingTarget.h"
105 #include "utils_net.h"
106 #include "utils.h"
107 -using namespace std;
108
109 #define PKT_TYPE_TCP_CONNECT 1
110 #define PKT_TYPE_UDP_NORMAL 2
111 diff --git a/nping/nping.cc b/nping/nping.cc
112 index 9de151a7be..40df912a88 100644
113 --- a/nping/nping.cc
114 +++ b/nping/nping.cc
115 @@ -150,7 +150,6 @@
116 #include <signal.h>
117 #include <time.h>
118
119 -using namespace std;
120 NpingOps o;
121 EchoClient ec;
122 EchoServer es;
123 diff --git a/nping/utils.h b/nping/utils.h
124 index c3516cf29f..5de6b64b89 100644
125 --- a/nping/utils.h
126 +++ b/nping/utils.h
127 @@ -143,8 +143,6 @@
128 #endif
129
130 #include "global_structures.h"
131 -#include <vector>
132 -using namespace std;
133
134 /* Function prototypes */
135 bool contains(const char *source, const char *substring);