comparison src/stun.c @ 11364:e1840eb860e7

[gaim-migrate @ 13588] Make the stun stuff compile on win32. This is largely untested since this code will not currently ever be called, but it compiles. This is based on a patch from Fran?ois Gagn?." committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Tue, 30 Aug 2005 00:32:32 +0000
parents 97028c1c69e9
children 6e02e20e3a58
comparison
equal deleted inserted replaced
11363:78615ddd09ef 11364:e1840eb860e7
24 * along with this program; if not, write to the Free Software 24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 * 26 *
27 */ 27 */
28 28
29 #ifndef _WIN32
29 #include <sys/socket.h> 30 #include <sys/socket.h>
30 #include <ifaddrs.h> 31 #include <ifaddrs.h>
31 #include <net/if.h> 32 #include <net/if.h>
32 #include <sys/ioctl.h> 33 #include <sys/ioctl.h>
33 #include <resolv.h> 34 #include <resolv.h>
35 #else
36 #include "libc_interface.h"
37 #endif
34 38
35 #include "internal.h" 39 #include "internal.h"
36 40
37 #include "debug.h" 41 #include "debug.h"
38 #include "account.h" 42 #include "account.h"
139 ioctl(source, SIOCGIFCONF, &ifc); 143 ioctl(source, SIOCGIFCONF, &ifc);
140 144
141 tmp = buffer; 145 tmp = buffer;
142 while(tmp < buffer + ifc.ifc_len) { 146 while(tmp < buffer + ifc.ifc_len) {
143 ifr = (struct ifreq *) tmp; 147 ifr = (struct ifreq *) tmp;
144 len = sizeof(struct sockaddr); 148
145 149 tmp += sizeof(struct ifreq);
146 tmp += sizeof(ifr->ifr_name) + len;
147 150
148 if(ifr->ifr_addr.sa_family == AF_INET) { 151 if(ifr->ifr_addr.sa_family == AF_INET) {
149 // we only care about ipv4 interfaces 152 // we only care about ipv4 interfaces
150 sinptr = (struct sockaddr_in *) &ifr->ifr_addr; 153 sinptr = (struct sockaddr_in *) &ifr->ifr_addr;
151 if(sinptr->sin_addr.s_addr == in.s_addr) { 154 if(sinptr->sin_addr.s_addr == in.s_addr) {