792 lines
27 KiB
HTML
792 lines
27 KiB
HTML
|
|
<!DOCTYPE html>
|
|||
|
|
<html>
|
|||
|
|
<head>
|
|||
|
|
<meta charset="utf-8">
|
|||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|||
|
|
<title>
|
|||
|
|
Class: Rex::Proto::MySQL::Client
|
|||
|
|
|
|||
|
|
— Documentation by YARD 0.9.37
|
|||
|
|
|
|||
|
|
</title>
|
|||
|
|
|
|||
|
|
<link rel="stylesheet" href="../../../css/style.css" type="text/css" />
|
|||
|
|
|
|||
|
|
<link rel="stylesheet" href="../../../css/common.css" type="text/css" />
|
|||
|
|
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
pathId = "Rex::Proto::MySQL::Client";
|
|||
|
|
relpath = '../../../';
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
|||
|
|
|
|||
|
|
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</head>
|
|||
|
|
<body>
|
|||
|
|
<div class="nav_wrap">
|
|||
|
|
<iframe id="nav" src="../../../class_list.html?1"></iframe>
|
|||
|
|
<div id="resizer"></div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div id="main" tabindex="-1">
|
|||
|
|
<div id="header">
|
|||
|
|
<div id="menu">
|
|||
|
|
|
|||
|
|
<a href="../../../_index.html">Index (C)</a> »
|
|||
|
|
<span class='title'><span class='object_link'><a href="../../../Rex.html" title="Rex (module)">Rex</a></span></span> » <span class='title'><span class='object_link'><a href="../../Proto.html" title="Rex::Proto (module)">Proto</a></span></span> » <span class='title'><span class='object_link'><a href="../MySQL.html" title="Rex::Proto::MySQL (module)">MySQL</a></span></span>
|
|||
|
|
»
|
|||
|
|
<span class="title">Client</span>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div id="search">
|
|||
|
|
|
|||
|
|
<a class="full_list_link" id="class_list_link"
|
|||
|
|
href="../../../class_list.html">
|
|||
|
|
|
|||
|
|
<svg width="24" height="24">
|
|||
|
|
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|||
|
|
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|||
|
|
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|||
|
|
</svg>
|
|||
|
|
</a>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
<div class="clear"></div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div id="content"><h1>Class: Rex::Proto::MySQL::Client
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h1>
|
|||
|
|
<div class="box_info">
|
|||
|
|
|
|||
|
|
<dl>
|
|||
|
|
<dt>Inherits:</dt>
|
|||
|
|
<dd>
|
|||
|
|
<span class="inheritName">Mysql</span>
|
|||
|
|
|
|||
|
|
<ul class="fullTree">
|
|||
|
|
<li>Object</li>
|
|||
|
|
|
|||
|
|
<li class="next">Mysql</li>
|
|||
|
|
|
|||
|
|
<li class="next">Rex::Proto::MySQL::Client</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
<a href="#" class="inheritanceTree">show all</a>
|
|||
|
|
|
|||
|
|
</dd>
|
|||
|
|
</dl>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<dl>
|
|||
|
|
<dt>Defined in:</dt>
|
|||
|
|
<dd>lib/rex/proto/mysql/client.rb</dd>
|
|||
|
|
</dl>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<h2>Overview</h2><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>This is a Rex Proto wrapper around the ::Mysql client which is currently coming from the ‘ruby-mysql’ gem. The purpose of this wrapper is to provide ‘peerhost’ and ‘peerport’ methods to ensure the client interfaces are consistent between various SQL implementations/protocols.</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<h2>
|
|||
|
|
Instance Method Summary
|
|||
|
|
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|||
|
|
</h2>
|
|||
|
|
|
|||
|
|
<ul class="summary">
|
|||
|
|
|
|||
|
|
<li class="public ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#current_database-instance_method" title="#current_database (instance method)">#<strong>current_database</strong> ⇒ String </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>The database this client is currently connected to.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="public ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#detect_platform_and_arch-instance_method" title="#detect_platform_and_arch (instance method)">#<strong>detect_platform_and_arch</strong> ⇒ Hash </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>Detect the platform and architecture of the MySQL server: * :arch [String] The server architecture.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="public ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#map_compile_arch_to_architecture-instance_method" title="#map_compile_arch_to_architecture (instance method)">#<strong>map_compile_arch_to_architecture</strong>(compile_arch) ⇒ Object </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'></div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="public ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#map_compile_os_to_platform-instance_method" title="#map_compile_os_to_platform (instance method)">#<strong>map_compile_os_to_platform</strong>(compile_os) ⇒ Object </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>List of supported MySQL platforms & architectures: <a href="https://www.mysql.com/support/supportedplatforms/database.html">www.mysql.com/support/supportedplatforms/database.html</a>.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="public ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#peerhost-instance_method" title="#peerhost (instance method)">#<strong>peerhost</strong> ⇒ String </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>The remote IP address that the Mysql server is running on.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="public ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#peerinfo-instance_method" title="#peerinfo (instance method)">#<strong>peerinfo</strong> ⇒ String </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>The remote peer information containing IP and port.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<li class="public ">
|
|||
|
|
<span class="summary_signature">
|
|||
|
|
|
|||
|
|
<a href="#peerport-instance_method" title="#peerport (instance method)">#<strong>peerport</strong> ⇒ Integer </a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class="summary_desc"><div class='inline'>
|
|||
|
|
<p>The remote port that the Mysql server is running on.</p>
|
|||
|
|
</div></span>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<div id="instance_method_details" class="method_details_list">
|
|||
|
|
<h2>Instance Method Details</h2>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<div class="method_details first">
|
|||
|
|
<h3 class="signature first" id="current_database-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>current_database</strong> ⇒ <tt>String</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>Returns The database this client is currently connected to.</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
|
|||
|
|
<p class="tag_title">Returns:</p>
|
|||
|
|
<ul class="return">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>The database this client is currently connected to</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
27
|
|||
|
|
28
|
|||
|
|
29
|
|||
|
|
30</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/rex/proto/mysql/client.rb', line 27</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_current_database'>current_database</span>
|
|||
|
|
<span class='comment'># Current database is stored as an array under the type 1 key.
|
|||
|
|
</span> <span class='id identifier rubyid_session_track'>session_track</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='int'>1</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="detect_platform_and_arch-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>detect_platform_and_arch</strong> ⇒ <tt>Hash</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>Returns Detect the platform and architecture of the MySQL server:</p>
|
|||
|
|
<ul><li>
|
|||
|
|
<p>:arch [String] The server architecture.</p>
|
|||
|
|
</li><li>
|
|||
|
|
<p>:platform [String] The server platform.</p>
|
|||
|
|
</li></ul>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
|
|||
|
|
<p class="tag_title">Returns:</p>
|
|||
|
|
<ul class="return">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>Hash</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>Detect the platform and architecture of the MySQL server:</p>
|
|||
|
|
<ul><li>
|
|||
|
|
<p>:arch [String] The server architecture.</p>
|
|||
|
|
</li><li>
|
|||
|
|
<p>:platform [String] The server platform.</p>
|
|||
|
|
</li></ul>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
87
|
|||
|
|
88
|
|||
|
|
89
|
|||
|
|
90
|
|||
|
|
91
|
|||
|
|
92
|
|||
|
|
93
|
|||
|
|
94
|
|||
|
|
95</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/rex/proto/mysql/client.rb', line 87</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_detect_platform_and_arch'>detect_platform_and_arch</span>
|
|||
|
|
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_server_vars'>server_vars</span> <span class='op'>=</span> <span class='id identifier rubyid_query'>query</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>show variables where variable_name in ('version_compile_machine', 'version_compile_os')</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_entries'>entries</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span>
|
|||
|
|
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='symbol'>:arch</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_map_compile_arch_to_architecture'>map_compile_arch_to_architecture</span><span class='lparen'>(</span><span class='id identifier rubyid_server_vars'>server_vars</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>version_compile_machine</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='symbol'>:platform</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_map_compile_os_to_platform'>map_compile_os_to_platform</span><span class='lparen'>(</span><span class='id identifier rubyid_server_vars'>server_vars</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>version_compile_os</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_result'>result</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="map_compile_arch_to_architecture-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>map_compile_arch_to_architecture</strong>(compile_arch) ⇒ <tt>Object</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
56
|
|||
|
|
57
|
|||
|
|
58
|
|||
|
|
59
|
|||
|
|
60
|
|||
|
|
61
|
|||
|
|
62
|
|||
|
|
63
|
|||
|
|
64
|
|||
|
|
65
|
|||
|
|
66
|
|||
|
|
67
|
|||
|
|
68
|
|||
|
|
69
|
|||
|
|
70
|
|||
|
|
71
|
|||
|
|
72
|
|||
|
|
73
|
|||
|
|
74
|
|||
|
|
75
|
|||
|
|
76
|
|||
|
|
77
|
|||
|
|
78
|
|||
|
|
79
|
|||
|
|
80
|
|||
|
|
81
|
|||
|
|
82</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/rex/proto/mysql/client.rb', line 56</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_map_compile_arch_to_architecture'>map_compile_arch_to_architecture</span><span class='lparen'>(</span><span class='id identifier rubyid_compile_arch'>compile_arch</span><span class='rparen'>)</span>
|
|||
|
|
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_compile_arch'>compile_arch</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_compile_arch'>compile_arch</span> <span class='op'>=</span> <span class='id identifier rubyid_compile_arch'>compile_arch</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='period'>.</span><span class='id identifier rubyid_encode'>encode</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Encoding</span><span class='op'>::</span><span class='const'>BINARY</span><span class='rparen'>)</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_compile_arch'>compile_arch</span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>sparc</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_compile_arch'>compile_arch</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>64</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_arch'>arch</span> <span class='op'>=</span> <span class='const'>ARCH_SPARC64</span>
|
|||
|
|
<span class='kw'>else</span>
|
|||
|
|
<span class='id identifier rubyid_arch'>arch</span> <span class='op'>=</span> <span class='const'>ARCH_SPARC</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>elsif</span> <span class='id identifier rubyid_compile_arch'>compile_arch</span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>arm</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_compile_arch'>compile_arch</span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>64</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_arch'>arch</span> <span class='op'>=</span> <span class='const'>ARCH_AARCH64</span>
|
|||
|
|
<span class='kw'>elsif</span> <span class='id identifier rubyid_compile_arch'>compile_arch</span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>arm</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_arch'>arch</span> <span class='op'>=</span> <span class='const'>ARCH_ARMLE</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
<span class='kw'>elsif</span> <span class='id identifier rubyid_compile_arch'>compile_arch</span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>64</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_arch'>arch</span> <span class='op'>=</span> <span class='const'>ARCH_X86_64</span>
|
|||
|
|
<span class='kw'>elsif</span> <span class='id identifier rubyid_compile_arch'>compile_arch</span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>86</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_compile_arch'>compile_arch</span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>i686</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_arch'>arch</span> <span class='op'>=</span> <span class='const'>ARCH_X86</span>
|
|||
|
|
<span class='kw'>else</span>
|
|||
|
|
<span class='id identifier rubyid_arch'>arch</span> <span class='op'>=</span> <span class='id identifier rubyid_compile_arch'>compile_arch</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_arch'>arch</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="map_compile_os_to_platform-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>map_compile_os_to_platform</strong>(compile_os) ⇒ <tt>Object</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>List of supported MySQL platforms & architectures: <a href="https://www.mysql.com/support/supportedplatforms/database.html">www.mysql.com/support/supportedplatforms/database.html</a></p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
34
|
|||
|
|
35
|
|||
|
|
36
|
|||
|
|
37
|
|||
|
|
38
|
|||
|
|
39
|
|||
|
|
40
|
|||
|
|
41
|
|||
|
|
42
|
|||
|
|
43
|
|||
|
|
44
|
|||
|
|
45
|
|||
|
|
46
|
|||
|
|
47
|
|||
|
|
48
|
|||
|
|
49
|
|||
|
|
50
|
|||
|
|
51
|
|||
|
|
52
|
|||
|
|
53
|
|||
|
|
54</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/rex/proto/mysql/client.rb', line 34</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_map_compile_os_to_platform'>map_compile_os_to_platform</span><span class='lparen'>(</span><span class='id identifier rubyid_compile_os'>compile_os</span><span class='rparen'>)</span>
|
|||
|
|
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_compile_os'>compile_os</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_compile_os'>compile_os</span> <span class='op'>=</span> <span class='id identifier rubyid_compile_os'>compile_os</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='period'>.</span><span class='id identifier rubyid_encode'>encode</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Encoding</span><span class='op'>::</span><span class='const'>BINARY</span><span class='rparen'>)</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>if</span> <span class='id identifier rubyid_compile_os'>compile_os</span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>linux</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_platform'>platform</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../../Msf.html" title="Msf (module)">Msf</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../../Msf.html#Platform-constant" title="Msf::Platform (constant)">Platform</a></span></span><span class='op'>::</span><span class='const'>Linux</span><span class='period'>.</span><span class='id identifier rubyid_realname'>realname</span>
|
|||
|
|
<span class='kw'>elsif</span> <span class='id identifier rubyid_compile_os'>compile_os</span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>unix</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_platform'>platform</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../../Msf.html" title="Msf (module)">Msf</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../../Msf.html#Platform-constant" title="Msf::Platform (constant)">Platform</a></span></span><span class='op'>::</span><span class='const'>Unix</span><span class='period'>.</span><span class='id identifier rubyid_realname'>realname</span>
|
|||
|
|
<span class='kw'>elsif</span> <span class='id identifier rubyid_compile_os'>compile_os</span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>(darwin|mac|osx)</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_platform'>platform</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../../Msf.html" title="Msf (module)">Msf</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../../Msf.html#Platform-constant" title="Msf::Platform (constant)">Platform</a></span></span><span class='op'>::</span><span class='const'>OSX</span><span class='period'>.</span><span class='id identifier rubyid_realname'>realname</span>
|
|||
|
|
<span class='kw'>elsif</span> <span class='id identifier rubyid_compile_os'>compile_os</span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>win</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_platform'>platform</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../../Msf.html" title="Msf (module)">Msf</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../../Msf.html#Platform-constant" title="Msf::Platform (constant)">Platform</a></span></span><span class='op'>::</span><span class='const'>Windows</span><span class='period'>.</span><span class='id identifier rubyid_realname'>realname</span>
|
|||
|
|
<span class='kw'>elsif</span> <span class='id identifier rubyid_compile_os'>compile_os</span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>solaris</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|||
|
|
<span class='id identifier rubyid_platform'>platform</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../../Msf.html" title="Msf (module)">Msf</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../../../Msf.html#Platform-constant" title="Msf::Platform (constant)">Platform</a></span></span><span class='op'>::</span><span class='const'>Solaris</span><span class='period'>.</span><span class='id identifier rubyid_realname'>realname</span>
|
|||
|
|
<span class='kw'>else</span>
|
|||
|
|
<span class='id identifier rubyid_platform'>platform</span> <span class='op'>=</span> <span class='id identifier rubyid_compile_os'>compile_os</span>
|
|||
|
|
<span class='kw'>end</span>
|
|||
|
|
|
|||
|
|
<span class='id identifier rubyid_platform'>platform</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="peerhost-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>peerhost</strong> ⇒ <tt>String</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>Returns The remote IP address that the Mysql server is running on.</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
|
|||
|
|
<p class="tag_title">Returns:</p>
|
|||
|
|
<ul class="return">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>The remote IP address that the Mysql server is running on</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
12
|
|||
|
|
13
|
|||
|
|
14</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/rex/proto/mysql/client.rb', line 12</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_peerhost'>peerhost</span>
|
|||
|
|
<span class='id identifier rubyid_io'>io</span><span class='period'>.</span><span class='id identifier rubyid_remote_address'>remote_address</span><span class='period'>.</span><span class='id identifier rubyid_ip_address'>ip_address</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="peerinfo-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>peerinfo</strong> ⇒ <tt>String</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>Returns The remote peer information containing IP and port.</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
|
|||
|
|
<p class="tag_title">Returns:</p>
|
|||
|
|
<ul class="return">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>String</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>The remote peer information containing IP and port</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
22
|
|||
|
|
23
|
|||
|
|
24</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/rex/proto/mysql/client.rb', line 22</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_peerinfo'>peerinfo</span>
|
|||
|
|
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_peerhost'>peerhost</span><span class='embexpr_end'>}</span><span class='tstring_content'>:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_peerport'>peerport</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="method_details ">
|
|||
|
|
<h3 class="signature " id="peerport-instance_method">
|
|||
|
|
|
|||
|
|
#<strong>peerport</strong> ⇒ <tt>Integer</tt>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</h3><div class="docstring">
|
|||
|
|
<div class="discussion">
|
|||
|
|
|
|||
|
|
<p>Returns The remote port that the Mysql server is running on.</p>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="tags">
|
|||
|
|
|
|||
|
|
<p class="tag_title">Returns:</p>
|
|||
|
|
<ul class="return">
|
|||
|
|
|
|||
|
|
<li>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<span class='type'>(<tt>Integer</tt>)</span>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
—
|
|||
|
|
<div class='inline'>
|
|||
|
|
<p>The remote port that the Mysql server is running on</p>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</li>
|
|||
|
|
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
</div><table class="source_code">
|
|||
|
|
<tr>
|
|||
|
|
<td>
|
|||
|
|
<pre class="lines">
|
|||
|
|
|
|||
|
|
|
|||
|
|
17
|
|||
|
|
18
|
|||
|
|
19</pre>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
<pre class="code"><span class="info file"># File 'lib/rex/proto/mysql/client.rb', line 17</span>
|
|||
|
|
|
|||
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_peerport'>peerport</span>
|
|||
|
|
<span class='id identifier rubyid_io'>io</span><span class='period'>.</span><span class='id identifier rubyid_remote_address'>remote_address</span><span class='period'>.</span><span class='id identifier rubyid_ip_port'>ip_port</span>
|
|||
|
|
<span class='kw'>end</span></pre>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div id="footer">
|
|||
|
|
Generated on Fri May 8 17:04:14 2026 by
|
|||
|
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|||
|
|
0.9.37 (ruby-3.1.5).
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</body>
|
|||
|
|
</html>
|