On Fri, Sep 04, 2020 at 04:14:49PM +0000, Tony May via Linuxptp-users wrote:
> Is there a better way to find the PTP device path for a network > interface based on its name? In particular, is there a library that > I can include in some C/C++ code that I can call to resolve the > device path from the interface name? I don't know of any library for that. The methods you described are in fact the ways to find out the association between a network interface and a PHC character device. So any such library would have to do what you described anyhow. Personally, I use a shell script for that. For example: ETHA=eth6 DEVINDEX=$(ethtool -T $ETHA | awk '/PTP/ {print $4}') DEVA=/dev/ptp$DEVINDEX Thanks, Richard _______________________________________________ Linuxptp-users mailing list Linuxptp-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-users