Add a DSCP configuration value to IKE configs

This commit is contained in:
Martin Willi
2013-02-06 15:20:32 +01:00
parent ea5917afd8
commit 306a269e34
14 changed files with 41 additions and 25 deletions
+14 -1
View File
@@ -94,6 +94,11 @@ struct private_ike_cfg_t {
*/
fragmentation_t fragmentation;
/**
* DSCP value to use on sent IKE packets
*/
u_int8_t dscp;
/**
* List of proposals to use
*/
@@ -156,6 +161,12 @@ METHOD(ike_cfg_t, get_other_port, u_int16_t,
return this->other_port;
}
METHOD(ike_cfg_t, get_dscp, u_int8_t,
private_ike_cfg_t *this)
{
return this->dscp;
}
METHOD(ike_cfg_t, add_proposal, void,
private_ike_cfg_t *this, proposal_t *proposal)
{
@@ -312,7 +323,7 @@ METHOD(ike_cfg_t, destroy, void,
ike_cfg_t *ike_cfg_create(ike_version_t version, bool certreq, bool force_encap,
char *me, bool my_allow_any, u_int16_t my_port,
char *other, bool other_allow_any, u_int16_t other_port,
fragmentation_t fragmentation)
fragmentation_t fragmentation, u_int8_t dscp)
{
private_ike_cfg_t *this;
@@ -326,6 +337,7 @@ ike_cfg_t *ike_cfg_create(ike_version_t version, bool certreq, bool force_encap,
.get_other_addr = _get_other_addr,
.get_my_port = _get_my_port,
.get_other_port = _get_other_port,
.get_dscp = _get_dscp,
.add_proposal = _add_proposal,
.get_proposals = _get_proposals,
.select_proposal = _select_proposal,
@@ -345,6 +357,7 @@ ike_cfg_t *ike_cfg_create(ike_version_t version, bool certreq, bool force_encap,
.other_allow_any = other_allow_any,
.my_port = my_port,
.other_port = other_port,
.dscp = dscp,
.proposals = linked_list_create(),
);
+9 -1
View File
@@ -107,6 +107,13 @@ struct ike_cfg_t {
*/
u_int16_t (*get_other_port)(ike_cfg_t *this);
/**
* Get the DSCP value to use for IKE packets send from connections.
*
* @return DSCP value
*/
u_int8_t (*get_dscp)(ike_cfg_t *this);
/**
* Adds a proposal to the list.
*
@@ -205,11 +212,12 @@ struct ike_cfg_t {
* @param other_allow_any allow override of remote address by any address
* @param other_port IKE port to use as dest, 500 uses IKEv2 port floating
* @param fragmentation use IKEv1 fragmentation
* @param dscp DSCP value to send IKE packets with
* @return ike_cfg_t object.
*/
ike_cfg_t *ike_cfg_create(ike_version_t version, bool certreq, bool force_encap,
char *me, bool my_allow_any, u_int16_t my_port,
char *other, bool other_allow_any, u_int16_t other_port,
fragmentation_t fragmentation);
fragmentation_t fragmentation, u_int8_t dscp);
#endif /** IKE_CFG_H_ @}*/