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;
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)
{
* 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;
.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,
.force_encap = force_encap,
.me = strdup(me),
.other = strdup(other),
+ .my_port = my_port,
+ .other_port = other_port,
.proposals = linked_list_create(),
);