iu_client: derive local SCCP addr from sccp instance

ranap_iu_init() is passed an sccp instance that has a local primary point code.
Use this primary PC by default as the local address for IuCS and IuPS clients.

Remove the current vty command 'iu local-address point-code PC':
- It is possible that we would like to configure a differing local point code
  at some point; this should then happen via sccp address book entries, not
  parsing PC directly.
- Obtaining the local PC from the SCCP instance makes this command obsolete for
  all setups we're currently aiming at: one local PC per SCCP instance.
- There are vty doc failures in this vty command, which cause osmo-msc and
  osmo-bsc vty test failures; rather than fixing this, let's drop it entirely
  until we see a need for it (and then do it properly with the address book).

Cosmetic: prefix the local static variable with g_* like g_sccp and g_scu and
define it in the same place. No default values are needed anymore, it gets
overwritten in ranap_iu_init().

Change-Id: I3bb7fc1cd5261d214c6ba0cccfe95f637e6db087
diff --git a/src/iu_client.c b/src/iu_client.c
index 83ed276..17d955d 100644
--- a/src/iu_client.c
+++ b/src/iu_client.c
@@ -83,6 +83,7 @@
 
 static struct osmo_sccp_instance *g_sccp;
 static struct osmo_sccp_user *g_scu;
+static struct osmo_sccp_addr g_local_sccp_addr;
 
 const struct value_string ranap_iu_event_type_names[] = {
 	OSMO_VALUE_STRING(RANAP_IU_EVENT_RAB_ASSIGN),
@@ -584,13 +585,6 @@
  * Paging
  ***********************************************************************/
 
-struct osmo_sccp_addr local_sccp_addr = {
-	.presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC,
-	.ri = OSMO_SCCP_RI_SSN_PC,
-	.ssn = OSMO_SCCP_SSN_RANAP,
-	.pc = 1,
-};
-
 /* Send a paging command down a given SCCP User. tmsi and paging_cause are
  * optional and may be passed NULL and 0, respectively, to disable their use.
  * See enum RANAP_PagingCause.
@@ -604,7 +598,7 @@
 	struct msgb *msg;
 	msg = ranap_new_msg_paging_cmd(imsi, tmsi, is_ps? 1 : 0, paging_cause);
 	msg->l2h = msg->data;
-	osmo_sccp_tx_unitdata_msg(g_scu, &local_sccp_addr, called_addr, msg);
+	osmo_sccp_tx_unitdata_msg(g_scu, &g_local_sccp_addr, called_addr, msg);
 	return 0;
 }
 
@@ -776,6 +770,7 @@
 	global_iu_recv_cb = iu_recv_cb;
 	global_iu_event_cb = iu_event_cb;
 	g_sccp = sccp;
+	osmo_sccp_local_addr_by_instance(&g_local_sccp_addr, sccp, OSMO_SCCP_SSN_RANAP);
 	g_scu = osmo_sccp_user_bind(g_sccp, sccp_user_name, sccp_sap_up, OSMO_SCCP_SSN_RANAP);
 
 	return 0;