src/sync_impl.h
author Edouard Tisserant <edouard@pep-project.org>
Sat, 24 Sep 2016 09:27:25 +0200
branchkeysync
changeset 1172 15a75c0cc78f
parent 1165 05c831cfab65
child 1195 53f8859f476b
permissions -rw-r--r--
Sync : changed sync queue payload type so that sync protocol can receive event such as keygen or decrypt failure asynchronously from other sessions. Fixed problem with ownership of payload leading to memory leak in some case.
vb@1059
     1
#pragma once
vb@1059
     2
vb@1059
     3
#include "message.h"
edouard@1172
     4
#include "sync.h"
vb@1059
     5
#include "sync_fsm.h"
vb@1059
     6
vb@1059
     7
#ifdef __cplusplus
vb@1059
     8
extern "C" {
vb@1059
     9
#endif
vb@1059
    10
vb@1059
    11
PEP_STATUS receive_sync_msg(
vb@1059
    12
        PEP_SESSION session,
edouard@1172
    13
        sync_msg_t *sync_msg
vb@1059
    14
    );
vb@1059
    15
edouard@1165
    16
PEP_STATUS receive_DeviceState_msg(
edouard@1165
    17
    PEP_SESSION session, 
edouard@1165
    18
    message *src, 
edouard@1165
    19
    PEP_rating rating, 
edouard@1165
    20
    stringlist_t *keylist);
vb@1059
    21
vb@1059
    22
DeviceGroup_Protocol_t *new_DeviceGroup_Protocol_msg(DeviceGroup_Protocol__payload_PR type);
vb@1059
    23
void free_DeviceGroup_Protocol_msg(DeviceGroup_Protocol_t *msg);
vb@1059
    24
vb@1059
    25
PEP_STATUS unicast_msg(
vb@1059
    26
        PEP_SESSION session,
vb@1091
    27
        const Identity partner,
vb@1059
    28
        DeviceState_state state,
vb@1097
    29
        DeviceGroup_Protocol_t *msg,
vb@1097
    30
        bool encrypted
vb@1059
    31
    );
vb@1059
    32
vb@1059
    33
PEP_STATUS multicast_self_msg(
vb@1059
    34
        PEP_SESSION session,
vb@1059
    35
        DeviceState_state state,
vb@1097
    36
        DeviceGroup_Protocol_t *msg,
vb@1097
    37
        bool encrypted
vb@1059
    38
    );
vb@1059
    39
vb@1085
    40
bool is_double(DeviceGroup_Protocol_t *msg);
vb@1085
    41
vb@1059
    42
#ifdef __cplusplus
vb@1059
    43
}
vb@1059
    44
#endif
vb@1059
    45