1<!-- Creator     : groff version 1.22.2 -->
2<!-- CreationDate: Fri Feb  3 21:15:47 2017 -->
3<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
4"http://www.w3.org/TR/html4/loose.dtd">
5<html>
6<head>
7<meta name="generator" content="groff -Thtml, see www.gnu.org">
8<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
9<meta name="Content-Style" content="text/css">
10<style type="text/css">
11       p       { margin-top: 0; margin-bottom: 0; vertical-align: top }
12       pre     { margin-top: 0; margin-bottom: 0; vertical-align: top }
13       table   { margin-top: 0; margin-bottom: 0; vertical-align: top }
14       h1      { text-align: center }
15</style>
16<title>mtcp_get_uctx</title>
17
18</head>
19<body>
20
21<h1 align="center">mtcp_get_uctx</h1>
22
23<a href="#NAME">NAME</a><br>
24<a href="#SYNOPSIS">SYNOPSIS</a><br>
25<a href="#DESCRIPTION">DESCRIPTION</a><br>
26<a href="#RETURN VALUE">RETURN VALUE</a><br>
27<a href="#ERRORS">ERRORS</a><br>
28<a href="#AUTHORS">AUTHORS</a><br>
29<a href="#SEE ALSO">SEE ALSO</a><br>
30<a href="#COLOPHON">COLOPHON</a><br>
31
32<hr>
33
34
35<h2>NAME
36<a name="NAME"></a>
37</h2>
38
39
40<p style="margin-left:11%; margin-top: 1em">mtcp_get_uctx
41&minus; get private per-flow user-context data</p>
42
43<h2>SYNOPSIS
44<a name="SYNOPSIS"></a>
45</h2>
46
47
48<p style="margin-left:11%; margin-top: 1em"><b>#include
49&lt;mos_api.h&gt;</b></p>
50
51<p style="margin-left:11%; margin-top: 1em"><b>int
52mtcp_get_uctx(mctx_t</b> <i>mctx</i><b>, int</b>
53<i>sockid</i><b>);</b></p>
54
55<h2>DESCRIPTION
56<a name="DESCRIPTION"></a>
57</h2>
58
59
60
61<p style="margin-left:11%; margin-top: 1em"><b>mtcp_get_uctx</b>()
62can be used to retrieve flow-specific monitoring data to a
63flow record in the application layer. It is generally used
64in tandem with <b>mtcp_set_uctx</b>()<b>.</b> The
65flow-specific data is stored with the socket that can
66referred to by the <i>sockid</i> argument. The private data
67can be stored as a void *. It is the responsibility of the
68user to free up the private data (if it is dynamically
69allocated from memory) when the flow record gets deleted
70from the stack (due to, e.g., connection termination).</p>
71
72<p style="margin-left:11%; margin-top: 1em">The
73<b>mtcp_get_uctx</b>() call takes an additional argument
74named <i>mctx</i> that represents the per-core mTCP context
75in an application (see <b>mtcp_create_context()</b> for
76details).</p>
77
78<h2>RETURN VALUE
79<a name="RETURN VALUE"></a>
80</h2>
81
82
83<p style="margin-left:11%; margin-top: 1em">Returns pointer
84to the private data as void * on success; NULL on failure.
85In case of failure, <i>errno</i> is set appropriately.</p>
86
87<h2>ERRORS
88<a name="ERRORS"></a>
89</h2>
90
91
92<table width="100%" border="0" rules="none" frame="void"
93       cellspacing="0" cellpadding="0">
94<tr valign="top" align="left">
95<td width="11%"></td>
96<td width="9%">
97
98
99<p style="margin-top: 1em"><b>EACCES</b></p></td>
100<td width="6%"></td>
101<td width="74%">
102
103
104<p style="margin-top: 1em"><i>mctx</i> is not a valid.</p></td></tr>
105<tr valign="top" align="left">
106<td width="11%"></td>
107<td width="9%">
108
109
110<p><b>EBADF</b></p></td>
111<td width="6%"></td>
112<td width="74%">
113
114
115<p><i>sockid</i> is not a valid socket descriptor for
116binding to an address.</p></td></tr>
117<tr valign="top" align="left">
118<td width="11%"></td>
119<td width="9%">
120
121
122<p><b>EPERM</b></p></td>
123<td width="6%"></td>
124<td width="74%">
125
126
127<p>The user does not have permission to access the
128data.</p> </td></tr>
129</table>
130
131<h2>AUTHORS
132<a name="AUTHORS"></a>
133</h2>
134
135
136<p style="margin-left:11%; margin-top: 1em">mOS development
137team &lt;[email protected]&gt;</p>
138
139<h2>SEE ALSO
140<a name="SEE ALSO"></a>
141</h2>
142
143
144
145<p style="margin-left:11%; margin-top: 1em"><b>mtcp_socket</b>(),
146<b>mtcp_set_uctx</b>(),</p>
147
148<h2>COLOPHON
149<a name="COLOPHON"></a>
150</h2>
151
152
153<p style="margin-left:11%; margin-top: 1em">This page is
154part of mOS release 0.3 <i>docs</i> section. A description
155of the project, and information about reporting bugs, can be
156found at http://mos.kaist.edu/.</p>
157<hr>
158</body>
159</html>
160