src/sync_actions.c
author Volker Birk <vb@pep-project.org>
Thu, 14 Jul 2016 13:33:24 +0200
changeset 883 096ff09932ad
parent 807 a33a5f760372
child 884 d64d366512a0
permissions -rw-r--r--
separating send actions from other actions
     1 // Actions for DeviceState state machine
     2 
     3 #include <assert.h>
     4 #include "pEp_internal.h"
     5 #include "keymanagement.h"
     6 #include "message.h"
     7 #include "sync_fsm.h"
     8 
     9 
    10 // showHandshake() - 
    11 //
    12 //  params:
    13 //      session (in)        session handle
    14 //      state (in)          state the state machine is in
    15 //      partner (in)        partner to communicate with
    16 //
    17 //  returns:
    18 //      PEP_STATUS_OK or any other value on error
    19 
    20 PEP_STATUS showHandshake(
    21         PEP_SESSION session,
    22         DeviceState_state state,
    23         const Identity partner
    24     )
    25 {
    26     PEP_STATUS status = PEP_STATUS_OK;
    27 
    28     assert(session);
    29     assert(partner);
    30     if (!(session && partner))
    31         return PEP_ILLEGAL_VALUE;
    32 
    33     // working code
    34 
    35 
    36     return status;
    37 
    38 enomem:
    39     status = PEP_OUT_OF_MEMORY;
    40 error:
    41     // free...
    42     return status;
    43 }
    44 
    45 
    46 // reject() - 
    47 //
    48 //  params:
    49 //      session (in)        session handle
    50 //      state (in)          state the state machine is in
    51 //      partner (in)        partner to communicate with
    52 //
    53 //  returns:
    54 //      PEP_STATUS_OK or any other value on error
    55 
    56 PEP_STATUS reject(
    57         PEP_SESSION session,
    58         DeviceState_state state,
    59         const Identity partner
    60     )
    61 {
    62     PEP_STATUS status = PEP_STATUS_OK;
    63 
    64     assert(session);
    65     assert(partner);
    66     if (!(session && partner))
    67         return PEP_ILLEGAL_VALUE;
    68 
    69     // working code
    70 
    71 
    72     return status;
    73 
    74 enomem:
    75     status = PEP_OUT_OF_MEMORY;
    76 error:
    77     // free...
    78     return status;
    79 }
    80 
    81 
    82 // storeGroupKeys() - 
    83 //
    84 //  params:
    85 //      session (in)        session handle
    86 //      state (in)          state the state machine is in
    87 //      partner (in)        partner to communicate with
    88 //
    89 //  returns:
    90 //      PEP_STATUS_OK or any other value on error
    91 
    92 PEP_STATUS storeGroupKeys(
    93         PEP_SESSION session,
    94         DeviceState_state state,
    95         const Identity partner
    96     )
    97 {
    98     PEP_STATUS status = PEP_STATUS_OK;
    99 
   100     assert(session);
   101     assert(partner);
   102     if (!(session && partner))
   103         return PEP_ILLEGAL_VALUE;
   104 
   105     // working code
   106 
   107 
   108     return status;
   109 
   110 enomem:
   111     status = PEP_OUT_OF_MEMORY;
   112 error:
   113     // free...
   114     return status;
   115 }
   116