mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 03:26:01 +00:00
268 lines
42 KiB
HTML
268 lines
42 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
<meta name="generator" content="Doxygen 1.9.8"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>rippled: Handshake.h Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">rippled
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.8 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(document).ready(function() { init_codefold(0); });
|
|
/* @license-end */
|
|
</script>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_a62226f9e3a6c7c5a3be455e2f87ae01.html">xrpld</a></li><li class="navelem"><a class="el" href="dir_c4f38cd849aa2a8e7280b7c5f705957a.html">overlay</a></li><li class="navelem"><a class="el" href="dir_a79f2d25ef1e73674b335287bd5311a8.html">detail</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="headertitle"><div class="title">Handshake.h</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#ifndef XRPL_OVERLAY_HANDSHAKE_H_INCLUDED</span></div>
|
|
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#define XRPL_OVERLAY_HANDSHAKE_H_INCLUDED</span></div>
|
|
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span> </div>
|
|
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="preprocessor">#include <xrpld/app/main/Application.h></span></div>
|
|
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include <xrpld/overlay/detail/ProtocolVersion.h></span></div>
|
|
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
|
|
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include <xrpl/beast/utility/Journal.h></span></div>
|
|
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include <xrpl/protocol/BuildInfo.h></span></div>
|
|
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> </div>
|
|
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include <boost/asio/ssl.hpp></span></div>
|
|
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include <boost/beast/core/tcp_stream.hpp></span></div>
|
|
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include <boost/beast/http/dynamic_body.hpp></span></div>
|
|
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include <boost/beast/http/empty_body.hpp></span></div>
|
|
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <boost/beast/http/fields.hpp></span></div>
|
|
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <boost/beast/ssl/ssl_stream.hpp></span></div>
|
|
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
|
|
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include <<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/optional.html">optional</a>></span></div>
|
|
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include <<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/utility.html">utility</a>></span></div>
|
|
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
|
|
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespaceripple.html">ripple</a> {</div>
|
|
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> </div>
|
|
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="namespaceripple.html#acf6e0f2509512b9dac2b0daccafd75b9"> 22</a></span><span class="keyword">using </span><a class="code hl_typedef" href="namespaceripple.html#acf6e0f2509512b9dac2b0daccafd75b9">socket_type</a> = boost::beast::tcp_stream;</div>
|
|
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"><a class="line" href="namespaceripple.html#a0356489dd518b8dc89a1153048cb4aee"> 23</a></span><span class="keyword">using </span><a class="code hl_typedef" href="namespaceripple.html#a0356489dd518b8dc89a1153048cb4aee">stream_type</a> = boost::beast::ssl_stream<socket_type>;</div>
|
|
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="namespaceripple.html#aca9c2c7a74ddd4a436b5984f6a265621"> 24</a></span><span class="keyword">using </span><a class="code hl_typedef" href="namespaceripple.html#aca9c2c7a74ddd4a436b5984f6a265621">request_type</a> =</div>
|
|
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> boost::beast::http::request<boost::beast::http::empty_body>;</div>
|
|
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="keyword">using </span><a class="code hl_typedef" href="namespaceripple.html#aa265217edeb8282e636c78b50049f4c0">http_request_type</a> =</div>
|
|
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> boost::beast::http::request<boost::beast::http::dynamic_body>;</div>
|
|
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="keyword">using </span><a class="code hl_typedef" href="namespaceripple.html#a2581fa85c4291f16bf9e17d78615d584">http_response_type</a> =</div>
|
|
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> boost::beast::http::response<boost::beast::http::dynamic_body>;</div>
|
|
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
|
|
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional<uint256></a></div>
|
|
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><a class="code hl_function" href="namespaceripple.html#a7241d07322a0d8fa2e2effedd739a90f">makeSharedValue</a>(<a class="code hl_typedef" href="namespaceripple.html#a0356489dd518b8dc89a1153048cb4aee">stream_type</a>& ssl, <a class="code hl_class" href="classbeast_1_1Journal.html">beast::Journal</a> journal);</div>
|
|
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> </div>
|
|
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="keywordtype">void</span></div>
|
|
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><a class="code hl_function" href="namespaceripple.html#a2f6f4c48edfa4bab7857fc6d554d0bcf">buildHandshake</a>(</div>
|
|
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> boost::beast::http::fields& h,</div>
|
|
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <a class="code hl_class" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>& sharedValue,</div>
|
|
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional<std::uint32_t></a> networkID,</div>
|
|
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <a class="code hl_typedef" href="namespacebeast_1_1IP.html#adbe597760cb20a7aa3f2ff92f7bed2cc">beast::IP::Address</a> public_ip,</div>
|
|
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <a class="code hl_typedef" href="namespacebeast_1_1IP.html#adbe597760cb20a7aa3f2ff92f7bed2cc">beast::IP::Address</a> remote_ip,</div>
|
|
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <a class="code hl_class" href="classripple_1_1Application.html">Application</a>& app);</div>
|
|
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> </div>
|
|
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span><a class="code hl_class" href="classripple_1_1PublicKey.html">PublicKey</a></div>
|
|
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span><a class="code hl_function" href="namespaceripple.html#acd7881ae39681c7d64a5904b367219ab">verifyHandshake</a>(</div>
|
|
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> boost::beast::http::fields <span class="keyword">const</span>& headers,</div>
|
|
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <a class="code hl_class" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>& sharedValue,</div>
|
|
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional<std::uint32_t></a> networkID,</div>
|
|
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <a class="code hl_typedef" href="namespacebeast_1_1IP.html#adbe597760cb20a7aa3f2ff92f7bed2cc">beast::IP::Address</a> public_ip,</div>
|
|
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <a class="code hl_typedef" href="namespacebeast_1_1IP.html#adbe597760cb20a7aa3f2ff92f7bed2cc">beast::IP::Address</a> remote,</div>
|
|
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <a class="code hl_class" href="classripple_1_1Application.html">Application</a>& app);</div>
|
|
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> </div>
|
|
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><a class="code hl_typedef" href="namespaceripple.html#aca9c2c7a74ddd4a436b5984f6a265621">request_type</a></div>
|
|
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span><a class="code hl_function" href="namespaceripple.html#ac35dc55d3f3c259f344225586a8887b4">makeRequest</a>(</div>
|
|
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordtype">bool</span> crawlPublic,</div>
|
|
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keywordtype">bool</span> comprEnabled,</div>
|
|
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="keywordtype">bool</span> ledgerReplayEnabled,</div>
|
|
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordtype">bool</span> txReduceRelayEnabled,</div>
|
|
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keywordtype">bool</span> vpReduceRelayEnabled);</div>
|
|
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> </div>
|
|
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span><a class="code hl_typedef" href="namespaceripple.html#a2581fa85c4291f16bf9e17d78615d584">http_response_type</a></div>
|
|
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span><a class="code hl_function" href="namespaceripple.html#a5590ae6006b178275628bde91fa03129">makeResponse</a>(</div>
|
|
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordtype">bool</span> crawlPublic,</div>
|
|
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <a class="code hl_typedef" href="namespaceripple.html#aa265217edeb8282e636c78b50049f4c0">http_request_type</a> <span class="keyword">const</span>& req,</div>
|
|
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <a class="code hl_typedef" href="namespacebeast_1_1IP.html#adbe597760cb20a7aa3f2ff92f7bed2cc">beast::IP::Address</a> public_ip,</div>
|
|
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <a class="code hl_typedef" href="namespacebeast_1_1IP.html#adbe597760cb20a7aa3f2ff92f7bed2cc">beast::IP::Address</a> remote_ip,</div>
|
|
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <a class="code hl_class" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>& sharedValue,</div>
|
|
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional<std::uint32_t></a> networkID,</div>
|
|
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/utility/pair.html">ProtocolVersion</a> version,</div>
|
|
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <a class="code hl_class" href="classripple_1_1Application.html">Application</a>& app);</div>
|
|
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> </div>
|
|
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span><span class="comment">// Protocol features negotiated via HTTP handshake.</span></div>
|
|
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span><span class="comment">// The format is:</span></div>
|
|
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span><span class="comment">// X-Protocol-Ctl: feature1=value1[,value2]*[\s*;\s*feature2=value1[,value2]*]*</span></div>
|
|
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span><span class="comment">// value: \S+</span></div>
|
|
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> </div>
|
|
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span><span class="comment">// compression feature</span></div>
|
|
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"><a class="line" href="namespaceripple.html#a329f20572687d73e31094b0717ea7424"> 122</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">char</span> <a class="code hl_variable" href="namespaceripple.html#a329f20572687d73e31094b0717ea7424">FEATURE_COMPR</a>[] = <span class="stringliteral">"compr"</span>;</div>
|
|
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span><span class="comment">// validation/proposal reduce-relay base squelch feature</span></div>
|
|
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"><a class="line" href="namespaceripple.html#af8096ae8c38e0d57b54d62311a0ae0e3"> 124</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">char</span> <a class="code hl_variable" href="namespaceripple.html#af8096ae8c38e0d57b54d62311a0ae0e3">FEATURE_VPRR</a>[] = <span class="stringliteral">"vprr"</span>;</div>
|
|
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span><span class="comment">// transaction reduce-relay feature</span></div>
|
|
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"><a class="line" href="namespaceripple.html#abfa1036f5269ce11a14cb8a8680dbc3e"> 126</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">char</span> <a class="code hl_variable" href="namespaceripple.html#abfa1036f5269ce11a14cb8a8680dbc3e">FEATURE_TXRR</a>[] = <span class="stringliteral">"txrr"</span>;</div>
|
|
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span><span class="comment">// ledger replay</span></div>
|
|
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"><a class="line" href="namespaceripple.html#a59334776ad7699c39ec3683f1fca4b2e"> 128</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">char</span> <a class="code hl_variable" href="namespaceripple.html#a59334776ad7699c39ec3683f1fca4b2e">FEATURE_LEDGER_REPLAY</a>[] = <span class="stringliteral">"ledgerreplay"</span>;</div>
|
|
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"><a class="line" href="namespaceripple.html#a201121472e8bff3b8d8eef7a2ef84b11"> 129</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">char</span> <a class="code hl_variable" href="namespaceripple.html#a201121472e8bff3b8d8eef7a2ef84b11">DELIM_FEATURE</a>[] = <span class="stringliteral">";"</span>;</div>
|
|
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"><a class="line" href="namespaceripple.html#a3626d08bac9baa6b3480e2e5ebe91682"> 130</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">char</span> <a class="code hl_variable" href="namespaceripple.html#a3626d08bac9baa6b3480e2e5ebe91682">DELIM_VALUE</a>[] = <span class="stringliteral">","</span>;</div>
|
|
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> </div>
|
|
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span><a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/utility/optional.html">std::optional<std::string></a></div>
|
|
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span><a class="code hl_function" href="namespaceripple.html#ab289776c60bd705e640136f8248adff9">getFeatureValue</a>(</div>
|
|
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> boost::beast::http::fields <span class="keyword">const</span>& headers,</div>
|
|
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> <span class="keyword">const</span>& feature);</div>
|
|
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> </div>
|
|
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span><span class="keywordtype">bool</span></div>
|
|
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span><a class="code hl_function" href="namespaceripple.html#a6d7b29582ed0ce64ee27f482ae5f96ba">isFeatureValue</a>(</div>
|
|
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> boost::beast::http::fields <span class="keyword">const</span>& headers,</div>
|
|
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> <span class="keyword">const</span>& feature,</div>
|
|
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> <span class="keyword">const</span>& value);</div>
|
|
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> </div>
|
|
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span><span class="keywordtype">bool</span></div>
|
|
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span><a class="code hl_function" href="namespaceripple.html#aa479458839503ea9da8953313824886b">featureEnabled</a>(</div>
|
|
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> boost::beast::http::fields <span class="keyword">const</span>& headers,</div>
|
|
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> <span class="keyword">const</span>& feature);</div>
|
|
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> </div>
|
|
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span><span class="keyword">template</span> <<span class="keyword">typename</span> headers></div>
|
|
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span><span class="keywordtype">bool</span></div>
|
|
<div class="foldopen" id="foldopen00179" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"><a class="line" href="namespaceripple.html#ab58cf24607744c98d521c3e97aca2a53"> 179</a></span><a class="code hl_function" href="namespaceripple.html#ab58cf24607744c98d521c3e97aca2a53">peerFeatureEnabled</a>(</div>
|
|
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> headers <span class="keyword">const</span>& request,</div>
|
|
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> <span class="keyword">const</span>& feature,</div>
|
|
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> value,</div>
|
|
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> <span class="keywordtype">bool</span> config)</div>
|
|
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span>{</div>
|
|
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> <span class="keywordflow">return</span> config && <a class="code hl_function" href="namespaceripple.html#a6d7b29582ed0ce64ee27f482ae5f96ba">isFeatureValue</a>(request, feature, value);</div>
|
|
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> </div>
|
|
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span><span class="keyword">template</span> <<span class="keyword">typename</span> headers></div>
|
|
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span><span class="keywordtype">bool</span></div>
|
|
<div class="foldopen" id="foldopen00191" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"><a class="line" href="namespaceripple.html#afa68890c5d61f277f7e40b3e52a339c8"> 191</a></span><a class="code hl_function" href="namespaceripple.html#ab58cf24607744c98d521c3e97aca2a53">peerFeatureEnabled</a>(</div>
|
|
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> headers <span class="keyword">const</span>& request,</div>
|
|
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> <span class="keyword">const</span>& feature,</div>
|
|
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> <span class="keywordtype">bool</span> config)</div>
|
|
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span>{</div>
|
|
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <span class="keywordflow">return</span> config && <a class="code hl_function" href="namespaceripple.html#ab58cf24607744c98d521c3e97aca2a53">peerFeatureEnabled</a>(request, feature, <span class="stringliteral">"1"</span>, config);</div>
|
|
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> </div>
|
|
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span><a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a></div>
|
|
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span><a class="code hl_function" href="namespaceripple.html#a3b64d9e22ab9ae2c1f8957809f69d9b0">makeFeaturesRequestHeader</a>(</div>
|
|
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> <span class="keywordtype">bool</span> comprEnabled,</div>
|
|
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> <span class="keywordtype">bool</span> ledgerReplayEnabled,</div>
|
|
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> <span class="keywordtype">bool</span> txReduceRelayEnabled,</div>
|
|
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> <span class="keywordtype">bool</span> vpReduceRelayEnabled);</div>
|
|
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> </div>
|
|
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span><a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a></div>
|
|
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span><a class="code hl_function" href="namespaceripple.html#a0a0ee63f1430dcca0ca6e0b06ca53998">makeFeaturesResponseHeader</a>(</div>
|
|
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> <a class="code hl_typedef" href="namespaceripple.html#aa265217edeb8282e636c78b50049f4c0">http_request_type</a> <span class="keyword">const</span>& headers,</div>
|
|
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> <span class="keywordtype">bool</span> comprEnabled,</div>
|
|
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> <span class="keywordtype">bool</span> ledgerReplayEnabled,</div>
|
|
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> <span class="keywordtype">bool</span> txReduceRelayEnabled,</div>
|
|
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> <span class="keywordtype">bool</span> vpReduceRelayEnabled);</div>
|
|
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> </div>
|
|
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span>} <span class="comment">// namespace ripple</span></div>
|
|
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> </div>
|
|
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span><span class="preprocessor">#endif</span></div>
|
|
<div class="ttc" id="abasic_string_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a></div></div>
|
|
<div class="ttc" id="aclassbeast_1_1Journal_html"><div class="ttname"><a href="classbeast_1_1Journal.html">beast::Journal</a></div><div class="ttdoc">A generic endpoint for log messages.</div><div class="ttdef"><b>Definition</b> <a href="Journal_8h_source.html#l00040">Journal.h:41</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1Application_html"><div class="ttname"><a href="classripple_1_1Application.html">ripple::Application</a></div><div class="ttdef"><b>Definition</b> <a href="Application_8h_source.html#l00094">Application.h:95</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1PublicKey_html"><div class="ttname"><a href="classripple_1_1PublicKey.html">ripple::PublicKey</a></div><div class="ttdoc">A public key.</div><div class="ttdef"><b>Definition</b> <a href="PublicKey_8h_source.html#l00042">PublicKey.h:43</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1base__uint_html"><div class="ttname"><a href="classripple_1_1base__uint.html">ripple::base_uint< 256 ></a></div></div>
|
|
<div class="ttc" id="anamespacebeast_1_1IP_html_adbe597760cb20a7aa3f2ff92f7bed2cc"><div class="ttname"><a href="namespacebeast_1_1IP.html#adbe597760cb20a7aa3f2ff92f7bed2cc">beast::IP::Address</a></div><div class="ttdeci">boost::asio::ip::address Address</div><div class="ttdef"><b>Definition</b> <a href="IPAddress_8h_source.html#l00020">IPAddress.h:20</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html"><div class="ttname"><a href="namespaceripple.html">ripple</a></div><div class="ttdoc">Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.</div><div class="ttdef"><b>Definition</b> <a href="algorithm_8h_source.html#l00006">algorithm.h:6</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a0356489dd518b8dc89a1153048cb4aee"><div class="ttname"><a href="namespaceripple.html#a0356489dd518b8dc89a1153048cb4aee">ripple::stream_type</a></div><div class="ttdeci">boost::beast::ssl_stream< socket_type > stream_type</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8h_source.html#l00023">Handshake.h:23</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a0a0ee63f1430dcca0ca6e0b06ca53998"><div class="ttname"><a href="namespaceripple.html#a0a0ee63f1430dcca0ca6e0b06ca53998">ripple::makeFeaturesResponseHeader</a></div><div class="ttdeci">std::string makeFeaturesResponseHeader(http_request_type const &headers, bool comprEnabled, bool ledgerReplayEnabled, bool txReduceRelayEnabled, bool vpReduceRelayEnabled)</div><div class="ttdoc">Make response header X-Protocol-Ctl value with supported features.</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8cpp_source.html#l00075">Handshake.cpp:75</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a201121472e8bff3b8d8eef7a2ef84b11"><div class="ttname"><a href="namespaceripple.html#a201121472e8bff3b8d8eef7a2ef84b11">ripple::DELIM_FEATURE</a></div><div class="ttdeci">static constexpr char DELIM_FEATURE[]</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8h_source.html#l00129">Handshake.h:129</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a2581fa85c4291f16bf9e17d78615d584"><div class="ttname"><a href="namespaceripple.html#a2581fa85c4291f16bf9e17d78615d584">ripple::http_response_type</a></div><div class="ttdeci">boost::beast::http::response< boost::beast::http::dynamic_body > http_response_type</div><div class="ttdef"><b>Definition</b> <a href="Handoff_8h_source.html#l00016">Handoff.h:17</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a2f6f4c48edfa4bab7857fc6d554d0bcf"><div class="ttname"><a href="namespaceripple.html#a2f6f4c48edfa4bab7857fc6d554d0bcf">ripple::buildHandshake</a></div><div class="ttdeci">void buildHandshake(boost::beast::http::fields &h, ripple::uint256 const &sharedValue, std::optional< std::uint32_t > networkID, beast::IP::Address public_ip, beast::IP::Address remote_ip, Application &app)</div><div class="ttdoc">Insert fields headers necessary for upgrading the link to the peer protocol.</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8cpp_source.html#l00159">Handshake.cpp:159</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a329f20572687d73e31094b0717ea7424"><div class="ttname"><a href="namespaceripple.html#a329f20572687d73e31094b0717ea7424">ripple::FEATURE_COMPR</a></div><div class="ttdeci">static constexpr char FEATURE_COMPR[]</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8h_source.html#l00122">Handshake.h:122</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a3626d08bac9baa6b3480e2e5ebe91682"><div class="ttname"><a href="namespaceripple.html#a3626d08bac9baa6b3480e2e5ebe91682">ripple::DELIM_VALUE</a></div><div class="ttdeci">static constexpr char DELIM_VALUE[]</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8h_source.html#l00130">Handshake.h:130</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a3b64d9e22ab9ae2c1f8957809f69d9b0"><div class="ttname"><a href="namespaceripple.html#a3b64d9e22ab9ae2c1f8957809f69d9b0">ripple::makeFeaturesRequestHeader</a></div><div class="ttdeci">std::string makeFeaturesRequestHeader(bool comprEnabled, bool ledgerReplayEnabled, bool txReduceRelayEnabled, bool vpReduceRelayEnabled)</div><div class="ttdoc">Make request header X-Protocol-Ctl value with supported features.</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8cpp_source.html#l00056">Handshake.cpp:56</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a5590ae6006b178275628bde91fa03129"><div class="ttname"><a href="namespaceripple.html#a5590ae6006b178275628bde91fa03129">ripple::makeResponse</a></div><div class="ttdeci">http_response_type makeResponse(bool crawlPublic, http_request_type const &req, beast::IP::Address public_ip, beast::IP::Address remote_ip, uint256 const &sharedValue, std::optional< std::uint32_t > networkID, ProtocolVersion protocol, Application &app)</div><div class="ttdoc">Make http response.</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8cpp_source.html#l00373">Handshake.cpp:373</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a59334776ad7699c39ec3683f1fca4b2e"><div class="ttname"><a href="namespaceripple.html#a59334776ad7699c39ec3683f1fca4b2e">ripple::FEATURE_LEDGER_REPLAY</a></div><div class="ttdeci">static constexpr char FEATURE_LEDGER_REPLAY[]</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8h_source.html#l00128">Handshake.h:128</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a6d7b29582ed0ce64ee27f482ae5f96ba"><div class="ttname"><a href="namespaceripple.html#a6d7b29582ed0ce64ee27f482ae5f96ba">ripple::isFeatureValue</a></div><div class="ttdeci">bool isFeatureValue(boost::beast::http::fields const &headers, std::string const &feature, std::string const &value)</div><div class="ttdoc">Check if a feature's value is equal to the specified value.</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8cpp_source.html#l00036">Handshake.cpp:36</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_a7241d07322a0d8fa2e2effedd739a90f"><div class="ttname"><a href="namespaceripple.html#a7241d07322a0d8fa2e2effedd739a90f">ripple::makeSharedValue</a></div><div class="ttdeci">std::optional< uint256 > makeSharedValue(stream_type &ssl, beast::Journal journal)</div><div class="ttdoc">Computes a shared value based on the SSL connection state.</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8cpp_source.html#l00127">Handshake.cpp:127</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_aa265217edeb8282e636c78b50049f4c0"><div class="ttname"><a href="namespaceripple.html#aa265217edeb8282e636c78b50049f4c0">ripple::http_request_type</a></div><div class="ttdeci">boost::beast::http::request< boost::beast::http::dynamic_body > http_request_type</div><div class="ttdef"><b>Definition</b> <a href="Handoff_8h_source.html#l00013">Handoff.h:14</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_aa479458839503ea9da8953313824886b"><div class="ttname"><a href="namespaceripple.html#aa479458839503ea9da8953313824886b">ripple::featureEnabled</a></div><div class="ttdeci">bool featureEnabled(boost::beast::http::fields const &headers, std::string const &feature)</div><div class="ttdoc">Check if a feature is enabled.</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8cpp_source.html#l00048">Handshake.cpp:48</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_ab289776c60bd705e640136f8248adff9"><div class="ttname"><a href="namespaceripple.html#ab289776c60bd705e640136f8248adff9">ripple::getFeatureValue</a></div><div class="ttdeci">std::optional< std::string > getFeatureValue(boost::beast::http::fields const &headers, std::string const &feature)</div><div class="ttdoc">Get feature's header value.</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8cpp_source.html#l00020">Handshake.cpp:20</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_ab58cf24607744c98d521c3e97aca2a53"><div class="ttname"><a href="namespaceripple.html#ab58cf24607744c98d521c3e97aca2a53">ripple::peerFeatureEnabled</a></div><div class="ttdeci">bool peerFeatureEnabled(headers const &request, std::string const &feature, std::string value, bool config)</div><div class="ttdoc">Check if a feature should be enabled for a peer.</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8h_source.html#l00179">Handshake.h:179</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_abfa1036f5269ce11a14cb8a8680dbc3e"><div class="ttname"><a href="namespaceripple.html#abfa1036f5269ce11a14cb8a8680dbc3e">ripple::FEATURE_TXRR</a></div><div class="ttdeci">static constexpr char FEATURE_TXRR[]</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8h_source.html#l00126">Handshake.h:126</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_ac35dc55d3f3c259f344225586a8887b4"><div class="ttname"><a href="namespaceripple.html#ac35dc55d3f3c259f344225586a8887b4">ripple::makeRequest</a></div><div class="ttdeci">auto makeRequest(bool crawlPublic, bool comprEnabled, bool ledgerReplayEnabled, bool txReduceRelayEnabled, bool vpReduceRelayEnabled) -> request_type</div><div class="ttdoc">Make outbound http request.</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8cpp_source.html#l00346">Handshake.cpp:346</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_aca9c2c7a74ddd4a436b5984f6a265621"><div class="ttname"><a href="namespaceripple.html#aca9c2c7a74ddd4a436b5984f6a265621">ripple::request_type</a></div><div class="ttdeci">boost::beast::http::request< boost::beast::http::empty_body > request_type</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8h_source.html#l00024">Handshake.h:25</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_acd7881ae39681c7d64a5904b367219ab"><div class="ttname"><a href="namespaceripple.html#acd7881ae39681c7d64a5904b367219ab">ripple::verifyHandshake</a></div><div class="ttdeci">PublicKey verifyHandshake(boost::beast::http::fields const &headers, ripple::uint256 const &sharedValue, std::optional< std::uint32_t > networkID, beast::IP::Address public_ip, beast::IP::Address remote, Application &app)</div><div class="ttdoc">Validate header fields necessary for upgrading the link to the peer protocol.</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8cpp_source.html#l00208">Handshake.cpp:208</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_acf6e0f2509512b9dac2b0daccafd75b9"><div class="ttname"><a href="namespaceripple.html#acf6e0f2509512b9dac2b0daccafd75b9">ripple::socket_type</a></div><div class="ttdeci">boost::beast::tcp_stream socket_type</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8h_source.html#l00022">Handshake.h:22</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html_af8096ae8c38e0d57b54d62311a0ae0e3"><div class="ttname"><a href="namespaceripple.html#af8096ae8c38e0d57b54d62311a0ae0e3">ripple::FEATURE_VPRR</a></div><div class="ttdeci">static constexpr char FEATURE_VPRR[]</div><div class="ttdef"><b>Definition</b> <a href="Handshake_8h_source.html#l00124">Handshake.h:124</a></div></div>
|
|
<div class="ttc" id="aoptional_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/header/optional.html">optional</a></div></div>
|
|
<div class="ttc" id="apair_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a></div></div>
|
|
<div class="ttc" id="autility_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/header/utility.html">utility</a></div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
|
|
</small></address>
|
|
</body>
|
|
</html>
|