blob: 92ae5ce4704dd791e038619249cd28910f54e226 [file] [log] [blame]
anjana_sreekumar@infosys.com991c2062020-01-08 11:42:57 +05301/*
2 * Copyright (c) 2003-2018, Great Software Laboratory Pvt. Ltd.
3 * Copyright (c) 2017 Intel Corporation
4 * Copyright (c) 2019, Infosys Ltd.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19#ifndef IPC_API_H_
20#define IPC_API_H_
21
22#include <tipcTypes.h>
23
24#define IPC_MAX_BUFFER_SIZE 1024
25
26#define IPC_MODE 0664
27
28enum ipc_access_mode {
29 IPC_READ = 01,
30 IPC_WRITE = 02,
31};
32
33typedef int ipc_handle;
34
35int
36create_ipc_channel(char *name);
37
38int
39open_ipc_channel(char *name, enum ipc_access_mode access_mode);
40
41int
42create_open_ipc_channel(char *name,
43 enum ipc_access_mode access_mode);
44
45int
46read_ipc_channel(ipc_handle fd, char *buffer, size_t size);
47
48int
49write_ipc_channel(ipc_handle fd, char *buffer, size_t size);
50
51int
52close_ipc_channel(ipc_handle fd);
53
54int
55create_tipc_socket();
56
57int
58bind_tipc_socket(int sockFd, uint32_t instanceNum);
59
60int
61send_tipc_message(int sd, uint32_t destAddr, void * buf, int len);
62
63int
64read_tipc_msg(int sockFd, void * buf, int len);
65
66void
67close_tipc_socket(int sockFd);
68
69
70#endif /* IPC_API_H_ */