mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-23 23:12:31 +00:00
Add interface index to UP/DOWN monitor message
This commit is contained in:
parent
884a6211eb
commit
c78ee668d5
@ -684,10 +684,11 @@ int monitor_tell_formatted(int mask, char *fmt, ...){
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void monitor_interface_change(struct overlay_interface *interface){
|
static void monitor_interface_change(struct overlay_interface *interface){
|
||||||
|
unsigned i = interface - overlay_interfaces;
|
||||||
if (interface->state==INTERFACE_STATE_UP)
|
if (interface->state==INTERFACE_STATE_UP)
|
||||||
monitor_tell_formatted(MONITOR_INTERFACE, "\nINTERFACE:%s:UP\n", interface->name);
|
monitor_tell_formatted(MONITOR_INTERFACE, "\nINTERFACE:%u:%s:UP\n", i, interface->name);
|
||||||
else if(interface->state==INTERFACE_STATE_DOWN)
|
else if(interface->state==INTERFACE_STATE_DOWN)
|
||||||
monitor_tell_formatted(MONITOR_INTERFACE, "\nINTERFACE:%s:DOWN\n", interface->name);
|
monitor_tell_formatted(MONITOR_INTERFACE, "\nINTERFACE:%u:%s:DOWN\n", i, interface->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_TRIGGER(iupdown, monitor_interface_change);
|
DEFINE_TRIGGER(iupdown, monitor_interface_change);
|
||||||
|
@ -108,7 +108,7 @@ void overlay_interface_monitor_up()
|
|||||||
unsigned i;
|
unsigned i;
|
||||||
for (i=0;i<OVERLAY_MAX_INTERFACES;i++){
|
for (i=0;i<OVERLAY_MAX_INTERFACES;i++){
|
||||||
if (overlay_interfaces[i].state == INTERFACE_STATE_UP)
|
if (overlay_interfaces[i].state == INTERFACE_STATE_UP)
|
||||||
monitor_tell_formatted(MONITOR_INTERFACE, "\nINTERFACE:%s:UP\n", overlay_interfaces[i].name);
|
monitor_tell_formatted(MONITOR_INTERFACE, "\nINTERFACE:%u:%s:UP\n", i, overlay_interfaces[i].name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user