hi, sorry for delay to reply, i was kinda stucked at some other works.
i tried solving errors i mentioned in last post with the help of the hint Everton gave me. so, i added #include <sys/types.h> #include <sys/socket.h> this solved "'AF_INET undeclared" problem. then, i read FreeBSD uses IPPROTO_IP instead of SO_IP, and i was hoping two structures were the same. so i added: #define SOL_IP IPPROTO_IP at the top of pim_igmp_join.c. this solved "'SOL_IP undeclared" problem. but now , new errors appeared. this is what happened: In file included from test_igmpv3_join.c:28: /usr/include/net/if.h:294: error: field 'ifru_addr' has incomplete type /usr/include/net/if.h:295: error: field 'ifru_dstaddr' has incomplete type /usr/include/net/if.h:296: error: field 'ifru_broadaddr' has incomplete type /usr/include/net/if.h:330: error: field 'ifra_addr' has incomplete type /usr/include/net/if.h:331: error: field 'ifra_broadaddr' has incomplete type /usr/include/net/if.h:332: error: field 'ifra_mask' has incomplete type /usr/include/net/if.h:430: error: field 'addr' has incomplete type /usr/include/net/if.h:431: error: field 'dstaddr' has incomplete type *** Error code 1 i worked a while on it but i couldn't find a way to fix this error. i will continue working on it, and i will be glad if anyone helps me. thank you. ________________________________ From: Everton Marques <[email protected]> To: bored to death <[email protected]> Cc: [email protected] Sent: Mon, July 26, 2010 9:19:35 PM Subject: Re: [qpimd-users] qpimd in FreeBSD? Hi, On Mon, Jul 26, 2010 at 12:22 PM, bored to death <[email protected]> wrote: > > thank you for your reply. your hint about trying: "autoreconf -i --force" > after applying the patch solved the errors i mentioned about aclocal and > ..., but sadly during the build process, it ended with a new error. this is > the new error i got; > > pim_igmp_join.c: In function 'pim_igmp_join_source': > pim_igmp_join.c:46: error: 'AF_INET' undeclared (first use in this function) > pim_igmp_join.c:46: error: (Each undeclared identifier is reported only once > pim_igmp_join.c:46: error: for each function it appears in.) > pim_igmp_join.c:57: warning: implicit declaration of function 'setsockopt' > pim_igmp_join.c:57: error: 'SOL_IP' undeclared (first use in this function) > > i will work on solving this error, i think it has something to do with the > included files and libraries in pim code, (maybe some of them should be > replaced with their alternatives in FreeBSD?). Yes, I think you should include the right includes for FreeBSD. Check what "man setsockopt" recommends under FreeBSD. In Linux, "man setsockopt" points out these headers: #include <sys/types.h> #include <sys/socket.h> Then add those headers to the top of the file "pim_igmp_join.c". I think you should also check what is the correct FreeBSD api for joining source-specific multicast grupos. Under Linux, it goes like this: /* This type should be defined somewhere in the system headers. */ struct group_source_req { uint32_t gsr_interface; struct sockaddr_storage gsr_group; struct sockaddr_storage gsr_source; }; struct group_source_req req; setsockopt(fd, SOL_IP, MCAST_JOIN_SOURCE_GROUP, &req, sizeof(req)); Cheers, Everton
