📄 stru.cpp
字号:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "Stru.h"
bool operator==(TKey & lhs,TKey & rhs)
{
struct in_addr inaddr;
char filename[128];
inaddr.s_addr = lhs.src_ip;
//printf("l%s::%d--",inet_ntoa(inaddr),ntohs(lhs.src_port));
inaddr.s_addr = lhs.dst_ip;
//printf("%s::%d--\n",inet_ntoa(inaddr),ntohs(lhs.dst_port));
inaddr.s_addr = rhs.src_ip;
//printf("r%s::%d--",inet_ntoa(inaddr),ntohs(rhs.src_port));
inaddr.s_addr = rhs.dst_ip;
//printf("%s::%d--\n",inet_ntoa(inaddr),ntohs(rhs.dst_port));
//printf("proctocl [%x-%x]\n",lhs.protocol,rhs.protocol);
if( lhs.protocol!=rhs.protocol)
return false;
//printf("src-ip[%x-%x]\n",lhs.src_ip,rhs.src_ip);
if( lhs.src_ip!=rhs.src_ip)
return false;
//printf("src-port[%x-%x]\n",lhs.src_port,rhs.src_port);
if( lhs.src_port!=rhs.src_port)
return false;
//printf("dst_ip[%x-%x]\n",lhs.dst_ip,rhs.dst_ip);
if( lhs.dst_ip!=rhs.dst_ip)
return false;
//printf("dst-port[%x-%x]\n",lhs.dst_port,rhs.dst_port);
if( lhs.dst_port!=rhs.dst_port)
return false;
//printf("is identical\n");
return true;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -