We need dhcp-relay functionality. I tried to compile dhcp-helper from:
http://freshmeat.net/projects/dhcp-helper
but I am running into dependency issues:
mipsel-linux-gcc -O2 -Wall -W dhcp-helper.c -o dhcp-helper
dhcp-helper.c:23:24: sys/socket.h: No such file or directory
dhcp-helper.c:24:23: sys/ioctl.h: No such file or directory
dhcp-helper.c:25:24: sys/select.h: No such file or directory
dhcp-helper.c:26:22: sys/time.h: No such file or directory
dhcp-helper.c:27:22: sys/stat.h: No such file or directory
dhcp-helper.c:29:20: net/if.h: No such file or directory
dhcp-helper.c:30:20: unistd.h: No such file or directory
dhcp-helper.c:31:19: fcntl.h: No such file or directory
dhcp-helper.c:32:19: stdio.h: No such file or directory
dhcp-helper.c:33:20: string.h: No such file or directory
dhcp-helper.c:34:20: stdlib.h: No such file or directory
dhcp-helper.c:35:18: time.h: No such file or directory
dhcp-helper.c:36:19: errno.h: No such file or directory
dhcp-helper.c:37:17: pwd.h: No such file or directory
dhcp-helper.c:38:17: grp.h: No such file or directory
dhcp-helper.c:39:19: netdb.h: No such file or directory
dhcp-helper.c:40:25: linux/types.h: No such file or directory
dhcp-helper.c:41:30: linux/capability.h: No such file or directory
dhcp-helper.c:44: error: syntax error before "header"
dhcp-helper.c:45: error: syntax error before "header"
dhcp-helper.c:50:23: sys/prctl.h: No such file or directory
dhcp-helper.c:51:24: net/if_arp.h: No such file or directory
dhcp-helper.c:65: error: `IF_NAMESIZE' undeclared here (not in a function)
dhcp-helper.c:66: error: field `addr' has incomplete type
dhcp-helper.c:72: error: field `addr' has incomplete type
dhcp-helper.c:81: error: field `ciaddr' has incomplete type
dhcp-helper.c:81: error: field `yiaddr' has incomplete type
dhcp-helper.c:81: error: field `siaddr' has incomplete type
dhcp-helper.c:81: error: field `giaddr' has incomplete type
dhcp-helper.c: In function `main':
dhcp-helper.c:90: error: `IP_PMTUDISC_DONT' undeclared (first use in this function)
dhcp-helper.c:90: error: (Each undeclared identifier is reported only once
dhcp-helper.c:90: error: for each function it appears in.)
dhcp-helper.c:91: error: storage size of 'ifr' isn't known
dhcp-helper.c:92: error: storage size of 'saddr' isn't known
dhcp-helper.c:93: error: `size_t' undeclared (first use in this function)
dhcp-helper.c:93: error: syntax error before "buf_size"
dhcp-helper.c:95: error: `NULL' undeclared (first use in this function)
dhcp-helper.c:104: warning: implicit declaration of function `getopt'
dhcp-helper.c:113: warning: implicit declaration of function `malloc'
dhcp-helper.c:117: warning: implicit declaration of function `fprintf'
dhcp-helper.c:117: error: `stderr' undeclared (first use in this function)
dhcp-helper.c:118: warning: implicit declaration of function `exit'
dhcp-helper.c:121: warning: implicit declaration of function `strncpy'
dhcp-helper.c:121: error: `optarg' undeclared (first use in this function)
dhcp-helper.c:127: warning: implicit declaration of function `gethostbyname'
dhcp-helper.c:127: warning: initialization makes pointer from integer without a cast
dhcp-helper.c:134: error: dereferencing pointer to incomplete type
dhcp-helper.c:136: warning: implicit declaration of function `strlen'
dhcp-helper.c:141: warning: implicit declaration of function `socket'
dhcp-helper.c:141: error: `PF_INET' undeclared (first use in this function)
dhcp-helper.c:141: error: `SOCK_DGRAM' undeclared (first use in this function)
dhcp-helper.c:142: warning: implicit declaration of function `ioctl'
dhcp-helper.c:142: error: `SIOCGIFFLAGS' undeclared (first use in this function)
dhcp-helper.c:144: warning: implicit declaration of function `strerror'
dhcp-helper.c:144: error: `errno' undeclared (first use in this function)
dhcp-helper.c:144: warning: format argument is not a pointer (arg 4)
dhcp-helper.c:147: error: `IFF_BROADCAST' undeclared (first use in this function)
dhcp-helper.c:173: warning: implicit declaration of function `strcpy'
dhcp-helper.c:218: error: `buf_size' undeclared (first use in this function)
dhcp-helper.c:220: warning: implicit declaration of function `perror'
dhcp-helper.c:230: warning: implicit declaration of function `setsockopt'
dhcp-helper.c:230: error: `SOL_IP' undeclared (first use in this function)
dhcp-helper.c:230: error: `IP_PKTINFO' undeclared (first use in this function)
dhcp-helper.c:231: error: `SOL_SOCKET' undeclared (first use in this function)
dhcp-helper.c:231: error: `SO_BROADCAST' undeclared (first use in this function)
dhcp-helper.c:232: error: `IP_MTU_DISCOVER' undeclared (first use in this function)
dhcp-helper.c:238: error: `AF_INET' undeclared (first use in this function)
dhcp-helper.c:239: warning: implicit declaration of function `htons'
dhcp-helper.c:240: error: `INADDR_ANY' undeclared (first use in this function)
dhcp-helper.c:241: warning: implicit declaration of function `bind'
dhcp-helper.c:241: error: invalid application of `sizeof' to incomplete type `sockaddr_in'
dhcp-helper.c:249: error: `FILE' undeclared (first use in this function)
dhcp-helper.c:249: error: `pidfile' undeclared (first use in this function)
dhcp-helper.c:251: warning: implicit declaration of function `getpwnam'
dhcp-helper.c:251: warning: initialization makes pointer from integer without a cast
dhcp-helper.c:252: error: `gid_t' undeclared (first use in this function)
dhcp-helper.c:252: error: syntax error before "dummy"
dhcp-helper.c:254: error: `cap_user_header_t' undeclared (first use in this function)
dhcp-helper.c:254: error: syntax error before "hdr"
dhcp-helper.c:255: error: `cap_user_data_t' undeclared (first use in this function)
dhcp-helper.c:257: warning: implicit declaration of function `getuid'
dhcp-helper.c:259: error: `hdr' undeclared (first use in this function)
dhcp-helper.c:264: warning: implicit declaration of function `memset'
dhcp-helper.c:275: error: `data' undeclared (first use in this function)
dhcp-helper.c:287: error: `CAP_NET_ADMIN' undeclared (first use in this function)
dhcp-helper.c:287: error: `CAP_SETGID' undeclared (first use in this function)
dhcp-helper.c:287: error: `CAP_SETUID' undeclared (first use in this function)
dhcp-helper.c:290: warning: implicit declaration of function `prctl'
dhcp-helper.c:290: error: `PR_SET_KEEPCAPS' undeclared (first use in this function)
dhcp-helper.c:306: warning: implicit declaration of function `fork'
dhcp-helper.c:307: warning: implicit declaration of function `_exit'
dhcp-helper.c:309: warning: implicit declaration of function `setsid'
dhcp-helper.c:314: warning: implicit declaration of function `chdir'
dhcp-helper.c:315: warning: implicit declaration of function `umask'
dhcp-helper.c:318: warning: implicit declaration of function `fopen'
dhcp-helper.c:320: warning: implicit declaration of function `getpid'
dhcp-helper.c:321: warning: implicit declaration of function `fclose'
dhcp-helper.c:328: warning: implicit declaration of function `close'
dhcp-helper.c:332: warning: implicit declaration of function `setgroups'
dhcp-helper.c:332: error: `dummy' undeclared (first use in this function)
dhcp-helper.c:334: warning: implicit declaration of function `getgrgid'
dhcp-helper.c:334: error: dereferencing pointer to incomplete type
dhcp-helper.c:334: warning: assignment makes pointer from integer without a cast
dhcp-helper.c:335: warning: implicit declaration of function `setgid'
dhcp-helper.c:335: error: dereferencing pointer to incomplete type
dhcp-helper.c:336: warning: implicit declaration of function `setuid'
dhcp-helper.c:336: error: dereferencing pointer to incomplete type
dhcp-helper.c:348: error: storage size of 'iface_addr' isn't known
dhcp-helper.c:350: error: `ssize_t' undeclared (first use in this function)
dhcp-helper.c:350: error: syntax error before "sz"
dhcp-helper.c:351: error: storage size of 'msg' isn't known
dhcp-helper.c:352: error: storage size of 'iov' isn't known
dhcp-helper.c:356: error: field `align' has incomplete type
dhcp-helper.c:357: warning: implicit declaration of function `CMSG_SPACE'
dhcp-helper.c:357: error: invalid application of `sizeof' to incomplete type `in_pktinfo'
dhcp-helper.c:371: error: syntax error before "newsz"
dhcp-helper.c:374: error: `sz' undeclared (first use in this function)
dhcp-helper.c:374: warning: implicit declaration of function `recvmsg'
dhcp-helper.c:374: error: `MSG_PEEK' undeclared (first use in this function)
dhcp-helper.c:374: error: `EINTR' undeclared (first use in this function)
dhcp-helper.c:376: error: `MSG_TRUNC' undeclared (first use in this function)
dhcp-helper.c:377: warning: implicit declaration of function `realloc'
dhcp-helper.c:377: error: `newsz' undeclared (first use in this function)
dhcp-helper.c:377: warning: assignment makes pointer from integer without a cast
dhcp-helper.c:388: error: invalid application of `sizeof' to incomplete type `cmsghdr'
dhcp-helper.c:392: warning: implicit declaration of function `CMSG_FIRSTHDR'
dhcp-helper.c:392: warning: assignment makes pointer from integer without a cast
dhcp-helper.c:392: warning: implicit declaration of function `CMSG_NXTHDR'
dhcp-helper.c:392: warning: assignment makes pointer from integer without a cast
dhcp-helper.c:393: error: dereferencing pointer to incomplete type
dhcp-helper.c:393: error: dereferencing pointer to incomplete type
dhcp-helper.c:394: warning: implicit declaration of function `CMSG_DATA'
dhcp-helper.c:394: error: dereferencing pointer to incomplete type
dhcp-helper.c:396: error: `SIOCGIFNAME' undeclared (first use in this function)
dhcp-helper.c:400: error: `SIOCGIFADDR' undeclared (first use in this function)
dhcp-helper.c:420: warning: implicit declaration of function `strncmp'
dhcp-helper.c:464: error: `SIOCGIFBRDADDR' undeclared (first use in this function)
dhcp-helper.c:472: warning: implicit declaration of function `sendto'
dhcp-helper.c:512: warning: implicit declaration of function `ntohs'
dhcp-helper.c:517: warning: assignment makes pointer from integer without a cast
dhcp-helper.c:518: error: `INADDR_BROADCAST' undeclared (first use in this function)
dhcp-helper.c:520: error: dereferencing pointer to incomplete type
dhcp-helper.c:521: error: dereferencing pointer to incomplete type
dhcp-helper.c:522: error: dereferencing pointer to incomplete type
dhcp-helper.c:522: warning: implicit declaration of function `CMSG_LEN'
dhcp-helper.c:522: error: invalid application of `sizeof' to incomplete type `in_pktinfo'
dhcp-helper.c:523: error: dereferencing pointer to incomplete type
dhcp-helper.c:524: error: dereferencing pointer to incomplete type
dhcp-helper.c:534: error: storage size of 'req' isn't known
dhcp-helper.c:537: warning: implicit declaration of function `memcpy'
dhcp-helper.c:539: error: `ATF_COM' undeclared (first use in this function)
dhcp-helper.c:540: error: `SIOCSARP' undeclared (first use in this function)
dhcp-helper.c:534: warning: unused variable `req'
dhcp-helper.c:544: warning: implicit declaration of function `sendmsg'
dhcp-helper.c:348: warning: unused variable `iface_addr'
dhcp-helper.c:351: warning: unused variable `msg'
dhcp-helper.c:352: warning: unused variable `iov'
dhcp-helper.c:91: warning: unused variable `ifr'
dhcp-helper.c:92: warning: unused variable `saddr'
make: *** [all] Error 1
Can someone with more experience with compiling for Freetz help?
http://freshmeat.net/projects/dhcp-helper
but I am running into dependency issues:
mipsel-linux-gcc -O2 -Wall -W dhcp-helper.c -o dhcp-helper
dhcp-helper.c:23:24: sys/socket.h: No such file or directory
dhcp-helper.c:24:23: sys/ioctl.h: No such file or directory
dhcp-helper.c:25:24: sys/select.h: No such file or directory
dhcp-helper.c:26:22: sys/time.h: No such file or directory
dhcp-helper.c:27:22: sys/stat.h: No such file or directory
dhcp-helper.c:29:20: net/if.h: No such file or directory
dhcp-helper.c:30:20: unistd.h: No such file or directory
dhcp-helper.c:31:19: fcntl.h: No such file or directory
dhcp-helper.c:32:19: stdio.h: No such file or directory
dhcp-helper.c:33:20: string.h: No such file or directory
dhcp-helper.c:34:20: stdlib.h: No such file or directory
dhcp-helper.c:35:18: time.h: No such file or directory
dhcp-helper.c:36:19: errno.h: No such file or directory
dhcp-helper.c:37:17: pwd.h: No such file or directory
dhcp-helper.c:38:17: grp.h: No such file or directory
dhcp-helper.c:39:19: netdb.h: No such file or directory
dhcp-helper.c:40:25: linux/types.h: No such file or directory
dhcp-helper.c:41:30: linux/capability.h: No such file or directory
dhcp-helper.c:44: error: syntax error before "header"
dhcp-helper.c:45: error: syntax error before "header"
dhcp-helper.c:50:23: sys/prctl.h: No such file or directory
dhcp-helper.c:51:24: net/if_arp.h: No such file or directory
dhcp-helper.c:65: error: `IF_NAMESIZE' undeclared here (not in a function)
dhcp-helper.c:66: error: field `addr' has incomplete type
dhcp-helper.c:72: error: field `addr' has incomplete type
dhcp-helper.c:81: error: field `ciaddr' has incomplete type
dhcp-helper.c:81: error: field `yiaddr' has incomplete type
dhcp-helper.c:81: error: field `siaddr' has incomplete type
dhcp-helper.c:81: error: field `giaddr' has incomplete type
dhcp-helper.c: In function `main':
dhcp-helper.c:90: error: `IP_PMTUDISC_DONT' undeclared (first use in this function)
dhcp-helper.c:90: error: (Each undeclared identifier is reported only once
dhcp-helper.c:90: error: for each function it appears in.)
dhcp-helper.c:91: error: storage size of 'ifr' isn't known
dhcp-helper.c:92: error: storage size of 'saddr' isn't known
dhcp-helper.c:93: error: `size_t' undeclared (first use in this function)
dhcp-helper.c:93: error: syntax error before "buf_size"
dhcp-helper.c:95: error: `NULL' undeclared (first use in this function)
dhcp-helper.c:104: warning: implicit declaration of function `getopt'
dhcp-helper.c:113: warning: implicit declaration of function `malloc'
dhcp-helper.c:117: warning: implicit declaration of function `fprintf'
dhcp-helper.c:117: error: `stderr' undeclared (first use in this function)
dhcp-helper.c:118: warning: implicit declaration of function `exit'
dhcp-helper.c:121: warning: implicit declaration of function `strncpy'
dhcp-helper.c:121: error: `optarg' undeclared (first use in this function)
dhcp-helper.c:127: warning: implicit declaration of function `gethostbyname'
dhcp-helper.c:127: warning: initialization makes pointer from integer without a cast
dhcp-helper.c:134: error: dereferencing pointer to incomplete type
dhcp-helper.c:136: warning: implicit declaration of function `strlen'
dhcp-helper.c:141: warning: implicit declaration of function `socket'
dhcp-helper.c:141: error: `PF_INET' undeclared (first use in this function)
dhcp-helper.c:141: error: `SOCK_DGRAM' undeclared (first use in this function)
dhcp-helper.c:142: warning: implicit declaration of function `ioctl'
dhcp-helper.c:142: error: `SIOCGIFFLAGS' undeclared (first use in this function)
dhcp-helper.c:144: warning: implicit declaration of function `strerror'
dhcp-helper.c:144: error: `errno' undeclared (first use in this function)
dhcp-helper.c:144: warning: format argument is not a pointer (arg 4)
dhcp-helper.c:147: error: `IFF_BROADCAST' undeclared (first use in this function)
dhcp-helper.c:173: warning: implicit declaration of function `strcpy'
dhcp-helper.c:218: error: `buf_size' undeclared (first use in this function)
dhcp-helper.c:220: warning: implicit declaration of function `perror'
dhcp-helper.c:230: warning: implicit declaration of function `setsockopt'
dhcp-helper.c:230: error: `SOL_IP' undeclared (first use in this function)
dhcp-helper.c:230: error: `IP_PKTINFO' undeclared (first use in this function)
dhcp-helper.c:231: error: `SOL_SOCKET' undeclared (first use in this function)
dhcp-helper.c:231: error: `SO_BROADCAST' undeclared (first use in this function)
dhcp-helper.c:232: error: `IP_MTU_DISCOVER' undeclared (first use in this function)
dhcp-helper.c:238: error: `AF_INET' undeclared (first use in this function)
dhcp-helper.c:239: warning: implicit declaration of function `htons'
dhcp-helper.c:240: error: `INADDR_ANY' undeclared (first use in this function)
dhcp-helper.c:241: warning: implicit declaration of function `bind'
dhcp-helper.c:241: error: invalid application of `sizeof' to incomplete type `sockaddr_in'
dhcp-helper.c:249: error: `FILE' undeclared (first use in this function)
dhcp-helper.c:249: error: `pidfile' undeclared (first use in this function)
dhcp-helper.c:251: warning: implicit declaration of function `getpwnam'
dhcp-helper.c:251: warning: initialization makes pointer from integer without a cast
dhcp-helper.c:252: error: `gid_t' undeclared (first use in this function)
dhcp-helper.c:252: error: syntax error before "dummy"
dhcp-helper.c:254: error: `cap_user_header_t' undeclared (first use in this function)
dhcp-helper.c:254: error: syntax error before "hdr"
dhcp-helper.c:255: error: `cap_user_data_t' undeclared (first use in this function)
dhcp-helper.c:257: warning: implicit declaration of function `getuid'
dhcp-helper.c:259: error: `hdr' undeclared (first use in this function)
dhcp-helper.c:264: warning: implicit declaration of function `memset'
dhcp-helper.c:275: error: `data' undeclared (first use in this function)
dhcp-helper.c:287: error: `CAP_NET_ADMIN' undeclared (first use in this function)
dhcp-helper.c:287: error: `CAP_SETGID' undeclared (first use in this function)
dhcp-helper.c:287: error: `CAP_SETUID' undeclared (first use in this function)
dhcp-helper.c:290: warning: implicit declaration of function `prctl'
dhcp-helper.c:290: error: `PR_SET_KEEPCAPS' undeclared (first use in this function)
dhcp-helper.c:306: warning: implicit declaration of function `fork'
dhcp-helper.c:307: warning: implicit declaration of function `_exit'
dhcp-helper.c:309: warning: implicit declaration of function `setsid'
dhcp-helper.c:314: warning: implicit declaration of function `chdir'
dhcp-helper.c:315: warning: implicit declaration of function `umask'
dhcp-helper.c:318: warning: implicit declaration of function `fopen'
dhcp-helper.c:320: warning: implicit declaration of function `getpid'
dhcp-helper.c:321: warning: implicit declaration of function `fclose'
dhcp-helper.c:328: warning: implicit declaration of function `close'
dhcp-helper.c:332: warning: implicit declaration of function `setgroups'
dhcp-helper.c:332: error: `dummy' undeclared (first use in this function)
dhcp-helper.c:334: warning: implicit declaration of function `getgrgid'
dhcp-helper.c:334: error: dereferencing pointer to incomplete type
dhcp-helper.c:334: warning: assignment makes pointer from integer without a cast
dhcp-helper.c:335: warning: implicit declaration of function `setgid'
dhcp-helper.c:335: error: dereferencing pointer to incomplete type
dhcp-helper.c:336: warning: implicit declaration of function `setuid'
dhcp-helper.c:336: error: dereferencing pointer to incomplete type
dhcp-helper.c:348: error: storage size of 'iface_addr' isn't known
dhcp-helper.c:350: error: `ssize_t' undeclared (first use in this function)
dhcp-helper.c:350: error: syntax error before "sz"
dhcp-helper.c:351: error: storage size of 'msg' isn't known
dhcp-helper.c:352: error: storage size of 'iov' isn't known
dhcp-helper.c:356: error: field `align' has incomplete type
dhcp-helper.c:357: warning: implicit declaration of function `CMSG_SPACE'
dhcp-helper.c:357: error: invalid application of `sizeof' to incomplete type `in_pktinfo'
dhcp-helper.c:371: error: syntax error before "newsz"
dhcp-helper.c:374: error: `sz' undeclared (first use in this function)
dhcp-helper.c:374: warning: implicit declaration of function `recvmsg'
dhcp-helper.c:374: error: `MSG_PEEK' undeclared (first use in this function)
dhcp-helper.c:374: error: `EINTR' undeclared (first use in this function)
dhcp-helper.c:376: error: `MSG_TRUNC' undeclared (first use in this function)
dhcp-helper.c:377: warning: implicit declaration of function `realloc'
dhcp-helper.c:377: error: `newsz' undeclared (first use in this function)
dhcp-helper.c:377: warning: assignment makes pointer from integer without a cast
dhcp-helper.c:388: error: invalid application of `sizeof' to incomplete type `cmsghdr'
dhcp-helper.c:392: warning: implicit declaration of function `CMSG_FIRSTHDR'
dhcp-helper.c:392: warning: assignment makes pointer from integer without a cast
dhcp-helper.c:392: warning: implicit declaration of function `CMSG_NXTHDR'
dhcp-helper.c:392: warning: assignment makes pointer from integer without a cast
dhcp-helper.c:393: error: dereferencing pointer to incomplete type
dhcp-helper.c:393: error: dereferencing pointer to incomplete type
dhcp-helper.c:394: warning: implicit declaration of function `CMSG_DATA'
dhcp-helper.c:394: error: dereferencing pointer to incomplete type
dhcp-helper.c:396: error: `SIOCGIFNAME' undeclared (first use in this function)
dhcp-helper.c:400: error: `SIOCGIFADDR' undeclared (first use in this function)
dhcp-helper.c:420: warning: implicit declaration of function `strncmp'
dhcp-helper.c:464: error: `SIOCGIFBRDADDR' undeclared (first use in this function)
dhcp-helper.c:472: warning: implicit declaration of function `sendto'
dhcp-helper.c:512: warning: implicit declaration of function `ntohs'
dhcp-helper.c:517: warning: assignment makes pointer from integer without a cast
dhcp-helper.c:518: error: `INADDR_BROADCAST' undeclared (first use in this function)
dhcp-helper.c:520: error: dereferencing pointer to incomplete type
dhcp-helper.c:521: error: dereferencing pointer to incomplete type
dhcp-helper.c:522: error: dereferencing pointer to incomplete type
dhcp-helper.c:522: warning: implicit declaration of function `CMSG_LEN'
dhcp-helper.c:522: error: invalid application of `sizeof' to incomplete type `in_pktinfo'
dhcp-helper.c:523: error: dereferencing pointer to incomplete type
dhcp-helper.c:524: error: dereferencing pointer to incomplete type
dhcp-helper.c:534: error: storage size of 'req' isn't known
dhcp-helper.c:537: warning: implicit declaration of function `memcpy'
dhcp-helper.c:539: error: `ATF_COM' undeclared (first use in this function)
dhcp-helper.c:540: error: `SIOCSARP' undeclared (first use in this function)
dhcp-helper.c:534: warning: unused variable `req'
dhcp-helper.c:544: warning: implicit declaration of function `sendmsg'
dhcp-helper.c:348: warning: unused variable `iface_addr'
dhcp-helper.c:351: warning: unused variable `msg'
dhcp-helper.c:352: warning: unused variable `iov'
dhcp-helper.c:91: warning: unused variable `ifr'
dhcp-helper.c:92: warning: unused variable `saddr'
make: *** [all] Error 1
Can someone with more experience with compiling for Freetz help?