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.
     1 #pragma once
     2 
     3 #include "message.h"
     4 #include "sync.h"
     5 #include "sync_fsm.h"
     6 
     7 #ifdef __cplusplus
     8 extern "C" {
     9 #endif
    10 
    11 PEP_STATUS receive_sync_msg(
    12         PEP_SESSION session,
    13         sync_msg_t *sync_msg
    14     );
    15 
    16 PEP_STATUS receive_DeviceState_msg(
    17     PEP_SESSION session, 
    18     message *src, 
    19     PEP_rating rating, 
    20     stringlist_t *keylist);
    21 
    22 DeviceGroup_Protocol_t *new_DeviceGroup_Protocol_msg(DeviceGroup_Protocol__payload_PR type);
    23 void free_DeviceGroup_Protocol_msg(DeviceGroup_Protocol_t *msg);
    24 
    25 PEP_STATUS unicast_msg(
    26         PEP_SESSION session,
    27         const Identity partner,
    28         DeviceState_state state,
    29         DeviceGroup_Protocol_t *msg,
    30         bool encrypted
    31     );
    32 
    33 PEP_STATUS multicast_self_msg(
    34         PEP_SESSION session,
    35         DeviceState_state state,
    36         DeviceGroup_Protocol_t *msg,
    37         bool encrypted
    38     );
    39 
    40 bool is_double(DeviceGroup_Protocol_t *msg);
    41 
    42 #ifdef __cplusplus
    43 }
    44 #endif
    45