introduce new osmo_ss7_asp_disconnect() function

Higher-layer code shouldn't have to worry between client and server
difference.  It just wants to close the underlying connection for a
given ASP - which it now can by means of osmo_ss7_asp_disconnect().

Change-Id: I36b089abd281b8edac8830fda2d8e57cc06cd0a7
This commit is contained in:
Harald Welte 2017-04-15 22:39:05 +02:00
parent 03eda14b26
commit 3a57553145
2 changed files with 10 additions and 0 deletions

View File

@ -309,6 +309,7 @@ int osmo_ss7_as_del_asp(struct osmo_ss7_as *as, const char *asp_name);
void osmo_ss7_as_destroy(struct osmo_ss7_as *as);
bool osmo_ss7_as_has_asp(struct osmo_ss7_as *as,
struct osmo_ss7_asp *asp);
void osmo_ss7_asp_disconnect(struct osmo_ss7_asp *asp);
/***********************************************************************

View File

@ -1543,6 +1543,15 @@ int osmo_ss7_asp_send(struct osmo_ss7_asp *asp, struct msgb *msg)
return 0;
}
void osmo_ss7_asp_disconnect(struct osmo_ss7_asp *asp)
{
if (asp->server)
osmo_stream_srv_destroy(asp->server);
/* the close_cb() will handle the remaining cleanup here */
else if (asp->client)
xua_cli_close_and_reconnect(asp->client);
}
/***********************************************************************
* SS7 xUA Server
***********************************************************************/