# How to port a program that use linux/ethtool.h ?



## olivier (Feb 18, 2010)

Hi,

I'm trying to compile lldpd under FreeBSD.

And I meet a problem because this software use linux/ethtool.h.

What is the equivalent lib under FreeBSD ?

Thanks,


```
===>  Building for lldpd-0.4.0_1
make  all-recursive
Making all in src
cc -DHAVE_CONFIG_H -I. -I..      -O2 -pipe -march=native -fno-strict-aliasing -MT frame.o -MD -MP -MF .deps/frame.Tpo -c -o fr
ame.o frame.c
In file included from frame.c:17:
lldpd.h:37:27: error: linux/ethtool.h: No such file or directory
In file included from frame.c:17:
lldpd.h:271: error: 'ETH_ALEN' undeclared here (not in a function)
lldpd.h:451: warning: 'struct ethtool_cmd' declared inside parameter list
lldpd.h:451: warning: its scope is only this definition or declaration, which is probably not what you want
lldpd.h:454: warning: 'struct sockaddr_un' declared inside parameter list
lldpd.h:451: warning: its scope is only this definition or declaration, which is probably not what you want             [0/56]
lldpd.h:454: warning: 'struct sockaddr_un' declared inside parameter list
*** Error code 1
```


----------



## achix (Feb 18, 2010)

You must rewrite the application taking smth like those:
`# locate  ether | grep include`

/usr/include/net/ethernet.h
/usr/include/netgraph/ng_ether.h
/usr/include/netgraph/ng_ether_echo.h
/usr/include/netinet/if_ether.h


into consideartion.


----------



## olivier (Feb 19, 2010)

Thanks for your answer, then I need to found time for:

Discover C programming
Studying the linux/ethtool.h
Studying how to adapt the code to FreeBSD


----------

