Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > df754e4e6f7f5fc8ab9d6ed8559f3e3d > files > 39

bacula-docs-5.0.3-19.fc16.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<!--Converted with LaTeX2HTML 2008 (1.71)
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>Bnet API Changes</TITLE>
<META NAME="description" CONTENT="Bnet API Changes">
<META NAME="keywords" CONTENT="developers">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="developers.css">

<LINK REL="next" HREF="Authentication_Negotiation.html">
<LINK REL="previous" HREF="TLS_API_Implementation.html">
<LINK REL="up" HREF="TLS.html">
<LINK REL="next" HREF="Authentication_Negotiation.html">
</HEAD>

<BODY >
<!--Navigation Panel-->
<A NAME="tex2html1404"
  HREF="Authentication_Negotiation.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html1398"
  HREF="TLS.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html1392"
  HREF="TLS_API_Implementation.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html1400"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html1402"
  HREF="GNU_Free_Documentation_Lice.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html1405"
  HREF="Authentication_Negotiation.html">Authentication Negotiation</A>
<B> Up:</B> <A NAME="tex2html1399"
  HREF="TLS.html">TLS</A>
<B> Previous:</B> <A NAME="tex2html1393"
  HREF="TLS_API_Implementation.html">TLS API Implementation</A>
 &nbsp; <B>  <A NAME="tex2html1401"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html1403"
  HREF="GNU_Free_Documentation_Lice.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>

<UL>
<LI><A NAME="tex2html1406"
  HREF="Bnet_API_Changes.html#SECTION001441000000000000000">Negotiating a TLS Connection</A>
<LI><A NAME="tex2html1407"
  HREF="Bnet_API_Changes.html#SECTION001442000000000000000">Manipulating Socket Blocking State</A>
</UL>
<!--End of Table of Child-Links-->
<HR>

<H1><A NAME="SECTION001440000000000000000"></A>
<A NAME="4837"></A>
<A NAME="4838"></A>
<BR>
Bnet API Changes
</H1>

<P>
A minimal number of changes were required in the Bnet socket API. The BSOCK
structure was expanded to include an associated TLS_CONNECTION structure,
as well as a flag to designate the current blocking state of the socket.
The blocking state flag is required for win32, where it does not appear
possible to discern the current blocking state of a socket.

<P>

<H2><A NAME="SECTION001441000000000000000"></A>
<A NAME="4843"></A>
<A NAME="4844"></A>
<BR>
Negotiating a TLS Connection
</H2>

<P>
<I>bnet_tls_server()</I> and <I>bnet_tls_client()</I> were both
implemented using the new TLS API as follows:

<P>
<PRE>
int bnet_tls_client(TLS_CONTEXT *ctx, BSOCK * bsock);
</PRE>
<P>
Negotiates a TLS session via <I>bsock</I> using the settings from
<I>ctx</I>.  Returns 1 if successful, 0 otherwise.

<P>
<PRE>
int bnet_tls_server(TLS_CONTEXT *ctx, BSOCK * bsock, alist *verify_list);
</PRE>
<P>
Accepts a TLS client session via <I>bsock</I> using the settings from
<I>ctx</I>.  If <I>verify_list</I> is non-NULL, it is passed to
<I>tls_postconnect_verify_cn()</I> for client certificate verification.

<P>

<H2><A NAME="SECTION001442000000000000000"></A>
<A NAME="4861"></A>
<A NAME="4862"></A>
<A NAME="4863"></A>
<BR>
Manipulating Socket Blocking State
</H2>

<P>
Three functions were added for manipulating the blocking state of a socket
on both Win32 and Unix-like systems.  The Win32 code was written according
to the MSDN documentation, but has not been tested.

<P>
These functions are prototyped as follows:

<P>
<PRE>
int bnet_set_nonblocking (BSOCK *bsock);
</PRE>
<P>
Enables non-blocking I/O on the socket associated with <I>bsock</I>.
Returns a copy of the socket flags prior to modification.

<P>
<PRE>
int bnet_set_blocking (BSOCK *bsock);
</PRE>
<P>
Enables blocking I/O on the socket associated with <I>bsock</I>.  Returns a
copy of the socket flags prior to modification.

<P>
<PRE>
void bnet_restore_blocking (BSOCK *bsock, int flags);
</PRE>
<P>
Restores blocking or non-blocking IO setting on the socket associated with
<I>bsock</I>.  The <I>flags</I> argument must be the return value of either
<I>bnet_set_blocking()</I> or <I>bnet_restore_blocking()</I>.

<P>

<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html1404"
  HREF="Authentication_Negotiation.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html1398"
  HREF="TLS.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html1392"
  HREF="TLS_API_Implementation.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html1400"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html1402"
  HREF="GNU_Free_Documentation_Lice.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html1405"
  HREF="Authentication_Negotiation.html">Authentication Negotiation</A>
<B> Up:</B> <A NAME="tex2html1399"
  HREF="TLS.html">TLS</A>
<B> Previous:</B> <A NAME="tex2html1393"
  HREF="TLS_API_Implementation.html">TLS API Implementation</A>
 &nbsp; <B>  <A NAME="tex2html1401"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html1403"
  HREF="GNU_Free_Documentation_Lice.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>

2012-01-24
</ADDRESS>
</BODY>
</HTML>