ethhdr、ether_header、iphdr、tcphdr、udphdr 结构介绍
来源:互联网 发布:中科院陈玉福算法 编辑:程序博客网 时间:2024/05/22 08:08
http://blog.csdn.net/petershina/article/details/8573853
************************eth的结构**************************************
struct ethhdr {
unsigned char h_dest[ETH_ALEN];
unsigned char h_source[ETH_ALEN];
__be16 h_proto;
} __attribute__((packed));
struct ether_header
{
u_int8_t ether_dhost[ETH_ALEN]; // destination eth addr
u_int8_t ether_shost[ETH_ALEN]; // source ether addr
u_int16_t ether_type; // packet type ID field
} __attribute__ ((__packed__));
***********************IP的结构***********************************
struct iphdr
{
#if __BYTE_ORDER == __LITTLE_ENDIAN
unsigned int ihl:4;
unsigned int version:4;
#elif __BYTE_ORDER == __BIG_ENDIAN
unsigned int version:4;
unsigned int ihl:4;
#else
# error "Please fix <bits/endian.h>"
#endif
u_int8_t tos;
u_int16_t tot_len;
u_int16_t id;
u_int16_t frag_off;
u_int8_t ttl;
u_int8_t protocol;
u_int16_t check;
u_int32_t saddr;
u_int32_t daddr;
};
***********************TCP的结构****************************
struct tcphdr
{
u_int16_t source;
u_int16_t dest;
u_int32_t seq;
u_int32_t ack_seq;
# if __BYTE_ORDER == __LITTLE_ENDIAN
u_int16_t res1:4;
u_int16_t doff:4;
u_int16_t fin:1;
u_int16_t syn:1;
u_int16_t rst:1;
u_int16_t psh:1;
u_int16_t ack:1;
u_int16_t urg:1;
u_int16_t res2:2;
# elif __BYTE_ORDER == __BIG_ENDIAN
u_int16_t doff:4;
u_int16_t res1:4;
u_int16_t res2:2;
u_int16_t urg:1;
u_int16_t ack:1;
u_int16_t psh:1;
u_int16_t rst:1;
u_int16_t syn:1;
u_int16_t fin:1;
# else
# error "Adjust your <bits/endian.h> defines"
# endif
u_int16_t window;
u_int16_t check;
u_int16_t urg_ptr;
};
***********************UDP的结构*****************************
struct udphdr
{
u_int16_t source;
u_int16_t dest;
u_int16_t len;
u_int16_t check;
};
- ethhdr、ether_header、iphdr、tcphdr、udphdr 结构介绍
- ethhdr、ether_header、iphdr、tcphdr、udphdr 结构介绍
- struct ethhdr、ether_header、iphdr、tcphdr、udphdr结构体定义
- struct ethhdr、ether_header、iphdr、tcphdr、udphdr
- struct ethhdr、ether_header、iphdr、tcphdr、udphdr
- struct ethhdr、ether_header、iphdr、tcphdr、udphdr 收藏
- struct ethhdr、ether_header、iphdr、tcphdr、udphdr
- struct ethhdr、ether_header、iphdr、tcphdr、udphdr
- struct ethhdr、ether_header、iphdr、tcphdr、udphdr
- struct ethhdr、ether_header、iphdr、tcphdr、udphdr
- 网络包几种格式struct ethhdr、ether_header、iphdr、tcphdr、udphdr
- 网络包几种格式ethhdr、ether_header、iphdr、tcphdr、udphdr
- 网络包几种格式struct ethhdr、ether_header、iphdr、tcphdr、udphdr
- ethhdr、iphdr、tcphdr、udphdr等结构体
- [struct--iphdr -- IP头部]与[tcphdr结构]
- 调试打印ethhdr,iphdr,tcphdr和指定长度的内存块
- udphdr结构
- struct--iphdr sk_buff->tcphdr -- IP头部
- 怎样解决无法载入mysql扩展检查php配置问题?验证码无法识别问题?
- 简单的用堆栈实现的表达式计算
- Win8 C#画条形图,饼状图,曲线图的源代码
- SpaceX的垂直起降火箭已经达到840 英尺高度
- String s = new String("xyz")创建几个对象问题
- ethhdr、ether_header、iphdr、tcphdr、udphdr 结构介绍
- java回调函数
- 3124210孙宝康
- 批处理和单独运行时结果不一样
- Windows下安装MySQL5.5.25出错Last error:Unable to configure service
- binder,parcel和service的简记(2)
- 前滚与回滚
- hadoop 体系介绍
- Spring连接MySQL、Oracle和SQL Server的数据库连接属性