<p>Neels Hofmeyr <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/11110">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">cosmetic: sccp_scoc.c: fix timers definition units<br><br>The SCCP timer units are not what the comments say:<br>Milliseconds are 1000 * seconds, not 100.<br>Also, microseconds are 1000000 * seconds.<br><br>Interestingly enough, MSEC_TO_US() tried to fix the wrong hundredth-seconds to<br>microseconds by multiplying by 10, however, it should end up at a factor of a<br>million, not a thousand, hence would result in wrong sub-second fractions.<br>But, since none of the current timers use sub-second fractions, none of the<br>timers are actually affected in practice. Hence this patch is merely cosmetic.<br><br>Since all use of the timer constants is wrapped in MSEC_TO_US(), we can<br>transparently fix all those values and their use:<br><br>- define the constants in milliseconds (replace "100" with "1000").<br>- in MSEC_TO_US(), divide-and-mod by 1000.<br>- in MSEC_TO_US(), actually calculate microseconds.<br><br>BTW, I am about to make the timers VTY configurable, but before I get confused,<br>I'd rather fix these units first.<br><br>Change-Id: Ia6c893f734fbdc88873c4ef80f6cacf01ee7763a<br>---<br>M src/sccp_scoc.c<br>1 file changed, 9 insertions(+), 9 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c</span><br><span>index 3de986d..1057be0 100644</span><br><span>--- a/src/sccp_scoc.c</span><br><span>+++ b/src/sccp_scoc.c</span><br><span>@@ -65,18 +65,18 @@</span><br><span> #define SCU_MSGB_SIZE 1024</span><br><span> </span><br><span> /* Appendix C.4 of Q.714 (all in milliseconds) */</span><br><span style="color: hsl(0, 100%, 40%);">-#define CONNECTION_TIMER   ( 1 * 60 * 100)</span><br><span style="color: hsl(0, 100%, 40%);">-#define TX_INACT_TIMER           ( 7 * 60 * 100) /* RFC 3868 Ch. 8. */</span><br><span style="color: hsl(0, 100%, 40%);">-#define RX_INACT_TIMER             (15 * 60 * 100) /* RFC 3868 Ch. 8. */</span><br><span style="color: hsl(0, 100%, 40%);">-#define RELEASE_TIMER              (     10 * 100)</span><br><span style="color: hsl(0, 100%, 40%);">-#define RELEASE_REP_TIMER        (     10 * 100)</span><br><span style="color: hsl(0, 100%, 40%);">-#define INT_TIMER                ( 1 * 60 * 100)</span><br><span style="color: hsl(0, 100%, 40%);">-#define GUARD_TIMER              (23 * 60 * 100)</span><br><span style="color: hsl(0, 100%, 40%);">-#define RESET_TIMER              (     10 * 100)</span><br><span style="color: hsl(120, 100%, 40%);">+#define CONNECTION_TIMER       ( 1 * 60 * 1000)</span><br><span style="color: hsl(120, 100%, 40%);">+#define TX_INACT_TIMER                ( 7 * 60 * 1000) /* RFC 3868 Ch. 8. */</span><br><span style="color: hsl(120, 100%, 40%);">+#define RX_INACT_TIMER          (15 * 60 * 1000) /* RFC 3868 Ch. 8. */</span><br><span style="color: hsl(120, 100%, 40%);">+#define RELEASE_TIMER           (     10 * 1000)</span><br><span style="color: hsl(120, 100%, 40%);">+#define RELEASE_REP_TIMER     (     10 * 1000)</span><br><span style="color: hsl(120, 100%, 40%);">+#define INT_TIMER             ( 1 * 60 * 1000)</span><br><span style="color: hsl(120, 100%, 40%);">+#define GUARD_TIMER           (23 * 60 * 1000)</span><br><span style="color: hsl(120, 100%, 40%);">+#define RESET_TIMER           (     10 * 1000)</span><br><span> </span><br><span> /* convert from single value in milliseconds to comma-separated</span><br><span>  * "seconds, microseconds" format we use in osmocom/core/timers.h */</span><br><span style="color: hsl(0, 100%, 40%);">-#define MSEC_TO_S_US(x)                (x/100), ((x%100)*10)</span><br><span style="color: hsl(120, 100%, 40%);">+#define MSEC_TO_S_US(x)          (x/1000), ((x%1000)*1000)</span><br><span> </span><br><span> /***********************************************************************</span><br><span>  * SCCP connection table</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11110">change 11110</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/11110"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmo-sccp </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ia6c893f734fbdc88873c4ef80f6cacf01ee7763a </div>
<div style="display:none"> Gerrit-Change-Number: 11110 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>