update source for tizen_2.1
[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 #ifdef _WIN32
18 #include <windows.h>
19 #include <winsock2.h>
20 #include <ws2tcpip.h>
21 #else /* !_WIN32 */
22 #include <sys/ioctl.h>
23 #include <sys/socket.h>
24 #include <netinet/in.h>
25 #include <netinet/tcp.h>
26 #include <netdb.h>
27 #endif /* !_WIN32 */
28
29
30 #define SDB_HOST_PORT 26099
31
32 #define SDB_TCP_EMULD_INDEX  3    /* emulator daemon port */
33 #define SDB_TCP_OPENGL_INDEX  4   /* opengl server port */
34 #define SDB_UDP_SENSOR_INDEX  3   /* sensor server port */
35
36 void sdb_setup(void);
37 int get_sdb_base_port(void);
38 int inet_strtoip(const char*  str, uint32_t  *ip);
39 int socket_send(int fd, const void*  buf, int  buflen);
40 void socket_close(int fd);
41 void notify_sdb_daemon_start(void);
42 int check_port_bind_listen(uint32_t port);
43 int sdb_loopback_client(int port, int type);
44