[PATCH] nitb: Set the DST field in generated MM info messages

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Jacob Erlbeck jerlbeck at sysmocom.de
Tue Jan 7 14:05:16 UTC 2014


Currently the NET_DST information element (see GSM 24.008) is not
included in generated MM info messages even when the DST field in the
timezone info has been set via the VTY or the control interface.

This patch modifies gsm48_tx_mm_info() to append this information
element if (and only if) a non-zero DST has been configured. The
DST IE is not part of GSM 4.8. Therefore it will only be sent, if the
DST offset is configured to a value != 0.

The DST functionality has been verified with wireshark by Jacob.

Sponsored-by: On-Waves ehf
---
 openbsc/src/libmsc/gsm_04_08.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 997e996..9063f98 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -659,6 +659,7 @@ int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn)
 	struct tm* gmt_time;
 	struct tm* local_time;
 	int tzunits;
+	int dst = 0;
 
 	msg->lchan = conn->lchan;
 
@@ -752,6 +753,9 @@ int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn)
 			tzunits = tzunits + (bts->tz.mn/15);
 			ptr8[7] = bcdify(tzunits);
 		}
+		/* Convert DST value */
+		if (bts->tz.dst >= 0 && bts->tz.dst <= 2)
+			dst = bts->tz.dst;
 	}
 	else {
 		/* Need to get GSM offset and convert into 15 min units */
@@ -771,6 +775,17 @@ int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn)
 		}
 		else
 			ptr8[7] = bcdify(tzunits);
+
+		/* Does not support DST +2 */
+		if (local_time->tm_isdst)
+			dst = 1;
+	}
+
+	if (dst) {
+		ptr8 = msgb_put(msg, 3);
+		ptr8[0] = GSM48_IE_NET_DST;
+		ptr8[1] = 1;
+		ptr8[2] = dst;
 	}
 
 	DEBUGP(DMM, "-> MM INFO\n");
-- 
1.7.9.5





More information about the OpenBSC mailing list