mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 19:15:54 +00:00
285 lines
48 KiB
HTML
285 lines
48 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: PeerfinderConfig.cpp 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_89046728185f0c274a4164d3e2cb38fb.html">peerfinder</a></li><li class="navelem"><a class="el" href="dir_e9607b4c59cebecf2224e361d8d6d362.html">detail</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="headertitle"><div class="title">PeerfinderConfig.cpp</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="comment">//------------------------------------------------------------------------------</span></div>
|
|
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">/*</span></div>
|
|
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment"> This file is part of rippled: https://github.com/ripple/rippled</span></div>
|
|
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment"> Copyright (c) 2012, 2013 Ripple Labs Inc.</span></div>
|
|
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment"></span> </div>
|
|
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment"> Permission to use, copy, modify, and/or distribute this software for any</span></div>
|
|
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment"> purpose with or without fee is hereby granted, provided that the above</span></div>
|
|
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment"> copyright notice and this permission notice appear in all copies.</span></div>
|
|
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment"></span> </div>
|
|
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment"> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES</span></div>
|
|
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment"> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF</span></div>
|
|
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment"> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR</span></div>
|
|
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment"> ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES</span></div>
|
|
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment"> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN</span></div>
|
|
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment"> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF</span></div>
|
|
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment"> OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</span></div>
|
|
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment">*/</span></div>
|
|
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment">//==============================================================================</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="preprocessor">#include <xrpld/peerfinder/PeerfinderManager.h></span></div>
|
|
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include <xrpld/peerfinder/detail/Tuning.h></span></div>
|
|
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
|
|
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespaceripple.html">ripple</a> {</div>
|
|
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="keyword">namespace </span>PeerFinder {</div>
|
|
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div>
|
|
<div class="foldopen" id="foldopen00026" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"><a class="line" href="structripple_1_1PeerFinder_1_1Config.html#a189d9cacf39182df611c2e0ba2dd177f"> 26</a></span><a class="code hl_function" href="structripple_1_1PeerFinder_1_1Config.html#a189d9cacf39182df611c2e0ba2dd177f">Config::Config</a>()</div>
|
|
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> : maxPeers(Tuning::defaultMaxPeers)</div>
|
|
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> , outPeers(calcOutPeers())</div>
|
|
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> , inPeers(0)</div>
|
|
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> , wantIncoming(true)</div>
|
|
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> , autoConnect(true)</div>
|
|
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> , listeningPort(0)</div>
|
|
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> , ipLimit(0)</div>
|
|
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span>{</div>
|
|
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> </div>
|
|
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="keywordtype">bool</span></div>
|
|
<div class="foldopen" id="foldopen00038" data-start="{" data-end="};">
|
|
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="structripple_1_1PeerFinder_1_1Config.html#afb682cfc22bdb3d6e89c7c1b2e2b514a"> 38</a></span><a class="code hl_function" href="namespaceripple_1_1PeerFinder.html#a22c88667b16496babeb8c9726e6d1eec">operator==</a>(<a class="code hl_struct" href="structripple_1_1PeerFinder_1_1Config.html">Config</a> <span class="keyword">const</span>& lhs, <a class="code hl_struct" href="structripple_1_1PeerFinder_1_1Config.html">Config</a> <span class="keyword">const</span>& rhs)</div>
|
|
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span>{</div>
|
|
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keywordflow">return</span> lhs.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a2aa0119410e7741efd384492c1e5a3b9">autoConnect</a> == rhs.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a2aa0119410e7741efd384492c1e5a3b9">autoConnect</a> &&</div>
|
|
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> lhs.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#af9b3a48e05361caa57d3e0c09e37a166">peerPrivate</a> == rhs.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#af9b3a48e05361caa57d3e0c09e37a166">peerPrivate</a> &&</div>
|
|
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> lhs.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#ab92a8f8d998ed8d7e2940b71734fa09f">wantIncoming</a> == rhs.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#ab92a8f8d998ed8d7e2940b71734fa09f">wantIncoming</a> && lhs.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a67c60a2f6d0ef7a67fc7144f09f57d04">inPeers</a> == rhs.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a67c60a2f6d0ef7a67fc7144f09f57d04">inPeers</a> &&</div>
|
|
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> lhs.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#aa0026277cfc4914ecc8d136e5a94ef8e">maxPeers</a> == rhs.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#aa0026277cfc4914ecc8d136e5a94ef8e">maxPeers</a> && lhs.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#ab9a20f47b40f06984c08aed2ca613613">outPeers</a> == rhs.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#ab9a20f47b40f06984c08aed2ca613613">outPeers</a> &&</div>
|
|
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> lhs.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#ab5462b5e4ecc5a63168673fcf64ed221">features</a> == lhs.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#ab5462b5e4ecc5a63168673fcf64ed221">features</a> && lhs.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a46decaaf39a6782668b563d2d774ddb5">ipLimit</a> == rhs.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a46decaaf39a6782668b563d2d774ddb5">ipLimit</a> &&</div>
|
|
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> lhs.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#af8629cfefba4fb74f5a498562eddc06b">listeningPort</a> == rhs.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#af8629cfefba4fb74f5a498562eddc06b">listeningPort</a>;</div>
|
|
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> </div>
|
|
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a></div>
|
|
<div class="foldopen" id="foldopen00049" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="structripple_1_1PeerFinder_1_1Config.html#af22578657f9b42b4c0b66cb6289761aa"> 49</a></span><a class="code hl_function" href="structripple_1_1PeerFinder_1_1Config.html#af22578657f9b42b4c0b66cb6289761aa">Config::calcOutPeers</a>()<span class="keyword"> const</span></div>
|
|
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="keyword"></span>{</div>
|
|
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" href="http://en.cppreference.com/w/cpp/algorithm/max.html">std::max</a>(</div>
|
|
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> (<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#aa0026277cfc4914ecc8d136e5a94ef8e">maxPeers</a> * <a class="code hl_enumvalue" href="namespaceripple_1_1PeerFinder_1_1Tuning.html#affb41e96294735aed7d3908f12eec645a4bdda2a4de62bd1ac3594de895ba3b10">Tuning::outPercent</a> + 50) / 100,</div>
|
|
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a>(<a class="code hl_enumvalue" href="namespaceripple_1_1PeerFinder_1_1Tuning.html#affb41e96294735aed7d3908f12eec645adfb5a5032cadf474a7d73130e7bdfbab">Tuning::minOutCount</a>));</div>
|
|
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> </div>
|
|
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span><span class="keywordtype">void</span></div>
|
|
<div class="foldopen" id="foldopen00057" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="structripple_1_1PeerFinder_1_1Config.html#a7fde17254835e48c5b090bb00fe337e9"> 57</a></span><a class="code hl_function" href="structripple_1_1PeerFinder_1_1Config.html#a7fde17254835e48c5b090bb00fe337e9">Config::applyTuning</a>()</div>
|
|
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span>{</div>
|
|
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a46decaaf39a6782668b563d2d774ddb5">ipLimit</a> == 0)</div>
|
|
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> {</div>
|
|
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="comment">// Unless a limit is explicitly set, we allow between</span></div>
|
|
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="comment">// 2 and 5 connections from non RFC-1918 "private"</span></div>
|
|
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="comment">// IP addresses.</span></div>
|
|
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a46decaaf39a6782668b563d2d774ddb5">ipLimit</a> = 2;</div>
|
|
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
|
|
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a67c60a2f6d0ef7a67fc7144f09f57d04">inPeers</a> > <a class="code hl_enumvalue" href="namespaceripple_1_1PeerFinder_1_1Tuning.html#affb41e96294735aed7d3908f12eec645ae2613c88dfdb6971e3738f1f7ef8f295">Tuning::defaultMaxPeers</a>)</div>
|
|
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a46decaaf39a6782668b563d2d774ddb5">ipLimit</a> += <a class="code hl_functionRef" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a>(</div>
|
|
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> 5, <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a67c60a2f6d0ef7a67fc7144f09f57d04">inPeers</a> / <a class="code hl_enumvalue" href="namespaceripple_1_1PeerFinder_1_1Tuning.html#affb41e96294735aed7d3908f12eec645ae2613c88dfdb6971e3738f1f7ef8f295">Tuning::defaultMaxPeers</a>));</div>
|
|
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> }</div>
|
|
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> </div>
|
|
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="comment">// We don't allow a single IP to consume all incoming slots,</span></div>
|
|
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="comment">// unless we only have one incoming slot available.</span></div>
|
|
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a46decaaf39a6782668b563d2d774ddb5">ipLimit</a> = <a class="code hl_functionRef" href="http://en.cppreference.com/w/cpp/algorithm/max.html">std::max</a>(1, <a class="code hl_functionRef" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a>(<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a46decaaf39a6782668b563d2d774ddb5">ipLimit</a>, <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a67c60a2f6d0ef7a67fc7144f09f57d04">inPeers</a> / 2)));</div>
|
|
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> </div>
|
|
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span><span class="keywordtype">void</span></div>
|
|
<div class="foldopen" id="foldopen00077" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="structripple_1_1PeerFinder_1_1Config.html#a0003a9384327d7c4a4823fa736bf86cc"> 77</a></span><a class="code hl_function" href="structripple_1_1PeerFinder_1_1Config.html#a0003a9384327d7c4a4823fa736bf86cc">Config::onWrite</a>(<a class="code hl_class" href="classbeast_1_1PropertyStream_1_1Map.html">beast::PropertyStream::Map</a>& map)</div>
|
|
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span>{</div>
|
|
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> map[<span class="stringliteral">"max_peers"</span>] = <a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#aa0026277cfc4914ecc8d136e5a94ef8e">maxPeers</a>;</div>
|
|
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> map[<span class="stringliteral">"out_peers"</span>] = <a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#ab9a20f47b40f06984c08aed2ca613613">outPeers</a>;</div>
|
|
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> map[<span class="stringliteral">"want_incoming"</span>] = <a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#ab92a8f8d998ed8d7e2940b71734fa09f">wantIncoming</a>;</div>
|
|
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> map[<span class="stringliteral">"auto_connect"</span>] = <a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a2aa0119410e7741efd384492c1e5a3b9">autoConnect</a>;</div>
|
|
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> map[<span class="stringliteral">"port"</span>] = <a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#af8629cfefba4fb74f5a498562eddc06b">listeningPort</a>;</div>
|
|
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> map[<span class="stringliteral">"features"</span>] = <a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#ab5462b5e4ecc5a63168673fcf64ed221">features</a>;</div>
|
|
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> map[<span class="stringliteral">"ip_limit"</span>] = <a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a46decaaf39a6782668b563d2d774ddb5">ipLimit</a>;</div>
|
|
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> </div>
|
|
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span><a class="code hl_struct" href="structripple_1_1PeerFinder_1_1Config.html">Config</a></div>
|
|
<div class="foldopen" id="foldopen00089" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"><a class="line" href="structripple_1_1PeerFinder_1_1Config.html#a9321a565c8d2fac0bbc77cb24582fc94"> 89</a></span><a class="code hl_function" href="structripple_1_1PeerFinder_1_1Config.html#a9321a565c8d2fac0bbc77cb24582fc94">Config::makeConfig</a>(</div>
|
|
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <a class="code hl_class" href="classripple_1_1Config.html">ripple::Config</a> <span class="keyword">const</span>& cfg,</div>
|
|
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a> port,</div>
|
|
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="keywordtype">bool</span> validationPublicKey,</div>
|
|
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keywordtype">int</span> ipLimit)</div>
|
|
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span>{</div>
|
|
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <a class="code hl_struct" href="structripple_1_1PeerFinder_1_1Config.html">PeerFinder::Config</a> config;</div>
|
|
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> </div>
|
|
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#af9b3a48e05361caa57d3e0c09e37a166">peerPrivate</a> = cfg.<a class="code hl_variable" href="classripple_1_1Config.html#a5291a6910fa0a3e2aa99943895467dba">PEER_PRIVATE</a>;</div>
|
|
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> </div>
|
|
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="comment">// Servers with peer privacy don't want to allow incoming connections</span></div>
|
|
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#ab92a8f8d998ed8d7e2940b71734fa09f">wantIncoming</a> = (!config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#af9b3a48e05361caa57d3e0c09e37a166">peerPrivate</a>) && (port != 0);</div>
|
|
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> </div>
|
|
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordflow">if</span> (!cfg.<a class="code hl_variable" href="classripple_1_1Config.html#af722ebb601d71b9e56145ac49fc85280">PEERS_OUT_MAX</a> && !cfg.<a class="code hl_variable" href="classripple_1_1Config.html#a521c6cb417d606254ecb78c4933af418">PEERS_IN_MAX</a>)</div>
|
|
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> {</div>
|
|
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keywordflow">if</span> (cfg.<a class="code hl_variable" href="classripple_1_1Config.html#affa3814314db54dc51e3f56c00ff32e7">PEERS_MAX</a> != 0)</div>
|
|
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#aa0026277cfc4914ecc8d136e5a94ef8e">maxPeers</a> = cfg.<a class="code hl_variable" href="classripple_1_1Config.html#affa3814314db54dc51e3f56c00ff32e7">PEERS_MAX</a>;</div>
|
|
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> </div>
|
|
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordflow">if</span> (config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#aa0026277cfc4914ecc8d136e5a94ef8e">maxPeers</a> < <a class="code hl_enumvalue" href="namespaceripple_1_1PeerFinder_1_1Tuning.html#affb41e96294735aed7d3908f12eec645adfb5a5032cadf474a7d73130e7bdfbab">Tuning::minOutCount</a>)</div>
|
|
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#aa0026277cfc4914ecc8d136e5a94ef8e">maxPeers</a> = <a class="code hl_enumvalue" href="namespaceripple_1_1PeerFinder_1_1Tuning.html#affb41e96294735aed7d3908f12eec645adfb5a5032cadf474a7d73130e7bdfbab">Tuning::minOutCount</a>;</div>
|
|
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#ab9a20f47b40f06984c08aed2ca613613">outPeers</a> = config.<a class="code hl_function" href="structripple_1_1PeerFinder_1_1Config.html#af22578657f9b42b4c0b66cb6289761aa">calcOutPeers</a>();</div>
|
|
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> </div>
|
|
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="comment">// Calculate the number of outbound peers we want. If we dont want</span></div>
|
|
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="comment">// or can't accept incoming, this will simply be equal to maxPeers.</span></div>
|
|
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keywordflow">if</span> (!config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#ab92a8f8d998ed8d7e2940b71734fa09f">wantIncoming</a>)</div>
|
|
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#ab9a20f47b40f06984c08aed2ca613613">outPeers</a> = config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#aa0026277cfc4914ecc8d136e5a94ef8e">maxPeers</a>;</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">// Calculate the largest number of inbound connections we could</span></div>
|
|
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="comment">// take.</span></div>
|
|
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordflow">if</span> (config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#aa0026277cfc4914ecc8d136e5a94ef8e">maxPeers</a> >= config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#ab9a20f47b40f06984c08aed2ca613613">outPeers</a>)</div>
|
|
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a67c60a2f6d0ef7a67fc7144f09f57d04">inPeers</a> = config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#aa0026277cfc4914ecc8d136e5a94ef8e">maxPeers</a> - config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#ab9a20f47b40f06984c08aed2ca613613">outPeers</a>;</div>
|
|
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keywordflow">else</span></div>
|
|
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a67c60a2f6d0ef7a67fc7144f09f57d04">inPeers</a> = 0;</div>
|
|
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> }</div>
|
|
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keywordflow">else</span></div>
|
|
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> {</div>
|
|
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#ab9a20f47b40f06984c08aed2ca613613">outPeers</a> = cfg.<a class="code hl_variable" href="classripple_1_1Config.html#af722ebb601d71b9e56145ac49fc85280">PEERS_OUT_MAX</a>;</div>
|
|
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a67c60a2f6d0ef7a67fc7144f09f57d04">inPeers</a> = cfg.<a class="code hl_variable" href="classripple_1_1Config.html#a521c6cb417d606254ecb78c4933af418">PEERS_IN_MAX</a>;</div>
|
|
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#aa0026277cfc4914ecc8d136e5a94ef8e">maxPeers</a> = 0;</div>
|
|
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> }</div>
|
|
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> </div>
|
|
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <span class="comment">// This will cause servers configured as validators to request that</span></div>
|
|
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="comment">// peers they connect to never report their IP address. We set this</span></div>
|
|
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="comment">// after we set the 'wantIncoming' because we want a "soft" version</span></div>
|
|
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <span class="comment">// of peer privacy unless the operator explicitly asks for it.</span></div>
|
|
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keywordflow">if</span> (validationPublicKey)</div>
|
|
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#af9b3a48e05361caa57d3e0c09e37a166">peerPrivate</a> = <span class="keyword">true</span>;</div>
|
|
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> </div>
|
|
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="comment">// if it's a private peer or we are running as standalone</span></div>
|
|
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="comment">// automatic connections would defeat the purpose.</span></div>
|
|
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a2aa0119410e7741efd384492c1e5a3b9">autoConnect</a> = !cfg.<a class="code hl_function" href="classripple_1_1Config.html#a55cd8ef67ffbf6a137e0dd71bc8151c6">standalone</a>() && !cfg.<a class="code hl_variable" href="classripple_1_1Config.html#a5291a6910fa0a3e2aa99943895467dba">PEER_PRIVATE</a>;</div>
|
|
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#af8629cfefba4fb74f5a498562eddc06b">listeningPort</a> = port;</div>
|
|
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#ab5462b5e4ecc5a63168673fcf64ed221">features</a> = <span class="stringliteral">""</span>;</div>
|
|
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> config.<a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a46decaaf39a6782668b563d2d774ddb5">ipLimit</a> = <a class="code hl_variable" href="structripple_1_1PeerFinder_1_1Config.html#a46decaaf39a6782668b563d2d774ddb5">ipLimit</a>;</div>
|
|
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> </div>
|
|
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="comment">// Enforce business rules</span></div>
|
|
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> config.<a class="code hl_function" href="structripple_1_1PeerFinder_1_1Config.html#a7fde17254835e48c5b090bb00fe337e9">applyTuning</a>();</div>
|
|
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> </div>
|
|
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keywordflow">return</span> config;</div>
|
|
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> </div>
|
|
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span>} <span class="comment">// namespace PeerFinder</span></div>
|
|
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span>} <span class="comment">// namespace ripple</span></div>
|
|
<div class="ttc" id="aclassbeast_1_1PropertyStream_1_1Map_html"><div class="ttname"><a href="classbeast_1_1PropertyStream_1_1Map.html">beast::PropertyStream::Map</a></div><div class="ttdef"><b>Definition</b> <a href="PropertyStream_8h_source.html#l00222">PropertyStream.h:223</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1Config_html"><div class="ttname"><a href="classripple_1_1Config.html">ripple::Config</a></div><div class="ttdef"><b>Definition</b> <a href="Config_8h_source.html#l00085">Config.h:86</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1Config_html_a521c6cb417d606254ecb78c4933af418"><div class="ttname"><a href="classripple_1_1Config.html#a521c6cb417d606254ecb78c4933af418">ripple::Config::PEERS_IN_MAX</a></div><div class="ttdeci">std::size_t PEERS_IN_MAX</div><div class="ttdef"><b>Definition</b> <a href="Config_8h_source.html#l00181">Config.h:181</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1Config_html_a5291a6910fa0a3e2aa99943895467dba"><div class="ttname"><a href="classripple_1_1Config.html#a5291a6910fa0a3e2aa99943895467dba">ripple::Config::PEER_PRIVATE</a></div><div class="ttdeci">bool PEER_PRIVATE</div><div class="ttdef"><b>Definition</b> <a href="Config_8h_source.html#l00173">Config.h:173</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1Config_html_a55cd8ef67ffbf6a137e0dd71bc8151c6"><div class="ttname"><a href="classripple_1_1Config.html#a55cd8ef67ffbf6a137e0dd71bc8151c6">ripple::Config::standalone</a></div><div class="ttdeci">bool standalone() const</div><div class="ttdef"><b>Definition</b> <a href="Config_8h_source.html#l00336">Config.h:336</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1Config_html_af722ebb601d71b9e56145ac49fc85280"><div class="ttname"><a href="classripple_1_1Config.html#af722ebb601d71b9e56145ac49fc85280">ripple::Config::PEERS_OUT_MAX</a></div><div class="ttdeci">std::size_t PEERS_OUT_MAX</div><div class="ttdef"><b>Definition</b> <a href="Config_8h_source.html#l00180">Config.h:180</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1Config_html_affa3814314db54dc51e3f56c00ff32e7"><div class="ttname"><a href="classripple_1_1Config.html#affa3814314db54dc51e3f56c00ff32e7">ripple::Config::PEERS_MAX</a></div><div class="ttdeci">std::size_t PEERS_MAX</div><div class="ttdef"><b>Definition</b> <a href="Config_8h_source.html#l00179">Config.h:179</a></div></div>
|
|
<div class="ttc" id="ainteger_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a></div></div>
|
|
<div class="ttc" id="amax_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/max.html">std::max</a></div><div class="ttdeci">T max(T... args)</div></div>
|
|
<div class="ttc" id="amin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a></div><div class="ttdeci">T min(T... args)</div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1PeerFinder_1_1Tuning_html_affb41e96294735aed7d3908f12eec645a4bdda2a4de62bd1ac3594de895ba3b10"><div class="ttname"><a href="namespaceripple_1_1PeerFinder_1_1Tuning.html#affb41e96294735aed7d3908f12eec645a4bdda2a4de62bd1ac3594de895ba3b10">ripple::PeerFinder::Tuning::outPercent</a></div><div class="ttdeci">@ outPercent</div><div class="ttdef"><b>Definition</b> <a href="src_2xrpld_2peerfinder_2detail_2Tuning_8h_source.html#l00058">src/xrpld/peerfinder/detail/Tuning.h:52</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1PeerFinder_1_1Tuning_html_affb41e96294735aed7d3908f12eec645adfb5a5032cadf474a7d73130e7bdfbab"><div class="ttname"><a href="namespaceripple_1_1PeerFinder_1_1Tuning.html#affb41e96294735aed7d3908f12eec645adfb5a5032cadf474a7d73130e7bdfbab">ripple::PeerFinder::Tuning::minOutCount</a></div><div class="ttdeci">@ minOutCount</div><div class="ttdef"><b>Definition</b> <a href="src_2xrpld_2peerfinder_2detail_2Tuning_8h_source.html#l00062">src/xrpld/peerfinder/detail/Tuning.h:59</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1PeerFinder_1_1Tuning_html_affb41e96294735aed7d3908f12eec645ae2613c88dfdb6971e3738f1f7ef8f295"><div class="ttname"><a href="namespaceripple_1_1PeerFinder_1_1Tuning.html#affb41e96294735aed7d3908f12eec645ae2613c88dfdb6971e3738f1f7ef8f295">ripple::PeerFinder::Tuning::defaultMaxPeers</a></div><div class="ttdeci">@ defaultMaxPeers</div><div class="ttdef"><b>Definition</b> <a href="src_2xrpld_2peerfinder_2detail_2Tuning_8h_source.html#l00069">src/xrpld/peerfinder/detail/Tuning.h:63</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1PeerFinder_html_a22c88667b16496babeb8c9726e6d1eec"><div class="ttname"><a href="namespaceripple_1_1PeerFinder.html#a22c88667b16496babeb8c9726e6d1eec">ripple::PeerFinder::operator==</a></div><div class="ttdeci">bool operator==(Endpoint const &a, Endpoint const &b)</div><div class="ttdef"><b>Definition</b> <a href="Livecache__test_8cpp_source.html#l00035">Livecache_test.cpp:35</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#l00025">algorithm.h:25</a></div></div>
|
|
<div class="ttc" id="asize_t_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1PeerFinder_1_1Config_html"><div class="ttname"><a href="structripple_1_1PeerFinder_1_1Config.html">ripple::PeerFinder::Config</a></div><div class="ttdoc">PeerFinder configuration settings.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00044">PeerfinderManager.h:45</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1PeerFinder_1_1Config_html_a0003a9384327d7c4a4823fa736bf86cc"><div class="ttname"><a href="structripple_1_1PeerFinder_1_1Config.html#a0003a9384327d7c4a4823fa736bf86cc">ripple::PeerFinder::Config::onWrite</a></div><div class="ttdeci">void onWrite(beast::PropertyStream::Map &map)</div><div class="ttdoc">Write the configuration into a property stream.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderConfig_8cpp_source.html#l00077">PeerfinderConfig.cpp:77</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1PeerFinder_1_1Config_html_a189d9cacf39182df611c2e0ba2dd177f"><div class="ttname"><a href="structripple_1_1PeerFinder_1_1Config.html#a189d9cacf39182df611c2e0ba2dd177f">ripple::PeerFinder::Config::Config</a></div><div class="ttdeci">Config()</div><div class="ttdoc">Create a configuration with default values.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderConfig_8cpp_source.html#l00026">PeerfinderConfig.cpp:26</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1PeerFinder_1_1Config_html_a2aa0119410e7741efd384492c1e5a3b9"><div class="ttname"><a href="structripple_1_1PeerFinder_1_1Config.html#a2aa0119410e7741efd384492c1e5a3b9">ripple::PeerFinder::Config::autoConnect</a></div><div class="ttdeci">bool autoConnect</div><div class="ttdoc">true if we want to establish connections automatically</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00071">PeerfinderManager.h:71</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1PeerFinder_1_1Config_html_a46decaaf39a6782668b563d2d774ddb5"><div class="ttname"><a href="structripple_1_1PeerFinder_1_1Config.html#a46decaaf39a6782668b563d2d774ddb5">ripple::PeerFinder::Config::ipLimit</a></div><div class="ttdeci">int ipLimit</div><div class="ttdoc">Limit how many incoming connections we allow per IP.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00080">PeerfinderManager.h:80</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1PeerFinder_1_1Config_html_a67c60a2f6d0ef7a67fc7144f09f57d04"><div class="ttname"><a href="structripple_1_1PeerFinder_1_1Config.html#a67c60a2f6d0ef7a67fc7144f09f57d04">ripple::PeerFinder::Config::inPeers</a></div><div class="ttdeci">std::size_t inPeers</div><div class="ttdoc">The number of automatic inbound connections to maintain.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00062">PeerfinderManager.h:62</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1PeerFinder_1_1Config_html_a7fde17254835e48c5b090bb00fe337e9"><div class="ttname"><a href="structripple_1_1PeerFinder_1_1Config.html#a7fde17254835e48c5b090bb00fe337e9">ripple::PeerFinder::Config::applyTuning</a></div><div class="ttdeci">void applyTuning()</div><div class="ttdoc">Adjusts the values so they follow the business rules.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderConfig_8cpp_source.html#l00057">PeerfinderConfig.cpp:57</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1PeerFinder_1_1Config_html_a9321a565c8d2fac0bbc77cb24582fc94"><div class="ttname"><a href="structripple_1_1PeerFinder_1_1Config.html#a9321a565c8d2fac0bbc77cb24582fc94">ripple::PeerFinder::Config::makeConfig</a></div><div class="ttdeci">static Config makeConfig(ripple::Config const &config, std::uint16_t port, bool validationPublicKey, int ipLimit)</div><div class="ttdoc">Make PeerFinder::Config from configuration parameters.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderConfig_8cpp_source.html#l00089">PeerfinderConfig.cpp:89</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1PeerFinder_1_1Config_html_aa0026277cfc4914ecc8d136e5a94ef8e"><div class="ttname"><a href="structripple_1_1PeerFinder_1_1Config.html#aa0026277cfc4914ecc8d136e5a94ef8e">ripple::PeerFinder::Config::maxPeers</a></div><div class="ttdeci">std::size_t maxPeers</div><div class="ttdoc">The largest number of public peer slots to allow.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00050">PeerfinderManager.h:50</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1PeerFinder_1_1Config_html_ab5462b5e4ecc5a63168673fcf64ed221"><div class="ttname"><a href="structripple_1_1PeerFinder_1_1Config.html#ab5462b5e4ecc5a63168673fcf64ed221">ripple::PeerFinder::Config::features</a></div><div class="ttdeci">std::string features</div><div class="ttdoc">The set of features we advertise.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00077">PeerfinderManager.h:77</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1PeerFinder_1_1Config_html_ab92a8f8d998ed8d7e2940b71734fa09f"><div class="ttname"><a href="structripple_1_1PeerFinder_1_1Config.html#ab92a8f8d998ed8d7e2940b71734fa09f">ripple::PeerFinder::Config::wantIncoming</a></div><div class="ttdeci">bool wantIncoming</div><div class="ttdoc">true if we want to accept incoming connections.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00068">PeerfinderManager.h:68</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1PeerFinder_1_1Config_html_ab9a20f47b40f06984c08aed2ca613613"><div class="ttname"><a href="structripple_1_1PeerFinder_1_1Config.html#ab9a20f47b40f06984c08aed2ca613613">ripple::PeerFinder::Config::outPeers</a></div><div class="ttdeci">std::size_t outPeers</div><div class="ttdoc">The number of automatic outbound connections to maintain.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00056">PeerfinderManager.h:56</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1PeerFinder_1_1Config_html_af22578657f9b42b4c0b66cb6289761aa"><div class="ttname"><a href="structripple_1_1PeerFinder_1_1Config.html#af22578657f9b42b4c0b66cb6289761aa">ripple::PeerFinder::Config::calcOutPeers</a></div><div class="ttdeci">std::size_t calcOutPeers() const</div><div class="ttdoc">Returns a suitable value for outPeers according to the rules.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderConfig_8cpp_source.html#l00049">PeerfinderConfig.cpp:49</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1PeerFinder_1_1Config_html_af8629cfefba4fb74f5a498562eddc06b"><div class="ttname"><a href="structripple_1_1PeerFinder_1_1Config.html#af8629cfefba4fb74f5a498562eddc06b">ripple::PeerFinder::Config::listeningPort</a></div><div class="ttdeci">std::uint16_t listeningPort</div><div class="ttdoc">The listening port number.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00074">PeerfinderManager.h:74</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1PeerFinder_1_1Config_html_af9b3a48e05361caa57d3e0c09e37a166"><div class="ttname"><a href="structripple_1_1PeerFinder_1_1Config.html#af9b3a48e05361caa57d3e0c09e37a166">ripple::PeerFinder::Config::peerPrivate</a></div><div class="ttdeci">bool peerPrivate</div><div class="ttdoc">true if we want our IP address kept private.</div><div class="ttdef"><b>Definition</b> <a href="PeerfinderManager_8h_source.html#l00065">PeerfinderManager.h:65</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>
|