comparison uptools/libcoding/scaddr.c @ 332:ea41b6001848

uptools/libcoding: SC address decoding implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 03 Feb 2018 22:57:45 +0000
parents
children
comparison
equal deleted inserted replaced
331:110fffa1f001 332:ea41b6001848
1 /*
2 * This library module contains the code that figures out how many digits
3 * are there in a PDU-encoded Service Centre address.
4 */
5
6 #include <sys/types.h>
7
8 sc_addr_ndigits(sca)
9 u_char *sca;
10 {
11 unsigned nb, nd;
12
13 nb = sca[0];
14 nd = (nb - 1) * 2;
15 if ((sca[nb] & 0xF0) == 0xF0)
16 nd--;
17 return nd;
18 }