Commit 991998cb authored by 's avatar
Browse files

removed the doc/ folder and added a .tgz version of it to avoid 4MB of documentation


git-svn-id: file:///home/svn/mapi/trunk@250 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 2e2b5e90
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>ADMISSION CONTROL DAEMON(authd): adm_ctrl.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.5 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>adm_ctrl.c File Reference</h1>Authorization routines for authd.
<a href="#_details">More...</a>
<p>
<code>#include &lt;stdio.h&gt;</code><br>
<code>#include &lt;string.h&gt;</code><br>
<code>#include &lt;limits.h&gt;</code><br>
<code>#include &lt;openssl/rsa.h&gt;</code><br>
<code>#include &lt;regex.h&gt;</code><br>
<code>#include &lt;keynote.h&gt;</code><br>
<code>#include "<a class="el" href="config_8h-source.html">config.h</a>"</code><br>
<code>#include "<a class="el" href="adm__ctrl_8h-source.html">adm_ctrl.h</a>"</code><br>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structadm__ctrl__func.html">adm_ctrl_func</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Function type definition. </em> <a href="structadm__ctrl__func.html#_details">More...</a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structadm__ctrl__func__instance.html">adm_ctrl_func_instance</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Function instance structure. </em> <a href="structadm__ctrl__func__instance.html#_details">More...</a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structadm__ctrl__funcarg.html">adm_ctrl_funcarg</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Function argument definition. </em> <a href="structadm__ctrl__funcarg.html#_details">More...</a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>union &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="unionadm__ctrl__funcarg__value.html">adm_ctrl_funcarg_value</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Function argument value. </em> <a href="unionadm__ctrl__funcarg__value.html#_details">More...</a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a0">MAX</a>(x, y)&nbsp;&nbsp;&nbsp;(x&gt;y)?x:y</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Macro that returns largest number. <a href="#a0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a1">MIN</a>(x, y)&nbsp;&nbsp;&nbsp;(x&gt;y)?y:x</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Macro that returns smallest number. <a href="#a1"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a2">DEBUG_CMD</a>(x)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a3">STRING</a>&nbsp;&nbsp;&nbsp;'s'</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Function argument types. <a href="#a3"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a4">INT</a>&nbsp;&nbsp;&nbsp;'i'</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a5">UNSIGNED_LONG_LONG</a>&nbsp;&nbsp;&nbsp;'L'</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a6">NUMBER_OF_PCV</a>&nbsp;&nbsp;&nbsp;2</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Number of policy comply values we are going to use. <a href="#a6"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef <a class="el" href="unionadm__ctrl__funcarg__value.html">adm_ctrl_funcarg_value</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a7">adm_ctrl_funcarg_value_t</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Function argument value datatype. <a href="#a7"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef <a class="el" href="structadm__ctrl__funcarg.html">adm_ctrl_funcarg</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a8">adm_ctrl_funcarg_t</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Function arguments datatype. <a href="#a8"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef <a class="el" href="structadm__ctrl__func__instance.html">adm_ctrl_func_instance</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a9">adm_ctrl_func_instance_t</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Function instances datatype. <a href="#a9"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef <a class="el" href="structadm__ctrl__func.html">adm_ctrl_func</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a10">adm_ctrl_func_t</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Function type datatype. <a href="#a10"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a12">adm_ctrl_load_policy</a> (const char *fn, <a class="el" href="structadm__ctrl__policy.html">adm_ctrl_policy_t</a> *<a class="el" href="authd_8c.html#a4">policy</a>)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Load a keynote policy and extract the assertions. <a href="#a12"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a13">adm_ctrl_decrypt_nonce</a> (<a class="el" href="structbytestream__struct.html">bytestream</a> *src, unsigned int *dest, char *pub)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Decrypt the nonce provided by client Decrypts the bytestream using a keynote public key. The bytestream should contain an unsigned integer encrypted with a private key. <a href="#a13"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a14">adm_ctrl_free_functions</a> (<a class="el" href="structadm__ctrl__func.html">adm_ctrl_func_t</a> *list)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deallocates all the memory reserved for functions. <a href="#a14"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="structadm__ctrl__func.html">adm_ctrl_func_t</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a15">add_function_instance</a> (<a class="el" href="structadm__ctrl__func.html">adm_ctrl_func_t</a> *list, const char *name, <a class="el" href="structadm__ctrl__func__instance.html">adm_ctrl_func_instance_t</a> *func)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add a function instance for assertion generation. <a href="#a15"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="structadm__ctrl__func.html">adm_ctrl_func_t</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a16">adm_ctrl_deserialize_functions</a> (const unsigned char *buf, unsigned int num)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deserialize a function list. <a href="#a16"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a17">adm_ctrl_generate_func_assertions</a> (int id, <a class="el" href="structadm__ctrl__func.html">adm_ctrl_func_t</a> *flist, char db_update_cmd[MAX_DB_UPDATE_CMD])</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Generate function assertions for a keynote session. <a href="#a17"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a18">adm_ctrl_generate_pair_assertions</a> (int id, unsigned int pairs, <a class="el" href="structadm__ctrl__pair.html">adm_ctrl_pair_t</a> pair[MAX_PAIR_ASSERTIONS])</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Generates assertions from name-value pairs. <a href="#a18"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a19">adm_ctrl_check</a> (<a class="el" href="structadm__ctrl__request.html">adm_ctrl_request_t</a> *auth, <a class="el" href="structadm__ctrl__policy.html">adm_ctrl_policy_t</a> *<a class="el" href="authd_8c.html#a4">policy</a>, <a class="el" href="structadm__ctrl__result.html">adm_ctrl_result_t</a> *res)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Checks the credentials and resource consumption of request against a policy. <a href="#a19"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a20">adm_ctrl_authenticate</a> (<a class="el" href="structadm__ctrl__request.html">adm_ctrl_request_t</a> *a)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Authenticates a user. <a href="#a20"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="adm__ctrl_8c.html#a11">default_PCV</a> [NUMBER_OF_PCV] = { "false", "true" }</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The policy comply values used with keynote. <a href="#a11"></a><br><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Authorization routines for authd.
<p>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="a2" doxytag="adm_ctrl.c::DEBUG_CMD" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define DEBUG_CMD</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">x&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a4" doxytag="adm_ctrl.c::INT" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define INT&nbsp;&nbsp;&nbsp;'i'
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a0" doxytag="adm_ctrl.c::MAX" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define MAX</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">x, <tr>
<td></td>
<td></td>
<td class="md" nowrap>y&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>&nbsp;&nbsp;&nbsp;(x&gt;y)?x:y
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Macro that returns largest number.
<p>
</td>
</tr>
</table>
<a class="anchor" name="a1" doxytag="adm_ctrl.c::MIN" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define MIN</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">x, <tr>
<td></td>
<td></td>
<td class="md" nowrap>y&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>&nbsp;&nbsp;&nbsp;(x&gt;y)?y:x
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Macro that returns smallest number.
<p>
</td>
</tr>
</table>
<a class="anchor" name="a6" doxytag="adm_ctrl.c::NUMBER_OF_PCV" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define NUMBER_OF_PCV&nbsp;&nbsp;&nbsp;2
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Number of policy comply values we are going to use.
<p>
</td>
</tr>
</table>
<a class="anchor" name="a3" doxytag="adm_ctrl.c::STRING" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define STRING&nbsp;&nbsp;&nbsp;'s'
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Function argument types.
<p>
</td>
</tr>
</table>
<a class="anchor" name="a5" doxytag="adm_ctrl.c::UNSIGNED_LONG_LONG" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define UNSIGNED_LONG_LONG&nbsp;&nbsp;&nbsp;'L'
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
</td>
</tr>
</table>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="a9" doxytag="adm_ctrl.c::adm_ctrl_func_instance_t" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> typedef struct <a class="el" href="structadm__ctrl__func__instance.html">adm_ctrl_func_instance</a> <a class="el" href="structadm__ctrl__func__instance.html">adm_ctrl_func_instance_t</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Function instances datatype.
<p>
</td>
</tr>
</table>
<a class="anchor" name="a10" doxytag="adm_ctrl.c::adm_ctrl_func_t" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> typedef struct <a class="el" href="structadm__ctrl__func.html">adm_ctrl_func</a> <a class="el" href="structadm__ctrl__func.html">adm_ctrl_func_t</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Function type datatype.
<p>
</td>
</tr>
</table>
<a class="anchor" name="a8" doxytag="adm_ctrl.c::adm_ctrl_funcarg_t" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> typedef struct <a class="el" href="structadm__ctrl__funcarg.html">adm_ctrl_funcarg</a> <a class="el" href="structadm__ctrl__funcarg.html">adm_ctrl_funcarg_t</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Function arguments datatype.
<p>
</td>
</tr>
</table>
<a class="anchor" name="a7" doxytag="adm_ctrl.c::adm_ctrl_funcarg_value_t" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> typedef union <a class="el" href="unionadm__ctrl__funcarg__value.html">adm_ctrl_funcarg_value</a> <a class="el" href="unionadm__ctrl__funcarg__value.html">adm_ctrl_funcarg_value_t</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Function argument value datatype.
<p>
</td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="a15" doxytag="adm_ctrl.c::add_function_instance" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="structadm__ctrl__func.html">adm_ctrl_func_t</a>* add_function_instance </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="structadm__ctrl__func.html">adm_ctrl_func_t</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>list</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>const char *&nbsp;</td>
<td class="mdname" nowrap> <em>name</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="structadm__ctrl__func__instance.html">adm_ctrl_func_instance_t</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>func</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Add a function instance for assertion generation.
<p>
Allocates a new list, if called with a NULL list argument. If it fails due to lack of memory it deallocates the whole list.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>list</em>&nbsp;</td><td>a pointer to a function type list </td></tr>
<tr><td valign=top><em>name</em>&nbsp;</td><td>name of the function type to add </td></tr>
<tr><td valign=top><em>func</em>&nbsp;</td><td>function instance data</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>a pointer to the list on success, or NULL on failure </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="a20" doxytag="adm_ctrl.c::adm_ctrl_authenticate" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int adm_ctrl_authenticate </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="structadm__ctrl__request.html">adm_ctrl_request_t</a> *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>a</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Authenticates a user.
<p>
Checks that the encrypted number provided by the user, is actually the number sent by mapi. The number will be decrypted using the public key we are trying to authenticate, since it should be encrypted with the corresponsing private key.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>a</em>&nbsp;</td><td>the structure containing the authentication data</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>1 on successful authentication, 0 if it failed to pass the nonce challenge, or -1 in case of an error </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="a19" doxytag="adm_ctrl.c::adm_ctrl_check" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int adm_ctrl_check </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="structadm__ctrl__request.html">adm_ctrl_request_t</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>auth</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="structadm__ctrl__policy.html">adm_ctrl_policy_t</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>policy</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="structadm__ctrl__result.html">adm_ctrl_result_t</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>res</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Checks the credentials and resource consumption of request against a policy.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>auth</em>&nbsp;</td><td>admission control request </td></tr>
<tr><td valign=top><em>policy</em>&nbsp;</td><td>admission control policy </td></tr>
<tr><td valign=top><em>res</em>&nbsp;</td><td>admission control result datatype where results are going to be stored</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>the index of the PCV that corresponds to the provided credentials, or a negative number on error. Valid error values are: <ul>
<li>CHECK_KN_ERROR A keynote error occured </li>
<li>CHECK_SYNTAX_ERROR A syntactic error occured while processing the credentials </li>
<li>CHECK_SIGNATURE_ERROR The credentials could not be cryptographically verified </li>
</ul>
</dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="a13" doxytag="adm_ctrl.c::adm_ctrl_decrypt_nonce" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int adm_ctrl_decrypt_nonce </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="structbytestream__struct.html">bytestream</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>src</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>unsigned int *&nbsp;</td>
<td class="mdname" nowrap> <em>dest</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>char *&nbsp;</td>
<td class="mdname" nowrap> <em>pub</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Decrypt the nonce provided by client Decrypts the bytestream using a keynote public key. The bytestream should contain an unsigned integer encrypted with a private key.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>src</em>&nbsp;</td><td>the encrypted bytestream containing the nonce </td></tr>
<tr><td valign=top><em>dest</em>&nbsp;</td><td>the pointer to store the decrypted unsinged integer </td></tr>
<tr><td valign=top><em>pub</em>&nbsp;</td><td>the keynote public key to use for decryption</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>0 on success, or -1 on failure. </dd></dl>
</td>