From: wong_powah on
I am not sure whether this is the right place to ask questions about
source codes of the book "UNIX Network Programming, Volume 1, Third
Edition" by W. Richard Stevens, Bill Fenner, and Andy Rudoff.
Please point to me to the right place if necessary.

$ cd libroute/
[tcma(a)rose libroute]$ make
gcc -I../lib -g -O2 -D_REENTRANT -Wall -c -o get_rtaddrs.o
get_rtaddrs.c
In file included from get_rtaddrs.c:1:
unproute.h:3:45: error: net/if_dl.h: No such file or directory
get_rtaddrs.c: In function 'get_rtaddrs':
get_rtaddrs.c:21: error: 'RTAX_MAX' undeclared (first use in this
function)
get_rtaddrs.c:21: error: (Each undeclared identifier is reported only
once
get_rtaddrs.c:21: error: for each function it appears in.)
get_rtaddrs.c:24: error: 'struct sockaddr' has no member named
'sa_len'
get_rtaddrs.c:24: error: 'struct sockaddr' has no member named
'sa_len'
get_rtaddrs.c:24: error: 'struct sockaddr' has no member named
'sa_len'
get_rtaddrs.c:24: error: 'struct sockaddr' has no member named
'sa_len'
make: *** [get_rtaddrs.o] Error 1

The file if_dl.h is not found on my Fedora Core 6 computer and
RTAX_MAX is defined in /usr/include/linux/rtnetlink.h

$ uname -a
Linux rose 2.6.18-1.2798.fc6 #1 SMP Mon Oct 16 14:54:20 EDT 2006 i686
i686 i386 GNU/Linux

$ gcc -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --
infodir=/usr/share/info --enable-shared --enable-threads=posix --
enable-checking=release --with-system-zlib --enable-__cxa_atexit --
disable-libunwind-exceptions --enable-libgcj-multifile --enable-
languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --
disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-
gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.1 20061011 (Red Hat 4.1.1-30)

How to fix this compile error?
How to get the file if_dl.h?
Do I add /usr/include/linux/ to the search path of the compiler?