예제 #1
0
// We will start speed printer
void firehose_start() {
    my_ndpi_struct = init_ndpi();

    size_id_struct   = ndpi_detection_get_sizeof_ndpi_id_struct();
    size_flow_struct = ndpi_detection_get_sizeof_ndpi_flow_struct();

    pthread_t thread;
    pthread_create(&thread, NULL, speed_printer, NULL);

    pthread_detach(thread);
}
예제 #2
0
int main(int argc, char** argv) {
    my_ndpi_struct = init_ndpi();

    size_id_struct = ndpi_detection_get_sizeof_ndpi_id_struct();
    size_flow_struct = ndpi_detection_get_sizeof_ndpi_flow_struct();

    if (argc != 2) {
        printf("Please specify path to dump file\n");
        exit(-1);
    }

    const char* path = argv[1];

    //pcap_reader(path, pcap_parse_packet);
}
예제 #3
0
// We will start speed printer
void firehose_start() {
    my_ndpi_struct = init_ndpi();

    // Connect to the Redis
    redis_context = redis_init_connection();

    if (!redis_context) {
        printf("Can't connect to the Redis\n");
    }

    // Tune timer
    set_tsc_freq_fallback();

    // Set call time
    last_timestamp = (double)rte_rdtsc() / system_tsc_resolution_hz;

    size_id_struct   = ndpi_detection_get_sizeof_ndpi_id_struct();
    size_flow_struct = ndpi_detection_get_sizeof_ndpi_flow_struct();

    pthread_t thread;
    pthread_create(&thread, NULL, speed_printer, NULL);

    pthread_detach(thread);
}