1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>struct socket</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Networking and Network Devices APIs"><link rel="up" href="netcore.html#idp1093082748" title="Networking Base Types"><link rel="prev" href="API-enum-sock-type.html" title="enum sock_type"><link rel="next" href="ch01s02.html" title="Socket Buffer Functions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">struct socket</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-enum-sock-type.html">Prev</a>&#160;</td><th width="60%" align="center">Networking Base Types</th><td width="20%" align="right">&#160;<a accesskey="n" href="ch01s02.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-struct-socket"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct socket &#8212; 
2     general BSD socket
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting">
4struct socket {
5  socket_state state;
6  short type;
7  unsigned long flags;
8  struct socket_wq __rcu * wq;
9  struct file * file;
10  struct sock * sk;
11  const struct proto_ops * ops;
12};  </pre></div><div class="refsect1"><a name="idp1092819260"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">state</span></dt><dd><p>
13   socket state (<code class="constant">SS_CONNECTED</code>, etc)
14      </p></dd><dt><span class="term">type</span></dt><dd><p>
15   socket type (<code class="constant">SOCK_STREAM</code>, etc)
16      </p></dd><dt><span class="term">flags</span></dt><dd><p>
17   socket flags (<code class="constant">SOCK_ASYNC_NOSPACE</code>, etc)
18      </p></dd><dt><span class="term">wq</span></dt><dd><p>
19   wait queue for several uses
20      </p></dd><dt><span class="term">file</span></dt><dd><p>
21   File back pointer for gc
22      </p></dd><dt><span class="term">sk</span></dt><dd><p>
23   internal networking protocol agnostic socket representation
24      </p></dd><dt><span class="term">ops</span></dt><dd><p>
25   protocol specific socket operations
26      </p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-enum-sock-type.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="netcore.html#idp1093082748">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="ch01s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">enum sock_type</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Socket Buffer Functions</td></tr></table></div></body></html>
27