fix indent code and int type to keep conformity of the rest of the code (u_intxx instead uintxx)

This commit is contained in:
Campus
2016-12-15 12:15:48 +01:00
parent b68f197fea
commit 61f0eb062e
+25 -25
View File
@@ -1,23 +1,23 @@
/* /*
* smpp.c * smpp.c
* *
* Copyright (C) 2016 - Damir Franusic <df@release14.org> * Copyright (C) 2016 - Damir Franusic <df@release14.org>
* Copyright (C) 2016 - ntop.org * Copyright (C) 2016 - ntop.org
* *
* nDPI is free software: you can redistribute it and/or modify * 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 * 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 * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* nDPI is distributed in the hope that it will be useful, * nDPI is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with nDPI. If not, see <http://www.gnu.org/licenses/>. * along with nDPI. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
#include "ndpi_protocols.h" #include "ndpi_protocols.h"
@@ -44,7 +44,7 @@ void ndpi_search_smpp_tcp(struct ndpi_detection_module_struct* ndpi_struct,
return; return;
} }
// get PDU length // get PDU length
uint32_t pdu_l = ntohl(get_u_int32_t(packet->payload, 0)); u_int32_t pdu_l = ntohl(get_u_int32_t(packet->payload, 0));
NDPI_LOG(NDPI_PROTOCOL_SMPP, NDPI_LOG(NDPI_PROTOCOL_SMPP,
ndpi_struct, ndpi_struct,
@@ -61,9 +61,9 @@ void ndpi_search_smpp_tcp(struct ndpi_detection_module_struct* ndpi_struct,
// verify PDU length // verify PDU length
if(pdu_l != packet->payload_packet_len) { if(pdu_l != packet->payload_packet_len) {
// check if multiple PDUs included // check if multiple PDUs included
uint32_t total_pdu_l = pdu_l; u_int32_t total_pdu_l = pdu_l;
uint32_t tmp_pdu_l = 0; u_int32_t tmp_pdu_l = 0;
uint16_t pdu_c = 1; u_int16_t pdu_c = 1;
// loop PDUs (check if lengths are valid) // loop PDUs (check if lengths are valid)
while(total_pdu_l < packet->payload_packet_len) { while(total_pdu_l < packet->payload_packet_len) {
// get next PDU length // get next PDU length
@@ -90,7 +90,7 @@ void ndpi_search_smpp_tcp(struct ndpi_detection_module_struct* ndpi_struct,
} }
// *** check PDU type *** // *** check PDU type ***
uint32_t pdu_type = ntohl(get_u_int32_t(packet->payload, 4)); u_int32_t pdu_type = ntohl(get_u_int32_t(packet->payload, 4));
// first byte of PDU type is either 0x00 of 0x80 // first byte of PDU type is either 0x00 of 0x80
if(!(packet->payload[4] == 0x00 || packet->payload[4] == 0x80)) { if(!(packet->payload[4] == 0x00 || packet->payload[4] == 0x80)) {
NDPI_LOG(NDPI_PROTOCOL_SMPP, ndpi_struct, NDPI_LOG_DEBUG, "SMPP excluded\n"); NDPI_LOG(NDPI_PROTOCOL_SMPP, ndpi_struct, NDPI_LOG_DEBUG, "SMPP excluded\n");
@@ -98,7 +98,7 @@ void ndpi_search_smpp_tcp(struct ndpi_detection_module_struct* ndpi_struct,
return; return;
} }
// remove 0x80, get request type pdu // remove 0x80, get request type pdu
uint32_t pdu_req = pdu_type & 0x00FFFFFF; u_int32_t pdu_req = pdu_type & 0x00FFFFFF;
// list of known PDU types // list of known PDU types
if((pdu_req >= 0x00000000 && pdu_req <= 0x00000009) || if((pdu_req >= 0x00000000 && pdu_req <= 0x00000009) ||
(pdu_req == 0x0000000B || pdu_req == 0x00000015 || (pdu_req == 0x0000000B || pdu_req == 0x00000015 ||