aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/config/ike_cfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/charon/config/ike_cfg.c')
-rw-r--r--src/charon/config/ike_cfg.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/charon/config/ike_cfg.c b/src/charon/config/ike_cfg.c
index bb0fd87fd..b486d576f 100644
--- a/src/charon/config/ike_cfg.c
+++ b/src/charon/config/ike_cfg.c
@@ -49,6 +49,16 @@ struct private_ike_cfg_t {
char *other;
/**
+ * our source port
+ */
+ u_int16_t my_port;
+
+ /**
+ * destination port
+ */
+ u_int16_t other_port;
+
+ /**
* should we send a certificate request?
*/
bool certreq;
@@ -88,6 +98,18 @@ METHOD(ike_cfg_t, get_other_addr, char*,
return this->other;
}
+METHOD(ike_cfg_t, get_my_port, u_int16_t,
+ private_ike_cfg_t *this)
+{
+ return this->my_port;
+}
+
+METHOD(ike_cfg_t, get_other_port, u_int16_t,
+ private_ike_cfg_t *this)
+{
+ return this->other_port;
+}
+
METHOD(ike_cfg_t, add_proposal, void,
private_ike_cfg_t *this, proposal_t *proposal)
{
@@ -236,7 +258,7 @@ METHOD(ike_cfg_t, destroy, void,
* Described in header.
*/
ike_cfg_t *ike_cfg_create(bool certreq, bool force_encap,
- char *me, char *other)
+ char *me, u_int16_t my_port, char *other, u_int16_t other_port)
{
private_ike_cfg_t *this;
@@ -246,6 +268,8 @@ ike_cfg_t *ike_cfg_create(bool certreq, bool force_encap,
.force_encap = _force_encap_,
.get_my_addr = _get_my_addr,
.get_other_addr = _get_other_addr,
+ .get_my_port = _get_my_port,
+ .get_other_port = _get_other_port,
.add_proposal = _add_proposal,
.get_proposals = _get_proposals,
.select_proposal = _select_proposal,
@@ -259,6 +283,8 @@ ike_cfg_t *ike_cfg_create(bool certreq, bool force_encap,
.force_encap = force_encap,
.me = strdup(me),
.other = strdup(other),
+ .my_port = my_port,
+ .other_port = other_port,
.proposals = linked_list_create(),
);