Project

General

Profile

Actions

Feature #6051

open

misnomer in internal SCCP functions

Added by neels 11 months ago. Updated 10 months ago.

Status:
New
Priority:
Low
Assignee:
Target version:
-
Start date:
06/02/2023
Due date:
% Done:

0%

Spec Reference:

Description

code review has indicated that functions talking to the SCCP User SAP should not be named tx_foo().

See
https://gerrit.osmocom.org/c/osmo-hnbgw/+/32915
https://gerrit.osmocom.org/c/osmo-hnbgw/+/33128

It came up in code review for these patches, after the functions in question had already been merged by earlier patches.

List the functions that should be renamed,
and choose names that everyone agrees with.

Actions #1

Updated by neels 10 months ago

  • Status changed from New to Feedback
  • Assignee set to laforge

I think this code is a good place to find a better name:

context_map_sccp.c:

static int tx_sccp_rlsd(struct osmo_fsm_inst *fi)
{
        struct hnbgw_context_map *map = fi->priv;

        if (!map->cnlink || !map->cnlink->hnbgw_sccp_user) {
                LOGPFSML(fi, LOGL_ERROR, "Failed to send SCCP RLSD: no CN link\n");
                return -1;      
        }                       

        return osmo_sccp_tx_disconn(map->cnlink->hnbgw_sccp_user->sccp_user, map->scu_conn_id, NULL, 0);
}    

IIUC these points exist:

  • tx_sccp_rlsd() implies that a RLSD message will be sent on the wire, but the SCCP-SCOC FSM will do a number of different things that get it to disconnect. So instead of 'rlsd' it should say 'disconn'?
  • The "tx" implies a message on the wire, while it is a dispatching of a primitive, more like an FSM event. Instead of "tx" it should say "dispatch"?

Interesting also is, osmo_sccp_tx_disconn() is from osmocom/sigtran/sccp_helpers.h. It has "disconn" in its name but also the "tx".

I'd like to get some feedback on what name would be satisfactory here, instead of tx_sccp_rlsd().
Maybe tx_sccp_disconn()? Or rather dispatch_sccp_disconn()? just sccp_disconn()?

Actions #2

Updated by laforge 10 months ago

On Tue, Jul 04, 2023 at 10:17:11PM +0000, neels wrote:

I'd like to get some feedback on what name would be satisfactory here, instead of tx_sccp_rlsd().
Maybe tx_sccp_disconn()? Or rather dispatch_sccp_disconn()? just sccp_disconn()?

I think either of those would be fine. The best would probably to avoid the tx_ prefix, as it is
not really transmitting. I just re-checked ITU-T X.210 and it speaks of

  • issuing a primitive by an user to a service-provider
  • submitting a primitive (user -> provider):

5.2.8 There are two basic types of OSI-service primitive: the submit primitive invoked by the OSI-service-user to exchange information with the OSI-service-provider, and the deliver primitive invoked by the OSI-service-provider to exchange information with the OSI-service-user.

So we end up with the choice of

  • {dispatch,submit,issue}_sccp_disconn(), or
  • sccp_disconn()

I guess I'd go for submit_sccp_disconn, but have no strong preference

Actions #3

Updated by laforge 10 months ago

  • Status changed from Feedback to New
  • Assignee changed from laforge to neels
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)