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