ice: add ice_set_conf()

This commit is contained in:
Richard Aas 2014-08-18 09:32:29 +00:00
parent fc306d1577
commit e7bd36312f
2 changed files with 17 additions and 0 deletions

View file

@ -42,6 +42,7 @@ typedef void (ice_connchk_h)(int err, bool update, void *arg);
/* ICE Session */
int ice_alloc(struct ice **icep, enum ice_mode mode, bool offerer);
struct ice_conf *ice_conf(struct ice *ice);
void ice_set_conf(struct ice *ice, const struct ice_conf *conf);
void ice_set_offerer(struct ice *ice, bool offerer);
int ice_sdp_decode(struct ice *ice, const char *name, const char *value);
int ice_conncheck_start(struct ice *ice);

View file

@ -120,6 +120,22 @@ struct ice_conf *ice_conf(struct ice *ice)
}
void ice_set_conf(struct ice *ice, const struct ice_conf *conf)
{
if (!ice || !conf)
return;
ice->conf = *conf;
if (ice->stun) {
/* Update STUN Transport */
stun_conf(ice->stun)->rto = ice->conf.rto;
stun_conf(ice->stun)->rc = ice->conf.rc;
}
}
/**
* Set the offerer flag on the ICE Session
*