本文整理汇总了C++中Scan::runTcpScan方法的典型用法代码示例。如果您正苦于以下问题:C++ Scan::runTcpScan方法的具体用法?C++ Scan::runTcpScan怎么用?C++ Scan::runTcpScan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scan
的用法示例。
在下文中一共展示了Scan::runTcpScan方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
void * perform_scan(void * args) {
ps_args_t* ps_args = ((ps_args_t *) args);
string ip = "ip";
int port = 0;
while (ip != "finish" && port != -1) {
get_next_ip_port(*ps_args, ip, port);
if (ip == "finish" && port == -1) {
return NULL;
}
for (int s = 0; s < 6; s++) {
if (ps_args->scans[s] == 1) {
Scan sc = Scan();
sc.ipToScan = ip;
sc.port = htons(port);
//sc.scanVector = vector<ScanType>();
switch (s) {
case SYN:
sc.cScan = SYN;
sc.runTcpScan();
break;
case NUL:
sc.cScan = NUL;
sc.runTcpScan();
break;
case FIN:
sc.cScan = FIN;
sc.runTcpScan();
break;
case XMAS:
sc.cScan = XMAS;
sc.runTcpScan();
break;
case ACK:
sc.cScan = ACK;
sc.runTcpScan();
break;
case UDP:
sc.cScan = UDP;
sc.runUdpScan();
break;
}
pthread_mutex_lock(&arrMutex);
scanArray.push_back(sc);
pthread_mutex_unlock(&arrMutex);
}
}
}
return NULL;
}