CCF
Loading...
Searching...
No Matches
node_types.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
6#include "ccf/frame_format.h"
7#include "ccf/tx_id.h"
9
10#include <cstdint>
11#include <limits>
12
13namespace ccf
14{
15 using Node2NodeMsg = uint64_t;
16
17 // Type of messages exchanged between nodes
24 // NB: The node-to-node channels assume only 2 types of messages exist, and
25 // treat them differently. Adding a new message type will likely need
26 // additional changes.
27
28 // Types of channel messages
35
36 // Types of frontend messages
38 {
41
42 // Includes a command_id, so that forwarded requests and responses can be
43 // precisely correlated. Supported since 2.0.8, emitted since 3.0.0
46
47 // Includes session consistency information:
48 // - cmd contains view in which all session requests must execute
49 // - response contains bool indicating that session should be closed
52 };
53
54#pragma pack(push, 1)
55 // Channel-specific header for key exchange
61
62 // Frontend-specific header for forwarding
68
74
76 {
85
86 // The view in which this session is being executed. For consistency, we
87 // pessimistically close this session if the node is in any other view.
89 };
90
92 {
101
102 // If the response contains a fatal error, indicate to the original node
103 // that the session should be terminated.
105 };
106
108 {
109 MessageHash() = default;
111 msg(msg_),
112 hash(std::move(hash_))
113 {}
114
117 };
118#pragma pack(pop)
119
122 {
124 DEFINE_RINGBUFFER_MSG_TYPE(associate_node_address),
125
128 DEFINE_RINGBUFFER_MSG_TYPE(node_inbound),
129
134 DEFINE_RINGBUFFER_MSG_TYPE(node_outbound),
135
137 DEFINE_RINGBUFFER_MSG_TYPE(close_node_outbound)
138 };
139}
140
142 ccf::associate_node_address, ccf::NodeId::Value, std::string, std::string);
144 ccf::node_inbound,
149 ccf::node_outbound,
155 ccf::close_node_outbound, ccf::NodeId::Value);
Definition sha256_hash.h:16
Definition app_interface.h:14
ChannelMsg
Definition node_types.h:30
@ key_exchange_init
Definition node_types.h:31
@ key_exchange_final
Definition node_types.h:33
@ key_exchange_response
Definition node_types.h:32
view
Definition signatures.h:54
uint64_t Node2NodeMsg
Definition node_types.h:15
ForwardedMsg
Definition node_types.h:38
@ forwarded_cmd_v3
Definition node_types.h:50
@ forwarded_cmd_v2
Definition node_types.h:44
@ forwarded_response_v1
Definition node_types.h:40
@ forwarded_response_v3
Definition node_types.h:51
@ forwarded_response_v2
Definition node_types.h:45
@ forwarded_cmd_v1
Definition node_types.h:39
@ DEFINE_RINGBUFFER_MSG_TYPE
Change the network nodes. Enclave -> Host.
Definition node_types.h:124
uint64_t View
Definition tx_id.h:23
FrameFormat
Definition frame_format.h:8
NodeMsgType
Definition node_types.h:19
@ channel_msg
Definition node_types.h:20
@ consensus_msg
Definition node_types.h:21
@ forwarded_msg
Definition node_types.h:22
uint32_t Message
Definition ring_buffer_types.h:19
STL namespace.
#define DECLARE_RINGBUFFER_MESSAGE_PAYLOAD(MTYPE,...)
Definition ring_buffer_types.h:179
Definition node_types.h:57
ChannelMsg msg
Definition node_types.h:58
NodeId from_node
Definition node_types.h:59
std::string Value
Definition entity_id.h:19
Definition node_types.h:76
ccf::View active_view
Definition node_types.h:88
ForwardedCommandHeader_v3(ForwardedHeader_v2::ForwardedCommandId cmd_id, ccf::View view)
Definition node_types.h:78
Definition node_types.h:64
ForwardedMsg msg
Definition node_types.h:65
ccf::FrameFormat frame_format
Definition node_types.h:66
Definition node_types.h:70
ForwardedCommandId id
Definition node_types.h:72
size_t ForwardedCommandId
Definition node_types.h:71
Definition node_types.h:92
ForwardedResponseHeader_v3(ForwardedHeader_v2::ForwardedCommandId cmd_id, bool terminate)
Definition node_types.h:94
bool terminate_session
Definition node_types.h:104
Definition node_types.h:108
MessageHash()=default
MessageHash(ForwardedMsg msg_, ccf::crypto::Sha256Hash &&hash_)
Definition node_types.h:110
ForwardedMsg msg
Definition node_types.h:115
ccf::crypto::Sha256Hash hash
Definition node_types.h:116
Definition serializer.h:27