kernel-interface: Add interface name to local subnet enumerator
This commit is contained in:
@@ -320,7 +320,9 @@ struct kernel_interface_t {
|
||||
*
|
||||
* Local subnets are subnets the host is directly connected to.
|
||||
*
|
||||
* @return enumerator over host_t*, uint8_t
|
||||
* The enumerator returns the network, subnet mask and interface.
|
||||
*
|
||||
* @return enumerator over host_t*, uint8_t, char*
|
||||
*/
|
||||
enumerator_t *(*create_local_subnet_enumerator)(kernel_interface_t *this);
|
||||
|
||||
|
||||
@@ -123,7 +123,9 @@ struct kernel_net_t {
|
||||
*
|
||||
* Local subnets are subnets the host is directly connected to.
|
||||
*
|
||||
* @return enumerator over host_t*, uint8_t
|
||||
* The enumerator returns the network, subnet mask and interface.
|
||||
*
|
||||
* @return enumerator over host_t*, uint8_t, char*
|
||||
*/
|
||||
enumerator_t *(*create_local_subnet_enumerator)(kernel_net_t *this);
|
||||
|
||||
|
||||
@@ -102,6 +102,7 @@ static job_requeue_t update_bypass(private_bypass_lan_listener_t *this)
|
||||
bypass_policy_t *found, *lookup;
|
||||
host_t *net;
|
||||
uint8_t mask;
|
||||
char *iface;
|
||||
|
||||
seen = hashtable_create((hashtable_hash_t)policy_hash,
|
||||
(hashtable_equals_t)policy_equals, 4);
|
||||
@@ -109,7 +110,7 @@ static job_requeue_t update_bypass(private_bypass_lan_listener_t *this)
|
||||
this->mutex->lock(this->mutex);
|
||||
|
||||
enumerator = charon->kernel->create_local_subnet_enumerator(charon->kernel);
|
||||
while (enumerator->enumerate(enumerator, &net, &mask))
|
||||
while (enumerator->enumerate(enumerator, &net, &mask, &iface))
|
||||
{
|
||||
INIT(lookup,
|
||||
.net = net->clone(net),
|
||||
|
||||
@@ -2148,7 +2148,7 @@ METHOD(enumerator_t, destroy_subnet_enumerator, void,
|
||||
}
|
||||
|
||||
METHOD(enumerator_t, enumerate_subnets, bool,
|
||||
subnet_enumerator_t *this, host_t **net, uint8_t *mask)
|
||||
subnet_enumerator_t *this, host_t **net, uint8_t *mask, char **ifname)
|
||||
{
|
||||
if (!this->current)
|
||||
{
|
||||
@@ -2204,6 +2204,7 @@ METHOD(enumerator_t, enumerate_subnets, bool,
|
||||
this->net = host_create_from_chunk(msg->rtm_family, dst, 0);
|
||||
*net = this->net;
|
||||
*mask = msg->rtm_dst_len;
|
||||
*ifname = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user