FreeCalypso > hg > sms-coding-utils
annotate gen-pdu/settings.c @ 16:d9d722033ff1
sms-gen-tpdu: add support for first octet flags
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 27 Aug 2023 07:32:46 +0000 |
parents | 5854e48d0ef7 |
children | 590b0b5bcbbb |
rev | line source |
---|---|
9
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * This module implements functions for various settings that come before |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * msg or msg-udh lines. |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 */ |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <sys/types.h> |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <stdio.h> |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include <stdlib.h> |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include <string.h> |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #include <strings.h> |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 #include "error.h" |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 extern int dir_mo, include_sca; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 extern u_char sc_addr[12], user_addr[12]; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 extern u_char mr_byte, pid_byte, dcs_byte; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 extern u_char scts_buf[7]; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 extern int is_septet, scts_is_set; |
16
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
18 extern int flag_rp, flag_sr, flag_lp, flag_mms, flag_rd; |
9
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 extern int input_lineno; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 void |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 set_sc_addr(argc, argv) |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 char **argv; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 { |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 int rc; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 if (!include_sca) { |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 fprintf(stderr, ERR_PREFIX |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 "sc-addr is not allowed in bare TPDU mode\n", |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 input_lineno); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 exit(1); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 } |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 rc = encode_phone_number_arg(argv[1], sc_addr, 0); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 if (rc < 0) { |
15
5854e48d0ef7
sms-gen-tpdu: add support for alphanumeric user-addr
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
36 fprintf(stderr, ERR_PREFIX "invalid SC-address argument\n", |
9
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 input_lineno); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 exit(1); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 } |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 } |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 void |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 set_user_addr(argc, argv) |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 char **argv; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 { |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 int rc; |
15
5854e48d0ef7
sms-gen-tpdu: add support for alphanumeric user-addr
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
47 char *err_desc; |
9
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 |
15
5854e48d0ef7
sms-gen-tpdu: add support for alphanumeric user-addr
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
49 if (!strncmp(argv[1], "alpha:", 6)) { |
5854e48d0ef7
sms-gen-tpdu: add support for alphanumeric user-addr
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
50 rc = encode_alpha_addr(argv[1] + 6, user_addr); |
5854e48d0ef7
sms-gen-tpdu: add support for alphanumeric user-addr
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
51 err_desc = "alpha address"; |
5854e48d0ef7
sms-gen-tpdu: add support for alphanumeric user-addr
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
52 } else { |
5854e48d0ef7
sms-gen-tpdu: add support for alphanumeric user-addr
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
53 rc = encode_phone_number_arg(argv[1], user_addr, 1); |
5854e48d0ef7
sms-gen-tpdu: add support for alphanumeric user-addr
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
54 err_desc = "phone number"; |
5854e48d0ef7
sms-gen-tpdu: add support for alphanumeric user-addr
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
55 } |
9
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 if (rc < 0) { |
15
5854e48d0ef7
sms-gen-tpdu: add support for alphanumeric user-addr
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
57 fprintf(stderr, ERR_PREFIX "invalid %s argument\n", |
5854e48d0ef7
sms-gen-tpdu: add support for alphanumeric user-addr
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
58 input_lineno, err_desc); |
9
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 exit(1); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 } |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 } |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 void |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 set_mr_byte(argc, argv) |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 char **argv; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 { |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 char *endp; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 if (!dir_mo) { |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 fprintf(stderr, ERR_PREFIX "mr is not allowed in MT mode\n", |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 input_lineno); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 exit(1); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 } |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 mr_byte = strtoul(argv[1], &endp, 0); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 if (*endp) { |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 fprintf(stderr, ERR_PREFIX "invalid byte value argument\n", |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 input_lineno); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 exit(1); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 } |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 } |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 void |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 set_pid_byte(argc, argv) |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 char **argv; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 { |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 char *endp; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 pid_byte = strtoul(argv[1], &endp, 0); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 if (*endp) { |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 fprintf(stderr, ERR_PREFIX "invalid byte value argument\n", |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 input_lineno); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 exit(1); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 } |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 } |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 void |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 set_dcs(argc, argv) |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 char **argv; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 { |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 char *endp; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 dcs_byte = strtoul(argv[1], &endp, 0); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 if (*endp) { |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 fprintf(stderr, ERR_PREFIX "invalid byte value argument\n", |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 input_lineno); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 exit(1); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 } |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 if (!strcmp(argv[2], "septet")) |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 is_septet = 1; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 else if (!strcmp(argv[2], "octet")) |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 is_septet = 0; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 else { |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 fprintf(stderr, ERR_PREFIX "invalid septet/octet mode kw\n", |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 input_lineno); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 exit(1); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 } |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 } |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 void |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 set_scts(argc, argv) |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 char **argv; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 { |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 int rc; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 if (dir_mo) { |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 fprintf(stderr, ERR_PREFIX "sc-ts is not allowed in MO mode\n", |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 input_lineno); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 exit(1); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 } |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 rc = encode_gsm_sms_abstime(argv[1], scts_buf); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 if (rc < 0) { |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 fprintf(stderr, ERR_PREFIX "invalid timestamp argument\n", |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 input_lineno); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 exit(1); |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 } |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 scts_is_set = 1; |
003660a57f99
new program sms-gen-tpdu
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 } |
16
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
138 |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
139 void |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
140 set_flag_rp() |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
141 { |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
142 flag_rp = 1; |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
143 } |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
144 |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
145 void |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
146 set_flag_sr() |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
147 { |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
148 flag_sr = 1; |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
149 } |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
150 |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
151 void |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
152 set_flag_lp() |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
153 { |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
154 if (dir_mo) { |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
155 fprintf(stderr, ERR_PREFIX "lp is not allowed in MO mode\n", |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
156 input_lineno); |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
157 exit(1); |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
158 } |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
159 flag_lp = 1; |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
160 } |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
161 |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
162 void |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
163 set_flag_mms() |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
164 { |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
165 if (dir_mo) { |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
166 fprintf(stderr, ERR_PREFIX "mms is not allowed in MO mode\n", |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
167 input_lineno); |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
168 exit(1); |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
169 } |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
170 flag_mms = 1; |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
171 } |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
172 |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
173 void |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
174 set_flag_rd() |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
175 { |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
176 if (!dir_mo) { |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
177 fprintf(stderr, ERR_PREFIX "rd is not allowed in MT mode\n", |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
178 input_lineno); |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
179 exit(1); |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
180 } |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
181 flag_rd = 1; |
d9d722033ff1
sms-gen-tpdu: add support for first octet flags
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
182 } |