/*
- * Copyright (C) 2006 Martin Willi
+ * Copyright (C) 2008 Andreas Steffen
* Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * $Id: acquire_job.c 4535 2008-10-31 01:43:23Z andreas $
+ * $Id$
*/
#include "migrate_job.h"
traffic_selector_t *dst_ts;
/**
- * local host address to be used
+ * local host address to be used for IKE
*/
host_t *local;
+
+ /**
+ * remote host address to be used for IKE
+ */
+ host_t *remote;
};
/**
DESTROY_IF(this->src_ts);
DESTROY_IF(this->dst_ts);
DESTROY_IF(this->local);
+ DESTROY_IF(this->remote);
free(this);
}
{
ike_sa->set_my_host(ike_sa, this->local->clone(this->local));
}
+ if (this->remote)
+ {
+ ike_sa->set_other_host(ike_sa, this->remote->clone(this->remote));
+ }
/* add a CHILD_SA for 'found_cfg' with a policy that has already been
* installed in the kernel
*/
{
ike_sa->set_my_host(ike_sa, this->local);
}
+ if (this->remote)
+ {
+ ike_sa->set_other_host(ike_sa, this->remote->clone(this->remote));
+ }
}
charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
destroy(this);
traffic_selector_t *src_ts,
traffic_selector_t *dst_ts,
policy_dir_t dir,
- host_t *local)
+ host_t *local, host_t *remote)
{
private_migrate_job_t *this = malloc_thing(private_migrate_job_t);
this->src_ts = (dir == POLICY_OUT) ? src_ts : dst_ts;
this->dst_ts = (dir == POLICY_OUT) ? dst_ts : src_ts;
this->local = local;
+ this->remote = remote;
return &this->public;
}