netsukuku/d6/d34/hook_8h_source.html
MissValeska f97a6e4a6f missvaleska@missvaleska-GA-970A-D3:~/Documents/Netsukuku/NtkDoc/html$ git status# On branch gh-pages
missvaleska@missvaleska-GA-970A-D3:~/Documents/Netsukuku/NtkDoc/html$ git status# On branch gh-pages
Doxygen generated Documentation
2014-02-19 15:45:00 -08:00

289 lines
39 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>The Netsukuku Project: src/hook.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="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</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 style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">The Netsukuku Project
&#160;<span id="projectnumber">0.0.9</span>
</div>
<div id="projectbrief">An Alternative routing method</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
<li><a href="../../annotated.html"><span>Data&#160;Structures</span></a></li>
<li class="current"><a href="../../files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="../../search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="../../files.html"><span>File&#160;List</span></a></li>
<li><a href="../../globals.html"><span>Globals</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('d6/d34/hook_8h_source.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">hook.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="../../d6/d34/hook_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/* This file is part of Netsukuku</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * (c) Copyright 2004 Andrea Lo Pumo aka AlpT &lt;alpt@freaknet.org&gt;</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * This source code is free software; you can redistribute it and/or</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> * modify it under the terms of the GNU General Public License as published </span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * by the Free Software Foundation; either version 2 of the License,</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> * or (at your option) any later version.</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * This source code is distributed in the hope that it will be useful,</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * Please refer to the GNU Public License for more details.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * You should have received a copy of the GNU Public License along with</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * this source code; if not, write to:</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;</div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#ifndef HOOK_H</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#define HOOK_H</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="../../d8/da0/qspn_8h.html">qspn.h</a>&quot;</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;</div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="../../d6/d34/hook_8h.html#a86a8367bc85c4ff3b609ce7b947b17ba"> 24</a></span>&#160;<span class="preprocessor">#define MAX_FIRST_RADAR_SCANS 1 </span><span class="comment">/* How many time we have to retry </span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="comment"> the first radar_scan if we</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="comment"> didn&#39;t found anything */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#undef MAX_FIRST_RADAR_SCANS</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#define MAX_FIRST_RADAR_SCANS 1</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="comment">/* The IP class used during the hook */</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="../../d6/d34/hook_8h.html#aea6244f0ec280e16d0bd132867adacda"> 33</a></span>&#160;<span class="preprocessor">#define HOOKING_IP_10 0xa000001 </span><span class="comment">/* 10.0.0.1 */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="../../d6/d34/hook_8h.html#ab922fdb592c292d5c3a839f443e93ae6"> 34</a></span>&#160;<span class="preprocessor">#define HOOKING_IP_172 0xac100001 </span><span class="comment">/* 172.16.0.1 */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="../../d6/d34/hook_8h.html#a9ad99da0a0ab3bf70a9f44de0373b081"> 35</a></span>&#160;<span class="preprocessor">#define HOOKING_IPV6 0xfec00000 </span><span class="comment">/* fec0:: */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;</div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="../../d6/d34/hook_8h.html#af99bef32c0423d237756999f35d7b554"> 37</a></span>&#160;<span class="preprocessor">#define HOOK_RQ_TIMEOUT 8 </span><span class="comment">/* seconds */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="comment"> * * * Global vars * * *</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;<span class="comment">/* How many times netsukuku_hook() was launched */</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="../../d6/d34/hook_8h.html#a02d00308296b3bf01fb0c537f356dc9b"> 44</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="../../d6/d34/hook_8h.html#a02d00308296b3bf01fb0c537f356dc9b">total_hooks</a>;</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="comment">/* Current join_rate */</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="../../d6/d34/hook_8h.html#ab9316eed1d091f99fc4884a2863c4553"> 47</a></span>&#160;u_int <a class="code" href="../../d6/d34/hook_8h.html#ab9316eed1d091f99fc4884a2863c4553">hook_join_rate</a>;</div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="../../d6/d34/hook_8h.html#a12af4a7ec9fc3795e61018514fcfbf64"> 48</a></span>&#160;u_int <a class="code" href="../../d6/d34/hook_8h.html#a12af4a7ec9fc3795e61018514fcfbf64">rnodes_rehooked</a>; <span class="comment">/* How many rnodes have rehooked with us */</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;<span class="comment"> * * * Hook packets stuff * * *</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="comment">/* </span></div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="comment"> * The free_nodes pkt is used to send the list of all the free/not used</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="comment"> * nodes/gnodes present at level fn_hdr.level. </span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="comment"> * If level is == 0 then the pkt contains the list of free nodes of the fn_hdr.gid</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;<span class="comment"> * gnode. </span></div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;<span class="comment"> * If level is &gt; 0 then it contains the list of free gnodes which are inside</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="comment"> * the gnode with `fn_hdr.gid&#39; gid of the `fn_hdr.level&#39;th level. So the free gnodes</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="comment"> * are part of the (fn_hdr.level - 1)th level.</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="../../db/d46/structfree__nodes__hdr.html"> 65</a></span>&#160;<span class="keyword">struct </span><a class="code" href="../../db/d46/structfree__nodes__hdr.html">free_nodes_hdr</a></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;{</div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="../../db/d46/structfree__nodes__hdr.html#a2fb19694636528e6197112fb01b95ee9"> 67</a></span>&#160; u_char <a class="code" href="../../db/d46/structfree__nodes__hdr.html#a2fb19694636528e6197112fb01b95ee9">max_levels</a>; <span class="comment">/* How many levels we are managing */</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;</div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="../../db/d46/structfree__nodes__hdr.html#ad1c9ea749686b693fe73432d57a5a84e"> 69</a></span>&#160; uint32_t <a class="code" href="../../db/d46/structfree__nodes__hdr.html#ad1c9ea749686b693fe73432d57a5a84e">ipstart</a>[<a class="code" href="../../d6/d4a/inet_8h.html#a70f8406c9556460a606bee45306c5630">MAX_IP_INT</a>]; <span class="comment">/* The ipstart of the gnode */</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="../../db/d46/structfree__nodes__hdr.html#a2e8ae48a9d34febba0bb7cb553d92c55"> 70</a></span>&#160; u_char <a class="code" href="../../db/d46/structfree__nodes__hdr.html#a2e8ae48a9d34febba0bb7cb553d92c55">level</a>; <span class="comment">/* The level where the gnode belongs */</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="../../db/d46/structfree__nodes__hdr.html#adea9dc565dd2e4473b1109dff99c3f64"> 71</a></span>&#160; u_char <a class="code" href="../../db/d46/structfree__nodes__hdr.html#adea9dc565dd2e4473b1109dff99c3f64">gid</a>; <span class="comment">/* The gnode id */</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="../../db/d46/structfree__nodes__hdr.html#ad12b312f781d758091b1f25adbe11f2c"> 72</a></span>&#160; u_char <a class="code" href="../../db/d46/structfree__nodes__hdr.html#ad12b312f781d758091b1f25adbe11f2c">nodes</a>; <span class="comment">/* The number of free (g)nodes - 1 */</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="../../db/d46/structfree__nodes__hdr.html#a4ab85aadd47a984728021ca4f9231a6c"> 73</a></span>&#160; uint32_t <a class="code" href="../../db/d46/structfree__nodes__hdr.html#a4ab85aadd47a984728021ca4f9231a6c">join_rate</a>; <span class="comment">/* Join_rate of `level&#39; */</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;}<a class="code" href="../../d6/d34/hook_8h.html#a14d32f6676649eb9afc8c122ddceca7e">_PACKED_</a>;</div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="../../d6/d34/hook_8h.html#a9f5bf83a6b6a55db0693fab688d3b67a"> 75</a></span>&#160;<a class="code" href="../../dc/d3e/endianness_8h.html#a3e44b8503d7a90af675c81800fe6d275">INT_INFO</a> <a class="code" href="../../d6/d34/hook_8h.html#a9f5bf83a6b6a55db0693fab688d3b67a">free_nodes_hdr_iinfo</a> = { 1, { <a class="code" href="../../dc/d3e/endianness_8h.html#acc663d0291dd4a32c1dfbed3167bd58b">INT_TYPE_32BIT</a> }, </div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; { <span class="keyword">sizeof</span>(<span class="keyword">struct </span><a class="code" href="../../db/d46/structfree__nodes__hdr.html">free_nodes_hdr</a>)-sizeof(uint32_t) },</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; { 1 }</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; };</div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="../../d6/d34/hook_8h.html#a3368325212747abd7bda568aecd36fb6"> 79</a></span>&#160;<span class="preprocessor">#define FREE_NODES_SZ(nodes) (sizeof(struct free_nodes_hdr) +\</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="preprocessor"> (sizeof(u_char) * (nodes)))</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;<span class="comment">/* </span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;<span class="comment"> * the free_nodes block is:</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;<span class="comment"> * u_char free_nodes[fn_hdr.nodes/8]; The bit x inside `free_nodes&#39;</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;<span class="comment"> * tells if the node x, i.e.</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;<span class="comment"> * int_map[x], is up or not.</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;<span class="comment"> * If the bit is set to 1, it</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;<span class="comment"> * is.</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;<span class="comment"> * The free_nodes pkt is:</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;<span class="comment"> * fn_hdr;</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;<span class="comment"> * fn_block;</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;<span class="comment">/* </span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;<span class="comment"> * the qspn_round pkt is:</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;<span class="comment"> * u_char max_levels;</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;<span class="comment"> * int qspn_id[max_levels]; the qspn_id of the last qspn_round for each </span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;<span class="comment"> * fn_hdr.max_levels level</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;<span class="comment"> * struct timeval qtime[max_levels]; qspn round time: how many seconds passed away</span></div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;<span class="comment"> * since the previous qspn round. There&#39;s a qtime</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;<span class="comment"> * for each fn_hdr.max_levels level</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;<span class="comment"> * u_int gcount[GCOUNT_LEVELS]; current qspn_gnode_count.</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;<span class="comment">/* Note: for this int_info we are considering the timeval array as one int</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;<span class="comment"> * with `max_levels&#39;*2 members */</span></div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="../../d6/d34/hook_8h.html#a1de69ac7df43e825221933910410452e"> 108</a></span>&#160;<a class="code" href="../../dc/d3e/endianness_8h.html#a3e44b8503d7a90af675c81800fe6d275">INT_INFO</a> <a class="code" href="../../d6/d34/hook_8h.html#a1de69ac7df43e825221933910410452e">qspn_round_pkt_iinfo</a> = { 3, </div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; { <a class="code" href="../../dc/d3e/endianness_8h.html#acc663d0291dd4a32c1dfbed3167bd58b">INT_TYPE_32BIT</a>, <a class="code" href="../../dc/d3e/endianness_8h.html#acc663d0291dd4a32c1dfbed3167bd58b">INT_TYPE_32BIT</a>, INT_TYPE_32BIT }, </div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; { <span class="keyword">sizeof</span>(char), <a class="code" href="../../dc/d3e/endianness_8h.html#aab0cb83658366f074119d70b2838c7d2">IINFO_DYNAMIC_VALUE</a>, <a class="code" href="../../dc/d3e/endianness_8h.html#aab0cb83658366f074119d70b2838c7d2">IINFO_DYNAMIC_VALUE</a> },</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; { <a class="code" href="../../dc/d3e/endianness_8h.html#aab0cb83658366f074119d70b2838c7d2">IINFO_DYNAMIC_VALUE</a>, <a class="code" href="../../dc/d3e/endianness_8h.html#aab0cb83658366f074119d70b2838c7d2">IINFO_DYNAMIC_VALUE</a>, <a class="code" href="../../d8/da0/qspn_8h.html#ae43980163dccdef6bba0624790470ac3">GCOUNT_LEVELS</a> }</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; };</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; </div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="../../d6/d34/hook_8h.html#a22191ec70af999dbf1a806a13682bd01"> 114</a></span>&#160;<span class="preprocessor">#define QSPN_ROUND_PKT_SZ(levels) (sizeof(u_char) + \</span></div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;<span class="preprocessor"> ((levels) * sizeof(int32_t)) + \</span></div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;<span class="preprocessor"> ((levels) * sizeof(struct timeval))+\</span></div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;<span class="preprocessor"> (GCOUNT_LEVELS * sizeof(u_int)))</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;<span class="comment">/* </span></div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;<span class="comment"> * * * Functions declaration * * *</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; </div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;<span class="keywordtype">int</span> <a class="code" href="../../d6/d34/hook_8h.html#a7da6546e5822e282b57e5aee17e0c80c">put_free_nodes</a>(<a class="code" href="../../d6/dbc/structPACKET.html">PACKET</a> rq_pkt);</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;<span class="keywordtype">int</span> <a class="code" href="../../d6/d34/hook_8h.html#a14eec030eb6098fc9cc4a8609b19bd00">put_qspn_round</a>(<a class="code" href="../../d6/dbc/structPACKET.html">PACKET</a> rq_pkt);</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;<span class="keywordtype">int</span> <a class="code" href="../../d6/d34/hook_8h.html#aa99944b9d6345e33be0bf1c850380228">put_ext_map</a>(<a class="code" href="../../d6/dbc/structPACKET.html">PACKET</a> rq_pkt);</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;<span class="keywordtype">int</span> <a class="code" href="../../d6/d34/hook_8h.html#ab08a91850a188145dc3f039300aeca8b">put_int_map</a>(<a class="code" href="../../d6/dbc/structPACKET.html">PACKET</a> rq_pkt);</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;<span class="keywordtype">int</span> <a class="code" href="../../d6/d34/hook_8h.html#a63187dcc3bfeb1895aed9385c06ed714">put_bnode_map</a>(<a class="code" href="../../d6/dbc/structPACKET.html">PACKET</a> rq_pkt);</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;<span class="keywordtype">int</span> <a class="code" href="../../d6/d34/hook_8h.html#ab49323f81163c48f70eacb3bd5a5eec4">create_gnodes</a>(<a class="code" href="../../da/d1d/structinet__prefix.html">inet_prefix</a> *ip, <span class="keywordtype">int</span> final_level);</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="keywordtype">void</span> <a class="code" href="../../d6/d34/hook_8h.html#adbf24b12ebeeeb408627e1d523b8eea0">set_ip_and_def_gw</a>(<span class="keywordtype">char</span> *dev, <a class="code" href="../../da/d1d/structinet__prefix.html">inet_prefix</a> ip);</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;<span class="keywordtype">int</span> <a class="code" href="../../d6/d34/hook_8h.html#af541d5ab5dd6596b12342140f4094dee">hook_init</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;<span class="keywordtype">int</span> <a class="code" href="../../d6/d34/hook_8h.html#af10a487801fab9a28a3cfb6759fe138f">netsukuku_hook</a>(<a class="code" href="../../d5/d7c/structmap__gnode.html">map_gnode</a> *hook_gnode, <span class="keywordtype">int</span> hook_level);</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/*HOOK_H*/</span><span class="preprocessor"></span></div>
<div class="ttc" id="hook_8h_html_ab08a91850a188145dc3f039300aeca8b"><div class="ttname"><a href="../../d6/d34/hook_8h.html#ab08a91850a188145dc3f039300aeca8b">put_int_map</a></div><div class="ttdeci">int put_int_map(PACKET rq_pkt)</div><div class="ttdef"><b>Definition:</b> hook.c:512</div></div>
<div class="ttc" id="structfree__nodes__hdr_html_a2fb19694636528e6197112fb01b95ee9"><div class="ttname"><a href="../../db/d46/structfree__nodes__hdr.html#a2fb19694636528e6197112fb01b95ee9">free_nodes_hdr::max_levels</a></div><div class="ttdeci">u_char max_levels</div><div class="ttdef"><b>Definition:</b> hook.h:67</div></div>
<div class="ttc" id="hook_8h_html_af10a487801fab9a28a3cfb6759fe138f"><div class="ttname"><a href="../../d6/d34/hook_8h.html#af10a487801fab9a28a3cfb6759fe138f">netsukuku_hook</a></div><div class="ttdeci">int netsukuku_hook(map_gnode *hook_gnode, int hook_level)</div><div class="ttdef"><b>Definition:</b> hook.c:1549</div></div>
<div class="ttc" id="hook_8h_html_a63187dcc3bfeb1895aed9385c06ed714"><div class="ttname"><a href="../../d6/d34/hook_8h.html#a63187dcc3bfeb1895aed9385c06ed714">put_bnode_map</a></div><div class="ttdeci">int put_bnode_map(PACKET rq_pkt)</div><div class="ttdef"><b>Definition:</b> hook.c:583</div></div>
<div class="ttc" id="hook_8h_html_adbf24b12ebeeeb408627e1d523b8eea0"><div class="ttname"><a href="../../d6/d34/hook_8h.html#adbf24b12ebeeeb408627e1d523b8eea0">set_ip_and_def_gw</a></div><div class="ttdeci">void set_ip_and_def_gw(char *dev, inet_prefix ip)</div></div>
<div class="ttc" id="hook_8h_html_ab49323f81163c48f70eacb3bd5a5eec4"><div class="ttname"><a href="../../d6/d34/hook_8h.html#ab49323f81163c48f70eacb3bd5a5eec4">create_gnodes</a></div><div class="ttdeci">int create_gnodes(inet_prefix *ip, int final_level)</div><div class="ttdef"><b>Definition:</b> hook.c:771</div></div>
<div class="ttc" id="hook_8h_html_a7da6546e5822e282b57e5aee17e0c80c"><div class="ttname"><a href="../../d6/d34/hook_8h.html#a7da6546e5822e282b57e5aee17e0c80c">put_free_nodes</a></div><div class="ttdeci">int put_free_nodes(PACKET rq_pkt)</div><div class="ttdef"><b>Definition:</b> hook.c:175</div></div>
<div class="ttc" id="hook_8h_html_af541d5ab5dd6596b12342140f4094dee"><div class="ttname"><a href="../../d6/d34/hook_8h.html#af541d5ab5dd6596b12342140f4094dee">hook_init</a></div><div class="ttdeci">int hook_init(void)</div><div class="ttdef"><b>Definition:</b> hook.c:940</div></div>
<div class="ttc" id="structfree__nodes__hdr_html_a4ab85aadd47a984728021ca4f9231a6c"><div class="ttname"><a href="../../db/d46/structfree__nodes__hdr.html#a4ab85aadd47a984728021ca4f9231a6c">free_nodes_hdr::join_rate</a></div><div class="ttdeci">uint32_t join_rate</div><div class="ttdef"><b>Definition:</b> hook.h:73</div></div>
<div class="ttc" id="hook_8h_html_a02d00308296b3bf01fb0c537f356dc9b"><div class="ttname"><a href="../../d6/d34/hook_8h.html#a02d00308296b3bf01fb0c537f356dc9b">total_hooks</a></div><div class="ttdeci">int total_hooks</div><div class="ttdef"><b>Definition:</b> hook.h:44</div></div>
<div class="ttc" id="endianness_8h_html_aab0cb83658366f074119d70b2838c7d2"><div class="ttname"><a href="../../dc/d3e/endianness_8h.html#aab0cb83658366f074119d70b2838c7d2">IINFO_DYNAMIC_VALUE</a></div><div class="ttdeci">#define IINFO_DYNAMIC_VALUE</div><div class="ttdef"><b>Definition:</b> endianness.h:25</div></div>
<div class="ttc" id="structinet__prefix_html"><div class="ttname"><a href="../../da/d1d/structinet__prefix.html">inet_prefix</a></div><div class="ttdef"><b>Definition:</b> inet.h:73</div></div>
<div class="ttc" id="hook_8h_html_a12af4a7ec9fc3795e61018514fcfbf64"><div class="ttname"><a href="../../d6/d34/hook_8h.html#a12af4a7ec9fc3795e61018514fcfbf64">rnodes_rehooked</a></div><div class="ttdeci">u_int rnodes_rehooked</div><div class="ttdef"><b>Definition:</b> hook.h:48</div></div>
<div class="ttc" id="structfree__nodes__hdr_html"><div class="ttname"><a href="../../db/d46/structfree__nodes__hdr.html">free_nodes_hdr</a></div><div class="ttdef"><b>Definition:</b> hook.h:65</div></div>
<div class="ttc" id="qspn_8h_html_ae43980163dccdef6bba0624790470ac3"><div class="ttname"><a href="../../d8/da0/qspn_8h.html#ae43980163dccdef6bba0624790470ac3">GCOUNT_LEVELS</a></div><div class="ttdeci">#define GCOUNT_LEVELS</div><div class="ttdef"><b>Definition:</b> qspn.h:69</div></div>
<div class="ttc" id="hook_8h_html_a1de69ac7df43e825221933910410452e"><div class="ttname"><a href="../../d6/d34/hook_8h.html#a1de69ac7df43e825221933910410452e">qspn_round_pkt_iinfo</a></div><div class="ttdeci">static const int_info qspn_round_pkt_iinfo</div><div class="ttdef"><b>Definition:</b> hook.h:108</div></div>
<div class="ttc" id="structfree__nodes__hdr_html_ad12b312f781d758091b1f25adbe11f2c"><div class="ttname"><a href="../../db/d46/structfree__nodes__hdr.html#ad12b312f781d758091b1f25adbe11f2c">free_nodes_hdr::nodes</a></div><div class="ttdeci">u_char nodes</div><div class="ttdef"><b>Definition:</b> hook.h:72</div></div>
<div class="ttc" id="inet_8h_html_a70f8406c9556460a606bee45306c5630"><div class="ttname"><a href="../../d6/d4a/inet_8h.html#a70f8406c9556460a606bee45306c5630">MAX_IP_INT</a></div><div class="ttdeci">#define MAX_IP_INT</div><div class="ttdef"><b>Definition:</b> inet.h:24</div></div>
<div class="ttc" id="qspn_8h_html"><div class="ttname"><a href="../../d8/da0/qspn_8h.html">qspn.h</a></div></div>
<div class="ttc" id="hook_8h_html_aa99944b9d6345e33be0bf1c850380228"><div class="ttname"><a href="../../d6/d34/hook_8h.html#aa99944b9d6345e33be0bf1c850380228">put_ext_map</a></div><div class="ttdeci">int put_ext_map(PACKET rq_pkt)</div><div class="ttdef"><b>Definition:</b> hook.c:446</div></div>
<div class="ttc" id="structfree__nodes__hdr_html_ad1c9ea749686b693fe73432d57a5a84e"><div class="ttname"><a href="../../db/d46/structfree__nodes__hdr.html#ad1c9ea749686b693fe73432d57a5a84e">free_nodes_hdr::ipstart</a></div><div class="ttdeci">uint32_t ipstart[4]</div><div class="ttdef"><b>Definition:</b> hook.h:69</div></div>
<div class="ttc" id="endianness_8h_html_a3e44b8503d7a90af675c81800fe6d275"><div class="ttname"><a href="../../dc/d3e/endianness_8h.html#a3e44b8503d7a90af675c81800fe6d275">INT_INFO</a></div><div class="ttdeci">#define INT_INFO</div><div class="ttdef"><b>Definition:</b> endianness.h:90</div></div>
<div class="ttc" id="hook_8h_html_a14d32f6676649eb9afc8c122ddceca7e"><div class="ttname"><a href="../../d6/d34/hook_8h.html#a14d32f6676649eb9afc8c122ddceca7e">_PACKED_</a></div><div class="ttdeci">struct free_nodes_hdr _PACKED_</div></div>
<div class="ttc" id="structPACKET_html"><div class="ttname"><a href="../../d6/dbc/structPACKET.html">PACKET</a></div><div class="ttdef"><b>Definition:</b> pkts.h:118</div></div>
<div class="ttc" id="structfree__nodes__hdr_html_a2e8ae48a9d34febba0bb7cb553d92c55"><div class="ttname"><a href="../../db/d46/structfree__nodes__hdr.html#a2e8ae48a9d34febba0bb7cb553d92c55">free_nodes_hdr::level</a></div><div class="ttdeci">u_char level</div><div class="ttdef"><b>Definition:</b> hook.h:70</div></div>
<div class="ttc" id="hook_8h_html_a9f5bf83a6b6a55db0693fab688d3b67a"><div class="ttname"><a href="../../d6/d34/hook_8h.html#a9f5bf83a6b6a55db0693fab688d3b67a">free_nodes_hdr_iinfo</a></div><div class="ttdeci">static const int_info free_nodes_hdr_iinfo</div><div class="ttdef"><b>Definition:</b> hook.h:75</div></div>
<div class="ttc" id="endianness_8h_html_acc663d0291dd4a32c1dfbed3167bd58b"><div class="ttname"><a href="../../dc/d3e/endianness_8h.html#acc663d0291dd4a32c1dfbed3167bd58b">INT_TYPE_32BIT</a></div><div class="ttdeci">#define INT_TYPE_32BIT</div><div class="ttdef"><b>Definition:</b> endianness.h:35</div></div>
<div class="ttc" id="hook_8h_html_ab9316eed1d091f99fc4884a2863c4553"><div class="ttname"><a href="../../d6/d34/hook_8h.html#ab9316eed1d091f99fc4884a2863c4553">hook_join_rate</a></div><div class="ttdeci">u_int hook_join_rate</div><div class="ttdef"><b>Definition:</b> hook.h:47</div></div>
<div class="ttc" id="structmap__gnode_html"><div class="ttname"><a href="../../d5/d7c/structmap__gnode.html">map_gnode</a></div><div class="ttdef"><b>Definition:</b> gmap.h:37</div></div>
<div class="ttc" id="hook_8h_html_a14eec030eb6098fc9cc4a8609b19bd00"><div class="ttname"><a href="../../d6/d34/hook_8h.html#a14eec030eb6098fc9cc4a8609b19bd00">put_qspn_round</a></div><div class="ttdeci">int put_qspn_round(PACKET rq_pkt)</div><div class="ttdef"><b>Definition:</b> hook.c:360</div></div>
<div class="ttc" id="structfree__nodes__hdr_html_adea9dc565dd2e4473b1109dff99c3f64"><div class="ttname"><a href="../../db/d46/structfree__nodes__hdr.html#adea9dc565dd2e4473b1109dff99c3f64">free_nodes_hdr::gid</a></div><div class="ttdeci">u_char gid</div><div class="ttdef"><b>Definition:</b> hook.h:71</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="../../d6/d34/hook_8h.html">hook.h</a></li>
<li class="footer">Generated on Wed Feb 19 2014 14:19:07 for The Netsukuku Project by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
</ul>
</div>
</body>
</html>