1 /*
2  * Copyright (C) 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include <stddef.h>
19 #include <trusty_ipc.h>
20 #include <uapi/trusty_uuid.h>
21 
22 struct tipc_port_acl {
23     uint32_t flags;
24     uint32_t uuid_num;
25     const struct uuid** uuids;
26     const void* extra_data;
27 };
28 
29 struct tipc_port {
30     const char* name;
31     uint32_t msg_max_size;
32     uint32_t msg_queue_len;
33     const struct tipc_port_acl* acl;
34     const void* priv;
35 };
36 
37 struct tipc_srv_ops {
38     int (*on_connect)(const struct tipc_port* port, handle_t chan, const struct uuid* peer,
39                       void** ctx_p);
40 
41     int (*on_message)(const struct tipc_port* port, handle_t chan, void* ctx);
42 
43     void (*on_disconnect)(const struct tipc_port* port, handle_t chan, void* ctx);
44 
45     void (*on_channel_cleanup)(void* ctx);
46 };
47 
tipc_add_service(struct tipc_hset *,const struct tipc_port *,uint32_t,uint32_t,const struct tipc_srv_ops *)48 static inline int tipc_add_service(struct tipc_hset*, const struct tipc_port*, uint32_t, uint32_t,
49                                    const struct tipc_srv_ops*) {
50     return 0;
51 }
52