我参考了RFC3022的文档,找到这个函数,计算后数据不对,不知是不是参数传的不对,有哪位大侠能帮我详细的解释一下参数,最好是能有例子,重谢。void   checksumadjust(unsigned   char   *chksum,   unsigned   char   *optr,   
        int   olen,   unsigned   char   *nptr,   int   nlen)   
        /*   assuming:   unsigned   char   is   8   bits,   long   is   32   bits.   
            -   chksum   points   to   the   chksum   in   the   packet   
            -   optr   points   to   the   old   data   in   the   packet   
            -   nptr   points   to   the   new   data   in   the   packet   
        */   
        {   
            long   x,   old,   new;  
            
            x=chksum[0]*256+chksum[1];   
            x=~x&0xFFFF;   
            while(olen)   
            {   
                    old=optr[0]*256+optr[1];  
                    
                    optr+=2;   
                    
                    x-=old&0xffff;   
                    if(x<=0)  
                    {   
                     x--;
                     x&=0xffff;  
                    }   
                    olen-=2;   
            }   
            while(nlen)   
            {   
                    new=nptr[0]*256+nptr[1];  
                    
                     nptr+=2;  
                      
                    x+=new&0xffff;   
                    if(x&0x10000)  
                    {  
                      x++;
                      x&=0xffff;  
                    }   
                    nlen-=2;   
            }   
            x=~x&0xFFFF;   
            chksum[0]=x/256;   
            chksum[1]=x&0xff;   
        }