Add device capability and get authenticated device list
[platform/core/system/edge-orchestration.git] / CMain / inc / orchestration.h
1 /* Code generated by cmd/cgo; DO NOT EDIT. */
2
3 /* package interfaces/capi */
4
5
6 #line 1 "cgo-builtin-export-prolog"
7
8 #include <stddef.h> /* for ptrdiff_t below */
9
10 #ifndef GO_CGO_EXPORT_PROLOGUE_H
11 #define GO_CGO_EXPORT_PROLOGUE_H
12
13 #ifndef GO_CGO_GOSTRING_TYPEDEF
14 typedef struct { const char *p; ptrdiff_t n; } _GoString_;
15 #endif
16
17 #endif
18
19 /* Start of preamble from import "C" comments.  */
20
21
22 #line 21 "main.go"
23 /*******************************************************************************
24  * Copyright 2020 Samsung Electronics All Rights Reserved.
25  *
26  * Licensed under the Apache License, Version 2.0 (the "License");
27  * you may not use this file except in compliance with the License.
28  * You may obtain a copy of the License at
29  *
30  * http://www.apache.org/licenses/LICENSE-2.0
31  *
32  * Unless required by applicable law or agreed to in writing, software
33  * distributed under the License is distributed on an "AS IS" BASIS,
34  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35  * See the License for the specific language governing permissions and
36  * limitations under the License.
37  *
38  *******************************************************************************/
39
40 #include <stdlib.h>
41
42 #ifndef __ORCHESTRATION_H__
43 #define __ORCHESTRATION_H__
44
45 #ifdef __cplusplus
46 extern "C"
47 {
48 #endif
49
50 #define MAX_SVC_INFO_NUM 3
51 typedef struct {
52         char* ExecutionType;
53         char* ExeCmd;
54 } RequestServiceInfo;
55
56 typedef struct {
57         char* ExecutionType;
58         char* Target;
59 } TargetInfo;
60
61 typedef struct {
62         char*      Message;
63         char*      ServiceName;
64         TargetInfo RemoteTargetInfo;
65 } ResponseService;
66
67 typedef struct {
68         char*   Message;
69         char*   Endpoints;
70 } DeviceList;
71
72 typedef struct {
73         char*   Message;
74         char*   CapabilityJson;
75 } DeviceCapability;
76
77 typedef char* (*identityGetterFunc)();
78 typedef char* (*keyGetterFunc)(char* id);
79 typedef int (*executeCb) (char* pkg_name, char* args);
80
81 static identityGetterFunc iGetter;
82 static keyGetterFunc kGetter;
83 static executeCb execCb;
84
85 static void setPSKHandler(identityGetterFunc ihandle, keyGetterFunc khandle){
86         iGetter = ihandle;
87         kGetter = khandle;
88 }
89
90 static char* bridge_iGetter(){
91         return iGetter();
92 }
93
94 static char* bridge_kGetter(char* id){
95         return kGetter(id);
96 }
97
98 static void setExecCb(executeCb exechandle) {
99         execCb = exechandle;
100 }
101
102 static int bridge_execCb(char *pkg_name, char* args){
103         return execCb(pkg_name, args);
104 }
105 #ifdef __cplusplus
106 }
107
108 #endif
109
110 #endif // __ORCHESTRATION_H__
111
112
113 #line 1 "cgo-generated-wrapper"
114
115
116 /* End of preamble from import "C" comments.  */
117
118
119 /* Start of boilerplate cgo prologue.  */
120 #line 1 "cgo-gcc-export-header-prolog"
121
122 #ifndef GO_CGO_PROLOGUE_H
123 #define GO_CGO_PROLOGUE_H
124
125 typedef signed char GoInt8;
126 typedef unsigned char GoUint8;
127 typedef short GoInt16;
128 typedef unsigned short GoUint16;
129 typedef int GoInt32;
130 typedef unsigned int GoUint32;
131 typedef long long GoInt64;
132 typedef unsigned long long GoUint64;
133 typedef GoInt32 GoInt;
134 typedef GoUint32 GoUint;
135 typedef __SIZE_TYPE__ GoUintptr;
136 typedef float GoFloat32;
137 typedef double GoFloat64;
138 typedef float _Complex GoComplex64;
139 typedef double _Complex GoComplex128;
140
141 /*
142   static assertion to make sure the file is being used on architecture
143   at least with matching size of GoInt.
144 */
145 typedef char _check_for_32_bit_pointer_matching_GoInt[sizeof(void*)==32/8 ? 1:-1];
146
147 #ifndef GO_CGO_GOSTRING_TYPEDEF
148 typedef _GoString_ GoString;
149 #endif
150 typedef void *GoMap;
151 typedef void *GoChan;
152 typedef struct { void *t; void *v; } GoInterface;
153 typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
154
155 #endif
156
157 /* End of boilerplate cgo prologue.  */
158
159 #ifdef __cplusplus
160 extern "C" {
161 #endif
162
163
164 extern int OrchestrationInit(executeCb p0);
165
166 extern ResponseService OrchestrationRequestService(char* p0, int p1, char* p2, RequestServiceInfo* p3, int p4);
167
168 extern ResponseService OrchestrationRequestServiceOnDevice(char* p0, int p1, char* p2, RequestServiceInfo* p3, char* p4, int p5);
169
170 extern DeviceList* OrchestrationGetDeviceList(char* p0, char* p1);
171
172 extern DeviceCapability* OrchestrationReadCapability(char* p0);
173
174 extern char* OrchestrationWriteCapability(char* p0);
175
176 extern void SetPSKHandler(identityGetterFunc p0, keyGetterFunc p1);
177
178 extern int PrintLog(char* p0);
179
180 #ifdef __cplusplus
181 }
182 #endif