FreeCalypso > hg > fc-selenite
annotate src/condat/com/include/socket_api.h @ 196:5f3544fc0308
AT@SPENH brought over from Magnetite
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 24 May 2020 19:46:18 +0000 |
parents | 6e457872f745 |
children |
rev | line source |
---|---|
4
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 +------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 | File: socket.h |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 +------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 | Copyright 2002 Texas Instruments Berlin, AG |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 | All rights reserved. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 | |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 | This file is confidential and a trade secret of Texas |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 | Instruments Berlin, AG |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 | The receipt of or possession of this file does not convey |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 | any rights to reproduce or disclose its contents or to |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 | manufacture, use, or sell anything it may describe, in |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 | whole, or in part, without the specific written consent of |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 | Texas Instruments Berlin, AG. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 +----------------------------------------------------------------------------- |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 | Purpose : This file implements the socket specific definitions to be used by applications in order to |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 | set up a connection(GPRS or CSD) or create sockets for data receiption. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 | For a description of the socket API read g23m\condat\doc\8462_601.doc |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 +----------------------------------------------------------------------------- |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 #ifndef __SOCKET_H__ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 #define __SOCKET_H__ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 #include "typedefs.h" |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 #include "vsi.h" |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 #include "gsm.h" |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 #include "prim.h" // to get the DCM defines |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 /***************** Defines added for TCPIP testing with the application. ***********/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 * Value constants for VAL_bearer_select |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 #define DCM_SOCK_BEARER_ANY (0x1) /* DCM will decide which connection type to be used */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 #define DCM_SOCK_BEARER_GPRS (0x2) /* Use a GPRS context as bearer, DCM will decide which GPRS settings to be used */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 #define DCM_SOCK_BEARER_GSM (0x3) /* Use GSM data connection as bearer DCM will decide which GSM settings to be used */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 #define DCM_SOCK_BEARER_USE_PROFILE (0x4) /* Use a specific data account for this connection */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 #define DCM_SOCK_BEARER_AS_SPECIFIED (0x5) /* Use the data account information which is which is delivered within this signal */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 * Value constants for VAL_authtype |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 #define DCM_SOCK_AUTH_PAP (0x1) /* PAP authentification protocol */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 #define DCM_SOCK_AUTH_CHAP (0x2) /* CHAP authentification protocol !!! NOT SUPPORTED */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 #define DCM_SOCK_AUTH_NO (0x3) /* No authentication */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 * user defined constants |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 #define CDCM_APN_MAX_LEN (0x64) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 #define CDCM_PHONE_NR_LEN (0x54) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 #define CDCM_USER_MAX_LEN (0x19) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 #define CDCM_PASSWORD_MAX_LEN (0x19) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 /************************************************************************************/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 * Maximum length of the full-qualified domain name of an Internet host |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 #define SOCK_MAXHOSTNAMELEN 255 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 /* Maximum length (in octets) of a GPRS Access Point Name (APN). */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 #define SOCK_MAX_APN_LEN CDCM_APN_MAX_LEN |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 /* Maximum length (in octets) of a telephone number. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 #define SOCK_MAX_PHONENUM_LEN CDCM_PHONE_NR_LEN |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 /* Maximum length (in octets) of a user id. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 #define SOCK_MAX_USERID_LEN CDCM_USER_MAX_LEN |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 /* Maximum length (in octets) of a user password. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 #define SOCK_MAX_PASSWORD_LEN CDCM_PASSWORD_MAX_LEN |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 * Type of an IP protocol |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 * The values of this type are used as the 'ipproto' argument when creating |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 * a socket to specify if a UDP socket or a TCP socket shall be created. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 typedef enum { |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 SOCK_IPPROTO_TCP = 6, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 SOCK_IPPROTO_UDP = 17 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 } T_SOCK_IPPROTO; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 * Type of a socket descriptor |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 typedef unsigned long T_SOCK_SOCKET; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 * Type of an API instance |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 typedef unsigned long T_SOCK_API_INSTANCE; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 * Type of an IP version 4 addresses in network byte order |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 typedef unsigned long T_SOCK_IPADDR; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 #define SOCK_IPADDR_ANY (T_SOCK_IPADDR)0 /* Unspecified IP address */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 * UDP or TCP port number in network byte order |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 typedef unsigned short T_SOCK_PORT; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 #define SOCK_PORT_ANY (T_SOCK_PORT)0 /* Unspecified port number */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 * Convert U32 value from host byte order to network byte order |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 #define SOCK_HTONL( x ) \ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 ((U32)((((U32)( x ) & 0x000000ffU) << 24) | \ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 (((U32)( x ) & 0x0000ff00U) << 8) | \ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 (((U32)( x ) & 0x00ff0000U) >> 8) | \ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 (((U32)( x ) & 0xff000000U) >> 24))) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 * Convert U16 value from host byte order to network byte order |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 #define SOCK_HTONS( x ) \ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 ((U16)((((U16)( x ) & 0x00ff) << 8) | \ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 (((U16)( x ) & 0xff00) >> 8))) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 * Convert U32 value from network byte order to host byte order |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 #define SOCK_NTOHL( x ) \ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 ((U32)((((U32)( x ) & 0x000000ffU) << 24) | \ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 (((U32)( x ) & 0x0000ff00U) << 8) | \ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 (((U32)( x ) & 0x00ff0000U) >> 8) | \ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 (((U32)( x ) & 0xff000000U) >> 24))) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 * Convert U16 value from network byte order to host byte order |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 #define SOCK_NTOHS( x ) \ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 ((U16)((((U16)( x ) & 0x00ff) << 8) | \ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 (((U16)( x ) & 0xff00) >> 8))) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 * Construct IP address in network byte order from single octets. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
145 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 #define SOCK_MK_IPADDR( a, b, c, d ) \ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
147 ((T_SOCK_IPADDR)((a << 24) | (b << 16) | (c << 8) | d)) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
149 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 * Type of a Socket API event |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
151 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
152 typedef enum { |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
153 SOCK_CREATE_CNF = 1, /* Result event of sock_create() */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
154 SOCK_CLOSE_CNF = 2, /* Result event of sock_close() */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
155 SOCK_BIND_CNF = 3, /* Result event of sock_bind() */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
156 SOCK_LISTEN_CNF = 4, /* Result event of sock_listen() */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
157 SOCK_CONNECT_CNF = 5, /* Result event of sock_connect() */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
158 SOCK_SOCKNAME_CNF = 6, /* Result event of sock_getsockname() */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 SOCK_PEERNAME_CNF = 7, /* Result event of sock_getpeername() */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 SOCK_HOSTINFO_CNF = 8, /* Result event of sock_gethostbyname() or sock_gethostbyaddr() */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
161 SOCK_MTU_SIZE_CNF = 9, /* Result event of sock_get_mtu_size() */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
162 SOCK_RECV_IND = 10, /* Network event: data has been received */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
163 SOCK_CONNECT_IND = 11, /* Network event: an incoming connection has been accepted. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
164 SOCK_CONN_CLOSED_IND = 12, /* Network event: connection has been closed by the remote peer */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
165 SOCK_ERROR_IND = 13, /* Network event: an asynchronous error has occurred */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
166 SOCK_FLOW_READY_IND = 14, /* Flow control: the API is ready to send data again */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
167 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
168 SOCK_OPEN_BEARER_CNF, // Result Event of sock_open_bearer() |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
169 SOCK_CLOSE_BEARER_CNF, // Result event of sock_close_bearer() |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
170 SOCK_BEARER_INFO_CNF, // Result event of sock_bearer_info() |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
171 SOCK_BAERER_CLOSED_IND // The bearer connection has been closed |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
172 } T_SOCK_EVENTTYPE; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
173 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
174 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
175 * Result codes of the API functions to indicate success or an error condition. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
176 * This type is used as the result code of the function and as the result value |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
177 * in the associated event. It is also used for the error codes of a |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
178 * 'SOCK_ERROR_IND' event |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
179 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
180 typedef enum { |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
181 SOCK_RESULT_OK = 0, /* No problem detected. a corresponding primitive has been sent to the TCP/IP entity */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
182 SOCK_RESULT_INVALID_PARAMETER = 1, /* A parameter given to the function is invalid */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
183 SOCK_RESULT_INTERNAL_ERROR = 2, /* An internal error has happened */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
184 SOCK_RESULT_ADDR_IN_USE = 3, /* The address or port is already in use */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
185 SOCK_RESULT_OUT_OF_MEMORY = 4, /* There is not enough memory to fulfill the request */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
186 SOCK_RESULT_NOT_SUPPORTED = 5, /* The socket is not of a type that can support this operation */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
187 SOCK_RESULT_UNREACHABLE = 6, /* The specified host cannot be reached */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
188 SOCK_RESULT_CONN_REFUSED = 7, /* The connection to the specified address was refused by the remote host */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
189 SOCK_RESULT_TIMEOUT = 8, /* The connection attempt timed out without establishing a connection */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
190 SOCK_RESULT_IS_CONNECTED = 9, /* The request could not be fulfilled because the socket is already connected */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
191 SOCK_RESULT_HOST_NOT_FOUND = 10, /* The specified host could not be found in the DNS */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
192 SOCK_RESULT_DNS_TEMP_ERROR = 11, /* A temporary DNS error has occurred. Retrying the query may be successful */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
193 SOCK_RESULT_DNS_PERM_ERROR = 12, /* A permanent DNS error has occurred */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
194 SOCK_RESULT_NO_IPADDR = 13, /* The specified name has been found in the DNS, but no IP address is available */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
195 SOCK_RESULT_NOT_CONNECTED = 14, /* The socket has not been connected yet */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
196 SOCK_RESULT_MSG_TOO_BIG = 15, /* The size of the data buffer is too large for a UDP socket */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
197 SOCK_RESULT_CONN_RESET = 16, /* The connection has been reset by the remote peer */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
198 SOCK_RESULT_CONN_ABORTED = 17, /* The connection was aborted due to timeout or some other error condition */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
199 SOCK_RESULT_NO_BUFSPACE = 18, /* Sending failed temporarily because the space to buffer the message was exhausted. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
200 SOCK_RESULT_NETWORK_LOST, // As a result code: The operation failed because TCP/IP's bearer connection has been disconnected.As an asynchronous event code: The bearer connection has been closed. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
201 SOCK_RESULT_NOT_READY, // The operation failed because the bearer connection has not been opened. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
202 SOCK_RESULT_BEARER_NOT_READY, // The bearer connection could not be opened because the mobile is not yet completely attached to the network. A retry at a later time may be successful. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
203 SOCK_RESULT_IN_PROGRESS, // The operation failed because a similar operation is already in progress. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
204 SOCK_RESULT_BEARER_ACTIVE// The operation failed because a bearer connection is already open. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
205 } T_SOCK_RESULT; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
206 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
207 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
208 /* Type of the bearer_select parameter of sock_open_bearer(), used to select the |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
209 * type of the bearer connection to be opened by the Data Connection Manager |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
210 * (DCM), and of the bearer_type field of the T_SOCK_BEARER_INFO struct. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
211 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
212 typedef enum { |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
213 SOCK_BEARER_ANY = DCM_SOCK_BEARER_ANY, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
214 SOCK_BEARER_GPRS = DCM_SOCK_BEARER_GPRS, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
215 SOCK_BEARER_GSM = DCM_SOCK_BEARER_GSM, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
216 SOCK_BEARER_USE_PROFILE = DCM_SOCK_BEARER_USE_PROFILE, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
217 SOCK_BEARER_AS_SPECIFIED = DCM_SOCK_BEARER_AS_SPECIFIED |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
218 } T_SOCK_BEARER_TYPE; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
219 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
220 // FST: ????? |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
221 typedef enum { |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
222 SOCK_AUTH_PAP = DCM_SOCK_AUTH_PAP, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
223 SOCK_AUTH_CHAP = DCM_SOCK_AUTH_CHAP, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
224 SOCK_AUTH_NO= DCM_SOCK_AUTH_NO |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
225 } T_SOCK_AUTHTYPE; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
226 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
227 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
228 * Type of the generic event data structure passed |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
229 * to the callback function on an event. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
230 * The actual event structure may be bigger(depending on its type), |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
231 * but it will contain these fields at the beginning |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
232 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
233 typedef struct { |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
234 T_SOCK_EVENTTYPE event_type; /* Type of the event. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
235 T_SOCK_RESULT result; /* Result code of the operation */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
236 T_SOCK_SOCKET socket; /* Socket for which the event occurred */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
237 } T_SOCK_EVENTSTRUCT; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
238 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
239 /* |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
240 * Pointer to the callback function specified by the application |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
241 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
242 typedef void (*T_SOCK_CALLBACK)(T_SOCK_EVENTSTRUCT* event, void *context); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
243 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
244 /* System wide handle of a bearer connection. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
245 * Variables of this type are used as handles to identify a bearer connection. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
246 * !! NOT NEEDED FOR CURRENT IMPLEMENTATION ONLY MENTIONED FOR FUTURE SUPPOSE.!! |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
247 */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
248 typedef U16 T_SOCK_BEARER_HANDLE; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
249 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
250 typedef struct { |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
251 T_SOCK_BEARER_HANDLE bearer_handle; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
252 T_HANDLE app_handle; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
253 T_SOCK_BEARER_TYPE bearer_type; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
254 BOOL apn_valid; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
255 char apn[SOCK_MAX_APN_LEN+1]; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
256 BOOL phone_nr_valid; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
257 char phone_nr[SOCK_MAX_PHONENUM_LEN+1]; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
258 BOOL user_id_valid; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
259 char user_id[SOCK_MAX_USERID_LEN+1]; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
260 BOOL password_valid; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
261 char password[SOCK_MAX_PASSWORD_LEN+1]; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
262 int cid; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
263 T_SOCK_IPADDR ip_address; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
264 T_SOCK_IPADDR dns1; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
265 T_SOCK_IPADDR dns2; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
266 T_SOCK_IPADDR gateway; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
267 T_SOCK_AUTHTYPE authtype; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
268 BOOL data_compr; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
269 BOOL header_comp; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
270 int precedence; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
271 int delay; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
272 int reliability; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
273 int peak_throughput; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
274 int mean_througput; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
275 BOOL shareable; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
276 } T_SOCK_BEARER_INFO; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
277 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
278 /* ========================================================================== */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
279 /* ============================== Result Events from TCPIP ================= */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
280 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
281 typedef struct { |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
282 T_SOCK_EVENTTYPE event_type; /* Type of the event. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
283 T_SOCK_RESULT result; /* Result code of the operation */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
284 T_SOCK_SOCKET socket; /* Socket for which the event occurred */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
285 T_SOCK_BEARER_HANDLE bearer_handle; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
286 } T_SOCK_OPEN_BEARER_CNF; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
287 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
288 typedef T_SOCK_EVENTSTRUCT T_SOCK_CLOSE_BEARER_CNF; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
289 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
290 typedef struct { |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
291 T_SOCK_EVENTTYPE event_type; /* Type of the event. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
292 T_SOCK_RESULT result; /* Result code of the operation */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
293 T_SOCK_SOCKET socket; /* Socket for which the event occurred */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
294 T_SOCK_BEARER_INFO bearer_params; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
295 } T_SOCK_BEARER_INFO_CNF; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
296 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
297 typedef struct { |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
298 T_SOCK_EVENTTYPE event_type; /* Type of the event. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
299 T_SOCK_RESULT result; /* Result code of the operation */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
300 T_SOCK_SOCKET socket; /* Socket for which the event occurred */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
301 U32 dcm_error; /* The parameter contains errors received from |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
302 * PS (ETSI Spec 07.07) */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
303 } T_SOCK_BAERER_CLOSED_IND; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
304 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
305 typedef struct { |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
306 T_SOCK_EVENTTYPE event_type; /* Type of the event. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
307 T_SOCK_RESULT result; /* Result code of the operation */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
308 T_SOCK_SOCKET socket; /* Socket for which the event occurred */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
309 } T_SOCK_CREATE_CNF; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
310 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
311 typedef T_SOCK_EVENTSTRUCT T_SOCK_CLOSE_CNF; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
312 typedef T_SOCK_EVENTSTRUCT T_SOCK_BIND_CNF; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
313 typedef T_SOCK_EVENTSTRUCT T_SOCK_LISTEN_CNF; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
314 typedef T_SOCK_EVENTSTRUCT T_SOCK_CONNECT_CNF; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
315 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
316 typedef struct { |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
317 T_SOCK_EVENTTYPE event_type; /* Type of the event. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
318 T_SOCK_RESULT result; /* Result code of the operation */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
319 T_SOCK_SOCKET socket; /* Socket for which the event occurred */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
320 T_SOCK_IPADDR ipaddr; /* The local IP address of the socket */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
321 T_SOCK_PORT port; /* The local port number of the socket */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
322 } T_SOCK_SOCKNAME_CNF; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
323 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
324 typedef T_SOCK_SOCKNAME_CNF T_SOCK_PEERNAME_CNF; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
325 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
326 typedef struct { |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
327 T_SOCK_EVENTTYPE event_type; /* Type of the event. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
328 T_SOCK_RESULT result; /* Result code of the operation */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
329 T_SOCK_SOCKET socket; /* unused */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
330 char hostname[SOCK_MAXHOSTNAMELEN+1]; /* The name of the host as |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
331 a zero-terminated string */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
332 T_SOCK_IPADDR ipaddr; /* The local IP address of the socket */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
333 } T_SOCK_HOSTINFO_CNF; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
334 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
335 typedef struct { |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
336 T_SOCK_EVENTTYPE event_type; /* Type of the event. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
337 T_SOCK_RESULT result; /* Result code of the operation */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
338 T_SOCK_SOCKET socket; /* Socket for which the event occurred */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
339 U16 mtu_size; /* MTU size */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
340 } T_SOCK_MTU_SIZE_CNF; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
341 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
342 typedef struct { |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
343 T_SOCK_EVENTTYPE event_type; /* Type of the event. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
344 T_SOCK_RESULT result; /* Result code of the operation */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
345 T_SOCK_SOCKET socket; /* Socket for which the event occurred */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
346 U32 data_length; /* Length of the data portion received. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
347 char *data_buffer; /* Pointer to the data received. The application |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
348 shall free this data buffer after use. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
349 } T_SOCK_RECV_IND; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
350 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
351 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
352 typedef struct { |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
353 T_SOCK_EVENTTYPE event_type; /* Type of the event. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
354 T_SOCK_RESULT result; /* Result code of the operation */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
355 T_SOCK_SOCKET socket; /* Socket for which the event occurred */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
356 T_SOCK_SOCKET new_socket; /* New socket allocated for the connection. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
357 T_SOCK_IPADDR peer_ipaddr; /* IP address of the remote peer. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
358 T_SOCK_PORT peer_port; /* Port number on the remote side. */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
359 } T_SOCK_CONNECT_IND; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
360 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
361 typedef T_SOCK_EVENTSTRUCT T_SOCK_CONN_CLOSED_IND; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
362 typedef T_SOCK_EVENTSTRUCT T_SOCK_ERROR_IND; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
363 typedef T_SOCK_EVENTSTRUCT T_SOCK_FLOW_READY_IND; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
364 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
365 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
366 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
367 /* ========================================================================== */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
368 /* ================== Prototypes of socket API ============================== */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
369 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
370 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
371 /* ******************* API administrative functions ************************* */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
372 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
373 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
374 Function : sock_api_initialize |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
375 Parameter : - T_SOCK_API_INSTANCE * : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
376 'The function returns an API instance value. The value is needed |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
377 for several API functions.' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
378 - T_HANDLE : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
379 'Application task handle as passed to pei_init()' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
380 - char* : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
381 'Name of the application entity as used with vsi_c_open().' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
382 Return : The function returns TRUE if the initialization was successful. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
383 Description : Initializes the socket interface API. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
384 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
385 BOOL sock_api_initialize(T_SOCK_API_INSTANCE *api_instance, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
386 T_HANDLE app_handle, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
387 char* app_name); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
388 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
389 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
390 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
391 Function : sock_api_deinitialize |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
392 Parameter : - T_SOCK_API_INSTANCE : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
393 'API instance value.' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
394 Return : None |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
395 Description : Deinitializes the socket interface API. The function releases |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
396 all associated memory. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
397 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
398 void sock_api_deinitialize(T_SOCK_API_INSTANCE api_instance); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
399 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
400 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
401 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
402 Function : sock_api_handles_primitive |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
403 Parameter : - T_SOCK_API_INSTANCE: API instance value |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
404 - T_PRIM: Pointer to primitive received from |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
405 the primitive queue' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
406 Return : The function returns TRUE if the primitive has been handled by |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
407 this function.In this case the application should not do |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
408 anything else with the primitive and should not call PFREE() |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
409 to free the memory block used for the primitive. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
410 The function returns FALSE if the primitive has not been |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
411 handled by this function. In this case the application should |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
412 process the primitive as usual. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
413 Description : Handles primitives for the socket API. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
414 To free the application from the handling of the event |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
415 primitives sent by the TCP/IP entity, the Socket API provides |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
416 this function that checks if a primitive is to be handled by |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
417 the Socket API and if it is, handles it. The application is |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
418 supposed to call it immediately after receiving a primitive. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
419 If the primitive is meant for the Socket API, it is handled by |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
420 this function. This will in most cases include calling the |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
421 callback function supplied by the application to deliver an |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
422 event. If the primitive is not meant for the Socket API, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
423 no action is taken. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
424 It is recommended to call this function early in the |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
425 application entity's pei_primitive() function. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
426 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
427 BOOL sock_api_handles_primitive(T_SOCK_API_INSTANCE api_instance, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
428 T_PRIM *prim); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
429 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
430 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
431 /* ******************* Bearer related functions ***************************** */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
432 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
433 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
434 Function : sock_open_bearer() |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
435 Parameter : - T_SOCK_API_INSTANCE: API instance value |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
436 - T_SOCK_BEARER_TYPE : CSD or GPRS |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
437 - int: Number of the selected profile with a bearer |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
438 selection of SOCK_BEARER_USE_PROFILE. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
439 Unused in other cases. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
440 - T_SOCK_BEARER_INFO: requested parameters of the bearer connection |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
441 - T_SOCK_CALLBACK: callback function to be called for return events. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
442 - void*: An arbitrary pointer to be passed to the |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
443 callback function when it is called |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
444 Return : T_SOCK_RESULT indicates successor a problem that happend |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
445 Return Event : T_SOCK_OPEN_BEARER_CNF |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
446 Description : Opens a CSD or GPRS connection for use with TCP/IP. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
447 This function a bearer connection for use with TCP/IP. It must be |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
448 called after sock_api_initialize() and before any other |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
449 TCP/IP-related functions. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
450 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
451 T_SOCK_RESULT sock_open_bearer(T_SOCK_API_INSTANCE api_instance, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
452 T_SOCK_BEARER_TYPE bearer_select, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
453 int profile_number, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
454 T_SOCK_BEARER_INFO *params, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
455 T_SOCK_CALLBACK sock_cb, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
456 void *context); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
457 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
458 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
459 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
460 Function : sock_close_bearer() |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
461 Parameter : - T_SOCK_API_INSTANCE : API instance value |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
462 - T_SOCK_BEARER_HANDLE: returned by SOCK_OPEN_BEARER_CNF |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
463 - T_SOCK_CALLBACK: Callback function to be called for return events. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
464 - void*: An arbitrary pointer to be passed to the |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
465 callback function when it is called |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
466 Return : T_SOCK_RESULT indicates successor a problem that happend |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
467 Return Event : T_SOCK_CLOSE_BEARER_CNF |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
468 Description : Close a bearer connection that has been opened with sock_open_bearer(). |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
469 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
470 T_SOCK_RESULT sock_close_bearer(T_SOCK_API_INSTANCE api_instance, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
471 T_SOCK_BEARER_HANDLE bearer_handle, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
472 T_SOCK_CALLBACK sock_cb, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
473 void *context); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
474 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
475 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
476 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
477 Function : sock_bearer_info() |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
478 Parameter : - T_SOCK_API_INSTANCE: API instance value |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
479 - T_SOCK_BEARER_HANDLE: returned by SOCK_OPEN_BEARER_CNF |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
480 - T_SOCK_CALLBACK: Callback function to be called for |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
481 return events. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
482 - void*: An arbitrary pointer to be passed to the |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
483 callback function when it is called |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
484 Return : T_SOCK_RESULT |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
485 Return Event : T_SOCK_BEARER_INFO_CNF |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
486 Description : Get information about a bearer connection that has been opened |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
487 with sock_open_bearer(). |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
488 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
489 T_SOCK_RESULT sock_bearer_info(T_SOCK_API_INSTANCE api_instance, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
490 T_SOCK_BEARER_HANDLE bearer_handle, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
491 T_SOCK_CALLBACK sock_cb, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
492 void *context); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
493 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
494 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
495 /* ******************* Socket related functions ***************************** */ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
496 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
497 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
498 Function : sock_create |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
499 Parameter : - T_SOCK_API_INSTANCE : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
500 'API instance value.' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
501 - T_SOCK_IPPROTO : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
502 'The protocol (UDP or TCP) to be used with this socket' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
503 - T_SOCK_CALLBACK : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
504 'The callback function to be called for events on this socket' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
505 - void * : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
506 'An arbitrary pointer to be passed to |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
507 the callback function when it is called' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
508 Return : (T_SOCK_RESULT) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
509 Return Event : 'SOCK_CREATE_CNF' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
510 - T_SOCK_RESULT : Result code |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
511 - T_SOCK_SOCKET : The socket descriptor returned by the TCP/IP entity |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
512 Description : - Create a new UDP or TCP socket |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
513 - This function creates a socket that can subsequently be used with |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
514 the other Socket API functions |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
515 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
516 T_SOCK_RESULT sock_create(T_SOCK_API_INSTANCE api_instance, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
517 T_SOCK_IPPROTO ipproto, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
518 T_SOCK_CALLBACK callback, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
519 void *context); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
520 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
521 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
522 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
523 Function : sock_close |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
524 Parameter : - T_SOCK_SOCKET : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
525 'The socket descriptor to be closed' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
526 Return : (T_SOCK_RESULT) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
527 Return Event : 'SOCK_CLOSE_CNF' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
528 - T_SOCK_RESULT : Result code |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
529 - T_SOCK_SOCKET : The socket descriptor to be closed |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
530 Description : - Close socket, shutdown connection if present |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
531 - This function closes a socket that has previously |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
532 been created with sock_create(). |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
533 If a connection is open for this socket, it will be closed. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
534 If this socket has listened for connections, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
535 no further connections will be accepted |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
536 History : 0001 03.08.11 shkim Created |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
537 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
538 T_SOCK_RESULT sock_close(T_SOCK_SOCKET socket); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
539 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
540 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
541 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
542 Function : sock_bind |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
543 Parameter : - T_SOCK_SOCKET : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
544 'The socket descriptor to be closed' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
545 - T_SOCK_PORT : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
546 'The port number to bind the socket to' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
547 Return : (T_SOCK_RESULT) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
548 Return Event : 'SOCK_BIND_CNF' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
549 - T_SOCK_RESULT : Result code |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
550 - T_SOCK_SOCKET : The socket descriptor to be bound |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
551 Description : - Bind socket to a specific local port number |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
552 - This function binds a socket to the specified local port |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
553 History : 0001 03.08.11 shkim Created |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
554 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
555 T_SOCK_RESULT sock_bind(T_SOCK_SOCKET socket, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
556 T_SOCK_PORT port); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
557 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
558 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
559 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
560 Function : sock_listen |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
561 Parameter : - T_SOCK_SOCKET : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
562 'The socket descriptor to listen on' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
563 Return : (T_SOCK_RESULT) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
564 Return Event : 'SOCK_LISTEN_CNF' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
565 - T_SOCK_RESULT : Result code |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
566 - T_SOCK_SOCKET : The socket descriptor to listen on |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
567 Description : - Accept TCP connections on this socket |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
568 - This function makes TCP/IP listen for |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
569 TCP connections on this socket. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
570 The socket should have been bound to a specific port |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
571 using sock_bind() before. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
572 History : 0001 03.08.11 shkim Created |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
573 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
574 T_SOCK_RESULT sock_listen(T_SOCK_SOCKET socket); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
575 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
576 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
577 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
578 Function : sock_connect |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
579 Parameter : - T_SOCK_SOCKET : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
580 'The socket descriptor to connect' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
581 - T_SOCK_IPADDR : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
582 'The IP address to connect to' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
583 - T_SOCK_PORT : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
584 'The port number to connect to' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
585 Return : (T_SOCK_RESULT) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
586 Return Event : 'SOCK_CONNECT_CNF' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
587 - T_SOCK_RESULT : Result code |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
588 - T_SOCK_SOCKET : The socket descriptor to connect |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
589 Description : - Connect the socket to a remote endpoint |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
590 - With TCP sockets, a TCP connection is established to |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
591 the specified IP address and the specified port. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
592 The connection can then be used to send data using sock_send(); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
593 received data is indicated by a SOCK_RECV_IND event. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
594 With UDP sockets, the specified IP address and port number |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
595 are stored with the socket; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
596 subsequent UDP messages can be sent to this address |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
597 using sock_send(); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
598 only messages from this address will be received. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
599 History : 0001 03.08.11 shkim Created |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
600 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
601 T_SOCK_RESULT sock_connect(T_SOCK_SOCKET socket, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
602 T_SOCK_IPADDR ipaddr, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
603 T_SOCK_PORT port); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
604 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
605 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
606 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
607 Function : sock_getsockname |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
608 Parameter : - T_SOCK_SOCKET : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
609 'The socket descriptor to retrieve information about' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
610 Return : (T_SOCK_RESULT) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
611 Return Event : 'SOCK_SOCKNAME_CNF' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
612 - T_SOCK_RESULT : Result code |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
613 - T_SOCK_SOCKET : The socket descriptor to connect |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
614 - T_SOCK_IPADDR : The local IP address of the socket |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
615 - T_SOCK_PORT : The local port number of the socket |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
616 Description : - Retrieve local address information |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
617 - The function retrieves local address information of the socket. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
618 If the socket has not yet been bound to an address using sock_bind(), |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
619 the port number is unspecified (SOCK_PORT_ANY) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
620 History : 0001 03.08.11 shkim Created |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
621 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
622 T_SOCK_RESULT sock_getsockname(T_SOCK_SOCKET socket); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
623 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
624 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
625 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
626 Function : sock_getpeername |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
627 Parameter : - T_SOCK_SOCKET : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
628 'The socket descriptor to retrieve information about' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
629 Return : (T_SOCK_RESULT) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
630 Return Event : 'SOCK_PEERNAME_CNF' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
631 - T_SOCK_RESULT : Result code |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
632 - T_SOCK_SOCKET : The socket descriptor to connect |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
633 - T_SOCK_IPADDR : The IP address of the remote peer |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
634 - T_SOCK_PORT : The port number at the remote peer |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
635 Description : - Retrieve remote address information |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
636 - The function retrieves address information of |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
637 the connection at the remote peer. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
638 If the socket is not connected, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
639 the IP address and port number are unspecified |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
640 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
641 T_SOCK_RESULT sock_getpeername(T_SOCK_SOCKET socket); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
642 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
643 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
644 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
645 Function : sock_gethostbyname |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
646 Parameter : - T_SOCK_API_INSTANCE : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
647 'API instance value.' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
648 - char * : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
649 'The name of the referenced host' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
650 - T_SOCK_CALLBACK : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
651 'The callback function to be called for the result event' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
652 - void * : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
653 'An arbitrary pointer to be passed to the callback |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
654 function when it is called' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
655 Return : (T_SOCK_RESULT) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
656 Return Event : 'SOCK_HOSTINFO_CNF' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
657 - T_SOCK_RESULT : Result code |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
658 - char hostname[SOCK_MAXHOSTNAMELEN+1] : The name of the |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
659 host as a zero-terminated string |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
660 - T_SOCK_IPADDR : The IP address of the host |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
661 Description : - Get the IP address of a host |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
662 - The function queries the IP address information of |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
663 the specified host from the DNS. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
664 Because the function is not associated to any socket, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
665 a callback function and a context |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
666 pointer must be specified separately |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
667 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
668 T_SOCK_RESULT sock_gethostbyname(T_SOCK_API_INSTANCE api_instance, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
669 char *hostname, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
670 T_SOCK_CALLBACK callback, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
671 void *context); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
672 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
673 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
674 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
675 Function : sock_gethostbyaddr |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
676 Parameter : - T_SOCK_API_INSTANCE : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
677 'API instance value.' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
678 - T_SOCK_IPADDR : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
679 'The IP address of the referenced host' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
680 - T_SOCK_CALLBACK : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
681 'The callback function to be called for the result event' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
682 - void * : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
683 'An arbitrary pointer to be passed to the callback function |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
684 when it is called' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
685 Return : (T_SOCK_RESULT) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
686 Return Event : 'SOCK_HOSTINFO_CNF' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
687 - T_SOCK_RESULT : Result code |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
688 - char hostname[SOCK_MAXHOSTNAMELEN+1] : The name of the |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
689 host as a zero-terminated string |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
690 - T_SOCK_IPADDR : The IP address of the host |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
691 Description : - Get the name of a host |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
692 - The function queries the hostname for the specified |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
693 IP address from the DNS. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
694 Because the function is not associated to any socket, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
695 a callback function and a context pointer must be specified separately |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
696 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
697 T_SOCK_RESULT sock_gethostbyaddr(T_SOCK_API_INSTANCE api_instance, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
698 T_SOCK_IPADDR ipaddr, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
699 T_SOCK_CALLBACK callback, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
700 void *context); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
701 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
702 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
703 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
704 Function : sock_send |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
705 Parameter : - T_SOCK_SOCKET : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
706 'The socket to send the data on' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
707 - char * : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
708 'The data buffer to be sent' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
709 - U16 : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
710 'The length of the data buffer in bytes' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
711 Return : (T_SOCK_RESULT) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
712 Return Event : None |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
713 Description : - Send data on a socket ( TCP only ) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
714 - The function sends the specified data buffer over the socket. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
715 The socket must be connected, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
716 i. e. it must have been connected to a remote peer |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
717 using sock_connect() or been created when accepting |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
718 a connection as indicated by SOCK_SONNECT_IND. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
719 Implementation note: In order to send the payload data via DTI, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
720 the data must be copied into a DTI descriptor by the Socket API; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
721 there is no way to avoid the copy operation without |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
722 putting the burden of knowing DTI-internal data |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
723 structures on the application. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
724 It has been decided to pay the cost of the copy operation |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
725 in order to free the application from this responsibility |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
726 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
727 T_SOCK_RESULT sock_send(T_SOCK_SOCKET socket, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
728 char *buffer, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
729 U16 buffer_length); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
730 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
731 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
732 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
733 Function : sock_sendto |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
734 Parameter : - T_SOCK_SOCKET : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
735 'The socket to send the data on' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
736 - char * : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
737 'The data buffer to be sent' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
738 - U16 : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
739 'The length of the data buffer' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
740 - T_SOCK_IPADDR : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
741 'IP address of the host to send data to' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
742 - T_SOCK_PORT : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
743 'Remote port to send data to' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
744 Return : (T_SOCK_RESULT) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
745 Return Event : None |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
746 Description : - Send data on a socket( UDP only ) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
747 - The function sends the specified data buffer |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
748 over the socket to the specified address. The socket must be |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
749 a UDP socket. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
750 Implementation note: In order to send the payload data via DTI, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
751 the data must be copied into a DTI descriptor by the Socket API; |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
752 there is no way to avoid the copy operation without putting |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
753 the burden of knowing DTI-internal data structures on |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
754 the application. It has been decided to pay the cost of |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
755 the copy operation in order to free the application from |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
756 this responsibility |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
757 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
758 T_SOCK_RESULT sock_sendto(T_SOCK_SOCKET socket, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
759 char *buffer, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
760 U16 buffer_length, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
761 T_SOCK_IPADDR ipaddr, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
762 T_SOCK_PORT port); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
763 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
764 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
765 /*------------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
766 Function : sock_set_callback |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
767 Parameter : - T_SOCK_SOCKET : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
768 'Socket to set callback and context for' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
769 - T_SOCK_CALLBACK : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
770 'New callback function for the socket' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
771 - void * : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
772 'New context pointer for the socket' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
773 Return : (T_SOCK_RESULT) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
774 Return Event : None |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
775 Description : - Set a new callback function and context pointer for the socket |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
776 - The function defines a new callback function and a new context |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
777 pointer for the socket. All socket events after this call will be |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
778 delivered using the new callback function and the new context |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
779 pointer |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
780 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
781 T_SOCK_RESULT sock_set_callback(T_SOCK_SOCKET socket, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
782 T_SOCK_CALLBACK callback, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
783 void *context); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
784 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
785 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
786 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
787 Function : sock_get_callback |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
788 Parameter : - T_SOCK_SOCKET : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
789 'Socket to get callback and context from' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
790 - T_SOCK_CALLBACK * : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
791 'Return callback function pointer for the socket' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
792 - void ** : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
793 'Return context pointer for the socket' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
794 Return : (T_SOCK_RESULT) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
795 Return Event : None |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
796 Description : - Get callback function pointer and context pointer for the socket |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
797 - The function returns callback function pointer and context pointer |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
798 for the socket. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
799 pointer |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
800 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
801 T_SOCK_RESULT sock_get_callback(T_SOCK_SOCKET socket, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
802 T_SOCK_CALLBACK *callback_p, |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
803 void **context_p); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
804 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
805 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
806 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
807 Function : sock_flow_xoff |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
808 Parameter : - T_SOCK_SOCKET : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
809 'Socket to switch to "xoff" status' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
810 Return : (T_SOCK_RESULT) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
811 Return Event : None |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
812 Description : - Flow control: make TCP/IP stop sending data |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
813 - This function makes the Socket API stop TCP/IP sending data. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
814 If TCP/IP has already been stopped, the function has no effect. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
815 History : 0001 03.08.11 shkim Created |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
816 0002 03.09.12 STW T_SOCK_RESULT added |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
817 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
818 T_SOCK_RESULT sock_flow_xoff(T_SOCK_SOCKET socket); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
819 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
820 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
821 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
822 Function : sock_flow_xon |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
823 Parameter : - T_SOCK_SOCKET : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
824 'Socket to switch to "xon" status' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
825 Return : (T_SOCK_RESULT) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
826 Return Event : None |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
827 Description : - Flow control: make TCP/IP resume sending data |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
828 - This function makes TCP/IP resume sending data. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
829 If TCP/IP has not been stopped, the function has no effect |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
830 History : 0001 03.08.11 shkim Created |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
831 0002 03.09.12 STW T_SOCK_RESULT added |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
832 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
833 T_SOCK_RESULT sock_flow_xon(T_SOCK_SOCKET socket); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
834 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
835 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
836 /*------------------------------------------------------------------------------ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
837 Function : sock_get_mtu_size |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
838 Parameter : - T_SOCK_SOCKET : |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
839 'Socket to get MTU size from' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
840 Return : (T_SOCK_RESULT) |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
841 Return Event : 'SOCK_MTU_SIZE_CNF' |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
842 - T_SOCK_RESULT : Result code |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
843 - T_SOCK_SOCKET : The socket descriptor (unused). |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
844 - U16 : MTU size |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
845 Description : - Get MTU size of network connection |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
846 - The function retrieves the size of |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
847 the Maximum Transfer Unit(MTU) of the network connection. |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
848 History : 0001 03.08.11 shkim Created |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
849 0002 03.09.12 STW T_SOCK_SOCKET added |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
850 ------------------------------------------------------------------------------*/ |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
851 T_SOCK_RESULT sock_get_mtu_size(T_SOCK_SOCKET socket); |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
852 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
853 |
6e457872f745
src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
854 #endif /* __SOCKET_H__ */ |