Revision: 14732
Author: adrian.chadd
Date: Sun Jul 11 15:36:23 2010
Log: Flesh out IPv6-related fqdncache_nbgethostbyaddr6() and
fqdncache_gethostbyaddr6() placeholders.
These will currently always fail on IPv6 related lookups.
http://code.google.com/p/lusca-cache/source/detail?r=14732
Modified:
/playpen/LUSCA_HEAD_ipv6/libsqname/fqdncache.c
/playpen/LUSCA_HEAD_ipv6/libsqname/fqdncache.h
/playpen/LUSCA_HEAD_ipv6/src/client_side.c
=======================================
--- /playpen/LUSCA_HEAD_ipv6/libsqname/fqdncache.c Sun Jul 4 06:56:53 2010
+++ /playpen/LUSCA_HEAD_ipv6/libsqname/fqdncache.c Sun Jul 11 15:36:23 2010
@@ -315,6 +315,23 @@
fqdncacheCallback(f);
}
+#warning fqdncache_nbgethostbyaddr6() needs fleshing out!
+void
+fqdncache_nbgethostbyaddr6(sqaddr_t *addr, FQDNH * handler, void
*handlerData)
+{
+ struct in_addr a;
+
+ if (sqinet_get_family(addr) != AF_INET) {
+ debug(35, 1) ("fqdncache_nbgethostbyaddr: IPv6 not yet
supported!\n");
+ dns_error_message = "IPv6 FQDNcache not yet supported!";
+ handler(NULL, handlerData);
+ return;
+ }
+
+ a = sqinet_get_v4_inaddr(addr, SQADDR_ASSERT_IS_V4);
+ return fqdncache_nbgethostbyaddr(a, handler, handlerData);
+}
+
void
fqdncache_nbgethostbyaddr(struct in_addr addr, FQDNH * handler, void
*handlerData)
{
@@ -383,6 +400,19 @@
fqdn_table = hash_create((HASHCMP *) strcmp, n, hash4);
pool_fqdncache = memPoolCreate("fqdncache_entry",
sizeof(fqdncache_entry));
}
+
+#warning fqdncache_gethostbyaddr6() needs fleshing out!
+const char *
+fqdncache_gethostbyaddr6(sqaddr_t *addr, int flags)
+{
+ struct in_addr a;
+
+ if (sqinet_get_family(addr) != AF_INET)
+ return NULL;
+
+ a = sqinet_get_v4_inaddr(addr, SQADDR_ASSERT_IS_V4);
+ return fqdncache_gethostbyaddr(a, flags);
+}
const char *
fqdncache_gethostbyaddr(struct in_addr addr, int flags)
=======================================
--- /playpen/LUSCA_HEAD_ipv6/libsqname/fqdncache.h Sun Jul 4 06:56:53 2010
+++ /playpen/LUSCA_HEAD_ipv6/libsqname/fqdncache.h Sun Jul 11 15:36:23 2010
@@ -42,7 +42,9 @@
extern FqdncacheStatStruct FqdncacheStats;
extern void fqdncache_nbgethostbyaddr(struct in_addr, FQDNH *, void *);
+extern void fqdncache_nbgethostbyaddr6(sqaddr_t *addr, FQDNH *, void *);
extern const char *fqdncache_gethostbyaddr(struct in_addr, int flags);
+extern const char * fqdncache_gethostbyaddr6(sqaddr_t *addr, int flags);
extern void fqdncache_init(void);
extern void fqdncacheReleaseInvalid(const char *);
extern const char *fqdnFromAddr(struct in_addr);
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/client_side.c Sun Jul 11 02:56:42 2010
+++ /playpen/LUSCA_HEAD_ipv6/src/client_side.c Sun Jul 11 15:36:23 2010
@@ -2586,7 +2586,7 @@
connState->port = s;
cbdataLock(connState->port);
if (Config.onoff.log_fqdn)
- fqdncache_gethostbyaddr(sqinet_get_v4_inaddr(&peer,
SQADDR_ASSERT_IS_V4), FQDN_LOOKUP_IF_MISS);
+ fqdncache_gethostbyaddr6(&peer, FQDN_LOOKUP_IF_MISS);
commSetTimeout(fd, Config.Timeout.request, requestTimeout, connState);
#if USE_IDENT
identChecklist.src_addr = sqinet_get_v4_inaddr(&peer,
SQADDR_ASSERT_IS_V4);
--
You received this message because you are subscribed to the Google Groups
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/lusca-commit?hl=en.