NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
ip_header结构体 参考

IPv4头部结构定义 更多...

#include <ip_socket.hpp>

Public 属性

uint8_t ihl: 4
 IP头部长度
uint8_t version: 4
 IP版本号
uint8_t tos
 服务类型
uint16_t total_len
 IP数据包总长度
uint16_t id
 标识符
uint16_t frag_off
 标志和片偏移
uint8_t ttl
 生存时间
uint8_t protocol
 上层协议类型
uint16_t checksum
 头部校验和
uint32_t src_addr
 源IP地址
uint32_t dest_addr
 目的IP地址

详细描述

IPv4头部结构定义

定义IPv4数据包的头部格式,用于原始套接字操作。 使用位域精确匹配IPv4头部字段布局。

IPv4头部格式:

  • 版本(4位) + 头部长度(4位)
  • 服务类型(8位)
  • 总长度(16位)
  • 标识(16位)
  • 标志(3位) + 片偏移(13位)
  • 生存时间(8位)
  • 协议(8位)
  • 头部校验和(16位)
  • 源地址(32位)
  • 目的地址(32位)

在文件 ip_socket.hpp40 行定义.


该结构体的文档由以下文件生成: