struct ethhdr、ether_header、iphdr、tcphdr、udphdr
来源:互联网 发布:华侨出版社知乎 编辑:程序博客网 时间:2024/05/09 23:50
************************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;
};
转于:http://blog.csdn.net/sally2021/article/details/4493391
- 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结构体定义
- 网络包几种格式struct ethhdr、ether_header、iphdr、tcphdr、udphdr
- ethhdr、ether_header、iphdr、tcphdr、udphdr 结构介绍
- ethhdr、ether_header、iphdr、tcphdr、udphdr 结构介绍
- 网络包几种格式ethhdr、ether_header、iphdr、tcphdr、udphdr
- ethhdr、iphdr、tcphdr、udphdr等结构体
- [struct--iphdr -- IP头部]与[tcphdr结构]
- struct--iphdr sk_buff->tcphdr -- IP头部
- 调试打印ethhdr,iphdr,tcphdr和指定长度的内存块
- struct iphdr IP头部与tcphdr tcp头部与linux中的struct IP IP头部
- Gdi+ 画笔
- 解决Ubuntu 中文乱码问题
- 图片游览效果
- thinking in java 学习笔记(一)之操作符
- robots.txt作用和写法
- struct ethhdr、ether_header、iphdr、tcphdr、udphdr
- 第18章 高级技巧 (二)
- Android联网方式判断详解
- Spring Acegi框架授权的实现
- Linux驱动之设备模型(3)
- udphdr结构
- Flash Builder 快捷键
- 考研小记 -- KMP 算法
- HDOJ-2222 AC自动机模板题..注意细节..