comparison uptools/sms-pdu-decode/pdu-common.c @ 599:18bfc10ba20e

sms-pdu-decode: more prep for pcm-sms-decode addition
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 08 Feb 2020 01:20:45 +0000
parents 9f7a263ad7f0
children 8dc93aac9a9c
comparison
equal deleted inserted replaced
598:9f7a263ad7f0 599:18bfc10ba20e
246 break; 246 break;
247 } 247 }
248 return(rc); 248 return(rc);
249 } 249 }
250 250
251 process_pdu() 251 process_pdu(require_exact_length)
252 { 252 {
253 unsigned udl, udl_octets; 253 unsigned udl, udl_octets;
254 unsigned udhl, udh_octets, udh_chars, ud_chars; 254 unsigned udhl, udh_octets, udh_chars, ud_chars;
255 u_char ud7[160], decode_buf[321]; 255 u_char ud7[160], decode_buf[321];
256 int do_hexdump; 256 int do_hexdump;
297 printf("Decode-Error: UDL %u > 140\n", udl); 297 printf("Decode-Error: UDL %u > 140\n", udl);
298 return(-1); 298 return(-1);
299 } 299 }
300 udl_octets = udl; 300 udl_octets = udl;
301 } 301 }
302 if (pdu_length - pdu_ptr != udl_octets) { 302 if (require_exact_length && pdu_length - pdu_ptr != udl_octets) {
303 printf("Decode-Error: UD length in PDU %u != expected %u\n", 303 printf("Decode-Error: UD length in PDU %u != expected %u\n",
304 pdu_length - pdu_ptr, udl_octets); 304 pdu_length - pdu_ptr, udl_octets);
305 return(-1); 305 return(-1);
306 } 306 }
307 if (first_octet & 0x40) { 307 if (first_octet & 0x40) {