1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 // |
7 // |
8 // Initial Contributors: |
8 // Initial Contributors: |
9 // Nokia Corporation - initial contribution. |
9 // Nokia Corporation - initial contribution. |
10 // |
10 // |
11 // Contributors: |
11 // Contributors: |
12 // |
12 // |
13 // Description: |
13 // Description: |
14 // |
14 // |
15 |
|
16 |
|
17 |
15 |
18 /** |
16 /** |
19 @file |
17 @file |
20 @publishedAll |
18 @publishedAll |
21 @released |
19 @released |
27 #include "_ansi.h" |
25 #include "_ansi.h" |
28 |
26 |
29 #ifdef __cplusplus |
27 #ifdef __cplusplus |
30 extern "C" { |
28 extern "C" { |
31 #endif |
29 #endif |
32 |
30 #include <sys/types.h> |
33 /* |
31 /* |
34 Types - may be extended by individual protocols |
32 Types - may be extended by individual protocols |
35 */ |
33 */ |
36 #define SOCK_STREAM 1 ///< stream socket |
34 #define SOCK_STREAM 1 //< stream socket |
37 #define SOCK_DGRAM 2 ///< datagram socket |
35 #define SOCK_DGRAM 2 //< datagram socket |
38 #define SOCK_SEQPACKET 3 ///< sequenced packet stream |
36 #define SOCK_SEQPACKET 3 //< sequenced packet stream |
39 #define SOCK_RAW 4 ///< raw-protocol interface |
37 #define SOCK_RAW 4 //< raw-protocol interface |
40 |
38 |
41 /* |
39 /* |
42 Options for use with [gs]etsockopt at the socket level. |
40 Options for use with [gs]etsockopt at the socket level. |
43 Note: Symbian OS setsockopt() ignores the options with values <= 0. |
41 Note: Symbian OS setsockopt() ignores the options with values <= 0. |
44 */ |
42 */ |
45 #define SOL_SOCKET 1 ///< options for socket level |
43 #define SOL_SOCKET 1 //< options for socket level |
46 |
44 |
47 #define SO_DEBUG 1 ///< turn on debugging info recording |
45 #define SO_DEBUG 1 //< turn on debugging info recording |
48 #define SO_RCVBUF 2 ///< receive buffer size |
46 #define SO_RCVBUF 2 //< receive buffer size |
49 #define SO_SNDBUF 3 ///< send buffer size |
47 #define SO_SNDBUF 3 //< send buffer size |
50 #define SO_ERROR 9 ///< get error status and clear |
48 #define SO_ERROR 9 //< get error status and clear |
51 #define SO_REUSEADDR 0x406 ///< reuse local addresses |
49 #define SO_REUSEADDR 0x406 //< reuse local addresses |
52 #define SO_BROADCAST -1 ///< permit sending of broadcast msgs, not supported in Symbian OS |
50 #define SO_BROADCAST -1 //< permit sending of broadcast msgs, not supported in Symbian OS |
53 #define SO_USELOOPBACK -2 ///< bypass hardware when possible, not supported in Symbian OS |
51 #define SO_USELOOPBACK -2 //< bypass hardware when possible, not supported in Symbian OS |
54 #define SO_LINGER -3 ///< linger on close if data present, not supported in Symbian OS |
52 #define SO_LINGER -3 //< linger on close if data present, not supported in Symbian OS |
55 #define SO_OOBINLINE -4 ///< leave received OOB data in line, not supported in Symbian OS |
53 #define SO_OOBINLINE -4 //< leave received OOB data in line, not supported in Symbian OS |
56 |
54 |
57 /* |
55 /* |
58 Address families - for EPOC32 these are based on the protocol IDs. |
56 Address families - for EPOC32 these are based on the protocol IDs. |
59 */ |
57 */ |
60 #define AF_UNSPEC 0 ///< unspecified |
58 #define AF_UNSPEC 0 //< unspecified |
61 #define AF_LOCAL 0x666 ///< local to host (pipes) |
59 #define AF_LOCAL 0x666 //< local to host (pipes) |
62 #define AF_INET 0x0800 ///< internetwork: UDP, TCP, etc. |
60 #define AF_INET 0x0800 //< internetwork: UDP, TCP, etc. |
63 #define AF_IRDA 0x0100 ///< IrDA |
61 #define AF_IRDA 0x0100 //< IrDA |
64 #define AF_PLP 273 ///< Symbian link protocol |
62 #define AF_PLP 273 //< Symbian link protocol |
65 |
63 |
66 /* |
64 /* |
67 Protocol families, same as address families |
65 Protocol families, same as address families |
68 */ |
66 */ |
69 #define PF_UNSPEC AF_UNSPEC |
67 #define PF_UNSPEC AF_UNSPEC |
81 u_short sa_family; /* address family */ |
79 u_short sa_family; /* address family */ |
82 u_short sa_port; /* port number - a common feature of most protocols */ |
80 u_short sa_port; /* port number - a common feature of most protocols */ |
83 char sa_data[24]; /* up to 24 bytes of direct address */ |
81 char sa_data[24]; /* up to 24 bytes of direct address */ |
84 }; |
82 }; |
85 |
83 |
86 #define SOMAXCONN 5 ///< Maximum queue length specifiable by listen |
84 #define SOMAXCONN 5 //< Maximum queue length specifiable by listen |
87 |
85 |
88 #define MSG_PEEK 1 ///< peek at incoming message |
86 #define MSG_PEEK 1 //< peek at incoming message |
89 #define MSG_OOB 1 ///< write out-of-band data |
87 #define MSG_OOB 1 //< write out-of-band data |
90 |
88 |
91 IMPORT_C int accept(int, struct sockaddr *, size_t *); |
89 IMPORT_C int accept(int, struct sockaddr *, size_t *); |
92 IMPORT_C int bind(int, struct sockaddr *, size_t); |
90 IMPORT_C int bind(int, struct sockaddr *, size_t); |
93 IMPORT_C int connect(int, struct sockaddr *, size_t); |
91 IMPORT_C int connect(int, struct sockaddr *, size_t); |
94 IMPORT_C int getpeername(int, struct sockaddr *, size_t *); |
92 IMPORT_C int getpeername(int, struct sockaddr *, size_t *); |