anjana_sreekumar@infosys.com | 991c206 | 2020-01-08 11:42:57 +0530 | [diff] [blame^] | 1 | /* |
| 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 | |
| 28 | enum ipc_access_mode { |
| 29 | IPC_READ = 01, |
| 30 | IPC_WRITE = 02, |
| 31 | }; |
| 32 | |
| 33 | typedef int ipc_handle; |
| 34 | |
| 35 | int |
| 36 | create_ipc_channel(char *name); |
| 37 | |
| 38 | int |
| 39 | open_ipc_channel(char *name, enum ipc_access_mode access_mode); |
| 40 | |
| 41 | int |
| 42 | create_open_ipc_channel(char *name, |
| 43 | enum ipc_access_mode access_mode); |
| 44 | |
| 45 | int |
| 46 | read_ipc_channel(ipc_handle fd, char *buffer, size_t size); |
| 47 | |
| 48 | int |
| 49 | write_ipc_channel(ipc_handle fd, char *buffer, size_t size); |
| 50 | |
| 51 | int |
| 52 | close_ipc_channel(ipc_handle fd); |
| 53 | |
| 54 | int |
| 55 | create_tipc_socket(); |
| 56 | |
| 57 | int |
| 58 | bind_tipc_socket(int sockFd, uint32_t instanceNum); |
| 59 | |
| 60 | int |
| 61 | send_tipc_message(int sd, uint32_t destAddr, void * buf, int len); |
| 62 | |
| 63 | int |
| 64 | read_tipc_msg(int sockFd, void * buf, int len); |
| 65 | |
| 66 | void |
| 67 | close_tipc_socket(int sockFd); |
| 68 | |
| 69 | |
| 70 | #endif /* IPC_API_H_ */ |