socket functions use socklen_t, patch from floriZ.Also set/getsockopt use void * instead of char * as fourth arg

This commit is contained in:
jani 2003-03-03 10:29:21 +00:00
parent ee2c049518
commit eb1a41f3c9
2 changed files with 19 additions and 19 deletions

View File

@ -152,7 +152,7 @@ alloc_socket(struct netconn *newconn)
}
/*-----------------------------------------------------------------------------------*/
int
lwip_accept(int s, struct sockaddr *addr, int *addrlen)
lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
{
struct lwip_socket *sock;
struct netconn *newconn;
@ -208,7 +208,7 @@ lwip_accept(int s, struct sockaddr *addr, int *addrlen)
}
/*-----------------------------------------------------------------------------------*/
int
lwip_bind(int s, struct sockaddr *name, int namelen)
lwip_bind(int s, struct sockaddr *name, socklen_t namelen)
{
struct lwip_socket *sock;
struct ip_addr local_addr;
@ -273,7 +273,7 @@ lwip_close(int s)
}
/*-----------------------------------------------------------------------------------*/
int
lwip_connect(int s, struct sockaddr *name, int namelen)
lwip_connect(int s, struct sockaddr *name, socklen_t namelen)
{
struct lwip_socket *sock;
err_t err;
@ -339,7 +339,7 @@ lwip_listen(int s, int backlog)
/*-----------------------------------------------------------------------------------*/
int
lwip_recvfrom(int s, void *mem, int len, unsigned int flags,
struct sockaddr *from, int *fromlen)
struct sockaddr *from, socklen_t *fromlen)
{
struct lwip_socket *sock;
struct netbuf *buf;
@ -512,7 +512,7 @@ lwip_send(int s, void *data, int size, unsigned int flags)
/*-----------------------------------------------------------------------------------*/
int
lwip_sendto(int s, void *data, int size, unsigned int flags,
struct sockaddr *to, int tolen)
struct sockaddr *to, socklen_t tolen)
{
struct lwip_socket *sock;
struct ip_addr remote_addr, addr;
@ -881,7 +881,7 @@ int lwip_shutdown(int s, int how)
return lwip_close(s); /* XXX temporary hack until proper implementation */
}
int lwip_getpeername (int s, struct sockaddr *name, int *namelen)
int lwip_getpeername (int s, struct sockaddr *name, socklen_t *namelen)
{
struct lwip_socket *sock;
struct sockaddr_in sin;
@ -916,7 +916,7 @@ int lwip_getpeername (int s, struct sockaddr *name, int *namelen)
return 0;
}
int lwip_getsockname (int s, struct sockaddr *name, int *namelen)
int lwip_getsockname (int s, struct sockaddr *name, socklen_t *namelen)
{
struct lwip_socket *sock;
struct sockaddr_in sin;
@ -951,7 +951,7 @@ int lwip_getsockname (int s, struct sockaddr *name, int *namelen)
return 0;
}
int lwip_getsockopt (int s, int level, int optname, char *optval, int *optlen)
int lwip_getsockopt (int s, int level, int optname, void *optval, socklen_t *optlen)
{
int err = ENOSYS;
struct lwip_socket *sock = get_socket(s);
@ -983,7 +983,7 @@ int lwip_getsockopt (int s, int level, int optname, char *optval, int *optlen)
return err ? -1 : 0;
}
int lwip_setsockopt (int s, int level, int optname, const char *optval, int optlen)
int lwip_setsockopt (int s, int level, int optname, const void *optval, socklen_t optlen)
{
struct lwip_socket *sock = get_socket(s);
int err = ENOSYS;

View File

@ -54,7 +54,7 @@ struct sockaddr {
};
#ifndef socklen_t
#define socklen_t int
# define socklen_t int
#endif
@ -183,23 +183,23 @@ struct linger {
#endif
int lwip_accept(int s, struct sockaddr *addr, int *addrlen);
int lwip_bind(int s, struct sockaddr *name, int namelen);
int lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen);
int lwip_bind(int s, struct sockaddr *name, socklen_t namelen);
int lwip_shutdown(int s, int how);
int lwip_getpeername (int s, struct sockaddr *name, int *namelen);
int lwip_getsockname (int s, struct sockaddr *name, int *namelen);
int lwip_getsockopt (int s, int level, int optname, char *optval, int *optlen);
int lwip_setsockopt (int s, int level, int optname, const char *optval, int optlen);
int lwip_getpeername (int s, struct sockaddr *name, socklen_t *namelen);
int lwip_getsockname (int s, struct sockaddr *name, socklen_t *namelen);
int lwip_getsockopt (int s, int level, int optname, void *optval, socklen_t *optlen);
int lwip_setsockopt (int s, int level, int optname, const void *optval, socklen_t optlen);
int lwip_close(int s);
int lwip_connect(int s, struct sockaddr *name, int namelen);
int lwip_connect(int s, struct sockaddr *name, socklen_t namelen);
int lwip_listen(int s, int backlog);
int lwip_recv(int s, void *mem, int len, unsigned int flags);
int lwip_read(int s, void *mem, int len);
int lwip_recvfrom(int s, void *mem, int len, unsigned int flags,
struct sockaddr *from, int *fromlen);
struct sockaddr *from, socklen_t *fromlen);
int lwip_send(int s, void *dataptr, int size, unsigned int flags);
int lwip_sendto(int s, void *dataptr, int size, unsigned int flags,
struct sockaddr *to, int tolen);
struct sockaddr *to, socklen_t tolen);
int lwip_socket(int domain, int type, int protocol);
int lwip_write(int s, void *dataptr, int size);
int lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset,