-
Notifications
You must be signed in to change notification settings - Fork 0
/
bgp-capability_8cc_source.html
105 lines (103 loc) · 50.1 KB
/
bgp-capability_8cc_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!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.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libbgp: src/bgp-capability.cc 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 style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libbgp
 <span id="projectnumber">0.6</span>
</div>
<div id="projectbrief">A C++ BGP Library.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- 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">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">bgp-capability.cc</div> </div>
</div><!--header-->
<div class="contents">
<a href="bgp-capability_8cc.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor">#include "<a class="code" href="bgp-capability_8h.html">bgp-capability.h</a>"</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#include "<a class="code" href="bgp-errcode_8h.html">bgp-errcode.h</a>"</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="preprocessor">#include "<a class="code" href="value-op_8h.html">value-op.h</a>"</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="preprocessor">#include <stdlib.h></span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#include <string.h></span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#include <arpa/inet.h></span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> </div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="keyword">namespace </span><a class="code" href="namespacelibbgp.html">libbgp</a> {</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div><div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="classlibbgp_1_1BgpCapability.html#ad7e1a42daea3e263b4c8ec5b9bcf890a"> 25</a></span> <a class="code" href="classlibbgp_1_1BgpCapability.html#ad7e1a42daea3e263b4c8ec5b9bcf890a">BgpCapability::BgpCapability</a>(<a class="code" href="classlibbgp_1_1BgpLogHandler.html">BgpLogHandler</a> *logger) : <a class="code" href="classlibbgp_1_1Serializable.html">Serializable</a>(logger) {</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  <a class="code" href="classlibbgp_1_1Serializable.html#a37f02045e83866077732aa421dbad0e4">length</a> = 0;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> }</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="classlibbgp_1_1BgpCapability.html#ac36cb4f0638b5a118b5d111f4b26fc6b"> 39</a></span> ssize_t <a class="code" href="classlibbgp_1_1BgpCapability.html#ac36cb4f0638b5a118b5d111f4b26fc6b">BgpCapability::parseHeader</a>(<span class="keyword">const</span> uint8_t *from, <span class="keywordtype">size_t</span> msg_sz) {</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <span class="keywordflow">if</span> (msg_sz < 2) {</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <a class="code" href="classlibbgp_1_1Serializable.html#a7fe3ec9c2494bb2bf6799d287ebe9dd2">setError</a>(E_OPEN, E_UNSPEC_OPEN, NULL, 0);</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  logger-><a class="code" href="classlibbgp_1_1BgpLogHandler.html#a7fa1c9be3cfe2b3ad321edeee5024274">log</a>(ERROR, <span class="stringliteral">"BgpCapability::parseHeader: unexpected end of capability.\n"</span>);</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  }</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> </div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  code = getValue<uint8_t>(&from);</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <a class="code" href="classlibbgp_1_1Serializable.html#a37f02045e83866077732aa421dbad0e4">length</a> = getValue<uint8_t>(&from);</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="keywordflow">if</span> ((<span class="keywordtype">size_t</span>) (length + 2) > msg_sz) {</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <a class="code" href="classlibbgp_1_1Serializable.html#a7fe3ec9c2494bb2bf6799d287ebe9dd2">setError</a>(E_OPEN, E_UNSPEC_OPEN, NULL, 0);</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  logger-><a class="code" href="classlibbgp_1_1BgpLogHandler.html#a7fa1c9be3cfe2b3ad321edeee5024274">log</a>(ERROR, <span class="stringliteral">"BgpCapability::parseHeader: capability size exceed capabilities list.\n"</span>);</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  }</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="keywordflow">return</span> 2;</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> }</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div><div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="classlibbgp_1_1BgpCapability4BytesAsn.html#ae7785a2cb617d11b4e80a4c1907bb9d6"> 63</a></span> <a class="code" href="classlibbgp_1_1BgpCapability4BytesAsn.html#ae7785a2cb617d11b4e80a4c1907bb9d6">BgpCapability4BytesAsn::BgpCapability4BytesAsn</a>(<a class="code" href="classlibbgp_1_1BgpLogHandler.html">BgpLogHandler</a> *logger) : <a class="code" href="classlibbgp_1_1BgpCapability.html">BgpCapability</a>(logger) {</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <a class="code" href="classlibbgp_1_1BgpCapability4BytesAsn.html#ab48afb805bb1745635833fe354938fdc">my_asn</a> = 0;</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  code = ASN_4B;</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> }</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="classlibbgp_1_1BgpCapability4BytesAsn.html#a13466b96b4b3936c3067d02f7fc14b3a"> 68</a></span> ssize_t <a class="code" href="classlibbgp_1_1BgpCapability4BytesAsn.html#a13466b96b4b3936c3067d02f7fc14b3a">BgpCapability4BytesAsn::doPrint</a>(<span class="keywordtype">size_t</span> indent, uint8_t **to, <span class="keywordtype">size_t</span> *buf_sz)<span class="keyword"> const </span>{</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  ssize_t written = 0;</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  written += <a class="code" href="classlibbgp_1_1Serializable.html#a439ea41e411d9695a0c49ac5563350d1">_print</a>(indent, to, buf_sz, <span class="stringliteral">"FourOctetAsnCapability {\n"</span>);</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  indent++; {</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  written += <a class="code" href="classlibbgp_1_1Serializable.html#a439ea41e411d9695a0c49ac5563350d1">_print</a>(indent, to, buf_sz, <span class="stringliteral">"Code { %d }\n"</span>, code);</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  written += <a class="code" href="classlibbgp_1_1Serializable.html#a439ea41e411d9695a0c49ac5563350d1">_print</a>(indent, to, buf_sz, <span class="stringliteral">"MyAsn { %d }\n"</span>, <a class="code" href="classlibbgp_1_1BgpCapability4BytesAsn.html#ab48afb805bb1745635833fe354938fdc">my_asn</a>);</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  }; indent--;</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  written += <a class="code" href="classlibbgp_1_1Serializable.html#a439ea41e411d9695a0c49ac5563350d1">_print</a>(indent, to, buf_sz, <span class="stringliteral">"}\n"</span>);</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span> </div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="keywordflow">return</span> written;</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span> }</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> </div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="classlibbgp_1_1BgpCapability4BytesAsn.html#a52f73c9019e78ab483be6c34180d875a"> 80</a></span> ssize_t <a class="code" href="classlibbgp_1_1BgpCapability4BytesAsn.html#a52f73c9019e78ab483be6c34180d875a">BgpCapability4BytesAsn::parse</a>(<span class="keyword">const</span> uint8_t *from, <span class="keywordtype">size_t</span> msg_sz) {</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  ssize_t hdr_len = <a class="code" href="classlibbgp_1_1BgpCapability.html#ac36cb4f0638b5a118b5d111f4b26fc6b">parseHeader</a>(from, msg_sz);</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span> </div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="keywordflow">if</span> (code != ASN_4B) {</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  logger-><a class="code" href="classlibbgp_1_1BgpLogHandler.html#a7fa1c9be3cfe2b3ad321edeee5024274">log</a>(FATAL, <span class="stringliteral">"BgpCapability4BytesAsn::parse: typecode mismatch with object type.\n"</span>);</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="keywordflow">throw</span> <span class="stringliteral">"bad_type"</span>;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  }</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> </div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keywordflow">if</span> (hdr_len < 0) <span class="keywordflow">return</span> hdr_len;</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="keywordflow">if</span> (<a class="code" href="classlibbgp_1_1Serializable.html#a37f02045e83866077732aa421dbad0e4">length</a> != 4) {</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <a class="code" href="classlibbgp_1_1Serializable.html#a7fe3ec9c2494bb2bf6799d287ebe9dd2">setError</a>(E_OPEN, E_UNSPEC_OPEN, NULL, 0);</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  logger-><a class="code" href="classlibbgp_1_1BgpLogHandler.html#a7fa1c9be3cfe2b3ad321edeee5024274">log</a>(ERROR, <span class="stringliteral">"BgpCapability4BytesAsn::parse: bad length field (saw %d, want 4).\n"</span>, <a class="code" href="classlibbgp_1_1Serializable.html#a37f02045e83866077732aa421dbad0e4">length</a>);</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  }</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span> </div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  <span class="keyword">const</span> uint8_t *buffer = from + hdr_len;</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <a class="code" href="classlibbgp_1_1BgpCapability4BytesAsn.html#ab48afb805bb1745635833fe354938fdc">my_asn</a> = ntohl(getValue<uint32_t>(&buffer));</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span> </div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="keywordflow">return</span> hdr_len + 4;</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> }</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span> </div><div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="classlibbgp_1_1BgpCapability4BytesAsn.html#a7719c202b5a1dd34d2a33d5b7f7cd9bd"> 101</a></span> ssize_t <a class="code" href="classlibbgp_1_1BgpCapability4BytesAsn.html#a7719c202b5a1dd34d2a33d5b7f7cd9bd">BgpCapability4BytesAsn::write</a>(uint8_t *to, <span class="keywordtype">size_t</span> buf_sz)<span class="keyword"> const </span>{</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keywordflow">if</span> (buf_sz < 6) {</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  logger-><a class="code" href="classlibbgp_1_1BgpLogHandler.html#a7fa1c9be3cfe2b3ad321edeee5024274">log</a>(ERROR, <span class="stringliteral">"BgpCapability4BytesAsn::write: dest buffer too small.\n"</span>);</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  }</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span> </div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  uint8_t *buffer = to;</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  putValue<uint8_t>(&buffer, ASN_4B);</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  putValue<uint8_t>(&buffer, 4);</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  putValue<uint32_t>(&buffer, htonl(<a class="code" href="classlibbgp_1_1BgpCapability4BytesAsn.html#ab48afb805bb1745635833fe354938fdc">my_asn</a>));</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span> </div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="keywordflow">return</span> 6;</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span> }</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span> </div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> BgpCapabilityMpBgp::BgpCapabilityMpBgp(<a class="code" href="classlibbgp_1_1BgpLogHandler.html">BgpLogHandler</a> *logger) : <a class="code" href="classlibbgp_1_1BgpCapability.html#ad7e1a42daea3e263b4c8ec5b9bcf890a">BgpCapability</a>(logger) {</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  code = MP_BGP;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> }</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span> </div><div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="classlibbgp_1_1BgpCapabilityMpBgp.html#a6647442cf6ea81aa654950925e6a1cdb"> 119</a></span> ssize_t <a class="code" href="classlibbgp_1_1BgpCapabilityMpBgp.html#a6647442cf6ea81aa654950925e6a1cdb">BgpCapabilityMpBgp::doPrint</a>(<span class="keywordtype">size_t</span> indent, uint8_t **to, <span class="keywordtype">size_t</span> *buf_sz)<span class="keyword"> const </span>{</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  ssize_t written = 0;</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  written += <a class="code" href="classlibbgp_1_1Serializable.html#a439ea41e411d9695a0c49ac5563350d1">_print</a>(indent, to, buf_sz, <span class="stringliteral">"MpBgpCapability {\n"</span>);</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  indent++; {</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  written += <a class="code" href="classlibbgp_1_1Serializable.html#a439ea41e411d9695a0c49ac5563350d1">_print</a>(indent, to, buf_sz, <span class="stringliteral">"Code { %d }\n"</span>, code);</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* afi_name = NULL;</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* safi_name = NULL;</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span> </div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="keywordflow">switch</span> (afi) {</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="keywordflow">case</span> IPV4: afi_name = <span class="stringliteral">"IPv4"</span>; <span class="keywordflow">break</span>;</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keywordflow">case</span> IPV6: afi_name = <span class="stringliteral">"IPv6"</span>; <span class="keywordflow">break</span>;</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="keywordflow">default</span>: afi_name = <span class="stringliteral">"Unknow"</span>; <span class="keywordflow">break</span>;</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  }</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span> </div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="keywordflow">switch</span> (safi) {</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="keywordflow">case</span> UNICAST: safi_name = <span class="stringliteral">"Unicast"</span>; <span class="keywordflow">break</span>;</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="keywordflow">case</span> MULTICAST: safi_name = <span class="stringliteral">"Multicast"</span>; <span class="keywordflow">break</span>;</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="keywordflow">case</span> UNICAST_AND_MULTICAST: safi_name = <span class="stringliteral">"Unicast & Multicast"</span>; <span class="keywordflow">break</span>;</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="keywordflow">default</span>: safi_name = <span class="stringliteral">"Unknow"</span>;</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  }</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span> </div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  written += <a class="code" href="classlibbgp_1_1Serializable.html#a439ea41e411d9695a0c49ac5563350d1">_print</a>(indent, to, buf_sz, <span class="stringliteral">"Afi { %s }\n"</span>, afi_name);</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  written += <a class="code" href="classlibbgp_1_1Serializable.html#a439ea41e411d9695a0c49ac5563350d1">_print</a>(indent, to, buf_sz, <span class="stringliteral">"Safi { %s }\n"</span>, safi_name);</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  }; indent--;</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  written += <a class="code" href="classlibbgp_1_1Serializable.html#a439ea41e411d9695a0c49ac5563350d1">_print</a>(indent, to, buf_sz, <span class="stringliteral">"}\n"</span>);</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span> </div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keywordflow">return</span> written;</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span> }</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span> </div><div class="line"><a name="l00148"></a><span class="lineno"><a class="line" href="classlibbgp_1_1BgpCapabilityMpBgp.html#aabcf1be4b8c98fd43b298dd6c7e702e9"> 148</a></span> ssize_t <a class="code" href="classlibbgp_1_1BgpCapabilityMpBgp.html#aabcf1be4b8c98fd43b298dd6c7e702e9">BgpCapabilityMpBgp::parse</a>(<span class="keyword">const</span> uint8_t *from, <span class="keywordtype">size_t</span> msg_sz) {</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  ssize_t hdr_len = <a class="code" href="classlibbgp_1_1BgpCapability.html#ac36cb4f0638b5a118b5d111f4b26fc6b">parseHeader</a>(from, msg_sz);</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span> </div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <span class="keywordflow">if</span> (code != MP_BGP) {</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  logger-><a class="code" href="classlibbgp_1_1BgpLogHandler.html#a7fa1c9be3cfe2b3ad321edeee5024274">log</a>(FATAL, <span class="stringliteral">"BgpCapabilityMpBgp::parse: typecode mismatch with object type.\n"</span>);</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <span class="keywordflow">throw</span> <span class="stringliteral">"bad_type"</span>;</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  }</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span> </div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="keywordflow">if</span> (hdr_len < 0) <span class="keywordflow">return</span> hdr_len;</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span> </div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <span class="keywordflow">if</span> (<a class="code" href="classlibbgp_1_1Serializable.html#a37f02045e83866077732aa421dbad0e4">length</a> != 4) {</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <a class="code" href="classlibbgp_1_1Serializable.html#a7fe3ec9c2494bb2bf6799d287ebe9dd2">setError</a>(E_OPEN, E_UNSPEC_OPEN, NULL, 0);</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  logger-><a class="code" href="classlibbgp_1_1BgpLogHandler.html#a7fa1c9be3cfe2b3ad321edeee5024274">log</a>(ERROR, <span class="stringliteral">"BgpCapabilityMpBgp::parse: bad length field, want 4, saw %d.\n"</span>, <a class="code" href="classlibbgp_1_1Serializable.html#a37f02045e83866077732aa421dbad0e4">length</a>);</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  }</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span> </div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="keyword">const</span> uint8_t *buffer = from + hdr_len;</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  afi = ntohs(getValue<uint16_t>(&buffer)); </div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span> </div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  uint8_t res = getValue<uint8_t>(&buffer);</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  <span class="keywordflow">if</span> (res != 0) {</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  logger-><a class="code" href="classlibbgp_1_1BgpLogHandler.html#a7fa1c9be3cfe2b3ad321edeee5024274">log</a>(WARN, <span class="stringliteral">"BgpCapabilityMpBgp::parse: reserved bits != 0.\n"</span>);</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  }</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span> </div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  safi = getValue<uint8_t>(&buffer);</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span> </div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <span class="keywordflow">return</span> hdr_len + 4;</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span> }</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span> </div><div class="line"><a name="l00176"></a><span class="lineno"><a class="line" href="classlibbgp_1_1BgpCapabilityMpBgp.html#ad3922b9a618c649a8161d03ccd62a30d"> 176</a></span> ssize_t <a class="code" href="classlibbgp_1_1BgpCapabilityMpBgp.html#ad3922b9a618c649a8161d03ccd62a30d">BgpCapabilityMpBgp::write</a>(uint8_t *to, <span class="keywordtype">size_t</span> buf_sz)<span class="keyword"> const </span>{</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <span class="keywordflow">if</span> (buf_sz < 6) {</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  logger-><a class="code" href="classlibbgp_1_1BgpLogHandler.html#a7fa1c9be3cfe2b3ad321edeee5024274">log</a>(ERROR, <span class="stringliteral">"BgpCapability4BytesAsn::write: dest buffer too small.\n"</span>);</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  }</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span> </div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  uint8_t *buffer = to;</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  putValue<uint8_t>(&buffer, MP_BGP);</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  putValue<uint8_t>(&buffer, 4);</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  putValue<uint16_t>(&buffer, htons(afi));</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  putValue<uint8_t>(&buffer, 0);</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  putValue<uint8_t>(&buffer, safi);</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span> </div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <span class="keywordflow">return</span> 6;</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span> }</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span> </div><div class="line"><a name="l00197"></a><span class="lineno"><a class="line" href="classlibbgp_1_1BgpCapabilityUnknow.html#ae3fec931f46f2aabbb11d78480f3d38a"> 197</a></span> <a class="code" href="classlibbgp_1_1BgpCapabilityUnknow.html#ae3fec931f46f2aabbb11d78480f3d38a">BgpCapabilityUnknow::BgpCapabilityUnknow</a>(<a class="code" href="classlibbgp_1_1BgpLogHandler.html">BgpLogHandler</a> *logger) : <a class="code" href="classlibbgp_1_1BgpCapability.html">BgpCapability</a>(logger) {</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  value = NULL;</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span> }</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span> </div><div class="line"><a name="l00205"></a><span class="lineno"><a class="line" href="classlibbgp_1_1BgpCapabilityUnknow.html#a38df1b5a656920e544ce7a0419f1f485"> 205</a></span> <a class="code" href="classlibbgp_1_1BgpCapabilityUnknow.html#a38df1b5a656920e544ce7a0419f1f485">BgpCapabilityUnknow::~BgpCapabilityUnknow</a>() {</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <span class="keywordflow">if</span> (<a class="code" href="classlibbgp_1_1Serializable.html#a37f02045e83866077732aa421dbad0e4">length</a> > 0 && value != NULL) free(value);</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span> }</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span> </div><div class="line"><a name="l00209"></a><span class="lineno"><a class="line" href="classlibbgp_1_1BgpCapabilityUnknow.html#a0677204e158b15ef9a8dd3bf79f10132"> 209</a></span> ssize_t <a class="code" href="classlibbgp_1_1BgpCapabilityUnknow.html#a0677204e158b15ef9a8dd3bf79f10132">BgpCapabilityUnknow::doPrint</a>(<span class="keywordtype">size_t</span> indent, uint8_t **to, <span class="keywordtype">size_t</span> *buf_sz)<span class="keyword"> const </span>{</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  ssize_t written = 0;</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  written += <a class="code" href="classlibbgp_1_1Serializable.html#a439ea41e411d9695a0c49ac5563350d1">_print</a>(indent, to, buf_sz, <span class="stringliteral">"UnknowCapability {\n"</span>);</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  indent++; {</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  written += <a class="code" href="classlibbgp_1_1Serializable.html#a439ea41e411d9695a0c49ac5563350d1">_print</a>(indent, to, buf_sz, <span class="stringliteral">"Code { %d }\n"</span>, code);</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  }; indent--;</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  written += <a class="code" href="classlibbgp_1_1Serializable.html#a439ea41e411d9695a0c49ac5563350d1">_print</a>(indent, to, buf_sz, <span class="stringliteral">"}\n"</span>);</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span> </div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <span class="keywordflow">return</span> written;</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span> }</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span> </div><div class="line"><a name="l00220"></a><span class="lineno"><a class="line" href="classlibbgp_1_1BgpCapabilityUnknow.html#ab8effbb0dedf8079718544785c101d58"> 220</a></span> ssize_t <a class="code" href="classlibbgp_1_1BgpCapabilityUnknow.html#ab8effbb0dedf8079718544785c101d58">BgpCapabilityUnknow::parse</a>(<span class="keyword">const</span> uint8_t *from, <span class="keywordtype">size_t</span> msg_sz) {</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  ssize_t hdr_len = <a class="code" href="classlibbgp_1_1BgpCapability.html#ac36cb4f0638b5a118b5d111f4b26fc6b">parseHeader</a>(from, msg_sz);</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span> </div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  <span class="keywordflow">if</span> (hdr_len < 0) <span class="keywordflow">return</span> hdr_len;</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <span class="keywordflow">if</span> (<a class="code" href="classlibbgp_1_1Serializable.html#a37f02045e83866077732aa421dbad0e4">length</a> == 0) <span class="keywordflow">return</span> hdr_len;</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span> </div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  value = (uint8_t *) malloc(<a class="code" href="classlibbgp_1_1Serializable.html#a37f02045e83866077732aa421dbad0e4">length</a>);</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  memcpy(value, from + hdr_len, <a class="code" href="classlibbgp_1_1Serializable.html#a37f02045e83866077732aa421dbad0e4">length</a>);</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span> </div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  <span class="keywordflow">return</span> hdr_len + <a class="code" href="classlibbgp_1_1Serializable.html#a37f02045e83866077732aa421dbad0e4">length</a>;</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span> }</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span> </div><div class="line"><a name="l00232"></a><span class="lineno"><a class="line" href="classlibbgp_1_1BgpCapabilityUnknow.html#ae22ea33ae03ca0c1765657887e7f2b4f"> 232</a></span> ssize_t <a class="code" href="classlibbgp_1_1BgpCapabilityUnknow.html#ae22ea33ae03ca0c1765657887e7f2b4f">BgpCapabilityUnknow::write</a>(uint8_t *to, <span class="keywordtype">size_t</span> buf_sz)<span class="keyword"> const </span>{</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  <span class="keywordflow">if</span> (buf_sz < (<span class="keywordtype">size_t</span>) (<a class="code" href="classlibbgp_1_1Serializable.html#a37f02045e83866077732aa421dbad0e4">length</a> + 2)) {</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  logger-><a class="code" href="classlibbgp_1_1BgpLogHandler.html#a7fa1c9be3cfe2b3ad321edeee5024274">log</a>(ERROR, <span class="stringliteral">"BgpCapabilityUnknow::write: dest buffer too small.\n"</span>);</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  }</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span> </div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  uint8_t *buffer = to;</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  putValue<uint8_t>(&buffer, code);</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  putValue<uint8_t>(&buffer, <a class="code" href="classlibbgp_1_1Serializable.html#a37f02045e83866077732aa421dbad0e4">length</a>);</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  <span class="keywordflow">if</span> (<a class="code" href="classlibbgp_1_1Serializable.html#a37f02045e83866077732aa421dbad0e4">length</a> == 0) <span class="keywordflow">return</span> 2;</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  <span class="keywordflow">if</span> (value == NULL) {</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  logger-><a class="code" href="classlibbgp_1_1BgpLogHandler.html#a7fa1c9be3cfe2b3ad321edeee5024274">log</a>(ERROR, <span class="stringliteral">"BgpCapabilityUnknow: missing value pointer.\n"</span>);</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  }</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  memcpy(buffer, value, <a class="code" href="classlibbgp_1_1Serializable.html#a37f02045e83866077732aa421dbad0e4">length</a>);</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span> </div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <span class="keywordflow">return</span> <a class="code" href="classlibbgp_1_1Serializable.html#a37f02045e83866077732aa421dbad0e4">length</a> + 2;</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span> }</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span> </div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span> }</div><div class="ttc" id="classlibbgp_1_1BgpCapability4BytesAsn_html_a7719c202b5a1dd34d2a33d5b7f7cd9bd"><div class="ttname"><a href="classlibbgp_1_1BgpCapability4BytesAsn.html#a7719c202b5a1dd34d2a33d5b7f7cd9bd">libbgp::BgpCapability4BytesAsn::write</a></div><div class="ttdeci">ssize_t write(uint8_t *to, size_t buf_sz) const</div><div class="ttdoc">Serialize a BGP open message capability. </div><div class="ttdef"><b>Definition:</b> <a href="bgp-capability_8cc_source.html#l00101">bgp-capability.cc:101</a></div></div>
<div class="ttc" id="classlibbgp_1_1Serializable_html_a37f02045e83866077732aa421dbad0e4"><div class="ttname"><a href="classlibbgp_1_1Serializable.html#a37f02045e83866077732aa421dbad0e4">libbgp::Serializable::length</a></div><div class="ttdeci">virtual ssize_t length() const</div><div class="ttdoc">Get size in bytes required to serialize the object. </div><div class="ttdef"><b>Definition:</b> <a href="serializable_8cc_source.html#l00176">serializable.cc:176</a></div></div>
<div class="ttc" id="classlibbgp_1_1BgpCapabilityMpBgp_html_ad3922b9a618c649a8161d03ccd62a30d"><div class="ttname"><a href="classlibbgp_1_1BgpCapabilityMpBgp.html#ad3922b9a618c649a8161d03ccd62a30d">libbgp::BgpCapabilityMpBgp::write</a></div><div class="ttdeci">ssize_t write(uint8_t *to, size_t buf_sz) const</div><div class="ttdoc">Serialize a BGP open message capability. </div><div class="ttdef"><b>Definition:</b> <a href="bgp-capability_8cc_source.html#l00176">bgp-capability.cc:176</a></div></div>
<div class="ttc" id="classlibbgp_1_1BgpCapabilityUnknow_html_a0677204e158b15ef9a8dd3bf79f10132"><div class="ttname"><a href="classlibbgp_1_1BgpCapabilityUnknow.html#a0677204e158b15ef9a8dd3bf79f10132">libbgp::BgpCapabilityUnknow::doPrint</a></div><div class="ttdeci">ssize_t doPrint(size_t indent, uint8_t **to, size_t *buf_sz) const</div><div class="ttdoc">Print implementation. </div><div class="ttdef"><b>Definition:</b> <a href="bgp-capability_8cc_source.html#l00209">bgp-capability.cc:209</a></div></div>
<div class="ttc" id="classlibbgp_1_1BgpCapability_html_ac36cb4f0638b5a118b5d111f4b26fc6b"><div class="ttname"><a href="classlibbgp_1_1BgpCapability.html#ac36cb4f0638b5a118b5d111f4b26fc6b">libbgp::BgpCapability::parseHeader</a></div><div class="ttdeci">ssize_t parseHeader(const uint8_t *from, size_t msg_sz)</div><div class="ttdoc">Parse the capability header (code, length). </div><div class="ttdef"><b>Definition:</b> <a href="bgp-capability_8cc_source.html#l00039">bgp-capability.cc:39</a></div></div>
<div class="ttc" id="classlibbgp_1_1BgpCapability_html"><div class="ttname"><a href="classlibbgp_1_1BgpCapability.html">libbgp::BgpCapability</a></div><div class="ttdoc">The BgpCapability base class. </div><div class="ttdef"><b>Definition:</b> <a href="bgp-capability_8h_source.html#l00040">bgp-capability.h:40</a></div></div>
<div class="ttc" id="classlibbgp_1_1BgpCapabilityUnknow_html_ab8effbb0dedf8079718544785c101d58"><div class="ttname"><a href="classlibbgp_1_1BgpCapabilityUnknow.html#ab8effbb0dedf8079718544785c101d58">libbgp::BgpCapabilityUnknow::parse</a></div><div class="ttdeci">ssize_t parse(const uint8_t *from, size_t msg_sz)</div><div class="ttdoc">Deserialize a BGP open message capability. </div><div class="ttdef"><b>Definition:</b> <a href="bgp-capability_8cc_source.html#l00220">bgp-capability.cc:220</a></div></div>
<div class="ttc" id="classlibbgp_1_1Serializable_html_a439ea41e411d9695a0c49ac5563350d1"><div class="ttname"><a href="classlibbgp_1_1Serializable.html#a439ea41e411d9695a0c49ac5563350d1">libbgp::Serializable::_print</a></div><div class="ttdeci">static ssize_t _print(size_t indent, uint8_t **to, size_t *buf_left, const char *format,...)</div><div class="ttdoc">Print helper. </div><div class="ttdef"><b>Definition:</b> <a href="serializable_8cc_source.html#l00144">serializable.cc:144</a></div></div>
<div class="ttc" id="classlibbgp_1_1Serializable_html"><div class="ttname"><a href="classlibbgp_1_1Serializable.html">libbgp::Serializable</a></div><div class="ttdoc">The serializable base class. </div><div class="ttdef"><b>Definition:</b> <a href="serializable_8h_source.html#l00026">serializable.h:26</a></div></div>
<div class="ttc" id="classlibbgp_1_1BgpCapabilityMpBgp_html_aabcf1be4b8c98fd43b298dd6c7e702e9"><div class="ttname"><a href="classlibbgp_1_1BgpCapabilityMpBgp.html#aabcf1be4b8c98fd43b298dd6c7e702e9">libbgp::BgpCapabilityMpBgp::parse</a></div><div class="ttdeci">ssize_t parse(const uint8_t *from, size_t msg_sz)</div><div class="ttdoc">Deserialize a BGP open message capability. </div><div class="ttdef"><b>Definition:</b> <a href="bgp-capability_8cc_source.html#l00148">bgp-capability.cc:148</a></div></div>
<div class="ttc" id="classlibbgp_1_1BgpLogHandler_html_a7fa1c9be3cfe2b3ad321edeee5024274"><div class="ttname"><a href="classlibbgp_1_1BgpLogHandler.html#a7fa1c9be3cfe2b3ad321edeee5024274">libbgp::BgpLogHandler::log</a></div><div class="ttdeci">void log(LogLevel level, const char *format_str,...)</div><div class="ttdoc">Log a message. Consider using LIBBGP_LOG if logging the message needs a lot of computing power...</div><div class="ttdef"><b>Definition:</b> <a href="bgp-log-handler_8cc_source.html#l00056">bgp-log-handler.cc:56</a></div></div>
<div class="ttc" id="bgp-capability_8h_html"><div class="ttname"><a href="bgp-capability_8h.html">bgp-capability.h</a></div><div class="ttdoc">BGP Capabilities. </div></div>
<div class="ttc" id="classlibbgp_1_1BgpCapability_html_ad7e1a42daea3e263b4c8ec5b9bcf890a"><div class="ttname"><a href="classlibbgp_1_1BgpCapability.html#ad7e1a42daea3e263b4c8ec5b9bcf890a">libbgp::BgpCapability::BgpCapability</a></div><div class="ttdeci">BgpCapability(BgpLogHandler *logger)</div><div class="ttdoc">Construct a new Bgp Capability object. </div><div class="ttdef"><b>Definition:</b> <a href="bgp-capability_8cc_source.html#l00025">bgp-capability.cc:25</a></div></div>
<div class="ttc" id="classlibbgp_1_1BgpCapabilityUnknow_html_a38df1b5a656920e544ce7a0419f1f485"><div class="ttname"><a href="classlibbgp_1_1BgpCapabilityUnknow.html#a38df1b5a656920e544ce7a0419f1f485">libbgp::BgpCapabilityUnknow::~BgpCapabilityUnknow</a></div><div class="ttdeci">~BgpCapabilityUnknow()</div><div class="ttdoc">Destroy the BgpCapabilityUnknow object. </div><div class="ttdef"><b>Definition:</b> <a href="bgp-capability_8cc_source.html#l00205">bgp-capability.cc:205</a></div></div>
<div class="ttc" id="classlibbgp_1_1BgpCapability4BytesAsn_html_ae7785a2cb617d11b4e80a4c1907bb9d6"><div class="ttname"><a href="classlibbgp_1_1BgpCapability4BytesAsn.html#ae7785a2cb617d11b4e80a4c1907bb9d6">libbgp::BgpCapability4BytesAsn::BgpCapability4BytesAsn</a></div><div class="ttdeci">BgpCapability4BytesAsn(BgpLogHandler *logger)</div><div class="ttdoc">Construct a new BgpCapability4BytesAsn object. </div><div class="ttdef"><b>Definition:</b> <a href="bgp-capability_8cc_source.html#l00063">bgp-capability.cc:63</a></div></div>
<div class="ttc" id="classlibbgp_1_1Serializable_html_a7fe3ec9c2494bb2bf6799d287ebe9dd2"><div class="ttname"><a href="classlibbgp_1_1Serializable.html#a7fe3ec9c2494bb2bf6799d287ebe9dd2">libbgp::Serializable::setError</a></div><div class="ttdeci">void setError(uint8_t err, uint8_t suberr, const uint8_t *data, size_t data_len)</div><div class="ttdoc">Set the error information. </div><div class="ttdef"><b>Definition:</b> <a href="serializable_8cc_source.html#l00061">serializable.cc:61</a></div></div>
<div class="ttc" id="value-op_8h_html"><div class="ttname"><a href="value-op_8h.html">value-op.h</a></div><div class="ttdoc">Buffer operation helpers. </div></div>
<div class="ttc" id="namespacelibbgp_html"><div class="ttname"><a href="namespacelibbgp.html">libbgp</a></div><div class="ttdef"><b>Definition:</b> <a href="bgp-afi_8h_source.html#l00014">bgp-afi.h:14</a></div></div>
<div class="ttc" id="classlibbgp_1_1BgpLogHandler_html"><div class="ttname"><a href="classlibbgp_1_1BgpLogHandler.html">libbgp::BgpLogHandler</a></div><div class="ttdoc">The BgpLogHandler class. </div><div class="ttdef"><b>Definition:</b> <a href="bgp-log-handler_8h_source.html#l00047">bgp-log-handler.h:47</a></div></div>
<div class="ttc" id="classlibbgp_1_1BgpCapabilityUnknow_html_ae3fec931f46f2aabbb11d78480f3d38a"><div class="ttname"><a href="classlibbgp_1_1BgpCapabilityUnknow.html#ae3fec931f46f2aabbb11d78480f3d38a">libbgp::BgpCapabilityUnknow::BgpCapabilityUnknow</a></div><div class="ttdeci">BgpCapabilityUnknow(BgpLogHandler *logger)</div><div class="ttdoc">Construct a new BgpCapabilityUnknow object. </div><div class="ttdef"><b>Definition:</b> <a href="bgp-capability_8cc_source.html#l00197">bgp-capability.cc:197</a></div></div>
<div class="ttc" id="classlibbgp_1_1BgpCapabilityMpBgp_html_a6647442cf6ea81aa654950925e6a1cdb"><div class="ttname"><a href="classlibbgp_1_1BgpCapabilityMpBgp.html#a6647442cf6ea81aa654950925e6a1cdb">libbgp::BgpCapabilityMpBgp::doPrint</a></div><div class="ttdeci">ssize_t doPrint(size_t indent, uint8_t **to, size_t *buf_sz) const</div><div class="ttdoc">Print implementation. </div><div class="ttdef"><b>Definition:</b> <a href="bgp-capability_8cc_source.html#l00119">bgp-capability.cc:119</a></div></div>
<div class="ttc" id="classlibbgp_1_1BgpCapabilityUnknow_html_ae22ea33ae03ca0c1765657887e7f2b4f"><div class="ttname"><a href="classlibbgp_1_1BgpCapabilityUnknow.html#ae22ea33ae03ca0c1765657887e7f2b4f">libbgp::BgpCapabilityUnknow::write</a></div><div class="ttdeci">ssize_t write(uint8_t *to, size_t buf_sz) const</div><div class="ttdoc">Serialize a BGP open message capability. </div><div class="ttdef"><b>Definition:</b> <a href="bgp-capability_8cc_source.html#l00232">bgp-capability.cc:232</a></div></div>
<div class="ttc" id="classlibbgp_1_1BgpCapability4BytesAsn_html_a13466b96b4b3936c3067d02f7fc14b3a"><div class="ttname"><a href="classlibbgp_1_1BgpCapability4BytesAsn.html#a13466b96b4b3936c3067d02f7fc14b3a">libbgp::BgpCapability4BytesAsn::doPrint</a></div><div class="ttdeci">ssize_t doPrint(size_t indent, uint8_t **to, size_t *buf_sz) const</div><div class="ttdoc">Print implementation. </div><div class="ttdef"><b>Definition:</b> <a href="bgp-capability_8cc_source.html#l00068">bgp-capability.cc:68</a></div></div>
<div class="ttc" id="bgp-errcode_8h_html"><div class="ttname"><a href="bgp-errcode_8h.html">bgp-errcode.h</a></div><div class="ttdoc">BGP error codes. </div></div>
<div class="ttc" id="classlibbgp_1_1BgpCapability4BytesAsn_html_ab48afb805bb1745635833fe354938fdc"><div class="ttname"><a href="classlibbgp_1_1BgpCapability4BytesAsn.html#ab48afb805bb1745635833fe354938fdc">libbgp::BgpCapability4BytesAsn::my_asn</a></div><div class="ttdeci">uint32_t my_asn</div><div class="ttdoc">The ASN. </div><div class="ttdef"><b>Definition:</b> <a href="bgp-capability_8h_source.html#l00103">bgp-capability.h:103</a></div></div>
<div class="ttc" id="classlibbgp_1_1BgpCapability4BytesAsn_html_a52f73c9019e78ab483be6c34180d875a"><div class="ttname"><a href="classlibbgp_1_1BgpCapability4BytesAsn.html#a52f73c9019e78ab483be6c34180d875a">libbgp::BgpCapability4BytesAsn::parse</a></div><div class="ttdeci">ssize_t parse(const uint8_t *from, size_t msg_sz)</div><div class="ttdoc">Deserialize a BGP open message capability. </div><div class="ttdef"><b>Definition:</b> <a href="bgp-capability_8cc_source.html#l00080">bgp-capability.cc:80</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>