diff options
author | Ken Raeburn <raeburn@mit.edu> | 2001-04-26 03:47:29 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2001-04-26 03:47:29 +0000 |
commit | d17088294e7ff5af099bf5f8336db259ac25cf45 (patch) | |
tree | 4aa73ae81bb774ee13a8d5f2abde5565b1c793e4 /src/include/k5-int.h | |
parent | 9ea22ba225059c4c1cfabf073338273c3e88bb7e (diff) | |
download | krb5-d17088294e7ff5af099bf5f8336db259ac25cf45.zip krb5-d17088294e7ff5af099bf5f8336db259ac25cf45.tar.gz krb5-d17088294e7ff5af099bf5f8336db259ac25cf45.tar.bz2 |
move socklen_t, socklen handling from krb5 library to include/k5-int.h
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13195 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include/k5-int.h')
-rw-r--r-- | src/include/k5-int.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/include/k5-int.h b/src/include/k5-int.h index d2976a4..fa1ffd4 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -203,6 +203,28 @@ typedef unsigned char u_char; #ifdef NEED_SOCKETS #include "port-sockets.h" + +/* Either size_t or int or unsigned int is probably right. Under + SunOS 4, it looks like int is desired, according to the accept man + page. */ +#ifndef HAVE_SOCKLEN_T +typedef int socklen_t; +#endif + +#if !defined (socklen) +/* size_t socklen (struct sockaddr *) */ +/* Should this return socklen_t instead? */ +# ifdef HAVE_SA_LEN +# define socklen(X) ((X)->sa_len) +# else +# ifdef KRB5_USE_INET6 +# define socklen(X) ((X)->sa_family == AF_INET6 ? sizeof (struct sockaddr_in6) : (X)->sa_family == AF_INET ? sizeof (struct sockaddr_in) : sizeof (struct sockaddr)) +# else +# define socklen(X) ((X)->sa_family == AF_INET ? sizeof (struct sockaddr_in) : sizeof (struct sockaddr)) +# endif +# endif +#endif + #else #ifndef SOCK_DGRAM struct sockaddr; |