epoc32/include/stdapis/sys/socket.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // © Portions copyright (c) 2006 Nokia Corporation.  All rights reserved.
     1 
     2 
     2 
     3 /*-
     3 /*-
     4  * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
     4  * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
     5  *	The Regents of the University of California.  All rights reserved.
     5  *	The Regents of the University of California.  All rights reserved.
     6  * © Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
       
     7  * Redistribution and use in source and binary forms, with or without
     6  * Redistribution and use in source and binary forms, with or without
     8  * modification, are permitted provided that the following conditions
     7  * modification, are permitted provided that the following conditions
     9  * are met:
     8  * are met:
    10  * 1. Redistributions of source code must retain the above copyright
     9  * 1. Redistributions of source code must retain the above copyright
    11  *    notice, this list of conditions and the following disclaimer.
    10  *    notice, this list of conditions and the following disclaimer.
    25  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    26  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    28  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    29  * SUCH DAMAGE.
    28  * SUCH DAMAGE.
    30  *
    29  * Portions Copyright (c) 2006-2007  Nokia Corporation and/or its subsidiary(-ies).  All rights reserved.
    31  *	@(#)socket.h	8.4 (Berkeley) 2/21/94
    30  *	@(#)socket.h	8.4 (Berkeley) 2/21/94
    32  * $FreeBSD: src/sys/sys/socket.h,v 1.88.2.1 2005/09/27 21:14:10 rwatson Exp $
    31  * $FreeBSD: src/sys/sys/socket.h,v 1.88.2.1 2005/09/27 21:14:10 rwatson Exp $
    33  */
    32  */
    34 
    33 
    35 #ifndef _SYS_SOCKET_H_
    34 #ifndef _SYS_SOCKET_H_
    38 #include <sys/cdefs.h>
    37 #include <sys/cdefs.h>
    39 #include <sys/types.h>
    38 #include <sys/types.h>
    40 #include <sys/_types.h>
    39 #include <sys/_types.h>
    41 #include <sys/_iovec.h>
    40 #include <sys/_iovec.h>
    42 #define _NO_NAMESPACE_POLLUTION
    41 #define _NO_NAMESPACE_POLLUTION
    43 #include <machine/param.h>
    42 #include <stdapis/machine/param.h>
    44 #undef _NO_NAMESPACE_POLLUTION
    43 #undef _NO_NAMESPACE_POLLUTION
    45 
    44 
    46 /*
    45 /*
    47  * Definitions related to sockets: types, address families, options.
    46  * Definitions related to sockets: types, address families, options.
    48  */
    47  */
   315 #endif
   314 #endif
   316 
   315 
   317 /*
   316 /*
   318  * RFC 2553: protocol-independent placeholder for socket addresses
   317  * RFC 2553: protocol-independent placeholder for socket addresses
   319  */
   318  */
       
   319 #ifndef __SYMBIAN32__
   320 #define	_SS_MAXSIZE	128U
   320 #define	_SS_MAXSIZE	128U
   321 #define	_SS_ALIGNSIZE	(sizeof(__int64_t))
   321 #define	_SS_ALIGNSIZE	(sizeof(__int64_t))
   322 #define	_SS_PAD1SIZE	(_SS_ALIGNSIZE - sizeof(unsigned char) - \
   322 #define	_SS_PAD1SIZE	(_SS_ALIGNSIZE - sizeof(unsigned char) - \
   323 			    sizeof(sa_family_t))
   323 			    sizeof(sa_family_t))
   324 #define	_SS_PAD2SIZE	(_SS_MAXSIZE - sizeof(unsigned char) - \
   324 #define	_SS_PAD2SIZE	(_SS_MAXSIZE - sizeof(unsigned char) - \
   329 	sa_family_t	ss_family;	/* address family */
   329 	sa_family_t	ss_family;	/* address family */
   330 	char		__ss_pad1[_SS_PAD1SIZE];
   330 	char		__ss_pad1[_SS_PAD1SIZE];
   331 	__int64_t	__ss_align;	/* force desired struct alignment */
   331 	__int64_t	__ss_align;	/* force desired struct alignment */
   332 	char		__ss_pad2[_SS_PAD2SIZE];
   332 	char		__ss_pad2[_SS_PAD2SIZE];
   333 };
   333 };
   334 
   334 #else
       
   335 #define _SS_MAXSIZE 128U
       
   336 #define _SS_ALIGNSIZE   (sizeof(__int64_t))
       
   337 #define _SS_PAD1SIZE    (_SS_ALIGNSIZE - sizeof(u_short))
       
   338 #define _SS_PAD2SIZE    (_SS_MAXSIZE -  sizeof(u_short) - _SS_PAD1SIZE - _SS_ALIGNSIZE)
       
   339 
       
   340 struct sockaddr_storage {
       
   341     u_short ss_family;  /* address family */
       
   342     char        __ss_pad1[_SS_PAD1SIZE];
       
   343     __int64_t   __ss_align; /* force desired struct alignment */
       
   344     char        __ss_pad2[_SS_PAD2SIZE];
       
   345 };
       
   346 #endif
   335 #if __BSD_VISIBLE
   347 #if __BSD_VISIBLE
   336 /*
   348 /*
   337  * Protocol families, same as address families for now.
   349  * Protocol families, same as address families for now.
   338  */
   350  */
   339 #define	PF_UNSPEC	AF_UNSPEC
   351 #define	PF_UNSPEC	AF_UNSPEC