diff --git a/source/enet/configure b/source/enet/configure index 8064071a..d2512f04 100755 --- a/source/enet/configure +++ b/source/enet/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60a for libenet 10-31-2006. +# Generated by GNU Autoconf 2.60a for libenet 12-12-2006. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -557,8 +557,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='libenet' PACKAGE_TARNAME='libenet' -PACKAGE_VERSION='10-31-2006' -PACKAGE_STRING='libenet 10-31-2006' +PACKAGE_VERSION='12-12-2006' +PACKAGE_STRING='libenet 12-12-2006' PACKAGE_BUGREPORT='' ac_subst_vars='SHELL @@ -1152,7 +1152,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libenet 10-31-2006 to adapt to many kinds of systems. +\`configure' configures libenet 12-12-2006 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1218,7 +1218,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libenet 10-31-2006:";; + short | recursive ) echo "Configuration of libenet 12-12-2006:";; esac cat <<\_ACEOF @@ -1301,7 +1301,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libenet configure 10-31-2006 +libenet configure 12-12-2006 generated by GNU Autoconf 2.60a Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1315,7 +1315,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libenet $as_me 10-31-2006, which was +It was created by libenet $as_me 12-12-2006, which was generated by GNU Autoconf 2.60a. Invocation command line was $ $0 $@ @@ -1985,7 +1985,7 @@ fi # Define the identity of the package. PACKAGE=libenet.a - VERSION=10-31-2006 + VERSION=12-12-2006 cat >>confdefs.h <<_ACEOF @@ -5159,7 +5159,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libenet $as_me 10-31-2006, which was +This file was extended by libenet $as_me 12-12-2006, which was generated by GNU Autoconf 2.60a. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5206,7 +5206,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -libenet config.status 10-31-2006 +libenet config.status 12-12-2006 configured by $0, generated by GNU Autoconf 2.60a, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/source/enet/configure.in b/source/enet/configure.in index 17580895..8a67c058 100755 --- a/source/enet/configure.in +++ b/source/enet/configure.in @@ -1,5 +1,5 @@ -AC_INIT(libenet, 10-31-2006) -AM_INIT_AUTOMAKE(libenet.a, 10-31-2006) +AC_INIT(libenet, 12-12-2006) +AM_INIT_AUTOMAKE(libenet.a, 12-12-2006) AC_PROG_CC AC_PROG_RANLIB diff --git a/source/enet/include/enet/enet.h b/source/enet/include/enet/enet.h index 5901448b..03a8f29e 100755 --- a/source/enet/include/enet/enet.h +++ b/source/enet/include/enet/enet.h @@ -396,7 +396,17 @@ ENET_API void enet_socket_destroy (ENetSocket); */ ENET_API int enet_address_set_host (ENetAddress * address, const char * hostName); -/** Attempts to do a reserve lookup of the host field in the address parameter. +/** Gives the printable form of the ip address specified in the address parameter. + @param address address printed + @param hostName destination for name, must not be NULL + @param nameLength maximum length of hostName. + @returns the null-terminated name of the host in hostName on success + @retval 0 on success + @retval < 0 on failure +*/ +ENET_API int enet_address_get_host_ip (const ENetAddress * address, char * hostName, size_t nameLength); + +/** Attempts to do a reverse lookup of the host field in the address parameter. @param address address used for reverse lookup @param hostName destination for name, must not be NULL @param nameLength maximum length of hostName. diff --git a/source/enet/peer.c b/source/enet/peer.c index cab62453..50df7740 100755 --- a/source/enet/peer.c +++ b/source/enet/peer.c @@ -200,7 +200,7 @@ enet_peer_receive (ENetPeer * peer, enet_uint8 channelID) incomingCommand = (ENetIncomingCommand *) enet_list_front (& channel -> incomingReliableCommands); if (incomingCommand -> fragmentsRemaining > 0 || - incomingCommand -> reliableSequenceNumber != channel -> incomingReliableSequenceNumber + 1) + incomingCommand -> reliableSequenceNumber != (enet_uint16) (channel -> incomingReliableSequenceNumber + 1)) return NULL; channel -> incomingReliableSequenceNumber = incomingCommand -> reliableSequenceNumber; diff --git a/source/enet/unix.c b/source/enet/unix.c index 75385a83..b0e6ee28 100755 --- a/source/enet/unix.c +++ b/source/enet/unix.c @@ -106,6 +106,21 @@ enet_address_set_host (ENetAddress * address, const char * name) return 0; } +int +enet_address_get_host_ip (const ENetAddress * address, char * name, size_t nameLength) +{ +#ifdef HAS_INET_NTOP + if (inet_ntop (AF_INET, & address -> host, name, nameLength) == NULL) +#else + char * addr = inet_ntoa (* (struct in_addr *) & address -> host); + if (addr != NULL) + strncpy (name, addr, nameLength); + else +#endif + return -1; + return 0; +} + int enet_address_get_host (const ENetAddress * address, char * name, size_t nameLength) { @@ -130,18 +145,7 @@ enet_address_get_host (const ENetAddress * address, char * name, size_t nameLeng #endif if (hostEntry == NULL) - { -#ifdef HAS_INET_NTOP - if (inet_ntop (AF_INET, & address -> host, name, nameLength) == NULL) -#else - char * addr = inet_ntoa (* (struct in_addr *) & address -> host); - if (addr != NULL) - strncpy (name, addr, nameLength); - else -#endif - return -1; - return 0; - } + return enet_address_get_host_ip (address, name, nameLength); strncpy (name, hostEntry -> h_name, nameLength); diff --git a/source/enet/win32.c b/source/enet/win32.c index 8fdd7468..5fde10d3 100755 --- a/source/enet/win32.c +++ b/source/enet/win32.c @@ -73,6 +73,16 @@ enet_address_set_host (ENetAddress * address, const char * name) return 0; } +int +enet_address_get_host_ip (const ENetAddress * address, char * name, size_t nameLength) +{ + char * addr = inet_ntoa (* (struct in_addr *) & address -> host); + if (addr == NULL) + return -1; + strncpy (name, addr, nameLength); + return 0; +} + int enet_address_get_host (const ENetAddress * address, char * name, size_t nameLength) { @@ -83,13 +93,7 @@ enet_address_get_host (const ENetAddress * address, char * name, size_t nameLeng hostEntry = gethostbyaddr ((char *) & in, sizeof (struct in_addr), AF_INET); if (hostEntry == NULL) - { - char * addr = inet_ntoa (* (struct in_addr *) & address -> host); - if (addr == NULL) - return -1; - strncpy (name, addr, nameLength); - return 0; - } + return enet_address_get_host_ip (address, name, nameLength); strncpy (name, hostEntry -> h_name, nameLength);