comparison uptools/sms-pdu-decode/pdu-common.c @ 960:411d1cc14326

sms-pdu-decode family: prepare for SC address becoming optional
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 04 Aug 2023 23:09:12 +0000
parents 30fbaa652ea5
children b515a97e5dff
comparison
equal deleted inserted replaced
959:c340f432cf03 960:411d1cc14326
244 break; 244 break;
245 } 245 }
246 return(rc); 246 return(rc);
247 } 247 }
248 248
249 process_pdu(require_exact_length) 249 process_pdu(require_exact_length, expect_sca)
250 { 250 {
251 unsigned udl, udl_octets; 251 unsigned udl, udl_octets;
252 unsigned udhl, udh_octets, udh_chars, ud_chars; 252 unsigned udhl, udh_octets, udh_chars, ud_chars;
253 u_char ud7[160], decode_buf[481]; 253 u_char ud7[160], decode_buf[481];
254 int do_hexdump; 254 int do_hexdump;
255 unsigned decoded_len; 255 unsigned decoded_len;
256 256
257 if (handle_sca() < 0) 257 if (expect_sca) {
258 return(-1); 258 if (handle_sca() < 0)
259 return(-1);
260 } else
261 pdu_ptr = 0;
259 if (handle_first_octet() < 0) 262 if (handle_first_octet() < 0)
260 return(-1); 263 return(-1);
261 if (first_octet & 2) { 264 if (first_octet & 2) {
262 printf("Decode-Error: MTI not supported\n"); 265 printf("Decode-Error: MTI not supported\n");
263 return(-1); 266 return(-1);