void CNatOption::dump(FILE *fd){

    fprintf(fd,"  op        : %x \n",get_option_type());
    fprintf(fd,"  ol        : %x \n",get_option_len());
    fprintf(fd,"  thread_id : %x \n",get_thread_id());
    fprintf(fd,"  magic     : %x \n",get_magic());
    fprintf(fd,"  fid       : %x \n",get_fid());
    utl_DumpBuffer(stdout,(void *)&u.m_data[0],8,0);
}
示例#2
0
bool CCapPktRaw::Compare(CCapPktRaw * obj,int dump,double dsec){

    if (pkt_len != obj->pkt_len) {
        if ( dump ){
            printf(" ERROR len is not eq \n");
        }
        return (false);
    }

    if ( getInterface() != obj->getInterface() ){
        printf(" ERROR original packet from if=%d and cur packet from if=%d \n",getInterface(),obj->getInterface());
        return (false);
    }

    CPktNsecTimeStamp t1(time_sec,time_nsec);
    CPktNsecTimeStamp t2(obj->time_sec,obj->time_nsec);
    if ( t1.diff(t2) > dsec ){
        if ( dump ){
            printf(" ERROR diff of 1 msec in time  \n");
        }
        return (false);
    }

    if ( memcmp(raw,obj->raw,pkt_len) == 0 ){
        return (true);
    }else{
        if ( dump ){
            fprintf(stdout," ERROR buffer not the same \n");
            fprintf(stdout," B1 \n");
            fprintf(stdout," ---------------\n");
            utl_DumpBuffer(stdout,raw,pkt_len,0);
            fprintf(stdout," B2 \n");
            fprintf(stdout," ---------------\n");
        
            utl_DumpBuffer(stdout,obj->raw,obj->pkt_len,0);
        }
        return (false);
    }
}
示例#3
0
void StreamVm::Dump(FILE *fd){
    fprintf(fd," instructions \n");
    uint32_t cnt=0;
    for (auto inst : m_inst_list) {
        fprintf(fd," [%04lu]   : ",(ulong)cnt);
        inst->Dump(fd);
        cnt++;
    }

    if ( get_bss_size() ) {
        fprintf(fd," BSS  size %lu\n",(ulong)get_bss_size());
        utl_DumpBuffer(fd,get_bss_ptr(),get_bss_size(),0);
    }

    if  ( m_instructions.get_program_size() > 0 ){
        fprintf(fd," RAW instructions \n");
        m_instructions.Dump(fd);
    }
}
示例#4
0
void CCapPktRaw::Dump(FILE *fd,int verbose){
	fprintf(fd," =>pkt (%p) %llu , len %d, time [%x:%x] \n",raw,pkt_cnt,pkt_len,time_sec,time_nsec);
	if (verbose) {
		utl_DumpBuffer(fd,raw,pkt_len,0);
	}
}