1<!-- Creator     : groff version 1.22.2 -->
2<!-- CreationDate: Fri Feb  3 21:10:01 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_set_uctx</title>
17<link rel="stylesheet" href="./common.css">
18</head>
19<body>
20<div class="main">
21<h1 align="center">mtcp_set_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="#AUTHORS">AUTHORS</a><br>
27<a href="#SEE ALSO">SEE ALSO</a><br>
28<a href="#COLOPHON">COLOPHON</a><br>
29<hr>
30-->
31
32<h2>NAME
33<a name="NAME"></a>
34</h2>
35
36
37<p style="margin-left:11%; margin-top: 1em">mtcp_set_uctx
38&minus; set private per-flow user-context data</p>
39
40<h2>SYNOPSIS
41<a name="SYNOPSIS"></a>
42</h2>
43
44
45<p style="margin-left:11%; margin-top: 1em"><b>#include
46&lt;mos_api.h&gt;</b></p>
47
48<p style="margin-left:11%; margin-top: 1em"><b>void
49mtcp_set_uctx(mctx_t</b> <i>mctx</i><b>, int</b>
50<i>sockid</i><b>, void *</b><i>uctx</i><b>);</b></p>
51
52<h2>DESCRIPTION
53<a name="DESCRIPTION"></a>
54</h2>
55
56
57
58<p style="margin-left:11%; margin-top: 1em"><b>mtcp_set_uctx</b>()
59can be used to associate flow-specific monitoring data to a
60flow record in the application layer. The flow-specific data
61is stored with the socket that can referred to by the
62<i>sockid</i> argument. The private data can be stored as a
63void *. It is the responsibility of the user to free up the
64private data (if it is dynamically allocated from memory)
65when the flow record gets deleted from the stack (due to,
66e.g., connection termination).</p>
67
68<p style="margin-left:11%; margin-top: 1em">The
69<b>mtcp_set_uctx</b>() call takes an additional argument
70named <i>mctx</i> that represents the per-core mTCP context
71in an application (see <b>mtcp_create_context()</b> for
72details).</p>
73
74<h2>AUTHORS
75<a name="AUTHORS"></a>
76</h2>
77
78
79<p style="margin-left:11%; margin-top: 1em">mOS development
80team &lt;[email protected]&gt;</p>
81
82
83<!----------------------------------------------------------->
84<h2>EXAMPLES
85  <a name="EXAMPLES"></a>
86</h2>
87
88<p style="margin-left:11%; margin-top: 1em">
89  <a href="http://mos.kaist.edu/guide/programmer/05_api_example.html#saving-and-loading-user-level-metadata">
90	http://mos.kaist.edu/guide/programmer/05_api_example.html#saving-and-loading-user-level-metadata
91  </a>
92</p>
93<!----------------------------------------------------------->
94
95<h2>SEE ALSO
96<a name="SEE ALSO"></a>
97</h2>
98
99
100
101<p style="margin-left:11%; margin-top: 1em"><b>mtcp_socket</b>(),
102<b>mtcp_get_uctx</b>(),</p>
103
104<h2>COLOPHON
105<a name="COLOPHON"></a>
106</h2>
107
108
109<p style="margin-left:11%; margin-top: 1em">This page is
110part of mOS release 0.3 <i>docs</i> section. A description
111of the project, and information about reporting bugs, can be
112found at http://mos.kaist.edu/.</p>
113<!-- <hr> -->
114<br>
115<div class="footer">
116  <img src="back-arrow.jpg" width="2%" height="2%"><a href="http://mos.kaist.edu/index_man.html">Back to Index</a>
117</div>
118</div>
119</body>
120</html>
121