1 /* Copyright (C) 2006-2010 The Android Open Source Project
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.
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.
13 #include "maru_common.h"
22 #include <sys/ioctl.h>
23 #include <sys/socket.h>
24 #include <netinet/in.h>
25 #include <netinet/tcp.h>
30 #define SDB_HOST_PORT 26099
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 */
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);