minor fix to keep same coherence of type used

This commit is contained in:
Campus
2016-10-30 01:14:49 +02:00
parent b8fb5fb403
commit 097ba22a59
3 changed files with 7 additions and 7 deletions
+4 -4
View File
@@ -283,7 +283,7 @@ static void parseOptions(int argc, char **argv) {
/**
* @brief From IPPROTO to string NAME
*/
static char* ipProto2Name(u_short proto_id) {
static char* ipProto2Name(u_int16_t proto_id) {
static char proto[8];
@@ -316,7 +316,7 @@ static char* ipProto2Name(u_short proto_id) {
/**
* @brief A faster replacement for inet_ntoa().
*/
char* intoaV4(unsigned int addr, char* buf, u_short bufLen) {
char* intoaV4(u_int32_t addr, char* buf, u_int16_t bufLen) {
char *cp, *retStr;
uint byte;
@@ -384,7 +384,7 @@ static void printFlow(u_int16_t thread_id, struct ndpi_flow_info *flow) {
ndpi_get_proto_name(ndpi_thread_info[thread_id].workflow->ndpi_struct, flow->detected_protocol.protocol));
fprintf(out, "[%u pkts/%llu bytes]",
flow->packets, (long long unsigned int)flow->bytes);
flow->packets, (long long unsigned int) flow->bytes);
if(flow->host_server_name[0] != '\0') fprintf(out, "[Host: %s]", flow->host_server_name);
if(flow->ssl.client_certificate[0] != '\0') fprintf(out, "[SSL client: %s]", flow->ssl.client_certificate);
@@ -760,7 +760,7 @@ static void printResults(u_int64_t tot_usec) {
u_int32_t i;
u_int64_t total_flow_bytes = 0;
u_int avg_pkt_size = 0;
u_int32_t avg_pkt_size = 0;
struct ndpi_stats cumulative_stats;
int thread_id;
char buf[32];
+1 -1
View File
@@ -748,7 +748,7 @@ void ndpi_workflow_process_packet (struct ndpi_workflow * workflow,
}
if(iph->version == 4) {
ip_len = ((u_short)iph->ihl * 4);
ip_len = ((u_int16_t)iph->ihl * 4);
iph6 = NULL;
if(iph->protocol == 41) {
+2 -2
View File
@@ -2063,7 +2063,7 @@ int ndpi_handle_rule(struct ndpi_detection_module_struct *ndpi_mod, char* rule,
}
if(is_tcp || is_udp) {
if(sscanf(value, "%u-%u", (unsigned int *)&range.port_low, (unsigned int *)&range.port_high) != 2)
if(sscanf(value, "%u-%u", (u_int32_t *)&range.port_low, (u_int32_t *)&range.port_high) != 2)
range.port_low = range.port_high = atoi(&elem[4]);
if(do_add)
addDefaultPort(&range, def, 1 /* Custom user proto */, is_tcp ? &ndpi_mod->tcpRoot : &ndpi_mod->udpRoot);
@@ -4319,7 +4319,7 @@ ndpi_protocol ndpi_guess_undetected_protocol(struct ndpi_detection_module_struct
u_int8_t proto,
u_int32_t shost /* host byte order */, u_int16_t sport,
u_int32_t dhost /* host byte order */, u_int16_t dport) {
unsigned int rc;
u_int32_t rc;
struct in_addr addr;
ndpi_protocol ret = { NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_UNKNOWN };
u_int8_t user_defined_proto;