4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Yong Yeon Kim <yy9875.kim@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
23 * This file defines api utilities of IPC.
25 * @file media-util-ipc.h
26 * @author Haejeong Kim(backto.kim@samsung.com)
30 #ifndef _MEDIA_UTIL_IPC_H_
31 #define _MEDIA_UTIL_IPC_H_
37 #ifdef _USE_UDS_SOCKET_
40 #include <sys/socket.h>
43 #ifdef _USE_UDS_SOCKET_TCP_
47 #include <netinet/in.h>
48 #include <arpa/inet.h>
50 #include "media-server-ipc.h"
52 #define SERVER_IP "127.0.0.1"
59 #ifdef _USE_UDS_SOCKET_
60 int ms_ipc_create_client_socket(ms_protocol_e protocol, int timeout_sec, int *sock_fd, int port);
62 int ms_ipc_create_client_socket(ms_protocol_e protocol, int timeout_sec, int *sock_fd);
65 #ifdef _USE_UDS_SOCKET_TCP_
66 int ms_ipc_create_client_tcp_socket(ms_protocol_e protocol, int timeout_sec, int *sock_fd, int port);
67 int ms_ipc_create_server_tcp_socket(ms_protocol_e protocol, int port, int *sock_fd);
70 int ms_ipc_create_server_socket(ms_protocol_e protocol, int port, int *sock_fd);
71 #ifdef _USE_UDS_SOCKET_
72 int ms_ipc_send_msg_to_server(int sockfd, int port, ms_comm_msg_s *send_msg, struct sockaddr_un *serv_addr);
73 int ms_ipc_send_msg_to_client(int sockfd, ms_comm_msg_s *send_msg, struct sockaddr_un *client_addr);
74 int ms_ipc_receive_message(int sockfd, void *recv_msg, unsigned int msg_size, struct sockaddr_un *client_addr, unsigned int *size);
75 int ms_ipc_wait_message(int sockfd, void *recv_msg, unsigned int msg_size, struct sockaddr_un *recv_addr, unsigned int *size);
77 int ms_ipc_send_msg_to_server(int sockfd, int port, ms_comm_msg_s *send_msg, struct sockaddr_in *serv_addr);
78 int ms_ipc_send_msg_to_client(int sockfd, ms_comm_msg_s *send_msg, struct sockaddr_in *client_addr);
79 int ms_ipc_receive_message(int sockfd, void *recv_msg, unsigned int msg_size, struct sockaddr_in *client_addr, unsigned int *size);
80 int ms_ipc_wait_message(int sockfd, void *recv_msg, unsigned int msg_size, struct sockaddr_in *recv_addr, unsigned int *size);
87 #endif /*_MEDIA_UTIL_IPC_H_*/