Re: Is there an way for a program to know when the list of network interfaces has changed (without rescanning them)?

2019-07-29 Thread Michael Tuexen



> On 29. Jul 2019, at 16:16, Rodney W. Grimes  
> wrote:
> 
>> I am asking because wireshark doesn't sense the interface list changes, 
>> and it just always shows the list from the time it was launched .
Does it also not show up after selecting Capture/Refresh Interfaces?

Best regards
Michael
> 
> I am cc'ing Michael Tuexen ,
> both a FreeBSD and long time wireshare developer.
> 
> I see there has been at least 2 ways proposed to you for
> doing this, I would suggest using the route socket as the
> prefered method as that should be some what portable
> accross all the BSD type platforms, a devd solution would
> be FreeBSD specific.
> 
> 
>> Yuri
> -- 
> Rod Grimes rgri...@freebsd.org
> ___
> freebsd-net@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

___
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"


Re: Is there an way for a program to know when the list of network interfaces has changed (without rescanning them)?

2019-07-29 Thread Rodney W. Grimes
> I am asking because wireshark doesn't sense the interface list changes, 
> and it just always shows the list from the time it was launched .

I am cc'ing Michael Tuexen ,
both a FreeBSD and long time wireshare developer.

I see there has been at least 2 ways proposed to you for
doing this, I would suggest using the route socket as the
prefered method as that should be some what portable
accross all the BSD type platforms, a devd solution would
be FreeBSD specific.


> Yuri
-- 
Rod Grimes rgri...@freebsd.org
___
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"


Re: Is there an way for a program to know when the list of network interfaces has changed (without rescanning them)?

2019-07-28 Thread Eugene Grosbein
29.07.2019 12:35, Yuri wrote:

> I am asking because wireshark doesn't sense the interface list changes, and 
> it just always shows the list from the time it was launched .

There is a way as we have devd(8) reading kernel-generated events and running 
commands in response.
Look at default /etc/devd.conf rules for example:

notify 0 {
match "system"  "IFNET";
match "subsystem"   "!(usbus|wlan)[0-9]+";
match "type""ATTACH";
action "/etc/pccard_ether $subsystem start";
};

Quoting devd(8) manual page:

>  Since devctl(4) allows only one active reader, devd multiplexes it,
>  forwarding all events to any number of connected clients.  Clients
>  connect by opening the SOCK_SEQPACKET UNIX domain socket at
>  /var/run/devd.seqpacket.pipe.

We have bsnmpd(1) in base system and its module 
usr.sbin/bsnmpd/modules/snmp_hostres
acting as client of devd, for example.

___
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"


Re: Is there an way for a program to know when the list of network interfaces has changed (without rescanning them)?

2019-07-28 Thread Hiroki Sato
Yuri  wrote
  in :

yu> I am asking because wireshark doesn't sense the interface list
yu> changes, and it just always shows the list from the time it was
yu> launched .

 You can open a routing socket and watch it to see if RTM_IFANNOUNCE
 message is coming.  The following command lines (on two different
 terminals on the same machine) show how this works when a new interface
 arrives:

  termA% route monitor
  (this waits for routing messages)

  termB# ifconfig tap0 create

 An example code to handle routing messages can be found in
 src/sbin/route/route.c.

-- Hiroki


pgpYGqOwuFwCZ.pgp
Description: PGP signature


Is there an way for a program to know when the list of network interfaces has changed (without rescanning them)?

2019-07-28 Thread Yuri
I am asking because wireshark doesn't sense the interface list changes, 
and it just always shows the list from the time it was launched .



Yuri


___
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"