wut/socket_8h_source.html

127 lines
53 KiB
HTML
Raw Normal View History

2018-07-26 20:52:03 +10:00
<!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.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>wut: include/nsysnet/socket.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="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">wut
&#160;<span id="projectnumber">1.0.0-alpha</span>
</div>
<div id="projectbrief">Wii U Toolchain</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @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:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</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_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_fe1e7b2a13642686c85dbce98656961b.html">nsysnet</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">socket.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="socket_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="preprocessor">#pragma once</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="wut_8h.html">wut.h</a>&gt;</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;</div><div class="line"><a name="l00005"></a><span class="lineno"><a class="line" href="socket_8h.html#a86c5dbf5a99358e288f573d6a1e0873f"> 5</a></span>&#160;<span class="preprocessor">#define FD_SETSIZE 32</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="preprocessor">#include &lt;sys/time.h&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="preprocessor">#include &lt;sys/types.h&gt;</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="preprocessor">#include &lt;sys/select.h&gt;</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="preprocessor">#endif</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"><a class="line" href="group__nsysnet__socket.html#ga92d045f6ee2f343d6b28830a9fec082e"> 19</a></span>&#160;<span class="preprocessor">#define SOL_SOCKET -1</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="group__nsysnet__socket.html#ga5d1940045dc2e7de552f3d4ff13a74ab"> 21</a></span>&#160;<span class="preprocessor">#define INADDR_ANY 0</span></div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="group__nsysnet__socket.html#ga4a725f61ded23ce8a7dff8e82ed51986"> 22</a></span>&#160;<span class="preprocessor">#define INADDR_BROADCAST 0xFFFFFFFF</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="group__nsysnet__socket.html#ga51dba11ffc8e3b1bf695e721b3144094"> 24</a></span>&#160;<span class="preprocessor">#define PF_UNSPEC 0</span></div><div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="group__nsysnet__socket.html#ga3f5da0b5be27fe31ec7cc11bfa8d1a25"> 25</a></span>&#160;<span class="preprocessor">#define PF_INET 2</span></div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="group__nsysnet__socket.html#ga323f2649198fc7e64b19881869265618"> 26</a></span>&#160;<span class="preprocessor">#define PF_INET6 23</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="group__nsysnet__socket.html#gae77ae24b14b7b7f294f3e04121173f12"> 28</a></span>&#160;<span class="preprocessor">#define AF_UNSPEC PF_UNSPEC</span></div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="group__nsysnet__socket.html#ga9930604d0e32588eae76f43ca38e7826"> 29</a></span>&#160;<span class="preprocessor">#define AF_INET PF_INET</span></div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" h
<div class="ttc" id="group__nsysnet__socket_html_ga0da303c73c2b8673a5a2fa875b8a19e8"><div class="ttname"><a href="group__nsysnet__socket.html#ga0da303c73c2b8673a5a2fa875b8a19e8">inet_ntoa</a></div><div class="ttdeci">const char * inet_ntoa(struct in_addr in)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_a0eae6616c263e76ee1c4a13dfbcd42a5"><div class="ttname"><a href="group__nsysnet__socket.html#a0eae6616c263e76ee1c4a13dfbcd42a5">sockaddr_in::sin_port</a></div><div class="ttdeci">unsigned short sin_port</div><div class="ttdef"><b>Definition:</b> <a href="socket_8h_source.html#l00101">socket.h:101</a></div></div>
<div class="ttc" id="group__nsysnet__socket_html_ga5989c21d05cb17caba26cef496a7beea"><div class="ttname"><a href="group__nsysnet__socket.html#ga5989c21d05cb17caba26cef496a7beea">listen</a></div><div class="ttdeci">int listen(int sockfd, int backlog)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_a86a5f304dfcd62d626f27bbd3796683d"><div class="ttname"><a href="group__nsysnet__socket.html#a86a5f304dfcd62d626f27bbd3796683d">linger::l_linger</a></div><div class="ttdeci">int l_linger</div><div class="ttdef"><b>Definition:</b> <a href="socket_8h_source.html#l00090">socket.h:90</a></div></div>
<div class="ttc" id="group__nsysnet__socket_html_a36eaef69fff1193837626c2833ab507a"><div class="ttname"><a href="group__nsysnet__socket.html#a36eaef69fff1193837626c2833ab507a">sockaddr::sa_family</a></div><div class="ttdeci">sa_family_t sa_family</div><div class="ttdef"><b>Definition:</b> <a href="socket_8h_source.html#l00077">socket.h:77</a></div></div>
<div class="ttc" id="group__nsysnet__socket_html_ga199f211423d21f413eabfffbacfd9493"><div class="ttname"><a href="group__nsysnet__socket.html#ga199f211423d21f413eabfffbacfd9493">socket_lib_finish</a></div><div class="ttdeci">void socket_lib_finish()</div></div>
<div class="ttc" id="group__nsysnet__socket_html_gabffaf13b8aaa3d58494997caa8a7e477"><div class="ttname"><a href="group__nsysnet__socket.html#gabffaf13b8aaa3d58494997caa8a7e477">socketlasterr</a></div><div class="ttdeci">int socketlasterr()</div></div>
<div class="ttc" id="group__nsysnet__socket_html_ae3ea34576030e8c0674c47de5bcaf9d5"><div class="ttname"><a href="group__nsysnet__socket.html#ae3ea34576030e8c0674c47de5bcaf9d5">sockaddr_storage::ss_family</a></div><div class="ttdeci">sa_family_t ss_family</div><div class="ttdef"><b>Definition:</b> <a href="socket_8h_source.html#l00083">socket.h:83</a></div></div>
<div class="ttc" id="group__nsysnet__socket_html_a1c7bfbfe59dbefd9344f98157b26ccdc"><div class="ttname"><a href="group__nsysnet__socket.html#a1c7bfbfe59dbefd9344f98157b26ccdc">sockaddr_in::sin_addr</a></div><div class="ttdeci">struct in_addr sin_addr</div><div class="ttdef"><b>Definition:</b> <a href="socket_8h_source.html#l00102">socket.h:102</a></div></div>
<div class="ttc" id="group__nsysnet__socket_html_gaf792d74a36744bbc7307fd9a7dedd234"><div class="ttname"><a href="group__nsysnet__socket.html#gaf792d74a36744bbc7307fd9a7dedd234">ntohs</a></div><div class="ttdeci">uint16_t ntohs(uint16_t val)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_structsockaddr__storage"><div class="ttname"><a href="group__nsysnet__socket.html#structsockaddr__storage">sockaddr_storage</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_8h_source.html#l00081">socket.h:81</a></div></div>
<div class="ttc" id="group__nsysnet__socket_html_ga7895af1011e7b9ff128eda29e773a84e"><div class="ttname"><a href="group__nsysnet__socket.html#ga7895af1011e7b9ff128eda29e773a84e">getsockname</a></div><div class="ttdeci">int getsockname(int sockfd, struct sockaddr *addr, socklen_t *addrlen)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_a019cb683bfdac71a46a437c71a792c99"><div class="ttname"><a href="group__nsysnet__socket.html#a019cb683bfdac71a46a437c71a792c99">sockaddr_in::sin_zero</a></div><div class="ttdeci">char sin_zero[8]</div><div class="ttdef"><b>Definition:</b> <a href="socket_8h_source.html#l00103">socket.h:103</a></div></div>
<div class="ttc" id="group__nsysnet__socket_html_ga82199bcd81894331533a25f08e172480"><div class="ttname"><a href="group__nsysnet__socket.html#ga82199bcd81894331533a25f08e172480">bind</a></div><div class="ttdeci">int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_gaa102b61428484589b89c98c7798ee65d"><div class="ttname"><a href="group__nsysnet__socket.html#gaa102b61428484589b89c98c7798ee65d">ntohl</a></div><div class="ttdeci">uint32_t ntohl(uint32_t val)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_ga9589bdf98da6cd301c6d3a2d4b4a5243"><div class="ttname"><a href="group__nsysnet__socket.html#ga9589bdf98da6cd301c6d3a2d4b4a5243">recvfrom</a></div><div class="ttdeci">int recvfrom(int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_ga22bf2db06ebc5466014e637d419cef90"><div class="ttname"><a href="group__nsysnet__socket.html#ga22bf2db06ebc5466014e637d419cef90">sa_family_t</a></div><div class="ttdeci">uint16_t sa_family_t</div><div class="ttdef"><b>Definition:</b> <a href="socket_8h_source.html#l00073">socket.h:73</a></div></div>
<div class="ttc" id="group__nsysnet__socket_html_ga2e14cfa6ded77b65c948476358284cf1"><div class="ttname"><a href="group__nsysnet__socket.html#ga2e14cfa6ded77b65c948476358284cf1">inet_aton</a></div><div class="ttdeci">int inet_aton(const char *cp, struct in_addr *inp)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_gac4852a645ab3207179dd9f9a2f480b28"><div class="ttname"><a href="group__nsysnet__socket.html#gac4852a645ab3207179dd9f9a2f480b28">send</a></div><div class="ttdeci">int send(int sockfd, const void *buf, size_t len, int flags)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_gaf4e0711877c45a41168ac677b0670ccd"><div class="ttname"><a href="group__nsysnet__socket.html#gaf4e0711877c45a41168ac677b0670ccd">socket</a></div><div class="ttdeci">int socket(int domain, int type, int protocol)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_ab92ef26b74c80139475481ea0deb21a8"><div class="ttname"><a href="group__nsysnet__socket.html#ab92ef26b74c80139475481ea0deb21a8">sockaddr::sa_data</a></div><div class="ttdeci">char sa_data[]</div><div class="ttdef"><b>Definition:</b> <a href="socket_8h_source.html#l00078">socket.h:78</a></div></div>
<div class="ttc" id="wut_8h_html"><div class="ttname"><a href="wut_8h.html">wut.h</a></div></div>
<div class="ttc" id="group__nsysnet__socket_html_gaa6779bbd3ee86fec7811f4ab4b916954"><div class="ttname"><a href="group__nsysnet__socket.html#gaa6779bbd3ee86fec7811f4ab4b916954">socket_lib_init</a></div><div class="ttdeci">void socket_lib_init()</div></div>
<div class="ttc" id="group__nsysnet__socket_html_structsockaddr"><div class="ttname"><a href="group__nsysnet__socket.html#structsockaddr">sockaddr</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_8h_source.html#l00075">socket.h:75</a></div></div>
<div class="ttc" id="group__nsysnet__socket_html_a27341aed2db90c6e66b466a97f5c560f"><div class="ttname"><a href="group__nsysnet__socket.html#a27341aed2db90c6e66b466a97f5c560f">sockaddr_storage::__ss_padding</a></div><div class="ttdeci">char __ss_padding[32]</div><div class="ttdef"><b>Definition:</b> <a href="socket_8h_source.html#l00084">socket.h:84</a></div></div>
<div class="ttc" id="group__nsysnet__socket_html_gaf188b4433461a4224c209231689e8270"><div class="ttname"><a href="group__nsysnet__socket.html#gaf188b4433461a4224c209231689e8270">setsockopt</a></div><div class="ttdeci">int setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_gad56bbd2dab72a7d4062e62bd0b129435"><div class="ttname"><a href="group__nsysnet__socket.html#gad56bbd2dab72a7d4062e62bd0b129435">getpeername</a></div><div class="ttdeci">int getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_ga5d6ce1e421c5ea25eb7aa4aa06b75534"><div class="ttname"><a href="group__nsysnet__socket.html#ga5d6ce1e421c5ea25eb7aa4aa06b75534">htons</a></div><div class="ttdeci">uint16_t htons(uint16_t val)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_ga7937a1ce0c865387d092f8440f7ef5bd"><div class="ttname"><a href="group__nsysnet__socket.html#ga7937a1ce0c865387d092f8440f7ef5bd">accept</a></div><div class="ttdeci">int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_a53f550a39f9923b9dbc6a67adc423cc0"><div class="ttname"><a href="group__nsysnet__socket.html#a53f550a39f9923b9dbc6a67adc423cc0">linger::l_onoff</a></div><div class="ttdeci">int l_onoff</div><div class="ttdef"><b>Definition:</b> <a href="socket_8h_source.html#l00089">socket.h:89</a></div></div>
<div class="ttc" id="group__nsysnet__socket_html_ab94314390938f112761a80e5fd1582fc"><div class="ttname"><a href="group__nsysnet__socket.html#ab94314390938f112761a80e5fd1582fc">sockaddr_in::sin_family</a></div><div class="ttdeci">unsigned short sin_family</div><div class="ttdef"><b>Definition:</b> <a href="socket_8h_source.html#l00100">socket.h:100</a></div></div>
<div class="ttc" id="group__nsysnet__socket_html_gab81d992040a0b29b4f9fd20a263ab1d0"><div class="ttname"><a href="group__nsysnet__socket.html#gab81d992040a0b29b4f9fd20a263ab1d0">getsockopt</a></div><div class="ttdeci">int getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_gad37ee7b58324423eb6da7637d85dba29"><div class="ttname"><a href="group__nsysnet__socket.html#gad37ee7b58324423eb6da7637d85dba29">sendto</a></div><div class="ttdeci">int sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_structin__addr"><div class="ttname"><a href="group__nsysnet__socket.html#structin__addr">in_addr</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_8h_source.html#l00093">socket.h:93</a></div></div>
<div class="ttc" id="group__nsysnet__socket_html_structsockaddr__in"><div class="ttname"><a href="group__nsysnet__socket.html#structsockaddr__in">sockaddr_in</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_8h_source.html#l00098">socket.h:98</a></div></div>
<div class="ttc" id="group__nsysnet__socket_html_ga3f5f480bed01f54df564b99350f1d1bb"><div class="ttname"><a href="group__nsysnet__socket.html#ga3f5f480bed01f54df564b99350f1d1bb">socklen_t</a></div><div class="ttdeci">uint32_t socklen_t</div><div class="ttdef"><b>Definition:</b> <a href="socket_8h_source.html#l00072">socket.h:72</a></div></div>
<div class="ttc" id="group__nsysnet__socket_html_ab9db80bdd56057358ee6b04f9448a5ee"><div class="ttname"><a href="group__nsysnet__socket.html#ab9db80bdd56057358ee6b04f9448a5ee">in_addr::s_addr</a></div><div class="ttdeci">unsigned int s_addr</div><div class="ttdef"><b>Definition:</b> <a href="socket_8h_source.html#l00095">socket.h:95</a></div></div>
<div class="ttc" id="group__nsysnet__socket_html_gadd056a205aa6181762de87c1d8c9a210"><div class="ttname"><a href="group__nsysnet__socket.html#gadd056a205aa6181762de87c1d8c9a210">select</a></div><div class="ttdeci">int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_ga03a98fdcd6c919f9f9b9f0d49d3cc49b"><div class="ttname"><a href="group__nsysnet__socket.html#ga03a98fdcd6c919f9f9b9f0d49d3cc49b">socketclose</a></div><div class="ttdeci">int socketclose(int sockfd)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_gacdfd99b6c59c833776412fbb0c539efb"><div class="ttname"><a href="group__nsysnet__socket.html#gacdfd99b6c59c833776412fbb0c539efb">connect</a></div><div class="ttdeci">int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_ga5c5e62361984ca888ac4b840cf059c6f"><div class="ttname"><a href="group__nsysnet__socket.html#ga5c5e62361984ca888ac4b840cf059c6f">htonl</a></div><div class="ttdeci">uint32_t htonl(uint32_t val)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_ga402425b8e1ceab40ac38a949babcf1aa"><div class="ttname"><a href="group__nsysnet__socket.html#ga402425b8e1ceab40ac38a949babcf1aa">shutdown</a></div><div class="ttdeci">int shutdown(int sockfd, int how)</div></div>
<div class="ttc" id="group__nsysnet__socket_html_structlinger"><div class="ttname"><a href="group__nsysnet__socket.html#structlinger">linger</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_8h_source.html#l00087">socket.h:87</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>