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<link rel="stylesheet" href="./common.css">
18</head>
19<body>
20<div class="main">
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<hr>
32-->
33
34<h2>NAME
35<a name="NAME"></a>
36</h2>
37
38
39<p style="margin-left:11%; margin-top: 1em">mtcp_get_uctx
40&minus; get private per-flow user-context data</p>
41
42<h2>SYNOPSIS
43<a name="SYNOPSIS"></a>
44</h2>
45
46
47<p style="margin-left:11%; margin-top: 1em"><b>#include
48&lt;mos_api.h&gt;</b></p>
49
50<p style="margin-left:11%; margin-top: 1em"><b>int
51mtcp_get_uctx(mctx_t</b> <i>mctx</i><b>, int</b>
52<i>sockid</i><b>);</b></p>
53
54<h2>DESCRIPTION
55<a name="DESCRIPTION"></a>
56</h2>
57
58
59
60<p style="margin-left:11%; margin-top: 1em"><b>mtcp_get_uctx</b>()
61can be used to retrieve flow-specific monitoring data to a
62flow record in the application layer. It is generally used
63in tandem with <b>mtcp_set_uctx</b>()<b>.</b> The
64flow-specific data is stored with the socket that can
65referred to by the <i>sockid</i> argument. The private data
66can be stored as a void *. It is the responsibility of the
67user to free up the private data (if it is dynamically
68allocated from memory) when the flow record gets deleted
69from the stack (due to, e.g., connection termination).</p>
70
71<p style="margin-left:11%; margin-top: 1em">The
72<b>mtcp_get_uctx</b>() call takes an additional argument
73named <i>mctx</i> that represents the per-core mTCP context
74in an application (see <b>mtcp_create_context()</b> for
75details).</p>
76
77<h2>RETURN VALUE
78<a name="RETURN VALUE"></a>
79</h2>
80
81
82<p style="margin-left:11%; margin-top: 1em">Returns pointer
83to the private data as void * on success; NULL on failure.
84In case of failure, <i>errno</i> is set appropriately.</p>
85
86<h2>ERRORS
87<a name="ERRORS"></a>
88</h2>
89
90
91<table width="100%" border="0" rules="none" frame="void"
92       cellspacing="0" cellpadding="0">
93<tr valign="top" align="left">
94<td width="11%"></td>
95<td width="9%">
96
97
98<p style="margin-top: 1em"><b>EACCES</b></p></td>
99<td width="6%"></td>
100<td width="74%">
101
102
103<p style="margin-top: 1em"><i>mctx</i> is not a valid.</p></td></tr>
104<tr valign="top" align="left">
105<td width="11%"></td>
106<td width="9%">
107
108
109<p><b>EBADF</b></p></td>
110<td width="6%"></td>
111<td width="74%">
112
113
114<p><i>sockid</i> is not a valid socket descriptor for
115binding to an address.</p></td></tr>
116<tr valign="top" align="left">
117<td width="11%"></td>
118<td width="9%">
119
120
121<p><b>EPERM</b></p></td>
122<td width="6%"></td>
123<td width="74%">
124
125
126<p>The user does not have permission to access the
127data.</p> </td></tr>
128</table>
129
130<h2>AUTHORS
131<a name="AUTHORS"></a>
132</h2>
133
134
135<p style="margin-left:11%; margin-top: 1em">mOS development
136team &lt;[email protected]&gt;</p>
137
138
139<!----------------------------------------------------------->
140<h2>EXAMPLES
141  <a name="EXAMPLES"></a>
142</h2>
143
144<p style="margin-left:11%; margin-top: 1em">
145  <a href="http://mos.kaist.edu/guide/programmer/05_api_example.html#saving-and-loading-user-level-metadata">
146	http://mos.kaist.edu/guide/programmer/05_api_example.html#saving-and-loading-user-level-metadata
147  </a>
148</p>
149<!----------------------------------------------------------->
150
151
152<h2>SEE ALSO
153<a name="SEE ALSO"></a>
154</h2>
155
156
157
158<p style="margin-left:11%; margin-top: 1em"><b>mtcp_socket</b>(),
159<b>mtcp_set_uctx</b>(),</p>
160
161<h2>COLOPHON
162<a name="COLOPHON"></a>
163</h2>
164
165
166<p style="margin-left:11%; margin-top: 1em">This page is
167part of mOS release 0.3 <i>docs</i> section. A description
168of the project, and information about reporting bugs, can be
169found at http://mos.kaist.edu/.</p>
170<!-- <hr> -->
171<br>
172<div class="footer">
173  <img src="back-arrow.jpg" width="2%" height="2%"><a href="http://mos.kaist.edu/index_man.html">Back to Index</a>
174</div>
175</div>
176</body>
177</html>
178