From 5734bff3b01da2a7369da07f77ad617c3ac32096 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 21 Feb 2019 02:27:48 +0100 Subject: represent negative T-timers as Osmocom-specific X-timers fi->T values are int, i.e. can be negative. Do not log them as unsigned, but define a distinct timer class "Xnnnn" for negative T values: i.e. for T == -1, print "Timeout of X1" instead of "Timeout of T4294967295". The negative T timer number space is useful to distinguish freely invented timers from proper 3GPP defined T numbers. So far I was using numbers like T993210 or T9999 for invented T, but X1, X2 etc. is a better solution. This way we can make sure to not accidentally define an invented timer number that actually collides with a proper 3GPP specified timer number that the author was not aware of at the time of writing. Add OSMO_T_FMT and OSMO_T_FMT_ARGS() macros as standardized timer number print format. Use that in fsm.c, tdef_vty.c, and adjust vty tests accordingly. Mention the two timer classes in various API docs and VTY online-docs. Change-Id: I3a59457623da9309fbbda235fe18fadd1636bff6 --- include/osmocom/vty/tdef_vty.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/osmocom/vty') diff --git a/include/osmocom/vty/tdef_vty.h b/include/osmocom/vty/tdef_vty.h index f55239ad..16d94981 100644 --- a/include/osmocom/vty/tdef_vty.h +++ b/include/osmocom/vty/tdef_vty.h @@ -35,7 +35,9 @@ struct osmo_tdef; struct osmo_tdef_group; #define OSMO_TDEF_VTY_ARG_T "TNNNN" -#define OSMO_TDEF_VTY_DOC_T "T-number, optionally preceded by 't' or 'T'.\n" +#define OSMO_TDEF_VTY_DOC_T \ + "T- or X-timer-number -- 3GPP compliant timer number of the format '1234' or 'T1234' or 't1234';" \ + " Osmocom-specific timer number of the format: 'X1234' or 'x1234'.\n" #define OSMO_TDEF_VTY_ARG_T_OPTIONAL "[" OSMO_TDEF_VTY_ARG_T "]" #define OSMO_TDEF_VTY_ARG_VAL "(<0-2147483647>|default)" -- cgit v1.2.3