How to read offline pcap file using libnids?

378 views Asked by At
void main( )
{
    char filename[] = "dns.pcap";
    nids_params.filename = filename ; 
    nids_params.device = NULL;
    if (!nids_init())
    {   
        printf("%s\n", nids_errbuf);
        exit(1);
    }   
    nids_register_udp(udp_callback);  
    nids_run();  
}

My application need to read local pcap file for debuging more easily. My code is wrong , it still read data from eth0.How to read pcapfile using libnids?

0

There are 0 answers