Date: Sun, 19 Nov 2023 19:13:26 +0000 From: =?utf-8?Q?Mina_Gali=C4=87?= <freebsd@igalic.co> To: mike@karels.net Cc: kevans@FreeBSD.org, freebsd-net@freebsd.org Subject: Re: How to tell if a network interface was renamed (and from what) Message-ID: <B9P4hvvAaJn9M7-aiRmDqTRh460akNFaLIEmn2eRsunzAArKSvzaagrloT_py4Yuk_crTdhC0AsoBVrbMFXPolijnYGKeXatTiRP69GCtrw=@igalic.co> In-Reply-To: <99D24919-A5DF-4A8B-882F-9D724AAD494F@karels.net> References: <pdHC0ObBkAbx2HfFIhWYaB5-dmQDEUzNTWvVVJAuJV7FWdWWeSwybVFD-uyBUxPlqDRpAW7D1aAZsbrTxEj9kqsq7ESgO41srPmS-PcXGqw=@igalic.co> <E5F5F61E-3827-404A-A46F-BBCF45A29A82@FreeBSD.org> <9eef5488-e8da-4edd-bc00-baeb5aaf4a23@FreeBSD.org> <ptnVEMJ_x48tdYePN4iYRiEW2vWqwulbEOUJ4dQ1cKGkxNXZPPfdEVHdJKNHFfs2onxNipVZKPwDZZKlDv1peS1Xttim1VitMFsdUiTkAKE=@igalic.co> <99D24919-A5DF-4A8B-882F-9D724AAD494F@karels.net>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] Hi Mike, > The kernel has a driver name for each interface, which looks like it > doesn't change currently in most cases. There is a kernel accessor > function, but I don't think it is exported to user space now. It could > be, though. Would this be sufficient for your purposes? There is also > a unit number, which could also be exported. As mentioned in my initial post, I'm happy to drop to C where alternatives are infeasible, slow, or otherwise cumbersome, or just plain don't exist. Here's the code we use to determine boottime: https://github.com/canonical/cloud-init/blob/5496745b394f9b7b9eaf57fd619330d484ce2da8/cloudinit/util.py#L2073-L2105 > Mike Mina [-- Attachment #2 --] Hi Mike,<br><br>> The kernel has a driver name for each interface, which looks like it<br>> doesn't change currently in most cases. There is a kernel accessor<br>> function, but I don't think it is exported to user space now. It could<br>> be, though. Would this be sufficient for your purposes? There is also<br>> a unit number, which could also be exported.<br><br>As mentioned in my initial post, I'm happy to drop to C where alternatives are infeasible, slow, or otherwise cumbersome, or just plain don't exist.<br><br>Here's the code we use to determine boottime: <a href="https://github.com/canonical/cloud-init/blob/5496745b394f9b7b9eaf57fd619330d484ce2da8/cloudinit/util.py#L2073-L2105">https://github.com/canonical/cloud-init/blob/5496745b394f9b7b9eaf57fd619330d484ce2da8/cloudinit/util.py#L2073-L2105</a><br><br>> Mike<br><br>Mina
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B9P4hvvAaJn9M7-aiRmDqTRh460akNFaLIEmn2eRsunzAArKSvzaagrloT_py4Yuk_crTdhC0AsoBVrbMFXPolijnYGKeXatTiRP69GCtrw=>
