首页新闻资讯管理维护网络安全机房管理部署集成网管工具网管资料专题论坛 杂志
当前位置:首页 >> 网管资料 >> 白皮书 >> 网络 >> Ping的原代码 网络安全者必看
Ping的原代码 网络安全者必看
来源: 作者: 发布时间:2008-04-22

 

  #pragma pack(4)
  #define WIN32_LEAN_AND_MEAN
  #include
  #include
  #include
  
  #define ICMP_ECHO 8
  #define ICMP_ECHOREPLY 0
  
  #define ICMP_MIN 8 // minimum 8 byte icmp packet (just header)
  
  /* The IP header */
  typedef struct iphdr {
  unsigned int h_len:4; // length of the header
  unsigned int version:4; // Version of IP
  unsigned char tos; // Type of service
  unsigned short total_len; // total length of the packet
  unsigned short ident; // unique identifier
  unsigned short frag_and_flags; // flags
  unsigned char ttl;
  unsigned char proto; // protocol (TCP, UDP etc)
  unsigned short checksum; // IP checksum
  
  unsigned int sourceIP;
  unsigned int destIP;
  

(责任编辑:天空)
阅读次数:
共5页: 上一页 1 [2] [3] [4] [5] 下一页
快速检索
网友评论
评论加载中…
 
友情链接 | 欢迎投稿 | 杂志发行 | 广告报价 | 人才招聘 | 服务条款 | 免责声明 | 隐私保护 | 关于网管员世界
CopyRight © 2001-2008 [网管员世界 www.365master.com] All Rights Reserved.
《网管员世界》杂志,专为网管服务的刊物!