<!-- iframe showing the search results (closed by default) -->
<divid="MSearchResultsWindow">
<iframesrc="javascript:void(0)"frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<divclass="header">
<divclass="headertitle">
<divclass="title">rehook.h</div></div>
</div><!--header-->
<divclass="contents">
<ahref="../../d2/d42/rehook_8h.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">/* This file is part of Netsukuku</span></div>
<divclass="line"><aname="l00002"></a><spanclass="lineno"> 2</span> <spanclass="comment"> * (c) Copyright 2005 Andrea Lo Pumo aka AlpT <alpt@freaknet.org></span></div>
<divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> <spanclass="comment"> * This source code is free software; you can redistribute it and/or</span></div>
<divclass="line"><aname="l00005"></a><spanclass="lineno"> 5</span> <spanclass="comment"> * modify it under the terms of the GNU General Public License as published</span></div>
<divclass="line"><aname="l00006"></a><spanclass="lineno"> 6</span> <spanclass="comment"> * by the Free Software Foundation; either version 2 of the License,</span></div>
<divclass="line"><aname="l00007"></a><spanclass="lineno"> 7</span> <spanclass="comment"> * or (at your option) any later version.</span></div>
<divclass="line"><aname="l00009"></a><spanclass="lineno"> 9</span> <spanclass="comment"> * This source code is distributed in the hope that it will be useful,</span></div>
<divclass="line"><aname="l00010"></a><spanclass="lineno"> 10</span> <spanclass="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<divclass="line"><aname="l00011"></a><spanclass="lineno"> 11</span> <spanclass="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</span></div>
<divclass="line"><aname="l00012"></a><spanclass="lineno"> 12</span> <spanclass="comment"> * Please refer to the GNU Public License for more details.</span></div>
<divclass="line"><aname="l00014"></a><spanclass="lineno"> 14</span> <spanclass="comment"> * You should have received a copy of the GNU Public License along with</span></div>
<divclass="line"><aname="l00015"></a><spanclass="lineno"> 15</span> <spanclass="comment"> * this source code; if not, write to:</span></div>
<divclass="line"><aname="l00016"></a><spanclass="lineno"> 16</span> <spanclass="comment"> * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span></div>
<divclass="line"><aname="l00022"></a><spanclass="lineno"><aclass="line"href="../../d2/d42/rehook_8h.html#ab550ecd914996e316fa3fb5e52aa3847"> 22</a></span> <spanclass="keywordtype">int</span><aclass="code"href="../../d2/d42/rehook_8h.html#ab550ecd914996e316fa3fb5e52aa3847">rehook_mutex</a>; <spanclass="comment">/* The can be only one rehook at the same time */</span></div>
<divclass="line"><aname="l00025"></a><spanclass="lineno"> 25</span> <spanclass="comment"> * REHOOK_PER_INSTANCE the is total number of rehooks allowed in</span></div>
<divclass="line"><aname="l00026"></a><spanclass="lineno"> 26</span> <spanclass="comment"> * REHOOK_INSTANCE_TIME(level) seconds. After REHOOK_INSTANCE_TIME(level)</span></div>
<divclass="line"><aname="l00027"></a><spanclass="lineno"> 27</span> <spanclass="comment"> * seconds have passed since the first rehook, REHOOK_WAIT_TIME(level) seconds</span></div>
<divclass="line"><aname="l00028"></a><spanclass="lineno"> 28</span> <spanclass="comment"> * must be waited before rehooking again.</span></div>
<divclass="line"><aname="l00029"></a><spanclass="lineno"> 29</span> <spanclass="comment"> * `level' is the level where the rehook is taking place.</span></div>
<divclass="line"><aname="l00030"></a><spanclass="lineno"> 30</span> <spanclass="comment"> * REHOOK_WAIT_TIME is calculated in this way:</span></div>
<divclass="line"><aname="l00038"></a><spanclass="lineno"><aclass="line"href="../../d2/d42/rehook_8h.html#a0285644353cb7385e181a63777fca255"> 38</a></span> time_t <aclass="code"href="../../d2/d42/rehook_8h.html#a0285644353cb7385e181a63777fca255">last_instance_rehook</a>; <spanclass="comment">/* When the first rehook of the latest</span></div>
<divclass="line"><aname="l00040"></a><spanclass="lineno"><aclass="line"href="../../d2/d42/rehook_8h.html#a419acc34bafd06235d0533d8d7d3c815"> 40</a></span> <spanclass="keywordtype">int</span><aclass="code"href="../../d2/d42/rehook_8h.html#a419acc34bafd06235d0533d8d7d3c815">total_rehooks</a>; <spanclass="comment">/* Number of rehooks made in the current </span></div>
<divclass="line"><aname="l00046"></a><spanclass="lineno"><aclass="line"href="../../d2/d42/rehook_8h.html#a95e8cb2031864165725b4cecebb897e4"> 46</a></span> <spanclass="preprocessor">#define CHALLENGE_THRESHOLD (1<<16) </span><spanclass="comment">/* When the gnode X, which must</span></div>
<divclass="line"><aname="l00047"></a><spanclass="lineno"> 47</span> <spanclass="comment"> rehook, has a gnode_count >= (1<<16) </span></div>
<divclass="line"><aname="l00048"></a><spanclass="lineno"> 48</span> <spanclass="comment"> it sends a new challenge. */</span><spanclass="preprocessor"></span></div>
<divclass="line"><aname="l00050"></a><spanclass="lineno"> 50</span> <spanclass="comment">/* `rk_gnode_ip' is the ip that will be used if we cannot rehook directly to </span></div>
<divclass="line"><aname="l00051"></a><spanclass="lineno"> 51</span> <spanclass="comment"> * any gnode: a new gnode is created with the ip equal to `rk_gnode_ip'. */</span></div>
<divclass="ttc"id="rehook_8h_html_acd9ab3b97734c31a06ae3dcf475a1b39"><divclass="ttname"><ahref="../../d2/d42/rehook_8h.html#acd9ab3b97734c31a06ae3dcf475a1b39">new_rehook</a></div><divclass="ttdeci">void new_rehook(map_gnode *gnode, int gid, int level, int gnode_count)</div><divclass="ttdef"><b>Definition:</b> rehook.c:268</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<divid="nav-path"class="navpath"><!-- id is needed for treeview function! -->