# HG changeset patch # User Richard Laager # Date 1178407167 0 # Node ID 2be397cd726a332bf787bf83676c24d5ab0c1f29 # Parent d0e74d0be43fe13ba24d4919482f4ab66705cfac# Parent 0dcd915899aedbc533c70991514ed2c52a6f0727 merge of '43641085a7c20c6fca287f571d7662bf3c916f21' and '75611b054205d4ba63f10e5daaba999f3be4e363' diff -r 0dcd915899ae -r 2be397cd726a configure.ac --- a/configure.ac Sat May 05 23:08:20 2007 +0000 +++ b/configure.ac Sat May 05 23:19:27 2007 +0000 @@ -1922,6 +1922,7 @@ AC_CHECK_HEADERS(sys/file.h sys/filio.h sys/ioctl.h sys/msgbuf.h) AC_CHECK_HEADERS(sys/select.h sys/uio.h sys/utsname.h sys/wait.h) AC_CHECK_HEADERS(termios.h) +AC_CHECK_HEADERS(sys/sysctl.h sys/socket.h) AC_VAR_TIMEZONE_EXTERNALS AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff, diff -r 0dcd915899ae -r 2be397cd726a libpurple/nat-pmp.c --- a/libpurple/nat-pmp.c Sat May 05 23:08:20 2007 +0000 +++ b/libpurple/nat-pmp.c Sat May 05 23:19:27 2007 +0000 @@ -29,64 +29,58 @@ */ #include "nat-pmp.h" +#include "internal.h" #include "debug.h" #include "signals.h" #include "network.h" -#include -#ifndef _WIN32 -#include -#include -#include +#ifdef HAVE_SYS_SYSCTL_H #include - -#include -#include - -#include -#include #endif -#include -#include -#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif -#include +/* We will need sysctl() and NET_RT_DUMP, both of which are not present + * on all platforms, to continue. */ +#if defined(HAVE_SYS_SYSCTL_H) && defined(NET_RT_DUMP) -#ifdef NET_RT_DUMP +#include +#include #define PMP_DEBUG 1 typedef struct { - uint8_t version; - uint8_t opcode; + guint8 version; + guint8 opcode; } PurplePmpIpRequest; typedef struct { - uint8_t version; - uint8_t opcode; /* 128 + n */ - uint16_t resultcode; - uint32_t epoch; - uint32_t address; + guint8 version; + guint8 opcode; /* 128 + n */ + guint16 resultcode; + guint32 epoch; + guint32 address; } PurplePmpIpResponse; typedef struct { - uint8_t version; - uint8_t opcode; + guint8 version; + guint8 opcode; char reserved[2]; - uint16_t privateport; - uint16_t publicport; - uint32_t lifetime; + guint16 privateport; + guint16 publicport; + guint32 lifetime; } PurplePmpMapRequest; struct _PurplePmpMapResponse { - uint8_t version; - uint8_t opcode; - uint16_t resultcode; - uint32_t epoch; - uint16_t privateport; - uint16_t publicport; - uint32_t lifetime; + guint8 version; + guint8 opcode; + guint16 resultcode; + guint32 epoch; + guint16 privateport; + guint16 publicport; + guint32 lifetime; }; typedef struct _PurplePmpMapResponse PurplePmpMapResponse; @@ -549,4 +543,4 @@ { } -#endif /* #ifndef NET_RT_DUMP */ +#endif /* #if !(defined(HAVE_SYS_SYCTL_H) && defined(NET_RT_DUMP)) */ diff -r 0dcd915899ae -r 2be397cd726a libpurple/nat-pmp.h --- a/libpurple/nat-pmp.h Sat May 05 23:08:20 2007 +0000 +++ b/libpurple/nat-pmp.h Sat May 05 23:19:27 2007 +0000 @@ -31,7 +31,6 @@ #ifndef _PURPLE_NAT_PMP_H #define _PURPLE_NAT_PMP_H -#include #include #define PURPLE_PMP_LIFETIME 3600 /* 3600 seconds */