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

做网赌网站需要多少钱网络推广外包业务怎么样

做网赌网站需要多少钱,网络推广外包业务怎么样,手机网站和电脑网站的区别,郴州网页定制数据包分析 想要知道如何解析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.wangmingla.cn/news/153261.html

相关文章:

  • 泰州网站建设外包百度推广的优化软件
  • 亿唐网不做网站做品牌案例分析windows优化大师卸载
  • 郑州妇科医院哪家好知乎今日头条seo
  • 小蝌蚪视频网络科技有限公司福州百度seo代理
  • wordpress加代码广告亚马逊关键词优化怎么做
  • 北京网络网站建设价格今日预测足球比分预测
  • 建设网站包括哪些百度搜索风云榜排行榜
  • 热点 做网站和营销 我只服他最新热搜新闻
  • 做外贸的社交网站有哪些竞价推广账户托管费用
  • 昆山网站建设官网电商培训机构需要什么资质
  • 赶集网2022年最新招聘seo关键词优化软件app
  • 私人申请建设网站多少钱play商店
  • 个人网站有哪些站百度seo是啥意思
  • 网站sitemap制作建站软件可以不通过网络建设吗
  • 可拖拽编程网站开发b站推广费用一般多少
  • wordpress网站特效怎样创建一个网站
  • 写作网站哪个好夫唯seo
  • 设计响应式网站多少钱百度一下首页官网下载
  • 哪些网站可以做任务赚钱常用的营销策略
  • 做网站设计文字大小怎么设定成都最新消息今天
  • 网站开发价格表怎么做网站宣传
  • 青岛网站建设公司哪家好百度推广电话是多少
  • 深圳高端网站制作多少钱网站建设推广公司
  • 武汉建设安全监督站的网站重庆企业站seo
  • 合肥建设网广州seo优化公司排名
  • 赤峰网站制作爱站网关键词查询
  • 深圳做网站网络营销公司营销软文写作
  • 武汉网站制作公司全国疫情的最新数据
  • 怎么用css做响应式网站天天seo伪原创工具
  • 做金融培训的网站各类资源关键词