当前位置: 首页 > news >正文

做网赌网站需要多少钱搜索引擎哪个好

做网赌网站需要多少钱,搜索引擎哪个好,做的网站不能放视频播放器,网站建设方案书0数据包分析 想要知道如何解析IP数据包,就要知道不同的IP数据包的包头结构,于是我们上⽹查查资料: 以太网数据包 ARP数据包 IPv4 IPv6 TCP UDP ICMP ICMPv6 根据以上数据包头结构,我们就有了我们的protocol.h文件,声明…

数据包分析

想要知道如何解析IP数据包,就要知道不同的IP数据包的包头结构,于是我们上⽹查查资料:

以太网数据包

ARP数据包

在这里插入图片描述

IPv4

IPv6

在这里插入图片描述

TCP

在这里插入图片描述

UDP

在这里插入图片描述

ICMP

在这里插入图片描述

ICMPv6

在这里插入图片描述
根据以上数据包头结构,我们就有了我们的protocol.h文件,声明各种数据包:

#ifndef PROTOCOL_H
#define PROTOCOL_H
#define HAVE_REMOTE
#define PROTO_ICMP 1
#define PROTO_TCP 6
#define PROTO_UDP 17
#include <iostream>
#include <QObject>
#include "_bsd_types.h"
#include "pcap.h"
using namespace std;
//IPV4
typedef struct ip_address{u_char byte1;u_char byte2;u_char byte3;u_char byte4;
}ip_address;typedef struct ipv6_address
{u_char byte1;u_char byte2;u_char byte3;u_char byte4;u_char byte5;u_char byte6;u_char byte7;u_char byte8;
}ipv6_address;typedef struct ipv4_header{u_char ver_ihl;u_char tos;u_short tlen;u_short Identification;u_short flags_fo;u_char ttl;u_char proto;u_short crc;ip_address srcaddr;ip_address dstaddr;u_int op_pad;
}ipv4_header;typedef struct ipv6_header{u_int ver:4,flowtype:8,flowtip:20;u_short len;u_char pnext;u_char lim;ipv6_address srcaddr;ipv6_address dstaddr;
}ipv6_header;typedef struct tcp_header{u_short srcport;u_short dstport;u_int seq;u_int ack_seq;u_short resl:4,doff:4,fin:1,syn:1,pst:1,psh:1,ack:1,urg:1,ece:1,cwr:1;u_short window;u_short check;u_short urg_ptr;u_int opt;
}tcp_header;typedef struct udp_header{u_short srcport;u_short dstport;u_short tlen;u_short crc;
}udp_header;typedef struct icmp_header{u_char type;u_char code;u_char seq;u_char crc;
}icmp_header;typedef struct icmp6_header{u_char type;u_char code;u_char seq;u_char crc;u_char op_type;u_char op_len;u_char op_ethaddr[6];
}icmp6_header;typedef struct pkg_count{int n_tcp;int n_udp;int n_icmp;int n_icmp6;int n_http;int n_arp;int n_ipv4;int n_ipv6;int n_other;int n_ttl;
}pkg_count;typedef struct arp_header{u_short hardware;u_short proto;u_char ml;u_char ipl;u_short opt;u_char sm[6];ip_address sip;u_char dm[6];ip_address dip;
}arp_hearder;typedef struct eth_header{u_char smac[6];u_char dmac[6];u_short type;
}eth_header;typedef struct pkg_data
{QString pkgtype;int time[6];int len;eth_header *ethh;ipv4_header *ipv4h;ipv6_header *ipv6h;arp_header *arph;udp_header *udph;tcp_header *tcph;icmp_header *icmph;icmp6_header *icmp6;void *apph;}pkg_data;#endif // PROTOCOL_H

再对数据包的结构进行了解后,我们就需要对这些包进行解析,所以我们需要一个packettools类,里面用静态函数写出包的解析,供我们在别的地方调用:

#ifndef PACKETTOOLS_H
#define PACKETTOOLS_H
#include <QObject>
#include <QTextEdit>
#include "protocol.h"
#include "iostream"using namespace std;class PacketTools
{
public:static int unpcak_Frame(const u_char *pkg,pkg_data *data,pkg_count *pkgCnts);static int unpcak_Arp(const u_char *pkg,pkg_data *data,pkg_count *pkgCnts);static int unpack_Ip(const u_char *pkg,pkg_data *data,pkg_count *pkgCnts);static int unpack_Ipv6(const u_char *pkg,pkg_data *data,pkg_count *pkgCnts);static int unpack_Icmp(const u_char *pkg,pkg_data *data,pkg_count *pkgCnts);static int unpack_Icmp6(const u_char *pkg,pkg_data *data,pkg_count *pkgCnts);static int unpack_Tcp(const u_char *pkg,pkg_data *data,pkg_count *pkgCnts);static int unpack_Udp(const u_char *pkg,pkg_data *data,pkg_count *pkgCnts);static int pack_Print(u_char *pkg,int size,QTextEdit *edit);
};#endif // PACKETTOOLS_H

主要一点就是要知道父类数据包的type字段对子类数据包的分类,然后将数据包拷贝储存到全局容器里面。

http://www.yidumall.com/news/106374.html

相关文章:

  • 网站建设的报价为什么不同seo外推软件
  • nginx wordpress css双桥seo排名优化培训
  • 网站申请域名太原今日新闻最新头条
  • 可以做动漫网站的源码源码教育培训机构
  • php网站开发 课程介绍seo教学培训
  • 某集团中英文双语网站源码世界杯竞猜
  • 企业信息查询免费软件seo技术培训中心
  • 做网站的人多吗网络的推广方式有哪些
  • 好网站你知道市场营销推广策划方案
  • 中山网站建设网络平台运营是做什么的
  • 建个网站需要多少钱费用网络营销的内容有哪些方面
  • 厦门网站制作建设线下推广方法有哪些
  • 网站先做前端还是后台今晚比赛预测比分
  • 新手学做网站要多久小红书推广
  • 网站数据库是什么意思深圳seo招聘
  • wordpress更改访问路径关键词seo排名优化软件
  • 最新台湾新闻头条优化网站排名工具
  • 本溪市做网站公司seoul national university
  • 网站建设如何报价seo是什么的
  • 网上下载的网站后台安全吗seo必备工具
  • 网站标题第一个词百度关键词搜索查询
  • 北京网站制作网站优化绍兴seo管理
  • 网站设置伪静态seo接单平台
  • 大连网站搜索排名提升企业网站设计欣赏
  • 呼市做网站建设的公司哪家好西安百度推广网站建设
  • 网站互联网设计图风格百度云网盘免费资源
  • 珠海市网站建设企业营销型企业网站推广的方法有哪些
  • 云南建设厅网站公示网站优化公司怎么选
  • 重庆网站seo排名免费seo工具汇总
  • 个人博客网站建设武汉seo招聘