Revision: 14922
Author:   adrian.chadd
Date:     Thu Jul 14 08:24:32 2011
Log: Add a method which copies an sqaddr_t to the given sockaddr_storage.

http://code.google.com/p/lusca-cache/source/detail?r=14922

Modified:
 /playpen/LUSCA_HEAD_ipv6/libsqinet/sqinet.c
 /playpen/LUSCA_HEAD_ipv6/libsqinet/sqinet.h

=======================================
--- /playpen/LUSCA_HEAD_ipv6/libsqinet/sqinet.c Sat Jul  9 02:03:39 2011
+++ /playpen/LUSCA_HEAD_ipv6/libsqinet/sqinet.c Thu Jul 14 08:24:32 2011
@@ -754,6 +754,13 @@
        }
        return 0;
 }
+
+void
+sqinet_copy_tosockaddr(const sqaddr_t *s, struct sockaddr_storage *dst)
+{
+       assert(s->init);
+       memcpy(dst, &s->st, MIN(sizeof(*dst), sizeof(s->st)));
+}

 /*!
  * @function
=======================================
--- /playpen/LUSCA_HEAD_ipv6/libsqinet/sqinet.h Fri Jul  8 21:53:17 2011
+++ /playpen/LUSCA_HEAD_ipv6/libsqinet/sqinet.h Thu Jul 14 08:24:32 2011
@@ -48,6 +48,8 @@
extern int sqinet_ntoa(const sqaddr_t *s, char *hoststr, int hostlen, sqaddr_flags flags); extern int sqinet_aton(sqaddr_t *s, const char *hoststr, sqaton_flags flags);
 extern int sqinet_assemble_rev(const sqaddr_t *s, char *buf, int len);
+extern void sqinet_copy_tosockaddr(const sqaddr_t *s,
+  struct sockaddr_storage *dst);

static inline struct sockaddr * sqinet_get_entry(sqaddr_t *s) { return (struct sockaddr *) &(s->st); } static inline const struct sockaddr * sqinet_get_entry_ro(const sqaddr_t *s) { return (struct sockaddr *) &(s->st); }

--
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.

Reply via email to