OSSP CVS Repository

ossp - Check-in [5214]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 5214
Date: 2005-Oct-03 10:00:16 (local)
2005-Oct-03 08:00:16 (UTC)
User:rse
Branch:
Comment: Imported OSSP sa 1.2.5
Tickets:
Inspections:
Files:
ossp-pkg/l2/ChangeLog      1.28 -> 1.29     3 inserted, 0 deleted
ossp-pkg/l2/l2_ut_sa.c      1.27 -> 1.28     11 inserted, 9 deleted
ossp-pkg/l2/l2_ut_sa.h      1.24 -> 1.25     8 inserted, 8 deleted

ossp-pkg/l2/ChangeLog 1.28 -> 1.29

--- ChangeLog    2005/10/03 07:58:34     1.28
+++ ChangeLog    2005/10/03 08:00:16     1.29
@@ -15,6 +15,9 @@
        GNU libtool 1.5.20.
        [Ralf S. Engelschall <rse@engelschall.com>]
 
+    *) Imported OSSP sa 1.2.5
+       [Ralf S. Engelschall <rse@engelschall.com>]
+
   Changes between 0.9.9 and 0.9.10 (01-Feb-2005 to 18-Feb-2005)
 
     *) Synchronize l2_ut_format.[ch] with OSSP cfg and especially


ossp-pkg/l2/l2_ut_sa.c 1.27 -> 1.28

--- l2_ut_sa.c   2005/02/02 12:26:44     1.27
+++ l2_ut_sa.c   2005/10/03 08:00:16     1.28
@@ -267,14 +267,16 @@
            and for IPv6 inet_pton(3) would exist anyway */
         if (inet_aton(strptr, &in_val) == 0)
             return 0;
+        memcpy(addrptr, &in_val, sizeof(struct in_addr));
+        return 1;
 #elif defined(HAVE_INET_ADDR)
         /* at least for IPv4 try to rely on the even older inet_addr(3) */
         memset(&in_val, '\0', sizeof(in_val));
         if ((in_val.s_addr = inet_addr(strptr)) == ((in_addr_t)-1))
             return 0;
-#endif
         memcpy(addrptr, &in_val, sizeof(struct in_addr));
         return 1;
+#endif
     }
     errno = EAFNOSUPPORT;
     return 0;
@@ -732,7 +734,7 @@
 }
 
 /* export address object into URI */
-sa_rc_t sa_addr_a2u(sa_addr_t *saa, char **uri)
+sa_rc_t sa_addr_a2u(const sa_addr_t *saa, char **uri)
 {
     char uribuf[1024];
     struct sockaddr_un *un;
@@ -793,7 +795,7 @@
 }
 
 /* export address object into "struct sockaddr" */
-sa_rc_t sa_addr_a2s(sa_addr_t *saa, struct sockaddr **sabuf, socklen_t *salen)
+sa_rc_t sa_addr_a2s(const sa_addr_t *saa, struct sockaddr **sabuf, socklen_t *salen)
 {
     /* argument sanity check(s) */
     if (saa == NULL || sabuf == NULL || salen == 0)
@@ -808,7 +810,7 @@
     return SA_OK;
 }
 
-sa_rc_t sa_addr_match(sa_addr_t *saa1, sa_addr_t *saa2, int prefixlen)
+sa_rc_t sa_addr_match(const sa_addr_t *saa1, const sa_addr_t *saa2, int prefixlen)
 {
     const unsigned char *ucp1, *ucp2;
     unsigned int uc1, uc2, mask;
@@ -934,7 +936,7 @@
 }
 
 /* set timeouts if timeouts or done in kernel */
-static sa_rc_t sa_socket_settimeouts(sa_t *sa)
+static sa_rc_t sa_socket_settimeouts(const sa_t *sa)
 {
     /* stop processing if socket is still not allocated */
     if (sa->fdSocket == -1)
@@ -1222,7 +1224,7 @@
 
     /* kill underlying socket if type changes */
     if (sa->eType != type)
-        sa_socket_kill(sa);
+        (void)sa_socket_kill(sa);
 
     /* set new type */
     sa->eType = type;
@@ -1421,7 +1423,7 @@
 }
 
 /* bind socket to a local address */
