diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-07-26 17:31:53 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-08-09 13:53:26 +0200 |
commit | b711e1450444c5882a8d9a941094183484fa47db (patch) | |
tree | fb87d6b64bc6d3bb59ea4299db00ce1debf0bea4 /src/sccp_scrc.c | |
parent | 81a029a4e46bb7c62b2401ec055fe44c5b7568cd (diff) |
add OSMO_SS7_PC_INVALID, add osmo_ss7_pc_is_valid()
Introduce OSMO_SS7_PC_INVALID to mark an unset point code.
Add static osmo_ss7_pc_is_valid() (name matches schema of
osmo_ss7_pc_is_local()).
In osmo_ss7_pointcode_print(), return "(no PC)" if !osmo_ss7_pc_is_valid(), for
convenient printing of any PC state.
Subsequent patches will use this for
osmo_ss7_instance (I7f0f0c89b7335d9da24161bfac8234be214ca00c)
as well as osmo_sccp_user (I8684c9b559712072c772012890bbf7efa7c8eb35).
Rationale:
Currently, in osmo_ss7_vty.c we had "if (inst->cfg.primary_pc)" suggesting 0 is
invalid, but in struct osmo_sccp_user we have flag pc_valid suggesting 0 is
indeed valid. All known point code formats are <= 24bit, so we can easily use
0xffffffff as indicator for an unset PC, which removes the need to remember to
set a second field for validity and keeps the structs nice and lean.
Change-Id: Ib5715bf03a4de7713a7a809dfd821c700255ba8c
Diffstat (limited to 'src/sccp_scrc.c')
0 files changed, 0 insertions, 0 deletions