/*
- * Copyright (C) 2008-2018 Tobias Brunner
+ * Copyright (C) 2008-2019 Tobias Brunner
* Copyright (C) 2016 Andreas Steffen
* Copyright (C) 2005-2007 Martin Willi
* Copyright (C) 2005 Jan Hutter
*/
uint32_t reqid;
+ /**
+ * Optionl interface ID to use for inbound CHILD_SA
+ */
+ uint32_t if_id_in;
+
+ /**
+ * Optionl interface ID to use for outbound CHILD_SA
+ */
+ uint32_t if_id_out;
+
/**
* Optional mark to install inbound CHILD_SA with
*/
return this->reqid;
}
+METHOD(child_cfg_t, get_if_id, uint32_t,
+ private_child_cfg_t *this, bool inbound)
+{
+ return inbound ? this->if_id_in : this->if_id_out;
+}
+
METHOD(child_cfg_t, get_mark, mark_t,
private_child_cfg_t *this, bool inbound)
{
LIFETIME_EQUALS(this->lifetime, other->lifetime) &&
this->inactivity == other->inactivity &&
this->reqid == other->reqid &&
+ this->if_id_in == other->if_id_in &&
+ this->if_id_out == other->if_id_out &&
this->mark_in.value == other->mark_in.value &&
this->mark_in.mask == other->mark_in.mask &&
this->mark_out.value == other->mark_out.value &&
.get_dh_group = _get_dh_group,
.get_inactivity = _get_inactivity,
.get_reqid = _get_reqid,
+ .get_if_id = _get_if_id,
.get_mark = _get_mark,
.get_set_mark = _get_set_mark,
.get_tfc = _get_tfc,
.options = data->options,
.updown = strdupnull(data->updown),
.reqid = data->reqid,
+ .if_id_in = data->if_id_in,
+ .if_id_out = data->if_id_out,
.mode = data->mode,
.start_action = data->start_action,
.dpd_action = data->dpd_action,
/*
- * Copyright (C) 2008-2018 Tobias Brunner
+ * Copyright (C) 2008-2019 Tobias Brunner
* Copyright (C) 2016 Andreas Steffen
* Copyright (C) 2005-2007 Martin Willi
* Copyright (C) 2005 Jan Hutter
*/
uint32_t (*get_reqid)(child_cfg_t *this);
+ /**
+ * Optional interface ID to set on policies/SAs.
+ *
+ * @param inbound TRUE for inbound, FALSE for outbound
+ * @return interface ID
+ */
+ uint32_t (*get_if_id)(child_cfg_t *this, bool inbound);
+
/**
* Optional mark to set on policies/SAs.
*
child_cfg_option_t options;
/** Specific reqid to use for CHILD_SA, 0 for auto assignment */
uint32_t reqid;
+ /** Optional inbound interface ID */
+ uint32_t if_id_in;
+ /** Optional outbound interface ID */
+ uint32_t if_id_out;
/** Optional inbound mark */
mark_t mark_in;
/** Optional outbound mark */