diff 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
line wrap: on
line diff
--- a/gen-pdu/settings.c	Sun Aug 27 06:43:23 2023 +0000
+++ b/gen-pdu/settings.c	Sun Aug 27 07:32:46 2023 +0000
@@ -15,6 +15,7 @@
 extern u_char mr_byte, pid_byte, dcs_byte;
 extern u_char scts_buf[7];
 extern int is_septet, scts_is_set;
+extern int flag_rp, flag_sr, flag_lp, flag_mms, flag_rd;
 
 extern int input_lineno;
 
@@ -134,3 +135,48 @@
 	}
 	scts_is_set = 1;
 }
+
+void
+set_flag_rp()
+{
+	flag_rp = 1;
+}
+
+void
+set_flag_sr()
+{
+	flag_sr = 1;
+}
+
+void
+set_flag_lp()
+{
+	if (dir_mo) {
+		fprintf(stderr, ERR_PREFIX "lp is not allowed in MO mode\n",
+			input_lineno);
+		exit(1);
+	}
+	flag_lp = 1;
+}
+
+void
+set_flag_mms()
+{
+	if (dir_mo) {
+		fprintf(stderr, ERR_PREFIX "mms is not allowed in MO mode\n",
+			input_lineno);
+		exit(1);
+	}
+	flag_mms = 1;
+}
+
+void
+set_flag_rd()
+{
+	if (!dir_mo) {
+		fprintf(stderr, ERR_PREFIX "rd is not allowed in MT mode\n",
+			input_lineno);
+		exit(1);
+	}
+	flag_rd = 1;
+}