当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: 下面给出程序源代码,欢迎批评指正bool UserSended
 

 

    摘要: 系统平台:winxp sp2,vc6,winpcap3相关软件:sniffer 4.70530, h3c 802.1x客户端(v2.20-0210)参考文档:ieee std 802.1x-2001 之所以要自己编这个软件,是因为使用华为3com 802.1x客户端有很大的限制。首先,它能够检查系统使用代理软件和多网卡情况,万一发现有这些情况,马上迫使客户机下线,使得一个帐号仅能供一台电脑上网。......
    摘要: //md5.h头文件的内容开始#pragma once#define uchar unsigned chartypedef unsigned char *pointer;typedef unsigned short int uint2;typedef unsigned long int uint4;#define proto_list(list) list//md5 context.typede......


H3C 802.1x兼容客户端编程简述(2)
下面给出程序源代码,欢迎批评指正

【程序编程相关:VC中的string table

  【推荐阅读:CComboBox控件详解

bool firstpacket = true;        //用于标记第一个包是否已经发送 【扩展信息:工作两年(一)——进入Compiler的

bool usersended = false; //用于标记是否发送过密码

bool online = false;        // 是否在线的标记

hwnd howner = 0;            // 界面的窗体句柄

pcap_t *fp = null;      // 网卡设备

 

初始化各种待发送的包,略(包结构参考有关资料)

unsigned char connectbuf[60] 请求连接包

unsigned char disconnectbuf[60] 请求断开包

unsigned char unknowbufa[67] 我不知道的包

unsigned char passwordbuf[60] 包含密码.用户名的包

unsigned char keepbuf[60] 保持连接的包,包含ip.用户名

unsigned char sendusernamebuf[60] 发送ip.用户名的包

 

//打开网卡,用pcap_findalldevs()获得*device

bool opendevice(char* device)

{

    char errbuf[pcap_errbuf_size];

    //抓取的最大包的字节为60, 20ms抓取一次

    if ((fp = pcap_open_live(device, 60, 1, 20, errbuf)) == null)    

        return false;

    

    return true;

}

 

void closedevice()// 关闭网卡

{         

       if (fp != null)

       {

              pcap_close(fp);

       }

}

 


...   下一页
 ·自身支持排序的listctrl    »显示摘要«
    摘要: 自身支持排序的listctrlvc里的clistctrl是个很不好用的控件,特别是排序,实现起来很麻烦。关于排序的基本用法,有一篇很好的文章:asp?type_id=9&class_id=1&cata_id=1&article_id=73&search_term">http://www.vchelp.net/vchelp/zart/sortl.asp?type_i......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE