-
Notifications
You must be signed in to change notification settings - Fork 0
/
carrierUtils.h
39 lines (30 loc) · 1023 Bytes
/
carrierUtils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef __CARRIER_UTILS_H__
#define __CARRIER_UTILS_H__
#include <node_api.h>
#include "include/ela_carrier.h"
typedef struct BootstrapHelper {
char *ipv4;
char *ipv6;
char *port;
char *public_key;
} BootstrapHelper;
typedef struct ExpressNodeHelper {
char *ipv4;
char *ipv6;
char *port;
char *public_key;
} ExpressNodeHelper;
typedef struct OptionsHelper {
int udp_enabled;
char* persistent_location;
uint8_t* secret_key;
size_t bootstraps_size;
BootstrapHelper *bootstraps;
size_t express_nodes_size;
ExpressNodeHelper *express_nodes;
} OptionsHelper;
int getOptionsHelper(napi_env env, napi_callback_info info, napi_value options, OptionsHelper *opts);
int getNativeUserInfo(napi_env env, napi_callback_info info, napi_value jUserInfo, ElaUserInfo *userInfo);
int newUserInfo(napi_env env, ElaUserInfo *userInfo, napi_value *jUserInfo);
int newFriendInfo(napi_env env, ElaFriendInfo *friendInfo, napi_value *jFriendInfo);
#endif //__CARRIER_UTILS_H__