This repository has been archived on 2024-10-30. You can view files and clone it, but cannot push or open issues or pull requests.
esp-firewall/doxygen/html/_a_p_i_8hpp_source.html
2022-07-30 11:46:19 +02:00

213 lines
29 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ESP32/ESP8266 Firewall: src/API.hpp 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="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">ESP32/ESP8266 Firewall<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">a software firewall for ESP23 or ESP8266</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></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">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('_a_p_i_8hpp_source.html',''); initResizable(); });
/* @license-end */
</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)">
</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">API.hpp</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#ifndef API_HPP</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#define API_HPP</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span> </div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="preprocessor">#ifdef ESP8266</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &quot;ESP8266WebServerSecure.h&quot;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &quot;WebServer.h&quot;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &quot;uri/UriBraces.h&quot;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &quot;Firewall.hpp&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &quot;Utils.hpp&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="keyword">namespace </span>fw</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span>{</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="classfw_1_1_a_p_i.html"> 20</a></span> <span class="keyword">class </span><a class="code hl_class" href="classfw_1_1_a_p_i.html">API</a></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> {</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <a class="code hl_function" href="classfw_1_1_a_p_i.html#a033d5efd077dfad456cb6e6e7dd2baca">API</a>(<a class="code hl_class" href="classfw_1_1_firewall.html">Firewall</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *cert, <span class="keyword">const</span> <span class="keywordtype">char</span> *key, <span class="keyword">const</span> <span class="keywordtype">char</span> *username, <span class="keyword">const</span> <span class="keywordtype">char</span> *password, <span class="keyword">const</span> String ip, <span class="keyword">const</span> uint16_t port = 8080);</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <a class="code hl_function" href="classfw_1_1_a_p_i.html#a66ac0bd592bb08d069aea199668670ab">~API</a>();</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="preprocessor">#ifdef ESP8266</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keywordtype">void</span> handle_client();</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> </div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="preprocessor">#ifdef ESP8266</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> BearSSL::ESP8266WebServerSecure *server;</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> BearSSL::ServerSessions *serverCache;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> WebServer *server;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <a class="code hl_class" href="classfw_1_1_firewall.html">Firewall</a> *firewall;</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <a class="code hl_struct" href="structcredential__t.html">credential_t</a> credentials;</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <a class="code hl_struct" href="structapi__endpoint__t.html">api_endpoint_t</a> *endpoint_head = NULL;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> String api_ip = <span class="stringliteral">&quot;0.0.0.0&quot;</span>;</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> uint16_t api_port;</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> String json_response_type = <span class="stringliteral">&quot;application/json; charset=utf-8&quot;</span>;</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *TAG = <span class="stringliteral">&quot;[API]&quot;</span>;</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> </div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> String <a class="code hl_function" href="classfw_1_1_a_p_i.html#af5dc938ae5a274e3599d637e672b8d07">get_url_base</a>();</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> </div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> ok_t <a class="code hl_function" href="classfw_1_1_a_p_i.html#a45dcdd4969f70a7f1a02e49a47b16a1d">setup_auth</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *username, <span class="keyword">const</span> <span class="keywordtype">char</span> *password);</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> </div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> auth_t <a class="code hl_function" href="classfw_1_1_a_p_i.html#adc9523a1b6e6a6e8f57a514a25c35b8c">check_auth</a>();</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> </div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classfw_1_1_a_p_i.html#a90986dc50f303564e6f5af6d3707dd20">setup_routing</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *cert, <span class="keyword">const</span> <span class="keywordtype">char</span> *key);</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> </div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classfw_1_1_a_p_i.html#aad90a1bfa8e00c4e25a091e5e9a61772">add_endpoint_to_list</a>(<span class="keyword">const</span> String uri, <span class="keyword">const</span> <span class="keywordtype">char</span> *method, <span class="keyword">const</span> <span class="keywordtype">char</span> *description);</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> </div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classfw_1_1_a_p_i.html#aeb74e3b9efc2305c943683b14957ac9d">not_found_handler</a>();</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> </div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classfw_1_1_a_p_i.html#a734cbd9da536fb297da87b4310f20ba1">get_endpoint_list_handler</a>();</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> </div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classfw_1_1_a_p_i.html#ac76f5a6c9c28d71772b238a51b122e4a">get_firewall_rule_handler</a>();</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> </div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classfw_1_1_a_p_i.html#ab904f77fa777a1c8c19deb8e39cf89e8">get_firewall_rules_handler</a>();</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> </div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classfw_1_1_a_p_i.html#a2d78e9dd43abb72da8872cb207db25e3">post_firewall_handler</a>();</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> </div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classfw_1_1_a_p_i.html#a6ce4a9dd9afae493f6639b6fb3f6ba45">put_firewall_handler</a>();</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> </div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classfw_1_1_a_p_i.html#a592c2aa501ff920ebcc125f8d5635deb">delete_firewall_handler</a>();</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> </div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classfw_1_1_a_p_i.html#abab79e90786d14836dcf113077891c50">request_has_all_firewall_parameter</a>();</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> String <a class="code hl_function" href="classfw_1_1_a_p_i.html#a0ff5aeb3b916dae9219041dc240d9156">json_new_attribute</a>(String key, String value, <span class="keywordtype">bool</span> last = <span class="keyword">false</span>);</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> </div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> String <a class="code hl_function" href="classfw_1_1_a_p_i.html#a0ff5aeb3b916dae9219041dc240d9156">json_new_attribute</a>(String key, uint32_t value, <span class="keywordtype">bool</span> last = <span class="keyword">false</span>);</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> </div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classfw_1_1_a_p_i.html#acbebab924241292706c0287dca5c3ff5">json_generic_response</a>(String serialized_string, <span class="keyword">const</span> uint16_t response_code);</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> </div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classfw_1_1_a_p_i.html#a1892bc26b882b055853e26ed95d8d802">json_array_response</a>(String serialized_string, <span class="keyword">const</span> uint16_t response_code);</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> </div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classfw_1_1_a_p_i.html#a6b7d4ce75b9cdba0dd39c6c949ef1c15">json_message_response</a>(String message, <span class="keyword">const</span> uint16_t response_code);</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> </div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> String <a class="code hl_function" href="classfw_1_1_a_p_i.html#ac249b6e7533414d0296bde477cecac1b">construct_json_firewall_rule</a>(<a class="code hl_struct" href="structfirewall__rule__t.html">firewall_rule_t</a> *rule_ptr);</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> </div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> String <a class="code hl_function" href="classfw_1_1_a_p_i.html#a682ec7e09a230507c39cbc7d7c7427d5">construct_json_firewall</a>();</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> </div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> String <a class="code hl_function" href="classfw_1_1_a_p_i.html#a175d139d29530e2946f67789c9652da8">construct_json_api_endpoint</a>(<a class="code hl_struct" href="structapi__endpoint__t.html">api_endpoint_t</a> *api_ptr);</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> </div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> String <a class="code hl_function" href="classfw_1_1_a_p_i.html#aa541a477e14a992b55e3f75351887cab">construct_json_api</a>();</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> };</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span>}</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> </div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html"><div class="ttname"><a href="classfw_1_1_a_p_i.html">fw::API</a></div><div class="ttdoc">The API to create, edit or remove Firewall rules.</div><div class="ttdef"><b>Definition:</b> API.hpp:21</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_a033d5efd077dfad456cb6e6e7dd2baca"><div class="ttname"><a href="classfw_1_1_a_p_i.html#a033d5efd077dfad456cb6e6e7dd2baca">fw::API::API</a></div><div class="ttdeci">API(Firewall *, const char *cert, const char *key, const char *username, const char *password, const String ip, const uint16_t port=8080)</div><div class="ttdoc">Construct a new API object, assign ip and port to generate endpoint list, setup authentication,...</div><div class="ttdef"><b>Definition:</b> API.cpp:5</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_a0ff5aeb3b916dae9219041dc240d9156"><div class="ttname"><a href="classfw_1_1_a_p_i.html#a0ff5aeb3b916dae9219041dc240d9156">fw::API::json_new_attribute</a></div><div class="ttdeci">String json_new_attribute(String key, String value, bool last=false)</div><div class="ttdoc">add another attribute to the json object</div><div class="ttdef"><b>Definition:</b> API.cpp:225</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_a175d139d29530e2946f67789c9652da8"><div class="ttname"><a href="classfw_1_1_a_p_i.html#a175d139d29530e2946f67789c9652da8">fw::API::construct_json_api_endpoint</a></div><div class="ttdeci">String construct_json_api_endpoint(api_endpoint_t *api_ptr)</div><div class="ttdoc">construct an API endpoint as json object</div><div class="ttdef"><b>Definition:</b> API.cpp:284</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_a1892bc26b882b055853e26ed95d8d802"><div class="ttname"><a href="classfw_1_1_a_p_i.html#a1892bc26b882b055853e26ed95d8d802">fw::API::json_array_response</a></div><div class="ttdeci">void json_array_response(String serialized_string, const uint16_t response_code)</div><div class="ttdoc">json response that wraps the message in array brackets</div><div class="ttdef"><b>Definition:</b> API.cpp:244</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_a2d78e9dd43abb72da8872cb207db25e3"><div class="ttname"><a href="classfw_1_1_a_p_i.html#a2d78e9dd43abb72da8872cb207db25e3">fw::API::post_firewall_handler</a></div><div class="ttdeci">void post_firewall_handler()</div><div class="ttdoc">POST handler to create firewall rule.</div><div class="ttdef"><b>Definition:</b> API.cpp:156</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_a45dcdd4969f70a7f1a02e49a47b16a1d"><div class="ttname"><a href="classfw_1_1_a_p_i.html#a45dcdd4969f70a7f1a02e49a47b16a1d">fw::API::setup_auth</a></div><div class="ttdeci">ok_t setup_auth(const char *username, const char *password)</div><div class="ttdoc">Set up authentication.</div><div class="ttdef"><b>Definition:</b> API.cpp:52</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_a592c2aa501ff920ebcc125f8d5635deb"><div class="ttname"><a href="classfw_1_1_a_p_i.html#a592c2aa501ff920ebcc125f8d5635deb">fw::API::delete_firewall_handler</a></div><div class="ttdeci">void delete_firewall_handler()</div><div class="ttdoc">DELETE handler to delete firewall rule.</div><div class="ttdef"><b>Definition:</b> API.cpp:201</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_a66ac0bd592bb08d069aea199668670ab"><div class="ttname"><a href="classfw_1_1_a_p_i.html#a66ac0bd592bb08d069aea199668670ab">fw::API::~API</a></div><div class="ttdeci">~API()</div><div class="ttdoc">Destroy the API object.</div><div class="ttdef"><b>Definition:</b> API.cpp:31</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_a682ec7e09a230507c39cbc7d7c7427d5"><div class="ttname"><a href="classfw_1_1_a_p_i.html#a682ec7e09a230507c39cbc7d7c7427d5">fw::API::construct_json_firewall</a></div><div class="ttdeci">String construct_json_firewall()</div><div class="ttdoc">construct array of all firewall rules as json object</div><div class="ttdef"><b>Definition:</b> API.cpp:270</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_a6b7d4ce75b9cdba0dd39c6c949ef1c15"><div class="ttname"><a href="classfw_1_1_a_p_i.html#a6b7d4ce75b9cdba0dd39c6c949ef1c15">fw::API::json_message_response</a></div><div class="ttdeci">void json_message_response(String message, const uint16_t response_code)</div><div class="ttdoc">json response to send message as json object</div><div class="ttdef"><b>Definition:</b> API.cpp:249</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_a6ce4a9dd9afae493f6639b6fb3f6ba45"><div class="ttname"><a href="classfw_1_1_a_p_i.html#a6ce4a9dd9afae493f6639b6fb3f6ba45">fw::API::put_firewall_handler</a></div><div class="ttdeci">void put_firewall_handler()</div><div class="ttdoc">PUT handler to update firewall rule.</div><div class="ttdef"><b>Definition:</b> API.cpp:176</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_a734cbd9da536fb297da87b4310f20ba1"><div class="ttname"><a href="classfw_1_1_a_p_i.html#a734cbd9da536fb297da87b4310f20ba1">fw::API::get_endpoint_list_handler</a></div><div class="ttdeci">void get_endpoint_list_handler()</div><div class="ttdoc">GET handler to retrieve endpoint list.</div><div class="ttdef"><b>Definition:</b> API.cpp:131</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_a90986dc50f303564e6f5af6d3707dd20"><div class="ttname"><a href="classfw_1_1_a_p_i.html#a90986dc50f303564e6f5af6d3707dd20">fw::API::setup_routing</a></div><div class="ttdeci">void setup_routing(const char *cert, const char *key)</div><div class="ttdoc">Set up the routing/endpoints and encryption.</div><div class="ttdef"><b>Definition:</b> API.cpp:79</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_aa541a477e14a992b55e3f75351887cab"><div class="ttname"><a href="classfw_1_1_a_p_i.html#aa541a477e14a992b55e3f75351887cab">fw::API::construct_json_api</a></div><div class="ttdeci">String construct_json_api()</div><div class="ttdoc">construct array of all endpoints as json object</div><div class="ttdef"><b>Definition:</b> API.cpp:294</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_aad90a1bfa8e00c4e25a091e5e9a61772"><div class="ttname"><a href="classfw_1_1_a_p_i.html#aad90a1bfa8e00c4e25a091e5e9a61772">fw::API::add_endpoint_to_list</a></div><div class="ttdeci">void add_endpoint_to_list(const String uri, const char *method, const char *description)</div><div class="ttdoc">add endpoint information to linked list that is used for the /api endpoint</div><div class="ttdef"><b>Definition:</b> API.cpp:100</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_ab904f77fa777a1c8c19deb8e39cf89e8"><div class="ttname"><a href="classfw_1_1_a_p_i.html#ab904f77fa777a1c8c19deb8e39cf89e8">fw::API::get_firewall_rules_handler</a></div><div class="ttdeci">void get_firewall_rules_handler()</div><div class="ttdoc">GET handler to retrieve firewall rules.</div><div class="ttdef"><b>Definition:</b> API.cpp:149</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_abab79e90786d14836dcf113077891c50"><div class="ttname"><a href="classfw_1_1_a_p_i.html#abab79e90786d14836dcf113077891c50">fw::API::request_has_all_firewall_parameter</a></div><div class="ttdeci">bool request_has_all_firewall_parameter()</div><div class="ttdoc">check if request to create/update firewall rule has all required parameter</div><div class="ttdef"><b>Definition:</b> API.cpp:213</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_ac249b6e7533414d0296bde477cecac1b"><div class="ttname"><a href="classfw_1_1_a_p_i.html#ac249b6e7533414d0296bde477cecac1b">fw::API::construct_json_firewall_rule</a></div><div class="ttdeci">String construct_json_firewall_rule(firewall_rule_t *rule_ptr)</div><div class="ttdoc">construct a firewall rule as json object</div><div class="ttdef"><b>Definition:</b> API.cpp:257</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_ac76f5a6c9c28d71772b238a51b122e4a"><div class="ttname"><a href="classfw_1_1_a_p_i.html#ac76f5a6c9c28d71772b238a51b122e4a">fw::API::get_firewall_rule_handler</a></div><div class="ttdeci">void get_firewall_rule_handler()</div><div class="ttdoc">GET handler to retrieve single firewall rule.</div><div class="ttdef"><b>Definition:</b> API.cpp:136</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_acbebab924241292706c0287dca5c3ff5"><div class="ttname"><a href="classfw_1_1_a_p_i.html#acbebab924241292706c0287dca5c3ff5">fw::API::json_generic_response</a></div><div class="ttdeci">void json_generic_response(String serialized_string, const uint16_t response_code)</div><div class="ttdoc">json response to send any string and response code</div><div class="ttdef"><b>Definition:</b> API.cpp:239</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_adc9523a1b6e6a6e8f57a514a25c35b8c"><div class="ttname"><a href="classfw_1_1_a_p_i.html#adc9523a1b6e6a6e8f57a514a25c35b8c">fw::API::check_auth</a></div><div class="ttdeci">auth_t check_auth()</div><div class="ttdoc">check if request to API can proceed or needs to stop</div><div class="ttdef"><b>Definition:</b> API.cpp:69</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_aeb74e3b9efc2305c943683b14957ac9d"><div class="ttname"><a href="classfw_1_1_a_p_i.html#aeb74e3b9efc2305c943683b14957ac9d">fw::API::not_found_handler</a></div><div class="ttdeci">void not_found_handler()</div><div class="ttdoc">handling not found</div><div class="ttdef"><b>Definition:</b> API.cpp:126</div></div>
<div class="ttc" id="aclassfw_1_1_a_p_i_html_af5dc938ae5a274e3599d637e672b8d07"><div class="ttname"><a href="classfw_1_1_a_p_i.html#af5dc938ae5a274e3599d637e672b8d07">fw::API::get_url_base</a></div><div class="ttdeci">String get_url_base()</div><div class="ttdoc">Get the url base string e.g. http://0.0.0.0:8080/api.</div><div class="ttdef"><b>Definition:</b> API.cpp:43</div></div>
<div class="ttc" id="aclassfw_1_1_firewall_html"><div class="ttname"><a href="classfw_1_1_firewall.html">fw::Firewall</a></div><div class="ttdoc">The Firewall will handle Firewall rules as linked list.</div><div class="ttdef"><b>Definition:</b> Firewall.hpp:20</div></div>
<div class="ttc" id="astructapi__endpoint__t_html"><div class="ttname"><a href="structapi__endpoint__t.html">api_endpoint_t</a></div><div class="ttdef"><b>Definition:</b> Utils.hpp:93</div></div>
<div class="ttc" id="astructcredential__t_html"><div class="ttname"><a href="structcredential__t.html">credential_t</a></div><div class="ttdef"><b>Definition:</b> Utils.hpp:85</div></div>
<div class="ttc" id="astructfirewall__rule__t_html"><div class="ttname"><a href="structfirewall__rule__t.html">firewall_rule_t</a></div><div class="ttdef"><b>Definition:</b> Utils.hpp:51</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"><b>API.hpp</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4 </li>
</ul>
</div>
</body>
</html>