-sa_rc_t sa_bind(sa_t *sa, sa_addr_t *laddr)
+sa_rc_t sa_bind(sa_t *sa, const sa_addr_t *laddr)
 {
     sa_rc_t rv;
     struct sockaddr_un *un;
@@ -1449,7 +1451,7 @@
 }
 
 /* connect socket to a remote address */
-sa_rc_t sa_connect(sa_t *sa, sa_addr_t *raddr)
+sa_rc_t sa_connect(sa_t *sa, const sa_addr_t *raddr)
 {
     int flags, n, error;
     fd_set rset, wset;
@@ -2131,7 +2133,7 @@
 }
 
 /* shutdown a socket connection */
-sa_rc_t sa_shutdown(sa_t *sa, char *flags)
+sa_rc_t sa_shutdown(sa_t *sa, const char *flags)
 {
     int how;
 


ossp-pkg/l2/l2_ut_sa.h 1.24 -> 1.25

--- l2_ut_sa.h   2005/02/02 12:26:44     1.24
+++ l2_ut_sa.h   2005/10/03 08:00:16     1.25
@@ -169,11 +169,11 @@
 extern sa_rc_t sa_addr_destroy (sa_addr_t  *__saa);
 
 /* address operations */
-extern sa_rc_t sa_addr_u2a     (sa_addr_t  *__saa, const char *__uri, ...);
-extern sa_rc_t sa_addr_s2a     (sa_addr_t  *__saa, const struct sockaddr *__sabuf, socklen_t __salen);
-extern sa_rc_t sa_addr_a2u     (sa_addr_t  *__saa, char **__uri);
-extern sa_rc_t sa_addr_a2s     (sa_addr_t  *__saa, struct sockaddr **__sabuf, socklen_t *__salen);
-extern sa_rc_t sa_addr_match   (sa_addr_t  *__saa1, sa_addr_t *__saa2, int __prefixlen);
+extern sa_rc_t sa_addr_u2a     (sa_addr_t       *__saa, const char *__uri, ...);
+extern sa_rc_t sa_addr_s2a     (sa_addr_t       *__saa, const struct sockaddr *__sabuf, socklen_t __salen);
+extern sa_rc_t sa_addr_a2u     (const sa_addr_t *__saa, char **__uri);
+extern sa_rc_t sa_addr_a2s     (const sa_addr_t *__saa, struct sockaddr **__sabuf, socklen_t *__salen);
+extern sa_rc_t sa_addr_match   (const sa_addr_t *__saa1, const sa_addr_t *__saa2, int __prefixlen);
 
 /* socket object operations */
 extern sa_rc_t sa_create       (sa_t **__sa);
@@ -187,14 +187,14 @@
 extern sa_rc_t sa_syscall      (sa_t  *__sa, sa_syscall_t __id, void (*__fptr)(void), void *__fctx);
 
 /* socket connection operations */
-extern sa_rc_t sa_bind         (sa_t  *__sa, sa_addr_t  *__laddr);
-extern sa_rc_t sa_connect      (sa_t  *__sa, sa_addr_t  *__raddr);
+extern sa_rc_t sa_bind         (sa_t  *__sa, const sa_addr_t *__laddr);
+extern sa_rc_t sa_connect      (sa_t  *__sa, const sa_addr_t *__raddr);
 extern sa_rc_t sa_listen       (sa_t  *__sa, int __backlog);
 extern sa_rc_t sa_accept       (sa_t  *__sa, sa_addr_t **__caddr, sa_t **__csa);
 extern sa_rc_t sa_getremote    (sa_t  *__sa, sa_addr_t **__raddr);
 extern sa_rc_t sa_getlocal     (sa_t  *__sa, sa_addr_t **__laddr);
 extern sa_rc_t sa_getfd        (sa_t  *__sa, int *__fd);
-extern sa_rc_t sa_shutdown     (sa_t  *__sa, char *__flags);
+extern sa_rc_t sa_shutdown     (sa_t  *__sa, const char *__flags);
 
 /* socket input/output operations (stream communication) */
 extern sa_rc_t sa_read         (sa_t  *__sa, char       *__buf, size_t __buflen, size_t *__bufdone);

CVSTrac 2.0.1