charon_send_route_response(RES_DEL_ROUTE, msg);
}
+
+static void stroke_set_interface(private_stroke_socket_t *this, stroke_msg_t *msg, FILE *out)
+{
+ enumerator_t *enumerator;
+ ike_sa_t *ike_sa;
+
+ pop_string(msg, &msg->set_interface.name);
+ pop_string(msg, &msg->set_interface.interface);
+ DBG1(DBG_CFG,"received stroke: set new interface for %s to %s\n", msg->set_interface.name, msg->set_interface.interface);
+
+ enumerator = charon->ike_sa_manager->create_enumerator(charon->ike_sa_manager, TRUE);
+ while (enumerator->enumerate(enumerator, &ike_sa))
+ {
+ if (streq(msg->set_interface.name, ike_sa->get_name(ike_sa)))
+ {
+ peer_cfg_t *peer_cfg = ike_sa->get_peer_cfg(ike_sa);
+ if (peer_cfg)
+ {
+ /* first, update interface */
+ peer_cfg->set_interface(peer_cfg, msg->set_interface.interface);
+
+ /* start roaming scenario */
+ ike_sa->roam(ike_sa, FALSE);
+ }
+ }
+ }
+ enumerator->destroy(enumerator);
+
+ charon_send_conn_response(RES_SET_INTERFACE, msg);
+}
#endif
/**
case STR_DEL_ROUTE:
stroke_del_route(this, msg, out);
break;
+ case STR_SET_INTERFACE:
+ stroke_set_interface(this, msg, out);
+ break;
#endif
default:
DBG1(DBG_CFG, "received unknown stroke");
/**
* Number of bytes by which the buffer is increased as needed
*/
-#define STROKE_BUF_LEN_INC 1024
+#define STROKE_BUF_LEN_INC 1024
#ifdef VOWIFI_CFG
typedef enum {
/* print/reset counters */
STR_COUNTERS,
#ifdef VOWIFI_CFG
- /* ADD route */
- STR_ADD_ROUTE,
- /* DELETE route */
- STR_DEL_ROUTE,
+ /* ADD route */
+ STR_ADD_ROUTE,
+ /* DELETE route */
+ STR_DEL_ROUTE,
+ /* set new interface */
+ STR_SET_INTERFACE,
#endif
/* more to come */
} type;
} counters;
#ifdef VOWIFI_CFG
- /* data for STR_ADD_ROUTE, STR_DEL_ROUTE */
- struct {
- char *src;
- char *dst;
- char *interface;
- } add_route, del_route;
+ /* data for STR_ADD_ROUTE, STR_DEL_ROUTE */
+ struct {
+ char *src;
+ char *dst;
+ char *interface;
+ } add_route, del_route;
+
+ /* data for STR_SET_INTERFACE */
+ struct {
+ char *name;
+ char *interface;
+ } set_interface;
#endif
};
#ifdef VOWIFI_CFG