osmo_epdg: ue: add set/get id
The unique_id may change over time
This commit is contained in:
parent
0e8b7ee01d
commit
f01b88ad4b
|
@ -85,6 +85,18 @@ METHOD(osmo_epdg_ue_t, get_apn, const char *,
|
|||
return this->apn;
|
||||
}
|
||||
|
||||
METHOD(osmo_epdg_ue_t, get_id, uint32_t,
|
||||
private_osmo_epdg_ue_t *this)
|
||||
{
|
||||
return this->id;
|
||||
}
|
||||
|
||||
METHOD(osmo_epdg_ue_t, set_id, void,
|
||||
private_osmo_epdg_ue_t *this, uint32_t unique_id)
|
||||
{
|
||||
this->id = unique_id;
|
||||
}
|
||||
|
||||
METHOD(osmo_epdg_ue_t, set_address, void,
|
||||
private_osmo_epdg_ue_t *this, host_t *address)
|
||||
{
|
||||
|
@ -173,6 +185,8 @@ osmo_epdg_ue_t *osmo_epdg_ue_create(uint32_t id, const char *imsi, const char *a
|
|||
.put = _put,
|
||||
.get_apn = _get_apn,
|
||||
.get_imsi = _get_imsi,
|
||||
.get_id = _get_id,
|
||||
.set_id = _set_id,
|
||||
.get_address = _get_address,
|
||||
.set_address = _set_address,
|
||||
.get_state = _get_state,
|
||||
|
|
|
@ -57,14 +57,28 @@ enum osmo_epdg_ue_state {
|
|||
struct osmo_epdg_ue_t {
|
||||
/**
|
||||
* Get APN
|
||||
* Should not change.
|
||||
*/
|
||||
const char *(*get_apn)(osmo_epdg_ue_t *this);
|
||||
|
||||
/**
|
||||
* Get IMSI
|
||||
* Should not change.
|
||||
*/
|
||||
const char *(*get_imsi)(osmo_epdg_ue_t *this);
|
||||
|
||||
/**
|
||||
* Get unique ID
|
||||
* The unique ID may change either by reconnect or rekey
|
||||
*/
|
||||
uint32_t (*get_id)(osmo_epdg_ue_t *this);
|
||||
|
||||
/**
|
||||
* Get unique ID
|
||||
* The unique ID may change either by reconnect or rekey
|
||||
*/
|
||||
void (*set_id)(osmo_epdg_ue_t *this, uint32_t unique_id);
|
||||
|
||||
/**
|
||||
* Get address. Returns NULL or a cloned' host_t object
|
||||
*/
|
||||
|
@ -85,7 +99,6 @@ struct osmo_epdg_ue_t {
|
|||
*/
|
||||
void (*set_state)(osmo_epdg_ue_t *this, enum osmo_epdg_ue_state state);
|
||||
|
||||
|
||||
/**
|
||||
* Increase the internal refcount. Use put() when done with the object
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue