Changeset 204
- Timestamp:
- 08/17/99 23:08:40 (14 years ago)
- Location:
- common/trunk
- Files:
-
- 4 modified
-
MODS (modified) (1 diff)
-
src/inet_ntop.c (modified) (2 diffs)
-
src/inet_pton.c (modified) (2 diffs)
-
src/net_udp.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
common/trunk/MODS
r202 r204 87 87 - Updates to the RTP code from Markus Germeier: time-out and delete sources, 88 88 fix X but in RTP header, add support for sending BYE packets. 89 - Add inet_pton() and inet_ntop() implementations, for those platforms 90 which are missing them. 89 91 90 92 Still to do... -
common/trunk/src/inet_ntop.c
r203 r204 17 17 */ 18 18 19 #if defined(LIBC_SCCS) && !defined(lint) 20 static char rcsid[] = "$Id$"; 21 #endif /* LIBC_SCCS and not lint */ 22 23 #include <sys/param.h> 24 #include <sys/types.h> 25 #include <sys/socket.h> 26 #include <netinet/in.h> 27 #include <arpa/inet.h> 28 #include <string.h> 29 #include <errno.h> 30 #include <stdio.h> 19 #ifdef NEED_INET_NTOP 20 #include "config_unix.h" 21 #include "config_win32.h" 31 22 #include "inet_ntop.h" 32 23 … … 198 189 return (dst); 199 190 } 191 192 #endif 193 -
common/trunk/src/inet_pton.c
r203 r204 17 17 */ 18 18 19 #if defined(LIBC_SCCS) && !defined(lint) 20 static char rcsid[] = "$Id$"; 21 #endif /* LIBC_SCCS and not lint */ 22 23 #include <sys/param.h> 24 #include <sys/types.h> 25 #include <sys/socket.h> 26 #include <netinet/in.h> 27 #include <arpa/inet.h> 28 #include <string.h> 29 #include <errno.h> 19 #ifdef NEED_INET_PTON 20 #include "config_unix.h" 21 #include "config_win32.h" 30 22 #include "inet_pton.h" 31 23 … … 224 216 return (1); 225 217 } 218 219 #endif 220 -
common/trunk/src/net_udp.c
r201 r204 44 44 #include "debug.h" 45 45 #include "memory.h" 46 #include "inet_pton.h" 47 #include "inet_ntop.h" 46 48 #include "net_udp.h" 47 49 … … 175 177 addr->s_addr = inet_addr(name); 176 178 return (addr->s_addr != (in_addr_t) INADDR_NONE); 177 }178 #endif179 180 #ifdef NEED_INET_PTON181 #ifdef NEED_INET_PTON_STATIC182 static183 #endif184 int inet_pton(int family, const char *name, void *addr)185 {186 if (family == AF_INET) {187 struct in_addr in_val;188 189 if (inet_aton(name, &in_val)) {190 memcpy(addr, &in_val, sizeof(struct in_addr));191 return 1;192 }193 return 0;194 #if defined (NEED_INET_PTON) && defined(HAVE_IPv6)195 } else if (family == AF_INET6) {196 return inet6_addr(name, addr);197 #endif198 } else {199 debug_msg("Unknown address family\n");200 return -1;201 }202 179 } 203 180 #endif
