Created
January 26, 2016 14:28
-
-
Save rlipscombe/ed96538e318015fdc3cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Using https://github.com/Feuerlabs/netlink | |
{ok, _} = application:ensure_all_started(lager). | |
{ok, _} = application:ensure_all_started(netlink). | |
{ok, Ref} = netlink:subscribe("eth1", all, [flush]). | |
% or | |
{ok, Ref} = netlink:subscribe("eth1", [address, operstate], [flush]). | |
flush(). | |
% You'll get messages of the form {netlink, Ref, "eth1", address, undefined, {10,0,0,1}} | |
% Note that 'address' messages come in (at least) two forms: hardware address changes and IP address changes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment