如何为此添加UDP标头....

编程入门 行业动态 更新时间:2024-10-28 02:22:49
本文介绍了如何为此添加UDP标头....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

typedef struct _IP_HEADER_ { BYTE ver_ihl; // Version (4 bits) and Internet Header Length (4 bits) BYTE type; // Type of Service (8 bits) WORD length; // Total size of packet (header + data)(16 bits) WORD packet_id; // (16 bits) WORD flags_foff; // Flags (3 bits) and Fragment Offset (13 bits) BYTE time_to_live; // (8 bits) BYTE protocol; // (8 bits) WORD hdr_chksum; // Header check sum (16 bits) DWORD source_ip; // Source Address (32 bits) DWORD destination_ip; // Destination Address (32 bits) } IPHEADER; typedef struct _TCP_HEADER_ { WORD source_port; // (16 bits) WORD destination_port; // (16 bits) DWORD seq_number; // Sequence Number (32 bits) DWORD ack_number; // Acknowledgment Number (32 bits) WORD info_ctrl; // Data Offset (4 bits), Reserved (6 bits), Control bits (6 bits) WORD window; // (16 bits) WORD checksum; // (16 bits) WORD urgent_pointer; // (16 bits) } TCPHEADER; typedef struct _ICMP_HEADER_ { BYTE type; // (8 bits) BYTE code; // (8 bits) WORD checksum; // (16 bits) } ICMPHEADER;

推荐答案

因此 [ ^ ].

这里是您所要询问的很好的图形表示形式: nmap/book/tcpip-ref.html [ ^ ] 如果我正确理解了您对Richard的跟进问题,则前面的单词"是类型定义: Here''s a good graphical representation of what you''re asking about: nmap/book/tcpip-ref.html[^] If I understood your follow up question to Richard correctly, the "preceeding words" are type definitions: typedef unsigned char BYTE; // 1byte typedef unsigned short WORD; // 2bytes typedef unsigned long DWORD; // 4bytes

更多推荐

如何为此添加UDP标头....

本文发布于:2023-10-28 17:42:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1537327.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:UDP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!