资源简介
centos7,官方网站下载的ndpi,Git clone https://github.com/ntop/nDPI
代码片段和文件信息
/*
* ndpiReader.c
*
* Copyright (C) 2011-19 - ntop.org
*
* nDPI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation either version 3 of the License or
* (at your option) any later version.
*
* nDPI is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with nDPI. If not see .
*
*/
#ifdef HAVE_CONFIG_H
#include “ndpi_config.h“
#endif
#ifdef linux
#define _GNU_SOURCE
#include
#endif
#include
#include
#include
#ifdef WIN32
#include /* winsock.h is included automatically */
#include
#include
#define getopt getopt____
#else
#include
#include
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include “ndpi_api.h“
#include “uthash.h“
#include
#include
#include
#include
#ifdef HAVE_JSON_C
#include
#endif
#include “ndpi_util.h“
/** Client parameters **/
static char *_pcap_file[MAX_NUM_READER_THREADS]; /**< Ingress pcap file/interfaces */
static FILE *playlist_fp[MAX_NUM_READER_THREADS] = { NULL }; /**< Ingress playlist */
static FILE *results_file = NULL;
static char *results_path = NULL;
static char * bpfFilter = NULL; /**< bpf filter */
static char *_protoFilePath = NULL; /**< Protocol file path */
static char *_customCategoryFilePath= NULL; /**< Custom categories file path */
#ifdef HAVE_JSON_C
static char *_statsFilePath = NULL; /**< Top stats file path */
static char *_diagnoseFilePath = NULL; /**< Top stats file path */
static char *_jsonFilePath = NULL; /**< JSON file path */
static FILE *stats_fp = NULL; /**< for Top Stats JSON file */
#endif
#ifdef HAVE_JSON_C
static json_object *jArray_known_flows *jArray_unknown_flows;
static json_object *jArray_topStats;
#endif
static u_int8_t live_capture = 0;
static u_int8_t undetected_flows_deleted = 0;
/** User preferences **/
u_int8_t enable_protocol_guess = 1;
static u_int8_t verbose = 0 json_flag = 0;
int nDPI_LogLevel = 0;
char *_debug_protocols = NULL;
static u_int8_t stats_flag = 0 bpf_filter_flag = 0;
#ifdef HAVE_JSON_C
static u_int8_t file_first_time = 1;
#endif
static u_int32_t pcap_analysis_duration = (u_int32_t)-1;
static u_int16_t decode_tunnels = 0;
static u_int16_t num_loops = 1;
static u_int8_t shutdown_app = 0 quiet_mode = 0;
static u_int8_t num_threads = 1;
static struct timeval startup_time
- 上一篇:智慧工地综合解决方案
- 下一篇:员工管理系统
评论
共有 条评论