fix indent code and int type to keep conformity of the rest of the code (u_intxx instead uintxx)
This commit is contained in:
+25
-25
@@ -1,23 +1,23 @@
|
||||
/*
|
||||
* smpp.c
|
||||
*
|
||||
* Copyright (C) 2016 - Damir Franusic <df@release14.org>
|
||||
* Copyright (C) 2016 - 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
* smpp.c
|
||||
*
|
||||
* Copyright (C) 2016 - Damir Franusic <df@release14.org>
|
||||
* Copyright (C) 2016 - 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "ndpi_protocols.h"
|
||||
@@ -44,7 +44,7 @@ void ndpi_search_smpp_tcp(struct ndpi_detection_module_struct* ndpi_struct,
|
||||
return;
|
||||
}
|
||||
// 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_struct,
|
||||
@@ -61,9 +61,9 @@ void ndpi_search_smpp_tcp(struct ndpi_detection_module_struct* ndpi_struct,
|
||||
// verify PDU length
|
||||
if(pdu_l != packet->payload_packet_len) {
|
||||
// check if multiple PDUs included
|
||||
uint32_t total_pdu_l = pdu_l;
|
||||
uint32_t tmp_pdu_l = 0;
|
||||
uint16_t pdu_c = 1;
|
||||
u_int32_t total_pdu_l = pdu_l;
|
||||
u_int32_t tmp_pdu_l = 0;
|
||||
u_int16_t pdu_c = 1;
|
||||
// loop PDUs (check if lengths are valid)
|
||||
while(total_pdu_l < packet->payload_packet_len) {
|
||||
// get next PDU length
|
||||
@@ -90,7 +90,7 @@ void ndpi_search_smpp_tcp(struct ndpi_detection_module_struct* ndpi_struct,
|
||||
}
|
||||
|
||||
// *** 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
|
||||
if(!(packet->payload[4] == 0x00 || packet->payload[4] == 0x80)) {
|
||||
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;
|
||||
}
|
||||
// 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
|
||||
if((pdu_req >= 0x00000000 && pdu_req <= 0x00000009) ||
|
||||
(pdu_req == 0x0000000B || pdu_req == 0x00000015 ||
|
||||
|
||||
Reference in New Issue
Block a user