我是刚毕业的学生,大家帮帮我吧,再做不出来,就要被公司淘汰了!

解决方案 »

  1.   

    ip包的好办,ipx还没有弄过,我帮你找找有没有这方便的资料先
      

  2.   

    基本上很难
    太难了记得以前在http://shotgun.xici.net
    上有一个sniffer的源代码叫gunsniffer
    你去找找不知道你说的是要截获别人的IPX包还是想自定义IPX包头来收发
    如果想自定义IPX包来收发
    用原始套接字试一试如果要截获别人的包
    那就更难了
      

  3.   

    IPX包头的格式和定义在MSDN里有我以前看过
    但是具体在什么地方忘记了
      

  4.   

    IP包我自己已经参老别人的程序做了一个sniffer程序,但是我发现不能收到IPX的数据!
    我把我的程序和系统自自带的网络监视器对比,发现IP包我都收到了,但是用IPX的就没有收到!我要截的包是截自己机器上的别人发过来的包,用sniffer没有问题!现在就是想试出IPX怎么收到!
      

  5.   

    if you need something simple, ncpfs (source) package comes with
    ipxdump/ipxparse (ftp://platan.vc.cvut.cz/pub/linux/ncpfs/latest/*.tgz).
      If you need something more detailed, there is
    ftp://platan.vc.cvut.cz/pub/linux/ncpfs/ncpanal-0.02.tgz
    all above work in LinuX.and I find a MFC example from codeproject.
    http://www.codeproject.com/internet/ipxcheck.asp
      

  6.   

    IPX/SPX协议和TCP/IP协议不同,他不是使用的IP地址
    而是网段地址和网卡地址,别的都一样
    主要就这点区别
    你自己再查查资料
      

  7.   

    我现在已经知道了,IPX和IP是两个都可以"自路由"的协议,连头都不一样!在Win2000下我可以用原始套接字来截!
    ....................
    但用
    m_s = socket( AF_IPX , SOCK_RAW , NSPROTO_IPX ) ;
    程序就会出错!
    (用m_s = socket( AF_INET , SOCK_RAW , IPPROTO_IP)不会!)
    ................
    能不能也用原始套接字来截IPX包!
      

  8.   

    yes,you can use raw socket with IPX
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <unistd.h>
    #include <sys/errno.h>#include <netdb.h>
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netinet/in.h>
    #include <netipx/ipx.h>#define IPX_DATA_LEN 20#define IPXPROTO_NETBIOS 20u_short checksum(u_short * data,u_short length)                                 
    {                                                                               
            register long value;                                                    
            u_short i;                                                              
                                                                                    
            for(i=0;i<(length>>1);i++)                                              
                    value+=data[i];                                                 
                                                                                    
            if((length&1)==1)                                                       
                    value+=(data[i]<<8);                                            
                                                                                    
            value=(value&65535)+(value>>16);                                        
                                                                                    
            return(~value);                                                         
    }                                                                               
    int main(int argc, char ** argv)
    {
    struct sockaddr_ipx  sipx;
    int  sock,err;
    char  buffer[sizeof(struct ipx)+IPX_DATA_LEN];
    struct ipx * ipxheader=(struct ipx *)buffer;
    struct ipx_addr addr;
    char src_addr[30];
    char dst_addr[30];
    char sck_addr[30];

    if (argc<3)
    {
    fprintf(stderr,"usage: %s src_ipx_addr dst_ipx_addr\n",argv[0]);
    return (-1);
    }


    bzero(&sipx,sizeof(struct sockaddr_ipx));
    sipx.sipx_family=AF_IPX;

            bzero(&buffer, sizeof(struct ipx)+IPX_DATA_LEN);
            
            ipxheader->ipx_len=sizeof(struct ipx)+IPX_DATA_LEN;
            ipxheader->ipx_tc =0;
            ipxheader->ipx_pt =IPXPROTO_NETBIOS;
            
    addr=ipx_addr(argv[2]);
    bcopy(&addr, &sipx.sipx_addr, sizeof(struct ipx_addr));
    bcopy(&addr,&ipxheader->ipx_dna, sizeof(struct ipx_addr));
            addr=ipx_addr(argv[1]);
    bcopy(&addr,&ipxheader->ipx_sna, sizeof(struct ipx_addr));        ipxheader->ipx_sum=0;//checksum((u_short *)ipxheader, sizeof(struct ipx)
    );                                 if ((sock=socket(PF_IPX,SOCK_RAW,IPXPROTO_RAW))==-1)
    {
                    fprintf(stderr,"couldn't allocate raw socket\n");               
                    return (-1);                                                    
     
            } sprintf(sck_addr,"%s",ipx_ntoa(sipx.sipx_addr));
    sprintf(src_addr,"%s",ipx_ntoa(ipxheader->ipx_sna));
    sprintf(dst_addr,"%s",ipx_ntoa(ipxheader->ipx_dna));
            
    if((err=sendto(sock, buffer, sizeof(struct ipx)+IPX_DATA_LEN, 0, (struct sockad
    dr *) &sipx, sizeof(struct sockaddr_ipx)))==-1)
    {
    fprintf(stderr,"couldn't send packet\n");
    fprintf(stderr,"%s : %s -> %s\n",sck_addr,src_addr,dst_addr); switch(errno)
        {
        case EBADF: { fprintf(stderr,"EBADF\n"); break; }
        case EACCES: { fprintf(stderr,"EACCES\n"); break;}
        case ENOTSOCK: { fprintf(stderr,"ENOTSOCK\n");break;}
        case EFAULT:  { fprintf(stderr,"EFAULT\n"); break;}
        case EMSGSIZE: { fprintf(stderr,"EMSGSIZE\n"); break;}
        case EAGAIN:  { fprintf(stderr,"EAGAIN\n"); break;}
        case ENOBUFS: { fprintf(stderr,"ENOBUFS\n"); break;}
        case EHOSTUNREACH: { fprintf(stderr,"EHOSTUNREACH\n"); break;}
        default: { fprintf(stderr,"%d: unknown error\n",errno); break;}
        }
    return (-1);
    }

    fprintf(stderr,"IPX packet was sent:\n%s : %s -> %s\n",sck_addr,src_addr,dst_ad
    dr);
    return (0);
    }
      

  9.   

    #include <unistd.h>
    #include <sys/errno.h>#include <netdb.h>
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netinet/in.h>
    #include <netipx/ipx.h>这些头文件我去什么地方下载,我的机器上没有
      

  10.   

    有些是UNIX下的头文件,有些是自己定义的,改成win32应该不难
      

  11.   

    你制的NetWare 网吗?
    上大学的时候在学校做过一点的。
    是直接调用的netware 的中断,(书上讲的这么做)
    想用ipx写一个聊天的程序
    做了几个月,能传通数据了,
    但是,老出问题,(水平低了)
    你要吗?
    是全dos的。
      

  12.   

    to:ququshb(忘求了)
    谢谢,只要能把数据发出来就行,不要很稳定![email protected]麻烦你也告诉我网卡地址在IPX里面怎么定义!
      

  13.   

    我用得系统是Win2000 sever,IPX/SPX,WAP,Netware Client都装了!我的程序就是发不出来!
      

  14.   

    #include <netdb.h>
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netinet/in.h>
    #include <netipx/ipx.h>哪里有下载,我找了两小时在网上都没有找到!