Tizen 2.1 base
[sdk/emulator/qemu.git] / tizen / src / sdb.h
1 /* Copyright (C) 2006-2010 The Android Open Source Project
2 **
3 ** This software is licensed under the terms of the GNU General Public
4 ** License version 2, as published by the Free Software Foundation, and
5 ** may be copied, distributed, and modified under those terms.
6 **
7 ** This program is distributed in the hope that it will be useful,
8 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
9 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 ** GNU General Public License for more details.
11 */
12
13 #include "maru_common.h"
14
15 #include <errno.h>
16
17 #define SDB_HOST_PORT 26099
18
19 #ifdef _WIN32
20 #  ifndef EINTR
21 #    define EINTR        10004
22 #  endif
23 #  ifndef EAGAIN
24 #    define EAGAIN       10035
25 #  endif
26 #  ifndef EWOULDBLOCK
27 #    define EWOULDBLOCK  EAGAIN
28 #  endif
29 #  ifndef EINPROGRESS
30 #    define EINPROGRESS  10036
31 #  endif
32 #  ifndef EALREADY
33 #    define EALREADY     10037
34 #  endif
35 #  ifndef EDESTADDRREQ
36 #    define EDESTADDRREQ 10039
37 #  endif
38 #  ifndef EMSGSIZE
39 #    define EMSGSIZE     10040
40 #  endif
41 #  ifndef EPROTOTYPE
42 #    define EPROTOTYPE   10041
43 #  endif
44 #  ifndef ENOPROTOOPT
45 #    define ENOPROTOOPT  10042
46 #  endif
47 #  ifndef EAFNOSUPPORT
48 #    define EAFNOSUPPORT 10047
49 #  endif
50 #  ifndef EADDRINUSE
51 #    define EADDRINUSE   10048
52 #  endif
53 #  ifndef EADDRNOTAVAIL
54 #    define EADDRNOTAVAIL 10049
55 #  endif
56 #  ifndef ENETDOWN
57 #    define ENETDOWN     10050
58 #  endif
59 #  ifndef ENETUNREACH
60 #    define ENETUNREACH  10051
61 #  endif
62 #  ifndef ENETRESET
63 #    define ENETRESET    10052
64 #  endif
65 #  ifndef ECONNABORTED
66 #    define ECONNABORTED 10053
67 #  endif
68 #  ifndef ECONNRESET
69 #    define ECONNRESET   10054
70 #  endif
71 #  ifndef ENOBUFS
72 #    define ENOBUFS      10055
73 #  endif
74 #  ifndef EISCONN
75 #    define EISCONN      10056
76 #  endif
77 #  ifndef ENOTCONN
78 #    define ENOTCONN     10057
79 #  endif
80 #  ifndef ESHUTDOWN
81 #    define ESHUTDOWN     10058
82 #  endif
83 #  ifndef ETOOMANYREFS
84 #    define ETOOMANYREFS  10059
85 #  endif
86 #  ifndef ETIMEDOUT
87 #    define ETIMEDOUT     10060
88 #  endif
89 #  ifndef ECONNREFUSED
90 #    define ECONNREFUSED  10061
91 #  endif
92 #  ifndef ELOOP
93 #    define ELOOP         10062
94 #  endif
95 #  ifndef EHOSTDOWN
96 #    define EHOSTDOWN     10064
97 #  endif
98 #  ifndef EHOSTUNREACH
99 #    define EHOSTUNREACH  10065
100 #  endif
101 #endif /* _WIN32 */
102
103 #define SDB_TCP_EMULD_INDEX  3    /* emulator daemon port */
104 #define SDB_TCP_OPENGL_INDEX  4   /* opengl server port */
105 #define SDB_UDP_SENSOR_INDEX  3   /* sensor server port */
106
107 extern int tizen_base_port;
108
109 void sdb_setup(void);
110 int get_sdb_base_port(void);
111 int inet_strtoip(const char*  str, uint32_t  *ip);
112 int socket_send(int fd, const void*  buf, int  buflen);
113 void socket_close(int fd);
114 void notify_sdb_daemon_start(void);
115 int check_port_bind_listen(uint32_t port);
116 int sdb_loopback_client(int port, int type);
117