aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Piserchia <vito.piserchia@dreamlab.net>2016-11-02 10:16:16 +0100
committerVito Piserchia <vito.piserchia@dreamlab.net>2016-11-02 10:16:16 +0100
commit8169b35fa68c5dde575b961820271f4b05dd6e4d (patch)
tree2b756f754449c9c8e180b0a8a7fb93af1229fd65
parent78ebb3445a34f3bc2aea494c9a3d5c5499f2503e (diff)
parent097ba22a595f7d5e8f4f58dcd4c3e7e77d71e355 (diff)
Merge remote-tracking branch 'upstream/dev' into dev
-rw-r--r--example/ndpiReader.c8
-rw-r--r--example/ndpi_util.c2
-rw-r--r--src/lib/ndpi_main.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index deb61b681..0440a3954 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -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];
diff --git a/example/ndpi_util.c b/example/ndpi_util.c
index 405cac366..672eee561 100644
--- a/example/ndpi_util.c
+++ b/example/ndpi_util.c
@@ -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) {
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index c2610ffe9..7959a3570 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -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;