nitb: Set the DST field in generated MM info messages

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
This commit is contained in:
Jacob Erlbeck 2014-01-07 15:05:16 +01:00 committed by Holger Hans Peter Freyther
parent 095bd36627
commit f46e226428
1 changed files with 15 additions and 0 deletions

View File

@ -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");