trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrew...@apache.org
Subject svn commit: r831152 [31/37] - in /incubator/trafficserver/site/trunk/docs: ./ admin/ admin/images/ sdk/ sdk/css/ sdk/images/ sdk/images/docbook/ sdk/js/
Date Thu, 29 Oct 2009 23:23:36 GMT
Added: incubator/trafficserver/site/trunk/docs/sdk/SampleBufferedNullTransformPlugin.html
URL: http://svn.apache.org/viewvc/incubator/trafficserver/site/trunk/docs/sdk/SampleBufferedNullTransformPlugin.html?rev=831152&view=auto
==============================================================================
--- incubator/trafficserver/site/trunk/docs/sdk/SampleBufferedNullTransformPlugin.html (added)
+++ incubator/trafficserver/site/trunk/docs/sdk/SampleBufferedNullTransformPlugin.html Thu Oct 29 23:23:25 2009
@@ -0,0 +1,234 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>The Sample Buffered Null Transform Plugin</title>
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/reset/reset-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/fonts/fonts-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/treeview/assets/tree.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc-chunk.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="index.html" title="Traffic Server Software Developers Kit">
+<link rel="up" href="HTTPTransformationPlugins.html" title="Chapter 5. HTTP Transformation Plugins">
+<link rel="prev" href="AppendTransformPlugin.html" title="The Append-Transform Plugin">
+<link rel="next" href="NewProtocolPlugins.html" title="Chapter 6. New Protocol Plugins">
+<link rel="preface" href="Preface.html" title="Preface">
+<link rel="chapter" href="GetingStarted.html" title="Chapter 1. Getting Started">
+<link rel="chapter" href="CreatingTSPlugins.html" title="Chapter 2. How to Create Traffic Server Plugins">
+<link rel="index" href="CreatingTSPlugins.html#id372630" title="Index">
+<link rel="chapter" href="ch03.html" title="Chapter 3. Remap Plugin">
+<link rel="chapter" href="HeaderBasedPluginEx.html" title="Chapter 4. Header-Based Plugin Examples">
+<link rel="chapter" href="HTTPTransformationPlugins.html" title="Chapter 5. HTTP Transformation Plugins">
+<link rel="chapter" href="NewProtocolPlugins.html" title="Chapter 6. New Protocol Plugins">
+<link rel="chapter" href="ch07.html" title="Chapter 7. Cache Plugin">
+<link rel="chapter" href="HTTPHooksAndTransactions.html" title="Chapter 8. HTTP Hooks and Transactions">
+<link rel="chapter" href="MiscellaneousInterfaceGuide.html" title="Chapter 9. Miscellaneous Interface Guide">
+<link rel="chapter" href="HTTPHeaders.html" title="Chapter 10. HTTP Headers">
+<link rel="chapter" href="MutexGuide.html" title="Chapter 11. Mutex Guide">
+<link rel="chapter" href="Continuations.html" title="Chapter 12. Continuations">
+<link rel="chapter" href="PluginConfigurations.html" title="Chapter 13. Plugin Configurations">
+<link rel="chapter" href="ActionsGuide.html" title="Chapter 14. Actions Guide">
+<link rel="chapter" href="IOGuide.html" title="Chapter 15. IO Guide">
+<link rel="chapter" href="PluginManagement.html" title="Chapter 16. Plugin Management">
+<link rel="chapter" href="AddingStatistics.html" title="Chapter 17. Adding Statistics">
+<link rel="chapter" href="FunctionReference.html" title="Chapter 18. Function Reference">
+<link rel="appendix" href="App_SampleSourceCode.html" title="Appendix A. Sample Source Code">
+<link rel="appendix" href="App_DeprecatedFunctions.html" title="Appendix B. Deprecated Functions">
+<link rel="appendix" href="App_Troubleshooting.html" title="Appendix C. Troubleshooting Tips">
+<link rel="appendix" href="FunctionIndex.html" title="Appendix D. Function Index">
+<link rel="appendix" href="TypeIndex.html" title="Appendix E. Type Index">
+<link rel="index" href="ConceptIndex.html" title="Index">
+<script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/yahoo/yahoo-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/event/event-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/treeview/treeview-min.js"></script><script type="text/javascript" src="js/tocnodes.js"></script><script type="text/javascript" src="js/toc.js"></script><script type="text/javascript">
+    document.write("<style> div.toc {display: none} </style>"); 
+  </script>
+</head>
+<body>
+<div class="doctitle">
+<a href="index.html">Home</a>
+<img src="images/docbook/ts75.png"><h1 class="doctitle">Traffic Server Software Developers Kit</h1>
+</div>
+<div class="navheader">
+<div class="navprev">
+<a accesskey="p" href="AppendTransformPlugin.html">Prev</a> — The Append-Transform Plugin</div>
+<div class="navnext">Chapter 6. New Protocol Plugins — <a accesskey="n" href="NewProtocolPlugins.html">Next</a>
+</div>
+</div>
+<div id="toc"></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="SampleBufferedNullTransformPlugin"></a>The Sample Buffered Null Transform Plugin</h2></div></div></div>
+<p>The buffered null transform,
+      <code class="filename">bnull-transform.c</code>, reads the response content into
+      a buffer and then writes the full buffer out to the client. Many
+      examples of transformations, such as compression, require you to gather
+      the full response content in order to perform the transformation.</p>
+<p>The buffered null transform uses a state variable to keep track of
+      when it is (a) reading data into the buffer and (b) writing the data
+      from the buffer to the downstream vconnection.</p>
+<p>The following is a step-by-step walk through the buffered null
+      transform:</p>
+<div class="orderedlist"><ol type="1">
+<li>
+<p>Gets a handle to HTTP transactions.</p>
+<pre class="programlisting">void
+     INKPluginInit (int argc, const char *argv[]) {
+          INKHttpHookAdd (INK_HTTP_READ_RESPONSE_HDR_HOOK,
+               INKContCreate (transform_plugin, NULL)); }</pre>
+<p>With this <code class="function">INKPluginInit</code> routine, the
+          plugin is called back every time Traffic Server reads a response
+          header.</p>
+</li>
+<li>
+<p>Checks to see if the transaction response is
+          transformable.</p>
+<pre class="programlisting">static int transform_plugin (INKCont contp, INKEvent event, void *edata) {
+     INKHttpTxn txnp = (INKHttpTxn) edata;
+     switch (event) {
+          case INK_EVENT_HTTP_READ_RESPONSE_HDR:
+          if (transformable (txnp)) {
+          transform_add (txnp);}</pre>
+<p>The default behavior for transformations is to cache the
+          transformed content. (You can tell Traffic Server to cache
+          untransformed content, if you want). Therefore, only responses
+          received directly from an origin server need be transformed. Objects
+          served from the cache are already transformed. To determine whether
+          the response is from the origin server, the routine transformable
+          checks the response header for the “200 OK” server response.</p>
+<pre class="programlisting">{
+     INKMBuffer bufp;
+     INKMLoc hdr_loc;
+     INKHttpStatus resp_status;
+
+     INKHttpTxnServerRespGet (txnp, &amp;bufp, &amp;hdr_loc);
+
+     if(INK_HTTP_STATUS_OK==
+          (resp_status=INKHttpHdrStatusGet(bufp,hdr_loc)))
+          {
+               return 1;
+          }
+          else {
+               return 0;
+          }
+}</pre>
+</li>
+<li>
+<p>If the response is transformable, the plugin creates a
+          transformation vconnection that gets called back when the response
+          data is ready to be transformed (as it is streaming from the origin
+          server).</p>
+<pre class="programlisting">static void transform_add (INKHttpTxn txnp)
+{
+     INKVConn connp;
+     connp = INKTransformCreate (bnull_transform, txnp);
+     INKHttpTxnHookAdd (txnp, INK_HTTP_RESPONSE_TRANSFORM_HOOK, connp);
+}</pre>
+<p>The previous code fragment shows that the handler function for
+          the transformation vconnection is
+          <code class="function">bnull_transform</code>.</p>
+</li>
+<li><p>The <code class="function">bnull_transform</code> function has to
+          handle <code class="code">ERROR</code>, <code class="code">WRITE_COMPLETE</code>,
+          <code class="code">WRITE_READY</code>, and <code class="code">IMMEDIATE</code> events. If the
+          transform is just beginning, the event received is probably
+          <code class="code">IMMEDIATE</code>. The <code class="function">bnull_transform</code>
+          function calls <code class="function">handle_transform</code> to handle
+          <code class="code">WRITE_READY</code> and <code class="code">IMMEDIATE</code>.</p></li>
+<li><p>The <code class="function">handle_transform</code> function examines
+          the data parameter for the continuation passed to it (the
+          continuation passed to <code class="function">handle_transform</code> is the
+          transformation vconnection). The data structure keeps track of two
+          states: copying the data into the buffer
+          (<code class="code">STATE_BUFFER_DATA</code>) and writing the contents of the
+          buffer to the output vconnection
+          (<code class="code">STATE_OUTPUT_DATA</code>).</p></li>
+<li>
+<p>Get a handle to the input VIO. (See the
+          <code class="function">handle_buffering</code> function.)</p>
+<pre class="programlisting">input_vio = INKVConnWriteVIOGet (contp);</pre>
+<p>This is so that the transformation can get information about
+          the upstream vconnection’s write operation to the input
+          buffer.</p>
+</li>
+<li>
+<p>Copy data from the input buffer to the output buffer. See the
+          <code class="function">handle_buffering</code> function for the following
+          code fragment:</p>
+<pre class="programlisting">INKIOBufferCopy (data-&gt;output_buffer,
+     INKVIOReaderGet (write_vio), towrite, 0);</pre>
+</li>
+<li>
+<p>Tell the input buffer that the transformation has read the
+          data. See the <code class="function">handle_buffering</code> function for the
+          following code fragment:</p>
+<pre class="programlisting">INKIOBufferReaderConsume (INKVIOReaderGet (write_vio), towrite);</pre>
+</li>
+<li>
+<p>Modify the input VIO to tell it how much data has been read
+          (increase the value of ndone). See the
+          <code class="function">handle_buffering</code> function for the following
+          code fragment:</p>
+<pre class="programlisting">INKVIONDoneSet (write_vio, INKVIONDoneGet (write_vio) + towrite); }</pre>
+</li>
+<li>
+<p>If there is more data left to read (<code class="code">if ndone &lt;
+          nbytes</code>), the <code class="function">handle_buffering</code> function
+          wakes up the upstream vconnection by sending it
+          <code class="code">WRITE_READY</code>:</p>
+<pre class="programlisting">if (INKVIONTodoGet (write_vio) &gt; 0) {
+     if (towrite &gt; 0) {
+          INKContCall (INKVIOContGet (write_vio),
+               INK_EVENT_VCONN_WRITE_READY, write_vio);
+     }
+} else {</pre>
+<p>The process of passing data through the transformation is
+          illustrated in the following diagram. The transformation sends
+          <code class="code">WRITE_READY</code> events when it needs more data, and when
+          data is available the upstream vconnection reenables the
+          transformation with an <code class="code">IMMEDIATE</code> event.</p>
+<div class="figure">
+<a name="Fig_STATE_BUFFER_DATAState"></a><p class="title"><b>Figure 5.4. Reading Data Into the Buffer (the STATE_BUFFER_DATA
+            State)</b></p>
+<div class="mediaobject"><img src="images/vconn_buffer.jpg" alt="Reading Data Into the Buffer (the STATE_BUFFER_DATA State)"></div>
+</div>
+</li>
+<li>
+<p>When the data is read into the output buffer, the
+          <code class="function">handle_buffering</code> function sets the state of the
+          transformation’s data structure to <code class="code">STATE_OUTPUT_DATA</code>.
+          and calls the upstream vconnection back with the
+          <code class="code">WRITE_COMPLETE</code> event.</p>
+<pre class="programlisting">data-&gt;state = STATE_OUTPUT_DATA;
+INKContCall (INKVIOContGet (write_vio),
+     INK_EVENT_VCONN_WRITE_COMPLETE, write_vio);</pre>
+</li>
+<li><p>The upstream vconnection will probably shut down the write
+          operation when it receives the <code class="code">WRITE_COMPLETE</code> event.
+          The handler function of the transformation,
+          <code class="function">bnull_transform</code>, will receive an
+          <code class="code">IMMEDIATE</code> event, and call the
+          <code class="function">handle_transform</code> function. This time, the state
+          is <code class="code">STATE_OUTPUT_DATA</code>, so
+          <code class="function">handle_transform</code> calls
+          <code class="function">handle_output</code>.</p></li>
+<li>
+<p>The <code class="function">handle_output</code> function gets a handle
+          to the output vconnection:</p>
+<pre class="programlisting">output_conn = INKTransformOutputVConnGet (contp);</pre>
+</li>
+<li>
+<p>The handle_output function writes the buffer to the output
+          vconnectio</p>
+<pre class="programlisting">data-&gt;output_vio =
+INKVConnWrite (output_conn, contp, data-&gt;output_reader,
+INKIOBufferReaderAvail (data-&gt;output_reader) );</pre>
+<p>The following diagram illustrates the write to the output
+          vconnection:</p>
+<div class="figure">
+<a name="Fig_WriteBufferedDataToOutputVcon"></a><p class="title"><b>Figure 5.5. Writing the Buffered Data to the Output Vconnection</b></p>
+<div class="mediaobject"><img src="images/vconn_buf_output.jpg" alt="Writing the Buffered Data to the Output Vconnection"></div>
+</div>
+</li>
+</ol></div>
+</div>
+</body>
+</html>

Propchange: incubator/trafficserver/site/trunk/docs/sdk/SampleBufferedNullTransformPlugin.html
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/trafficserver/site/trunk/docs/sdk/SampleNullTransformPlugin.html
URL: http://svn.apache.org/viewvc/incubator/trafficserver/site/trunk/docs/sdk/SampleNullTransformPlugin.html?rev=831152&view=auto
==============================================================================
--- incubator/trafficserver/site/trunk/docs/sdk/SampleNullTransformPlugin.html (added)
+++ incubator/trafficserver/site/trunk/docs/sdk/SampleNullTransformPlugin.html Thu Oct 29 23:23:25 2009
@@ -0,0 +1,230 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>The Sample Null Transform Plugin</title>
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/reset/reset-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/fonts/fonts-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/treeview/assets/tree.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc-chunk.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="index.html" title="Traffic Server Software Developers Kit">
+<link rel="up" href="HTTPTransformationPlugins.html" title="Chapter 5. HTTP Transformation Plugins">
+<link rel="prev" href="HTTPTransformationPlugins.html" title="Chapter 5. HTTP Transformation Plugins">
+<link rel="next" href="AppendTransformPlugin.html" title="The Append-Transform Plugin">
+<link rel="preface" href="Preface.html" title="Preface">
+<link rel="chapter" href="GetingStarted.html" title="Chapter 1. Getting Started">
+<link rel="chapter" href="CreatingTSPlugins.html" title="Chapter 2. How to Create Traffic Server Plugins">
+<link rel="index" href="CreatingTSPlugins.html#id372630" title="Index">
+<link rel="chapter" href="ch03.html" title="Chapter 3. Remap Plugin">
+<link rel="chapter" href="HeaderBasedPluginEx.html" title="Chapter 4. Header-Based Plugin Examples">
+<link rel="chapter" href="HTTPTransformationPlugins.html" title="Chapter 5. HTTP Transformation Plugins">
+<link rel="chapter" href="NewProtocolPlugins.html" title="Chapter 6. New Protocol Plugins">
+<link rel="chapter" href="ch07.html" title="Chapter 7. Cache Plugin">
+<link rel="chapter" href="HTTPHooksAndTransactions.html" title="Chapter 8. HTTP Hooks and Transactions">
+<link rel="chapter" href="MiscellaneousInterfaceGuide.html" title="Chapter 9. Miscellaneous Interface Guide">
+<link rel="chapter" href="HTTPHeaders.html" title="Chapter 10. HTTP Headers">
+<link rel="chapter" href="MutexGuide.html" title="Chapter 11. Mutex Guide">
+<link rel="chapter" href="Continuations.html" title="Chapter 12. Continuations">
+<link rel="chapter" href="PluginConfigurations.html" title="Chapter 13. Plugin Configurations">
+<link rel="chapter" href="ActionsGuide.html" title="Chapter 14. Actions Guide">
+<link rel="chapter" href="IOGuide.html" title="Chapter 15. IO Guide">
+<link rel="chapter" href="PluginManagement.html" title="Chapter 16. Plugin Management">
+<link rel="chapter" href="AddingStatistics.html" title="Chapter 17. Adding Statistics">
+<link rel="chapter" href="FunctionReference.html" title="Chapter 18. Function Reference">
+<link rel="appendix" href="App_SampleSourceCode.html" title="Appendix A. Sample Source Code">
+<link rel="appendix" href="App_DeprecatedFunctions.html" title="Appendix B. Deprecated Functions">
+<link rel="appendix" href="App_Troubleshooting.html" title="Appendix C. Troubleshooting Tips">
+<link rel="appendix" href="FunctionIndex.html" title="Appendix D. Function Index">
+<link rel="appendix" href="TypeIndex.html" title="Appendix E. Type Index">
+<link rel="index" href="ConceptIndex.html" title="Index">
+<script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/yahoo/yahoo-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/event/event-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/treeview/treeview-min.js"></script><script type="text/javascript" src="js/tocnodes.js"></script><script type="text/javascript" src="js/toc.js"></script><script type="text/javascript">
+    document.write("<style> div.toc {display: none} </style>"); 
+  </script>
+</head>
+<body>
+<div class="doctitle">
+<a href="index.html">Home</a>
+<img src="images/docbook/ts75.png"><h1 class="doctitle">Traffic Server Software Developers Kit</h1>
+</div>
+<div class="navheader">
+<div class="navprev">
+<a accesskey="p" href="HTTPTransformationPlugins.html">Prev</a> — Chapter 5. HTTP Transformation Plugins</div>
+<div class="navnext">The Append-Transform Plugin — <a accesskey="n" href="AppendTransformPlugin.html">Next</a>
+</div>
+</div>
+<div id="toc"></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="SampleNullTransformPlugin"></a>The Sample Null Transform Plugin</h2></div></div></div>
+<p>This section provides a step-by-step description of what the null
+      transform plugin does, along with sections of the code that apply. For
+      context, you can find each code snippet in the complete source code.
+      Some of the error checking details are left out; to give the description
+      a step-by-step flow, only the highlights of the transform are
+      included.</p>
+<p>Here is an overview of the null transform plugin:</p>
+<div class="orderedlist"><ol type="1">
+<li>
+<p>Gets a handle to HTTP transactions.</p>
+<pre class="programlisting">void
+     INKPluginInit (int argc, const char *argv[]) {
+          INKHttpHookAdd (INK_HTTP_READ_RESPONSE_HDR_HOOK,
+               INKContCreate (transform_plugin, NULL));</pre>
+<p>With this <code class="code">INKPluginInit</code> routine, the plugin is
+          called back every time Traffic Server reads a response
+          header.</p>
+</li>
+<li>
+<p>Checks to see if the transaction response is
+          transformable.</p>
+<pre class="programlisting">static int transform_plugin (INKCont contp, INKEvent event, void *edata) {
+     INKHttpTxn txnp = (INKHttpTxn) edata;
+     switch (event) {
+          case INK_EVENT_HTTP_READ_RESPONSE_HDR:
+          if (transformable (txnp)) {
+               transform_add (txnp);}</pre>
+<p>The default behavior for transformations is to cache the
+          transformed content. (You can tell Traffic Server to cache
+          untransformed content, if you want). Therefore, only responses
+          received directly from an origin server need be transformed. Objects
+          served from the cache are already transformed. To determine whether
+          the response is from the origin server, the routine
+          <code class="code">transformable</code> checks the response header for the “200
+          OK” server response.</p>
+<pre class="programlisting">static int transformable (INKHttpTxn txnp)
+{
+     INKMBuffer bufp;
+     INKMLoc hdr_loc;
+     INKHttpStatus resp_status;
+     INKHttpTxnServerRespGet (txnp, &amp;bufp, &amp;hdr_loc);
+
+     if (INK_HTTP_STATUS_OK == (resp_status =
+          INKHttpHdrStatusGet (bufp, hdr_loc)) ) {
+          return 1;
+     } else {
+          return 0;
+     }
+}</pre>
+</li>
+<li>
+<p>If the response is transformable, the plugin creates a
+          transformation vconnection that gets called back when the response
+          data is ready to be transformed (as it is streaming from the origin
+          server).</p>
+<pre class="programlisting">static void transform_add (INKHttpTxn txnp)
+{
+     INKVConn connp;
+     connp = INKTransformCreate (null_transform, txnp);
+     INKHttpTxnHookAdd (txnp, INK_HTTP_RESPONSE_TRANSFORM_HOOK, connp);
+}</pre>
+<p>The previous code fragment shows that the handler function for
+          the transformation vconnection is
+          <code class="code">null_transform</code>.</p>
+</li>
+<li>
+<p>Get a handle to the output vconnection (that receives data
+          from the tranformation).</p>
+<pre class="programlisting">output_conn = INKTransformOutputVConnGet (con</pre>
+</li>
+<li>
+<p>Get a handle to the input VIO. (See the
+          <code class="code">handle_transform</code> function.)</p>
+<pre class="programlisting">input_vio = INKVConnWriteVIOGet (contp);</pre>
+<p>This is so that the transformation can get information about
+          the upstream vconnection’s write operation to the input
+          buffer.</p>
+</li>
+<li>
+<p>Initiate a write to the output vconnection of the specified
+          number of bytes. When the write is initiated, the transformation
+          expects to receive <code class="code">WRITE_READY</code>,
+          <code class="code">WRITE_COMPLETE</code>, or <code class="code">ERROR</code> events from the
+          output vconnection.</p>
+<p>See the <code class="code">handle_transform</code> function for the
+          following code fragment:</p>
+<pre class="programlisting">data-&gt;output_vio = INKVConnWrite (output_conn, contp,
+     data-&gt;output_reader, INKVIONBytesGet (input_vio));</pre>
+</li>
+<li>
+<p>Copy data from the input buffer to the output buffer. See the
+          <code class="code">handle_transform</code> function for the following code
+          fragm</p>
+<pre class="programlisting">INKIOBufferCopy (INKVIOBufferGet (data-&gt;output_vio),
+     INKVIOReaderGet (input_vio), towrite, 0);</pre>
+</li>
+<li>
+<p>Tell the input buffer that the transformation has read the
+          data. See the <code class="code">handle_transform</code> function for the
+          following code fragment:</p>
+<pre class="programlisting">INKIOBufferReaderConsume (INKVIOReaderGet (input_vio), towrite);</pre>
+</li>
+<li>
+<p>Modify the input VIO to tell it how much data has been read
+          (increase the value of ndone). See the <code class="code">handle_transform</code>
+          function for the following code fragment:</p>
+<pre class="programlisting">INKVIONDoneSet (input_vio, INKVIONDoneGet (input_vio) + towrite);</pre>
+</li>
+<li>
+<p>If there is more data left to read (<code class="code">if ndone &lt;
+          nbytes</code>), the <code class="code">handle_transform</code> function wakes up
+          the downstream vconnection with a reenable and wakes up the upstream
+          vconnection by sending it <code class="code">WRITE_READY</code>:</p>
+<pre class="programlisting">if (INKVIONTodoGet (input_vio) &gt; 0) {
+     if (towrite &gt; 0) {
+          INKVIOReenable (data-&gt;output_vio);
+
+          INKContCall (INKVIOContGet (input_vio),
+               INK_EVENT_VCONN_WRITE_READY, input_vio);
+          }
+     } else {</pre>
+<p>The process of passing data through the transformation is
+          illustrated in the following diagram. The downstream vconnections
+          send <code class="code">WRITE_READY</code> events when they need more data, and
+          when data is available the upstream vconnections reenable the
+          downstream vconnections. The <code class="function">INKVIOReenable</code>
+          function, in this instance, sends
+          <code class="code">INK_EVENT_IMMEDIATE</code>.</p>
+<div class="figure">
+<a name="Fig_PassDataThruTransform"></a><p class="title"><b>Figure 5.2. Passing Data Through a Transformation</b></p>
+<div class="mediaobject"><img src="images/vconnection1.jpg" alt="Passing Data Through a Transformation"></div>
+</div>
+</li>
+<li>
+<p>If the <code class="code">handle_transform</code> function finds that there
+          is no more data to read, it sets nbytes to ndone on the output
+          (downstream) VIO, and wakes up the output vconnection with a
+          reenable. It then triggers the end of the write operation from the
+          upstream vconnection by sending the upstream vconnection a
+          <code class="code">WRITE_COMPLETE</code> event.</p>
+<pre class="programlisting">} else {
+
+INKVIONBytesSet (data-&gt;output_vio, INKVIONDoneGet (input_vio));
+INKVIOReenable (data-&gt;output_vio);
+INKContCall (INKVIOContGet (input_vio),
+     INK_EVENT_VCONN_WRITE_COMPLETE, input_vio);
+}</pre>
+<p>When the upstream vconnection receives the
+          <code class="code">WRITE_COMPLETE</code> event, it will probably shut down the
+          write operation.</p>
+</li>
+<li>
+<p>Similarly, when the downstream vconnection has consumed all of
+          the data, it sends the transformation a <code class="code">WRITE_COMPLETE</code>
+          event. The transformation handles this event with a shut down (the
+          transformation shuts down the write operation to the downstream
+          vconnection). See the <code class="code">null_plugin</code> function for the
+          following code fragment:</p>
+<pre class="programlisting">case INK_EVENT_VCONN_WRITE_COMPLETE:
+     INKVConnShutdown (INKTransformOutputVConnGet (contp), 0, 1
+     break;</pre>
+<p>The following diagram illustrates the flow of events:</p>
+<div class="figure">
+<a name="Fig_EndTransformation"></a><p class="title"><b>Figure 5.3. Ending the Transformation</b></p>
+<div class="mediaobject"><img src="images/vconnection2.jpg" alt="Ending the Transformation"></div>
+</div>
+</li>
+</ol></div>
+</div>
+</body>
+</html>

Propchange: incubator/trafficserver/site/trunk/docs/sdk/SampleNullTransformPlugin.html
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/trafficserver/site/trunk/docs/sdk/SetTransactionHook.html
URL: http://svn.apache.org/viewvc/incubator/trafficserver/site/trunk/docs/sdk/SetTransactionHook.html?rev=831152&view=auto
==============================================================================
--- incubator/trafficserver/site/trunk/docs/sdk/SetTransactionHook.html (added)
+++ incubator/trafficserver/site/trunk/docs/sdk/SetTransactionHook.html Thu Oct 29 23:23:25 2009
@@ -0,0 +1,96 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Setting a Transaction Hook</title>
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/reset/reset-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/fonts/fonts-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/treeview/assets/tree.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc-chunk.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="index.html" title="Traffic Server Software Developers Kit">
+<link rel="up" href="BasicAuthorizatonPlugin.html" title="The Basic Authorization Plugin">
+<link rel="prev" href="WorkWithHTTPHeaders.html" title="Working With HTTP Headers">
+<link rel="next" href="HTTPTransformationPlugins.html" title="Chapter 5. HTTP Transformation Plugins">
+<link rel="preface" href="Preface.html" title="Preface">
+<link rel="chapter" href="GetingStarted.html" title="Chapter 1. Getting Started">
+<link rel="chapter" href="CreatingTSPlugins.html" title="Chapter 2. How to Create Traffic Server Plugins">
+<link rel="index" href="CreatingTSPlugins.html#id372630" title="Index">
+<link rel="chapter" href="ch03.html" title="Chapter 3. Remap Plugin">
+<link rel="chapter" href="HeaderBasedPluginEx.html" title="Chapter 4. Header-Based Plugin Examples">
+<link rel="chapter" href="HTTPTransformationPlugins.html" title="Chapter 5. HTTP Transformation Plugins">
+<link rel="chapter" href="NewProtocolPlugins.html" title="Chapter 6. New Protocol Plugins">
+<link rel="chapter" href="ch07.html" title="Chapter 7. Cache Plugin">
+<link rel="chapter" href="HTTPHooksAndTransactions.html" title="Chapter 8. HTTP Hooks and Transactions">
+<link rel="chapter" href="MiscellaneousInterfaceGuide.html" title="Chapter 9. Miscellaneous Interface Guide">
+<link rel="chapter" href="HTTPHeaders.html" title="Chapter 10. HTTP Headers">
+<link rel="chapter" href="MutexGuide.html" title="Chapter 11. Mutex Guide">
+<link rel="chapter" href="Continuations.html" title="Chapter 12. Continuations">
+<link rel="chapter" href="PluginConfigurations.html" title="Chapter 13. Plugin Configurations">
+<link rel="chapter" href="ActionsGuide.html" title="Chapter 14. Actions Guide">
+<link rel="chapter" href="IOGuide.html" title="Chapter 15. IO Guide">
+<link rel="chapter" href="PluginManagement.html" title="Chapter 16. Plugin Management">
+<link rel="chapter" href="AddingStatistics.html" title="Chapter 17. Adding Statistics">
+<link rel="chapter" href="FunctionReference.html" title="Chapter 18. Function Reference">
+<link rel="appendix" href="App_SampleSourceCode.html" title="Appendix A. Sample Source Code">
+<link rel="appendix" href="App_DeprecatedFunctions.html" title="Appendix B. Deprecated Functions">
+<link rel="appendix" href="App_Troubleshooting.html" title="Appendix C. Troubleshooting Tips">
+<link rel="appendix" href="FunctionIndex.html" title="Appendix D. Function Index">
+<link rel="appendix" href="TypeIndex.html" title="Appendix E. Type Index">
+<link rel="index" href="ConceptIndex.html" title="Index">
+<script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/yahoo/yahoo-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/event/event-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/treeview/treeview-min.js"></script><script type="text/javascript" src="js/tocnodes.js"></script><script type="text/javascript" src="js/toc.js"></script><script type="text/javascript">
+    document.write("<style> div.toc {display: none} </style>"); 
+  </script>
+</head>
+<body>
+<div class="doctitle">
+<a href="index.html">Home</a>
+<img src="images/docbook/ts75.png"><h1 class="doctitle">Traffic Server Software Developers Kit</h1>
+</div>
+<div class="navheader">
+<div class="navprev">
+<a accesskey="p" href="WorkWithHTTPHeaders.html">Prev</a> — Working With HTTP Headers</div>
+<div class="navnext">Chapter 5. HTTP Transformation Plugins — <a accesskey="n" href="HTTPTransformationPlugins.html">Next</a>
+</div>
+</div>
+<div id="toc"></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="SetTransactionHook"></a>Setting a Transaction Hook</h3></div></div></div>
+<p>If the request does not have the
+        <code class="code">Proxy-Authorization</code> field set to Basic authorization, or
+        a valid user name and password, the plugin sends the 407 Proxy
+        authorization required status code back to the client.The client
+        should then prompt the user for a user name and password, and resend
+        the request.</p>
+<p>In the <code class="code">handle_dns</code> routine, the following lines
+        handle the authorization error case:</p>
+<pre class="programlisting">done:
+     INKHttpTxnHookAdd (txnp, INK_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
+     INKHttpTxnReenable (txnp, INK_EVENT_HTTP_ERROR);</pre>
+<p>If <code class="code">handle_dns</code> does not find the
+        <code class="code">Proxy-Authorization</code> field set to Basic authorization, or
+        a valid user name and password, it adds a
+        <code class="code">SEND_RESPONSE_HDR_HOOK</code> to the transaction being
+        processed; this means that Traffic Server will call the plugin back
+        when sending the client response.</p>
+<p><code class="code">handle_dns</code> reenables the transaction with
+        <code class="code">INK_EVENT_HTTP_ERROR</code>, which means that the plugin wants
+        Traffic Server to terminate the transaction.</p>
+<p>When Traffic Server terminates the transaction, it sends the
+        client an error message. Because of the
+        <code class="code">SEND_RESPONSE_HDR_HOOK</code>, Traffic Server calls the plugin
+        back. The <code class="code">auth-plugin</code> routine calls
+        <code class="code">handle_response</code> to send the client a 407 status
+        code.</p>
+<p>When the client resends the request with the <code class="code">Proxy-
+        Authorization</code> field, a new transaction begins.</p>
+<p><code class="code">handle_dns</code> calls <code class="code">base64_decode</code> to
+        decode the user name and password.</p>
+<p><code class="code">handle_dns</code> calls <code class="code">authorized</code> to
+        validate the user name and password. In this plugin, sample NT code is
+        provided for password validation. Unix programmers can supply their
+        own validation mechanism.</p>
+</div>
+</body>
+</html>

Propchange: incubator/trafficserver/site/trunk/docs/sdk/SetTransactionHook.html
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/trafficserver/site/trunk/docs/sdk/SetUpLicensing.html
URL: http://svn.apache.org/viewvc/incubator/trafficserver/site/trunk/docs/sdk/SetUpLicensing.html?rev=831152&view=auto
==============================================================================
--- incubator/trafficserver/site/trunk/docs/sdk/SetUpLicensing.html (added)
+++ incubator/trafficserver/site/trunk/docs/sdk/SetUpLicensing.html Thu Oct 29 23:23:25 2009
@@ -0,0 +1,111 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Setting Up Licensing</title>
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/reset/reset-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/fonts/fonts-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/treeview/assets/tree.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc-chunk.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="index.html" title="Traffic Server Software Developers Kit">
+<link rel="up" href="PluginManagement.html" title="Chapter 16. Plugin Management">
+<link rel="prev" href="LicensingPlugin.html" title="Licensing Your Plugin">
+<link rel="next" href="GenerateLicenseKey.html" title="Generating a License Key">
+<link rel="preface" href="Preface.html" title="Preface">
+<link rel="chapter" href="GetingStarted.html" title="Chapter 1. Getting Started">
+<link rel="chapter" href="CreatingTSPlugins.html" title="Chapter 2. How to Create Traffic Server Plugins">
+<link rel="index" href="CreatingTSPlugins.html#id372630" title="Index">
+<link rel="chapter" href="ch03.html" title="Chapter 3. Remap Plugin">
+<link rel="chapter" href="HeaderBasedPluginEx.html" title="Chapter 4. Header-Based Plugin Examples">
+<link rel="chapter" href="HTTPTransformationPlugins.html" title="Chapter 5. HTTP Transformation Plugins">
+<link rel="chapter" href="NewProtocolPlugins.html" title="Chapter 6. New Protocol Plugins">
+<link rel="chapter" href="ch07.html" title="Chapter 7. Cache Plugin">
+<link rel="chapter" href="HTTPHooksAndTransactions.html" title="Chapter 8. HTTP Hooks and Transactions">
+<link rel="chapter" href="MiscellaneousInterfaceGuide.html" title="Chapter 9. Miscellaneous Interface Guide">
+<link rel="chapter" href="HTTPHeaders.html" title="Chapter 10. HTTP Headers">
+<link rel="chapter" href="MutexGuide.html" title="Chapter 11. Mutex Guide">
+<link rel="chapter" href="Continuations.html" title="Chapter 12. Continuations">
+<link rel="chapter" href="PluginConfigurations.html" title="Chapter 13. Plugin Configurations">
+<link rel="chapter" href="ActionsGuide.html" title="Chapter 14. Actions Guide">
+<link rel="chapter" href="IOGuide.html" title="Chapter 15. IO Guide">
+<link rel="chapter" href="PluginManagement.html" title="Chapter 16. Plugin Management">
+<link rel="chapter" href="AddingStatistics.html" title="Chapter 17. Adding Statistics">
+<link rel="chapter" href="FunctionReference.html" title="Chapter 18. Function Reference">
+<link rel="appendix" href="App_SampleSourceCode.html" title="Appendix A. Sample Source Code">
+<link rel="appendix" href="App_DeprecatedFunctions.html" title="Appendix B. Deprecated Functions">
+<link rel="appendix" href="App_Troubleshooting.html" title="Appendix C. Troubleshooting Tips">
+<link rel="appendix" href="FunctionIndex.html" title="Appendix D. Function Index">
+<link rel="appendix" href="TypeIndex.html" title="Appendix E. Type Index">
+<link rel="index" href="ConceptIndex.html" title="Index">
+<link rel="subsection" href="SetUpLicensing.html#Licensing_Example" title="Example">
+<script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/yahoo/yahoo-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/event/event-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/treeview/treeview-min.js"></script><script type="text/javascript" src="js/tocnodes.js"></script><script type="text/javascript" src="js/toc.js"></script><script type="text/javascript">
+    document.write("<style> div.toc {display: none} </style>"); 
+  </script>
+</head>
+<body>
+<div class="doctitle">
+<a href="index.html">Home</a>
+<img src="images/docbook/ts75.png"><h1 class="doctitle">Traffic Server Software Developers Kit</h1>
+</div>
+<div class="navheader">
+<div class="navprev">
+<a accesskey="p" href="LicensingPlugin.html">Prev</a> — Licensing Your Plugin</div>
+<div class="navnext">Generating a License Key — <a accesskey="n" href="GenerateLicenseKey.html">Next</a>
+</div>
+</div>
+<div id="toc"></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="SetUpLicensing"></a>Setting Up Licensing</h2></div></div></div>
+<p>Set up licensing in these steps:</p>
+<div class="orderedlist"><ol type="1">
+<li><p>Develop your plugin, using the
+          <code class="function">INKPluginLicenseRequired</code> function.</p></li>
+<li><p>Create an installation program for your plugin. The
+          installation program must update both
+          <code class="filename">plugin.config</code> and
+          <code class="filename">plugin.db</code>. When your plugin customer installs
+          the plugin, the program should ask the customer for the license
+          key.</p></li>
+<li><p>Use the <code class="filename">gen_key</code> tool to generate license
+          keys. You can generate different keys for different customers, and
+          you can set expiration dates for each key.</p></li>
+<li><p>Distribute your plugin together with license key to
+          customers.</p></li>
+</ol></div>
+<p>When the customer installs the plugin, the installation program
+      should ask for the license key. The installation program should then
+      make an entry in <code class="filename">plugin.db</code> and plugin.config for
+      the new plugin. When the customer runs the plugin, Traffic Server checks
+      the license key. If it passes, Traffic Server then calls
+      <code class="function">INKPluginInit</code>.</p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="Licensing_Example"></a>Example</h3></div></div></div>
+<div class="itemizedlist"><ul type="disc">
+<li><p>You have a plugin filtering, implemented in object
+            filtering.so</p></li>
+<li>
+<p>You generate a key for your plugin filtering by
+            using:</p>
+<p><span><strong class="command">gen_key filtering ABCDE 03312002</strong></span></p>
+</li>
+<li>
+<p>The key generated by <code class="code">gen_key</code> is:</p>
+<p><code class="code">ABCDE2E01E07D95</code></p>
+</li>
+<li>
+<p>You must update <code class="filename">plugin.db</code> and add the
+            following lines:</p>
+<pre class="programlisting">[filtering]
+Object=filtering.so
+License=ABCDE2E01E07D95</pre>
+</li>
+</ul></div>
+<p>The following function is used to license your plugin:</p>
+<div class="itemizedlist"><ul type="disc"><li><p><a href="INKPluginLicenseRequired.html" title="INKPluginLicenseRequired">“INKPluginLicenseRequired”</a></p></li></ul></div>
+</div>
+</div>
+</body>
+</html>

Propchange: incubator/trafficserver/site/trunk/docs/sdk/SetUpLicensing.html
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/trafficserver/site/trunk/docs/sdk/SettingGlobalHook.html
URL: http://svn.apache.org/viewvc/incubator/trafficserver/site/trunk/docs/sdk/SettingGlobalHook.html?rev=831152&view=auto
==============================================================================
--- incubator/trafficserver/site/trunk/docs/sdk/SettingGlobalHook.html (added)
+++ incubator/trafficserver/site/trunk/docs/sdk/SettingGlobalHook.html Thu Oct 29 23:23:25 2009
@@ -0,0 +1,77 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Setting a Global Hook</title>
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/reset/reset-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/fonts/fonts-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/treeview/assets/tree.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc-chunk.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="index.html" title="Traffic Server Software Developers Kit">
+<link rel="up" href="BlacklistPlugin.html" title="The Blacklist Plugin">
+<link rel="prev" href="BlacklistPlugin.html" title="The Blacklist Plugin">
+<link rel="next" href="SettingUpUIUpdateCallbacks.html" title="Setting Up UI Update Callbacks">
+<link rel="preface" href="Preface.html" title="Preface">
+<link rel="chapter" href="GetingStarted.html" title="Chapter 1. Getting Started">
+<link rel="chapter" href="CreatingTSPlugins.html" title="Chapter 2. How to Create Traffic Server Plugins">
+<link rel="index" href="CreatingTSPlugins.html#id372630" title="Index">
+<link rel="chapter" href="ch03.html" title="Chapter 3. Remap Plugin">
+<link rel="chapter" href="HeaderBasedPluginEx.html" title="Chapter 4. Header-Based Plugin Examples">
+<link rel="chapter" href="HTTPTransformationPlugins.html" title="Chapter 5. HTTP Transformation Plugins">
+<link rel="chapter" href="NewProtocolPlugins.html" title="Chapter 6. New Protocol Plugins">
+<link rel="chapter" href="ch07.html" title="Chapter 7. Cache Plugin">
+<link rel="chapter" href="HTTPHooksAndTransactions.html" title="Chapter 8. HTTP Hooks and Transactions">
+<link rel="chapter" href="MiscellaneousInterfaceGuide.html" title="Chapter 9. Miscellaneous Interface Guide">
+<link rel="chapter" href="HTTPHeaders.html" title="Chapter 10. HTTP Headers">
+<link rel="chapter" href="MutexGuide.html" title="Chapter 11. Mutex Guide">
+<link rel="chapter" href="Continuations.html" title="Chapter 12. Continuations">
+<link rel="chapter" href="PluginConfigurations.html" title="Chapter 13. Plugin Configurations">
+<link rel="chapter" href="ActionsGuide.html" title="Chapter 14. Actions Guide">
+<link rel="chapter" href="IOGuide.html" title="Chapter 15. IO Guide">
+<link rel="chapter" href="PluginManagement.html" title="Chapter 16. Plugin Management">
+<link rel="chapter" href="AddingStatistics.html" title="Chapter 17. Adding Statistics">
+<link rel="chapter" href="FunctionReference.html" title="Chapter 18. Function Reference">
+<link rel="appendix" href="App_SampleSourceCode.html" title="Appendix A. Sample Source Code">
+<link rel="appendix" href="App_DeprecatedFunctions.html" title="Appendix B. Deprecated Functions">
+<link rel="appendix" href="App_Troubleshooting.html" title="Appendix C. Troubleshooting Tips">
+<link rel="appendix" href="FunctionIndex.html" title="Appendix D. Function Index">
+<link rel="appendix" href="TypeIndex.html" title="Appendix E. Type Index">
+<link rel="index" href="ConceptIndex.html" title="Index">
+<script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/yahoo/yahoo-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/event/event-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/treeview/treeview-min.js"></script><script type="text/javascript" src="js/tocnodes.js"></script><script type="text/javascript" src="js/toc.js"></script><script type="text/javascript">
+    document.write("<style> div.toc {display: none} </style>"); 
+  </script>
+</head>
+<body>
+<div class="doctitle">
+<a href="index.html">Home</a>
+<img src="images/docbook/ts75.png"><h1 class="doctitle">Traffic Server Software Developers Kit</h1>
+</div>
+<div class="navheader">
+<div class="navprev">
+<a accesskey="p" href="BlacklistPlugin.html">Prev</a> — The Blacklist Plugin</div>
+<div class="navnext">Setting Up UI Update Callbacks — <a accesskey="n" href="SettingUpUIUpdateCallbacks.html">Next</a>
+</div>
+</div>
+<div id="toc"></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="SettingGlobalHook"></a>Setting a Global Hook<a class="indexterm" name="id373254"></a></h3></div></div></div>
+<p>Global hooks are always added in INKPluginInit using
+        <code class="function">INKHttpHookAdd</code>. The two arguments of
+        <code class="function">INKHttpHookAdd</code> are the hook ID and the
+        continuation to call when processing the event corresponding to the
+        hook. In <code class="filename">blacklist-1.c</code>, the global hook is added
+        as follows:</p>
+<pre class="programlisting">INKHttpHookAdd (INK_HTTP_OS_DNS_HOOK, contp);</pre>
+<p>Where <code class="code">INK_HTTP_OS_DNS_HOOK</code> is the ID for the origin
+        server DNS lookup hook, and <code class="code">contp</code> is the parent
+        continuation created earlier.</p>
+<p>This means that the Blacklist plugin is called at every origin
+        server DNS lookup. When it is called, the handler function<code class="code">
+        blacklist_plugin</code> receives <code class="code">INK_EVENT_HTTP_OS_DNS</code>
+        and calls <code class="code">handle_dn</code>s to see if the request is
+        forbidden.</p>
+</div>
+</body>
+</html>

Propchange: incubator/trafficserver/site/trunk/docs/sdk/SettingGlobalHook.html
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/trafficserver/site/trunk/docs/sdk/SettingUpTransacHook.html
URL: http://svn.apache.org/viewvc/incubator/trafficserver/site/trunk/docs/sdk/SettingUpTransacHook.html?rev=831152&view=auto
==============================================================================
--- incubator/trafficserver/site/trunk/docs/sdk/SettingUpTransacHook.html (added)
+++ incubator/trafficserver/site/trunk/docs/sdk/SettingUpTransacHook.html Thu Oct 29 23:23:25 2009
@@ -0,0 +1,125 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Setting Up a Transaction Hook</title>
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/reset/reset-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/fonts/fonts-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/treeview/assets/tree.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc-chunk.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="index.html" title="Traffic Server Software Developers Kit">
+<link rel="up" href="BlacklistPlugin.html" title="The Blacklist Plugin">
+<link rel="prev" href="AccessingTransactionProc.html" title="Accessing the Transaction Being Processed">
+<link rel="next" href="WorkWHTTPHeaderFunc.html" title="Working with HTTP Header Functions">
+<link rel="preface" href="Preface.html" title="Preface">
+<link rel="chapter" href="GetingStarted.html" title="Chapter 1. Getting Started">
+<link rel="chapter" href="CreatingTSPlugins.html" title="Chapter 2. How to Create Traffic Server Plugins">
+<link rel="index" href="CreatingTSPlugins.html#id372630" title="Index">
+<link rel="chapter" href="ch03.html" title="Chapter 3. Remap Plugin">
+<link rel="chapter" href="HeaderBasedPluginEx.html" title="Chapter 4. Header-Based Plugin Examples">
+<link rel="chapter" href="HTTPTransformationPlugins.html" title="Chapter 5. HTTP Transformation Plugins">
+<link rel="chapter" href="NewProtocolPlugins.html" title="Chapter 6. New Protocol Plugins">
+<link rel="chapter" href="ch07.html" title="Chapter 7. Cache Plugin">
+<link rel="chapter" href="HTTPHooksAndTransactions.html" title="Chapter 8. HTTP Hooks and Transactions">
+<link rel="chapter" href="MiscellaneousInterfaceGuide.html" title="Chapter 9. Miscellaneous Interface Guide">
+<link rel="chapter" href="HTTPHeaders.html" title="Chapter 10. HTTP Headers">
+<link rel="chapter" href="MutexGuide.html" title="Chapter 11. Mutex Guide">
+<link rel="chapter" href="Continuations.html" title="Chapter 12. Continuations">
+<link rel="chapter" href="PluginConfigurations.html" title="Chapter 13. Plugin Configurations">
+<link rel="chapter" href="ActionsGuide.html" title="Chapter 14. Actions Guide">
+<link rel="chapter" href="IOGuide.html" title="Chapter 15. IO Guide">
+<link rel="chapter" href="PluginManagement.html" title="Chapter 16. Plugin Management">
+<link rel="chapter" href="AddingStatistics.html" title="Chapter 17. Adding Statistics">
+<link rel="chapter" href="FunctionReference.html" title="Chapter 18. Function Reference">
+<link rel="appendix" href="App_SampleSourceCode.html" title="Appendix A. Sample Source Code">
+<link rel="appendix" href="App_DeprecatedFunctions.html" title="Appendix B. Deprecated Functions">
+<link rel="appendix" href="App_Troubleshooting.html" title="Appendix C. Troubleshooting Tips">
+<link rel="appendix" href="FunctionIndex.html" title="Appendix D. Function Index">
+<link rel="appendix" href="TypeIndex.html" title="Appendix E. Type Index">
+<link rel="index" href="ConceptIndex.html" title="Index">
+<script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/yahoo/yahoo-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/event/event-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/treeview/treeview-min.js"></script><script type="text/javascript" src="js/tocnodes.js"></script><script type="text/javascript" src="js/toc.js"></script><script type="text/javascript">
+    document.write("<style> div.toc {display: none} </style>"); 
+  </script>
+</head>
+<body>
+<div class="doctitle">
+<a href="index.html">Home</a>
+<img src="images/docbook/ts75.png"><h1 class="doctitle">Traffic Server Software Developers Kit</h1>
+</div>
+<div class="navheader">
+<div class="navprev">
+<a accesskey="p" href="AccessingTransactionProc.html">Prev</a> — Accessing the Transaction Being Processed</div>
+<div class="navnext">Working with HTTP Header Functions — <a accesskey="n" href="WorkWHTTPHeaderFunc.html">Next</a>
+</div>
+</div>
+<div id="toc"></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="SettingUpTransacHook"></a>Setting Up a Transaction Hook<a class="indexterm" name="id373445"></a></h3></div></div></div>
+<p>The Blacklist plugin sends “access forbidden” messages to
+        clients if their requests are directed to blacklisted hosts. Therefore
+        the plugin needs a transaction hook, so that it is called back when
+        Traffic Server’s HTTP state machine reaches the “send response header”
+        event. In the Blacklist plugin’s <code class="code">handle_dns</code> routine, the
+        transaction hook is added as follows:</p>
+<pre class="programlisting">INKMutexLock (sites_mutex);
+for (i = 0; i &lt; nsites; i++) {
+     if (strncmp (host, sites[i], host_length) == 0) {
+          printf ("blacklisting site: %s\n", sites[i]);
+          INKHttpTxnHookAdd (txnp,
+               INK_HTTP_SEND_RESPONSE_HDR_HOOK,
+               contp);
+          INKHandleStringRelease (bufp, url_loc, host);
+          INKHandleMLocRelease (bufp, hdr_loc, url_loc);
+          INKHandleMLocRelease (bufp, INK_NULL_MLOC, hdr_loc);
+          INKHttpTxnReenable (txnp, INK_EVENT_HTTP_ERROR);
+     INKMutexUnlock (sites_mutex);
+     return;
+     }
+}
+     INKMutexUnlock (sites_mutex);
+     done:
+          INKHttpTxnReenable (txnp, INK_EVENT_HTTP_CONTINUE);
+}</pre>
+<p>This code fragment shows some interesting features. What’s
+        happening is that the plugin is comparing the requested site to the
+        list of blacklisted sites. While the plugin is using the blacklist, it
+        must acquire the mutex lock for the blacklist. This prevents
+        configuration changes in the middle of a blacklisting operation. If
+        the requested site is blacklisted, two things happen:</p>
+<div class="orderedlist"><ol type="1">
+<li><p>A transaction hook is added with
+            <code class="code">INKHttpTxnHookAdd</code>, so that the plugin is called back
+            at the “send response header” event (the plugin sends an “access
+            forbidden” message to the client). You can see that in order to
+            add a transaction hook, you need a handle to the transaction being
+            processed.</p></li>
+<li><p>The transaction is reenabled using
+            <code class="code">INKHttpTxnReenable</code> with
+            <code class="code">INK_EVENT_HTTP_ERROR</code> as its event argument.
+            Reenabling with an error event tells the HTTP state machine to
+            stop the transaction and jump to the “send response header” state.
+            Notice that if the requested site is not blacklisted, the
+            transaction is reenabled with the
+            <code class="code">INK_EVENT_HTTP_CONTINUE</code> event.</p></li>
+<li><p>The string and <code class="function">INKMLoc</code> data stored in
+            the marshal buffer <code class="code">bufp</code> is released by
+            <code class="function">INKHandleStringRelease</code> and
+            <code class="code">INKHandleMLocRelease</code>. See <a href="RlsMarshalBufHandles.html" title="Release Marshal Buffer Handles">“Release Marshal Buffer Handles”</a>. Release these handles before
+            reenabling the transaction.</p></li>
+</ol></div>
+<p>In general, whenever the plugin is doing something to a
+        transaction, it must reenable the transaction when it is finished. Put
+        another way, every time your handler function handles a transaction
+        event, it must call <code class="code">INKHttpTxnReenable</code> when it is
+        finished.</p>
+<p>Similarly, after your plugin handles session events
+        (<code class="code">INK_EVENT_HTTP_SSN_START</code> and
+        <code class="code">INK_EVENT_HTTP_SSN_CLOSE</code>) it must reenable the session
+        with <code class="code">INKHttpSsnReenable</code>.</p>
+<p>Reenabling the transaction twice in the same plugin routine is a
+        bad error.</p>
+</div>
+</body>
+</html>

Propchange: incubator/trafficserver/site/trunk/docs/sdk/SettingUpTransacHook.html
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/trafficserver/site/trunk/docs/sdk/SettingUpUIUpdateCallbacks.html
URL: http://svn.apache.org/viewvc/incubator/trafficserver/site/trunk/docs/sdk/SettingUpUIUpdateCallbacks.html?rev=831152&view=auto
==============================================================================
--- incubator/trafficserver/site/trunk/docs/sdk/SettingUpUIUpdateCallbacks.html (added)
+++ incubator/trafficserver/site/trunk/docs/sdk/SettingUpUIUpdateCallbacks.html Thu Oct 29 23:23:25 2009
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Setting Up UI Update Callbacks</title>
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/reset/reset-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/fonts/fonts-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/treeview/assets/tree.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc-chunk.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="index.html" title="Traffic Server Software Developers Kit">
+<link rel="up" href="BlacklistPlugin.html" title="The Blacklist Plugin">
+<link rel="prev" href="SettingGlobalHook.html" title="Setting a Global Hook">
+<link rel="next" href="AccessingTransactionProc.html" title="Accessing the Transaction Being Processed">
+<link rel="preface" href="Preface.html" title="Preface">
+<link rel="chapter" href="GetingStarted.html" title="Chapter 1. Getting Started">
+<link rel="chapter" href="CreatingTSPlugins.html" title="Chapter 2. How to Create Traffic Server Plugins">
+<link rel="index" href="CreatingTSPlugins.html#id372630" title="Index">
+<link rel="chapter" href="ch03.html" title="Chapter 3. Remap Plugin">
+<link rel="chapter" href="HeaderBasedPluginEx.html" title="Chapter 4. Header-Based Plugin Examples">
+<link rel="chapter" href="HTTPTransformationPlugins.html" title="Chapter 5. HTTP Transformation Plugins">
+<link rel="chapter" href="NewProtocolPlugins.html" title="Chapter 6. New Protocol Plugins">
+<link rel="chapter" href="ch07.html" title="Chapter 7. Cache Plugin">
+<link rel="chapter" href="HTTPHooksAndTransactions.html" title="Chapter 8. HTTP Hooks and Transactions">
+<link rel="chapter" href="MiscellaneousInterfaceGuide.html" title="Chapter 9. Miscellaneous Interface Guide">
+<link rel="chapter" href="HTTPHeaders.html" title="Chapter 10. HTTP Headers">
+<link rel="chapter" href="MutexGuide.html" title="Chapter 11. Mutex Guide">
+<link rel="chapter" href="Continuations.html" title="Chapter 12. Continuations">
+<link rel="chapter" href="PluginConfigurations.html" title="Chapter 13. Plugin Configurations">
+<link rel="chapter" href="ActionsGuide.html" title="Chapter 14. Actions Guide">
+<link rel="chapter" href="IOGuide.html" title="Chapter 15. IO Guide">
+<link rel="chapter" href="PluginManagement.html" title="Chapter 16. Plugin Management">
+<link rel="chapter" href="AddingStatistics.html" title="Chapter 17. Adding Statistics">
+<link rel="chapter" href="FunctionReference.html" title="Chapter 18. Function Reference">
+<link rel="appendix" href="App_SampleSourceCode.html" title="Appendix A. Sample Source Code">
+<link rel="appendix" href="App_DeprecatedFunctions.html" title="Appendix B. Deprecated Functions">
+<link rel="appendix" href="App_Troubleshooting.html" title="Appendix C. Troubleshooting Tips">
+<link rel="appendix" href="FunctionIndex.html" title="Appendix D. Function Index">
+<link rel="appendix" href="TypeIndex.html" title="Appendix E. Type Index">
+<link rel="index" href="ConceptIndex.html" title="Index">
+<script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/yahoo/yahoo-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/event/event-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/treeview/treeview-min.js"></script><script type="text/javascript" src="js/tocnodes.js"></script><script type="text/javascript" src="js/toc.js"></script><script type="text/javascript">
+    document.write("<style> div.toc {display: none} </style>"); 
+  </script>
+</head>
+<body>
+<div class="doctitle">
+<a href="index.html">Home</a>
+<img src="images/docbook/ts75.png"><h1 class="doctitle">Traffic Server Software Developers Kit</h1>
+</div>
+<div class="navheader">
+<div class="navprev">
+<a accesskey="p" href="SettingGlobalHook.html">Prev</a> — Setting a Global Hook</div>
+<div class="navnext">Accessing the Transaction Being Processed — <a accesskey="n" href="AccessingTransactionProc.html">Next</a>
+</div>
+</div>
+<div id="toc"></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="SettingUpUIUpdateCallbacks"></a>Setting Up UI Update Callbacks</h3></div></div></div>
+<p>The Blacklist plugin must be called back whenever its
+        configuration is changed by an administrator through the Traffic
+        Manager UI. To get the interface working, you need an interface
+        program (such as a CGI form) to display an interface and obtain
+        configuration information, and a text file that the CGI program edits
+        and the Blacklist plugin reads. The callback to the plugin is
+        established in <code class="function">INKPluginInit</code> by:</p>
+<pre class="programlisting">INKMgmtUpdateRegister (contp, "Inktomi Blacklist Plugin", "blacklist.cgi");</pre>
+<p>Where <code class="code">contp</code> is the plugin’s static parent
+        continuation, “Inktomi Blacklist Plugin” is the name of the plugin as
+        specified by the CGI form’s <code class="code">INK_PLUGIN_NAME</code> variable, and
+        "<code class="filename">blacklist.cgi</code>" is the path to the plugin’s
+        interface program, relative to the Traffic Server plugins directory.
+        For more details see <a href="PluginManagement.html#SetUpPluginMgmtInterface" title="Setting Up a Plugin Management Interface">“Setting Up a Plugin Management Interface”</a>.</p>
+</div>
+</body>
+</html>

Propchange: incubator/trafficserver/site/trunk/docs/sdk/SettingUpUIUpdateCallbacks.html
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/trafficserver/site/trunk/docs/sdk/SpecifyingPluginLocation.html
URL: http://svn.apache.org/viewvc/incubator/trafficserver/site/trunk/docs/sdk/SpecifyingPluginLocation.html?rev=831152&view=auto
==============================================================================
--- incubator/trafficserver/site/trunk/docs/sdk/SpecifyingPluginLocation.html (added)
+++ incubator/trafficserver/site/trunk/docs/sdk/SpecifyingPluginLocation.html Thu Oct 29 23:23:25 2009
@@ -0,0 +1,76 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Specify the Plugin’s Location</title>
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/reset/reset-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/fonts/fonts-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/treeview/assets/tree.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc-chunk.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="index.html" title="Traffic Server Software Developers Kit">
+<link rel="up" href="ASimplePlugin.html" title="A Simple Plugin">
+<link rel="prev" href="Updatingplugin.configFile.html" title="Update the plugin.config File">
+<link rel="next" href="RestartingTS.html" title="Restart Traffic Server">
+<link rel="preface" href="Preface.html" title="Preface">
+<link rel="chapter" href="GetingStarted.html" title="Chapter 1. Getting Started">
+<link rel="chapter" href="CreatingTSPlugins.html" title="Chapter 2. How to Create Traffic Server Plugins">
+<link rel="index" href="CreatingTSPlugins.html#id372630" title="Index">
+<link rel="chapter" href="ch03.html" title="Chapter 3. Remap Plugin">
+<link rel="chapter" href="HeaderBasedPluginEx.html" title="Chapter 4. Header-Based Plugin Examples">
+<link rel="chapter" href="HTTPTransformationPlugins.html" title="Chapter 5. HTTP Transformation Plugins">
+<link rel="chapter" href="NewProtocolPlugins.html" title="Chapter 6. New Protocol Plugins">
+<link rel="chapter" href="ch07.html" title="Chapter 7. Cache Plugin">
+<link rel="chapter" href="HTTPHooksAndTransactions.html" title="Chapter 8. HTTP Hooks and Transactions">
+<link rel="chapter" href="MiscellaneousInterfaceGuide.html" title="Chapter 9. Miscellaneous Interface Guide">
+<link rel="chapter" href="HTTPHeaders.html" title="Chapter 10. HTTP Headers">
+<link rel="chapter" href="MutexGuide.html" title="Chapter 11. Mutex Guide">
+<link rel="chapter" href="Continuations.html" title="Chapter 12. Continuations">
+<link rel="chapter" href="PluginConfigurations.html" title="Chapter 13. Plugin Configurations">
+<link rel="chapter" href="ActionsGuide.html" title="Chapter 14. Actions Guide">
+<link rel="chapter" href="IOGuide.html" title="Chapter 15. IO Guide">
+<link rel="chapter" href="PluginManagement.html" title="Chapter 16. Plugin Management">
+<link rel="chapter" href="AddingStatistics.html" title="Chapter 17. Adding Statistics">
+<link rel="chapter" href="FunctionReference.html" title="Chapter 18. Function Reference">
+<link rel="appendix" href="App_SampleSourceCode.html" title="Appendix A. Sample Source Code">
+<link rel="appendix" href="App_DeprecatedFunctions.html" title="Appendix B. Deprecated Functions">
+<link rel="appendix" href="App_Troubleshooting.html" title="Appendix C. Troubleshooting Tips">
+<link rel="appendix" href="FunctionIndex.html" title="Appendix D. Function Index">
+<link rel="appendix" href="TypeIndex.html" title="Appendix E. Type Index">
+<link rel="index" href="ConceptIndex.html" title="Index">
+<script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/yahoo/yahoo-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/event/event-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/treeview/treeview-min.js"></script><script type="text/javascript" src="js/tocnodes.js"></script><script type="text/javascript" src="js/toc.js"></script><script type="text/javascript">
+    document.write("<style> div.toc {display: none} </style>"); 
+  </script>
+</head>
+<body>
+<div class="doctitle">
+<a href="index.html">Home</a>
+<img src="images/docbook/ts75.png"><h1 class="doctitle">Traffic Server Software Developers Kit</h1>
+</div>
+<div class="navheader">
+<div class="navprev">
+<a accesskey="p" href="Updatingplugin.configFile.html">Prev</a> — Update the <code class="filename">plugin.config</code> File</div>
+<div class="navnext">Restart Traffic Server — <a accesskey="n" href="RestartingTS.html">Next</a>
+</div>
+</div>
+<div id="toc"></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="SpecifyingPluginLocation"></a>Specify the Plugin’s Location</h3></div></div></div>
+<p>All plugins must be located in the directory specified by the
+        configuration variable
+        <code class="varname">proxy.config.plugin.plugin_dir</code>, which is located in
+        the <code class="filename">records.config</code> file. The directory can be
+        specified as an absolute or relative path.</p>
+<p>If a relative path is used, then the starting directory will be
+        the Traffic Server installation directory as specified in
+        <code class="filename">/etc/traffic_server</code>. The default value is
+        <code class="code">config/plugins</code>, which tells Traffic Server to use the
+        directory plugins located in the same configuration directory as
+        <code class="filename">records.config</code>. It is common to use the default
+        directory. Be sure to place the shared library
+        <code class="filename">hello-world.so</code> inside the directory you have
+        configured.</p>
+</div>
+</body>
+</html>

Propchange: incubator/trafficserver/site/trunk/docs/sdk/SpecifyingPluginLocation.html
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/trafficserver/site/trunk/docs/sdk/StatisticsFunctions.html
URL: http://svn.apache.org/viewvc/incubator/trafficserver/site/trunk/docs/sdk/StatisticsFunctions.html?rev=831152&view=auto
==============================================================================
--- incubator/trafficserver/site/trunk/docs/sdk/StatisticsFunctions.html (added)
+++ incubator/trafficserver/site/trunk/docs/sdk/StatisticsFunctions.html Thu Oct 29 23:23:25 2009
@@ -0,0 +1,260 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Statistics Functions</title>
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/reset/reset-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/fonts/fonts-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/treeview/assets/tree.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc-chunk.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="index.html" title="Traffic Server Software Developers Kit">
+<link rel="up" href="FunctionReference.html" title="Chapter 18. Function Reference">
+<link rel="prev" href="INKPluginLicenseRequired.html" title="INKPluginLicenseRequired">
+<link rel="next" href="CoupledStatsFunctions.html" title="Coupled Statistics">
+<link rel="preface" href="Preface.html" title="Preface">
+<link rel="chapter" href="GetingStarted.html" title="Chapter 1. Getting Started">
+<link rel="chapter" href="CreatingTSPlugins.html" title="Chapter 2. How to Create Traffic Server Plugins">
+<link rel="index" href="CreatingTSPlugins.html#id372630" title="Index">
+<link rel="chapter" href="ch03.html" title="Chapter 3. Remap Plugin">
+<link rel="chapter" href="HeaderBasedPluginEx.html" title="Chapter 4. Header-Based Plugin Examples">
+<link rel="chapter" href="HTTPTransformationPlugins.html" title="Chapter 5. HTTP Transformation Plugins">
+<link rel="chapter" href="NewProtocolPlugins.html" title="Chapter 6. New Protocol Plugins">
+<link rel="chapter" href="ch07.html" title="Chapter 7. Cache Plugin">
+<link rel="chapter" href="HTTPHooksAndTransactions.html" title="Chapter 8. HTTP Hooks and Transactions">
+<link rel="chapter" href="MiscellaneousInterfaceGuide.html" title="Chapter 9. Miscellaneous Interface Guide">
+<link rel="chapter" href="HTTPHeaders.html" title="Chapter 10. HTTP Headers">
+<link rel="chapter" href="MutexGuide.html" title="Chapter 11. Mutex Guide">
+<link rel="chapter" href="Continuations.html" title="Chapter 12. Continuations">
+<link rel="chapter" href="PluginConfigurations.html" title="Chapter 13. Plugin Configurations">
+<link rel="chapter" href="ActionsGuide.html" title="Chapter 14. Actions Guide">
+<link rel="chapter" href="IOGuide.html" title="Chapter 15. IO Guide">
+<link rel="chapter" href="PluginManagement.html" title="Chapter 16. Plugin Management">
+<link rel="chapter" href="AddingStatistics.html" title="Chapter 17. Adding Statistics">
+<link rel="chapter" href="FunctionReference.html" title="Chapter 18. Function Reference">
+<link rel="appendix" href="App_SampleSourceCode.html" title="Appendix A. Sample Source Code">
+<link rel="appendix" href="App_DeprecatedFunctions.html" title="Appendix B. Deprecated Functions">
+<link rel="appendix" href="App_Troubleshooting.html" title="Appendix C. Troubleshooting Tips">
+<link rel="appendix" href="FunctionIndex.html" title="Appendix D. Function Index">
+<link rel="appendix" href="TypeIndex.html" title="Appendix E. Type Index">
+<link rel="index" href="ConceptIndex.html" title="Index">
+<link rel="subsection" href="StatisticsFunctions.html#UncoupledStatsFuncs" title="Uncoupled Statistics">
+<link rel="subsection" href="CoupledStatsFunctions.html" title="Coupled Statistics">
+<script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/yahoo/yahoo-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/event/event-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/treeview/treeview-min.js"></script><script type="text/javascript" src="js/tocnodes.js"></script><script type="text/javascript" src="js/toc.js"></script><script type="text/javascript">
+    document.write("<style> div.toc {display: none} </style>"); 
+  </script>
+</head>
+<body>
+<div class="doctitle">
+<a href="index.html">Home</a>
+<img src="images/docbook/ts75.png"><h1 class="doctitle">Traffic Server Software Developers Kit</h1>
+</div>
+<div class="navheader">
+<div class="navprev">
+<a accesskey="p" href="INKPluginLicenseRequired.html">Prev</a> — INKPluginLicenseRequired</div>
+<div class="navnext">Coupled Statistics — <a accesskey="n" href="CoupledStatsFunctions.html">Next</a>
+</div>
+</div>
+<div id="toc"></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="StatisticsFunctions"></a>Statistics Functions</h2></div></div></div>
+<p></p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="UncoupledStatsFuncs"></a>Uncoupled Statistics</h3></div></div></div>
+<p></p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKStatFloatGet"></a>INKStatFloatGet</h4></div></div></div>
+<p>Obtains the value of a float stat.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKStatFloatGet(INKStat
+                <em class="replaceable"><code>stat</code></em>, float
+                *<em class="replaceable"><code>value</code></em>)</code></p></dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the API is called
+                successfully.</p>
+<p><code class="code">INK_ERROR</code> if an error occurs while calling
+                the API or if an argument is invalid.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.5</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKStatIntGet"></a>INKStatIntGet</h4></div></div></div>
+<p>Obtains the value of an integer stat.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKStatIntGet(INKStat stat, INK64
+                *value)</code></p></dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the API is called
+                successfully.</p>
+<p><code class="code">INK_ERROR</code> if an error occurs while calling
+                the API or if an argument is invalid.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.5</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKStatFloatAddTo"></a>INKStatFloatAddTo</h4></div></div></div>
+<p>Adds a float value to a float statistic.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKStatFloatAddTo ( INKStat
+                the_stat, float amount)</code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd><p>Adds a float value to a float statistic.</p></dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the operation completes
+                successfully.</p>
+<p><code class="code">INK_ERROR</code> if an error occurs.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.5</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKStatIntAddTo"></a>INKStatIntAddTo</h4></div></div></div>
+<p>Adds an INK64 value to an integer statistic.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKStatIntAddTo ( INKStat the_stat,
+                INK64 amount)</code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd><p>Adds an INK64 value to an integer statistic</p></dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the operation completes
+                successfully.</p>
+<p><code class="code">INK_ERROR</code> if an error occurs.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.5</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKStatCreate"></a>INKStatCreate</h4></div></div></div>
+<p>Creates a new <code class="code">INKStat</code>.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKStat INKStatCreate ( const char *
+                <em class="replaceable"><code>the_name</code></em>, INKStatTypes
+                <em class="replaceable"><code>the_type</code></em>)</code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd><p>Creates a new <code class="code">INKStat</code>. The value pointed to
+                by <code class="code"><em class="replaceable"><code>the_name</code></em></code> is the
+                name you use to view the statistic using Traffic Line. See
+                <a href="ViewStatsUsingTrafLine.html" title="Viewing Statistics Using Traffic Line">“Viewing Statistics Using Traffic Line”</a>. There are two
+                <code class="code">INKStatTypes</code>: <code class="code">INKSTAT_TYPE_INT64</code>,
+                and <code class="code">INKSTAT_TYPE_FLOAT</code>.</p></dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p>A handle to the newly created
+                <code class="code">INKStat</code>.</p>
+<p><code class="code">INK_ERROR_PTR</code> if an error occurs.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.5</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKStatDecrement"></a>INKStatDecrement</h4></div></div></div>
+<p>Decrements a stat.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKStatDecrement(INKStat
+                <em class="replaceable"><code>the_stat</code></em> )</code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd><p>Decrements a stat.</p></dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the operation completes
+                successfully.</p>
+<p><code class="code">INK_ERROR</code> if an error occurs.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.5</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKStatIncrement"></a>INKStatIncrement</h4></div></div></div>
+<p>Increments a stat.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKStatIncrement(INKStat
+                <em class="replaceable"><code>the_stat</code></em> )</code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd><p>Increments a stat.</p></dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the operation completes
+                successfully.</p>
+<p><code class="code">INK_ERROR</code> if an error occurs.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.5</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKStatFloatSet"></a>INKStatFloatSet</h4></div></div></div>
+<p>Sets the value of a float stat to a particular value.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKStatFloatSet(INKStat
+                <em class="replaceable"><code>the_stat</code></em> , float
+                <em class="replaceable"><code>the_value</code></em> )</code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd><p>Sets the value of a float stat to the specified
+                value.</p></dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the operation completes
+                successfully.</p>
+<p><code class="code">INK_ERROR</code> if an error occurs.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.5</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKStatIntSet"></a>INKStatIntSet</h4></div></div></div>
+<p>Sets the value of an integer stat to a particular
+          value.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKStatIntSet(INKStat
+                <em class="replaceable"><code>the_stat</code></em> , INK64
+                <em class="replaceable"><code>the_value</code></em> )</code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd><p>Sets the value of a integer stat to a particular
+                value.</p></dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the operation completes
+                successfully.</p>
+<p><code class="code">INK_ERROR</code> if an error occurs.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.5</p></dd>
+</dl></div>
+</div>
+</div>
+</div>
+</body>
+</html>

Propchange: incubator/trafficserver/site/trunk/docs/sdk/StatisticsFunctions.html
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message