src/sync_impl.h
author Edouard Tisserant <edouard@pep-project.org>
Tue, 06 Jun 2017 18:10:01 +0200
branchENGINE-179
changeset 1826 720922a950e9
parent 1597 cc039a6139cb
child 2287 026ab4dae779
permissions -rw-r--r--
Closed ENGINE-179 branch
vb@1513
     1
// This file is under GNU General Public License 3.0
vb@1513
     2
// see LICENSE.txt
vb@1513
     3
vb@1059
     4
#pragma once
vb@1059
     5
edouard@1586
     6
#include "../asn.1/DeviceGroup-Protocol.h"
vb@1059
     7
#include "message.h"
edouard@1172
     8
#include "sync.h"
vb@1059
     9
#include "sync_fsm.h"
vb@1059
    10
vb@1059
    11
#ifdef __cplusplus
vb@1059
    12
extern "C" {
vb@1059
    13
#endif
vb@1059
    14
edouard@1586
    15
typedef struct _group_keys_extra {
edouard@1586
    16
    identity_list *group_keys;
edouard@1586
    17
    char *group_id;
edouard@1586
    18
} group_keys_extra_t;
edouard@1586
    19
edouard@1597
    20
void free_group_keys_extra(group_keys_extra_t* groupkeys);
edouard@1597
    21
group_keys_extra_t* group_keys_extra_dup(group_keys_extra_t* groupkeys);
edouard@1597
    22
vb@1059
    23
PEP_STATUS receive_sync_msg(
vb@1059
    24
        PEP_SESSION session,
edouard@1445
    25
        sync_msg_t *sync_msg,
edouard@1445
    26
        time_t *timeout
vb@1059
    27
    );
vb@1059
    28
edouard@1195
    29
PEP_STATUS inject_DeviceState_event(
edouard@1195
    30
    PEP_SESSION session, 
edouard@1195
    31
    DeviceState_event event,
edouard@1195
    32
    Identity partner,
edouard@1195
    33
    void *extra);
edouard@1195
    34
edouard@1165
    35
PEP_STATUS receive_DeviceState_msg(
edouard@1165
    36
    PEP_SESSION session, 
edouard@1165
    37
    message *src, 
edouard@1165
    38
    PEP_rating rating, 
edouard@1165
    39
    stringlist_t *keylist);
vb@1059
    40
vb@1059
    41
DeviceGroup_Protocol_t *new_DeviceGroup_Protocol_msg(DeviceGroup_Protocol__payload_PR type);
vb@1059
    42
void free_DeviceGroup_Protocol_msg(DeviceGroup_Protocol_t *msg);
vb@1059
    43
vb@1059
    44
PEP_STATUS unicast_msg(
vb@1059
    45
        PEP_SESSION session,
vb@1091
    46
        const Identity partner,
vb@1059
    47
        DeviceState_state state,
vb@1097
    48
        DeviceGroup_Protocol_t *msg,
vb@1097
    49
        bool encrypted
vb@1059
    50
    );
vb@1059
    51
vb@1059
    52
PEP_STATUS multicast_self_msg(
vb@1059
    53
        PEP_SESSION session,
vb@1059
    54
        DeviceState_state state,
vb@1097
    55
        DeviceGroup_Protocol_t *msg,
vb@1097
    56
        bool encrypted
vb@1059
    57
    );
vb@1059
    58
vb@1085
    59
bool is_double(DeviceGroup_Protocol_t *msg);
vb@1085
    60
vb@1059
    61
#ifdef __cplusplus
vb@1059
    62
}
vb@1059
    63
#endif
vb@1059
    64