libipm: Add libipm_change_facility() call

This commit is contained in:
matt335672 2023-03-22 14:48:20 +00:00
parent c3f02f5107
commit 8064a463c9
2 changed files with 42 additions and 0 deletions

View File

@ -216,3 +216,25 @@ libipm_clear_flags(struct trans *trans, unsigned int flags)
priv->flags &= ~flags; priv->flags &= ~flags;
} }
} }
/*****************************************************************************/
void
libipm_change_facility(struct trans *trans,
enum libipm_facility old_facility,
enum libipm_facility new_facility)
{
struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data;
if (priv != NULL)
{
if (priv->facility != old_facility)
{
LOG(LOG_LEVEL_WARNING, "Not changing libipm facility - bad value");
}
else
{
priv->facility = new_facility;
}
}
}

View File

@ -119,6 +119,26 @@ libipm_set_flags(struct trans *trans, unsigned int flags);
void void
libipm_clear_flags(struct trans *trans, unsigned int flags); libipm_clear_flags(struct trans *trans, unsigned int flags);
/**
* Change the facility number for the transport
* @param trans libipm transport
* @param old_facility old transport facility
* @param new_facility new transport facility
*
* This call is required if a libipm transport changes a facility number.
* This can be used to implement switches from one functional server state to
* another.
*
* The caller must be aware of the previous facility to change the facility.
* In the event of a mismatch, a message is logged and no action is taken.
*/
void
libipm_change_facility(struct trans *trans,
enum libipm_facility old_facility,
enum libipm_facility new_facility);
/** /**
* Initialise an output message * Initialise an output message
* *