You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bu...@apache.org on 2010/11/06 07:31:10 UTC

svn commit: r778776 [8/21] - in /websites/staging/trafficserver/trunk/content/docs/trunk: admin/ sdk/

Modified: websites/staging/trafficserver/trunk/content/docs/trunk/sdk/HTTPHooksAndTransactions.en.html
URL: http://svn.apache.org/viewvc/websites/staging/trafficserver/trunk/content/docs/trunk/sdk/HTTPHooksAndTransactions.en.html?rev=778776&r1=778775&r2=778776&view=diff
==============================================================================
--- websites/staging/trafficserver/trunk/content/docs/trunk/sdk/HTTPHooksAndTransactions.en.html (original)
+++ websites/staging/trafficserver/trunk/content/docs/trunk/sdk/HTTPHooksAndTransactions.en.html Sat Nov  6 06:31:06 2010
@@ -4,14 +4,15 @@
 <html>
   <!-- This template is for the bulk of the site! -->
   <head>
+    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
     
     
-    <title></title>
-    
+    <title>Apache Traffic Server™ Software Developers Kit</title>
+    <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License.  You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License. -->
   </head>
 
   <body>
-    <h1></h1>
+    <h1>Apache Traffic Server™ Software Developers Kit</h1>
 
   <div id="content">
       <p><a href="ch07s05">Prev</a> - Cache Events

Modified: websites/staging/trafficserver/trunk/content/docs/trunk/sdk/HTTPSessionFunctions.en.html
URL: http://svn.apache.org/viewvc/websites/staging/trafficserver/trunk/content/docs/trunk/sdk/HTTPSessionFunctions.en.html?rev=778776&r1=778775&r2=778776&view=diff
==============================================================================
--- websites/staging/trafficserver/trunk/content/docs/trunk/sdk/HTTPSessionFunctions.en.html (original)
+++ websites/staging/trafficserver/trunk/content/docs/trunk/sdk/HTTPSessionFunctions.en.html Sat Nov  6 06:31:06 2010
@@ -4,17 +4,110 @@
 <html>
   <!-- This template is for the bulk of the site! -->
   <head>
+    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
     
     
-    <title></title>
-    
+    <title>Apache Traffic Server™ Software Developers Kit</title>
+    <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License.  You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License. -->
   </head>
 
   <body>
-    <h1></h1>
+    <h1>Apache Traffic Server™ Software Developers Kit</h1>
 
   <div id="content">
-      
+      <p><a href="HTTPFunctions">Prev</a> - HTTP Functions
+HTTP Transaction Functions - <a href="HTTPTransactionFunctions">Next</a></p>
+<h3 id="session_functions">Session Functions</h3>
+<ul>
+<li><strong><a href="HTTPSessionFunctions#INKHttpSsnHookAdd">INKHttpSsnHookAdd</a></strong></li>
+<li><strong><a href="HTTPSessionFunctions#INKHttpSsnReenable">INKHttpSsnReenable</a></strong><a href="HTTPSessionFunctions#INKHttpSsnReenable" /></li>
+</ul>
+<h4 id="inkhttpssnhookadd">INKHttpSsnHookAdd</h4>
+<p>Adds an HTTP session hook.</p>
+<p><strong>Prototype</strong>
+  ~ <code>INKReturnCode INKHttpSsnHookAdd (INKHttpSsn                 &lt;em class="replaceable"&gt;&lt;code&gt;ssnp</code>,
+    INKHttpHookID <em><code>id</code></em>, INKCont <em><code>contp</code></em>)</p>
+<p><strong>Description</strong>
+  ~ Adds <code>&lt;em class="replaceable"&gt;&lt;code&gt;contp</code> to the end of the
+    list of HTTP transaction hooks specified by
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;id</code>. This means that
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;contp</code> is called back for every
+    transaction within the session, at the point specified by the hook
+    ID. Since <code>&lt;em class="replaceable"&gt;&lt;code&gt;contp</code> is added to a
+    session, it is not possible to call <code>INKHttpSsnHookAdd</code> from the
+    plugin initialization routine. Therefore, the plugin needs a handle
+    to an HTTP session (see the
+    <a href="HTTPSessionFunctions#INKEvent_1">example</a> below).</p>
+<p><strong>Example</strong>
+  ~     #include ts.h</p>
+<div class="codehilite"><pre>    <span class="n">static</span> <span class="n">void</span> <span class="n">txn_handler</span> <span class="p">(</span><span class="n">INKHttpTxn</span> <span class="n">txnp</span><span class="p">,</span> <span class="n">INKCont</span> <span class="n">contp</span><span class="p">)</span>
+    <span class="p">{</span>
+         <span class="sr">//</span><span class="n">handle</span> <span class="n">transaction</span>
+    <span class="p">}</span>
+
+    <span class="n">static</span> <span class="n">void</span> <span class="n">handle_session</span> <span class="p">(</span><span class="n">INKHttpSsn</span> <span class="n">ssnp</span><span class="p">,</span> <span class="n">INKCont</span> <span class="n">contp</span><span class="p">)</span>
+    <span class="p">{</span>
+         <span class="n">INKHttpSsnHookAdd</span> <span class="p">(</span><span class="n">ssnp</span><span class="p">,</span> <span class="n">INK_HTTP_TXN_START_HOOK</span><span class="p">,</span> <span class="n">contp</span><span class="p">);</span>
+    <span class="p">}</span>
+
+    <span class="n">static</span> <span class="nb">int</span> <span class="n">ssn_handler</span> <span class="p">(</span><span class="n">INKCont</span> <span class="n">contp</span><span class="p">,</span> <span class="n">INKEvent</span> <span class="n">event</span><span class="p">,</span> <span class="n">void</span> <span class="o">*</span><span class="n">edata</span><span class="p">)</span>
+    <span class="p">{</span>
+        <span class="n">INKHttpSsn</span> <span class="n">ssnp</span><span class="p">;</span>
+        <span class="n">INKHttpTxn</span> <span class="n">txnp</span><span class="p">;</span>
+
+        <span class="n">switch</span> <span class="p">(</span><span class="n">event</span><span class="p">){</span>
+        <span class="k">case</span> <span class="n">INK_EVENT_HTTP_SSN_START:</span> 
+           <span class="n">ssnp</span> <span class="o">=</span> <span class="p">(</span><span class="n">INKHttpSsn</span><span class="p">)</span> <span class="n">edata</span><span class="p">;</span>
+           <span class="n">handle_session</span> <span class="p">(</span><span class="n">ssnp</span><span class="p">,</span> <span class="n">contp</span><span class="p">);</span>
+           <span class="n">INKHttpSsnReenable</span> <span class="p">(</span><span class="n">ssnp</span><span class="p">,</span> <span class="n">INK_EVENT_HTTP_CONTINUE</span><span class="p">);</span> 
+           <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+        <span class="k">case</span> <span class="n">INK_EVENT_HTTP_TXN_START:</span>
+           <span class="n">txnp</span> <span class="o">=</span> <span class="p">(</span><span class="n">INKHttpTxn</span><span class="p">)</span> <span class="n">edata</span><span class="p">;</span>
+           <span class="n">txn_handler</span> <span class="p">(</span><span class="n">txnp</span><span class="p">,</span> <span class="n">contp</span><span class="p">);</span>
+           <span class="n">INKHttpTxnReenable</span> <span class="p">(</span><span class="n">txnp</span><span class="p">,</span> <span class="n">INK_EVENT_HTTP_CONTINUE</span><span class="p">);</span>
+           <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+
+        <span class="n">default:</span>
+             <span class="n">break</span><span class="p">;</span> 
+        <span class="p">}</span>
+        <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="p">}</span>
+
+    <span class="n">void</span> <span class="n">INKPluginInit</span> <span class="p">(</span><span class="nb">int</span> <span class="n">argc</span><span class="p">,</span> <span class="n">const</span> <span class="n">char</span> <span class="o">*</span><span class="n">argv</span><span class="o">[]</span><span class="p">)</span>
+    <span class="p">{</span>
+        <span class="n">INKCont</span> <span class="n">contp</span><span class="p">;</span>
+        <span class="n">contp</span> <span class="o">=</span> <span class="n">INKContCreate</span> <span class="p">(</span><span class="n">ssn_handler</span><span class="p">,</span> <span class="n">NULL</span><span class="p">);</span>
+        <span class="n">INKHttpHookAdd</span> <span class="p">(</span><span class="n">INK_HTTP_SSN_START_HOOK</span><span class="p">,</span> <span class="n">contp</span><span class="p">);</span>
+    <span class="p">}</span>
+</pre></div>
+
+
+<p>~  
+<strong>Returns</strong>
+  ~ <code>INK_SUCCESS</code> if the hook is successfully added.</p>
+<div class="codehilite"><pre><span class="sb">`INK_ERROR`</span> <span class="k">if</span> <span class="n">the</span> <span class="n">hook</span> <span class="n">is</span> <span class="ow">not</span> <span class="n">added</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttpssnreenable">INKHttpSsnReenable</h4>
+<p>Reenables an HTTP session.</p>
+<p><strong>Prototype</strong>
+  ~ <code>INKReturnCode INKHttpSsnReenable (INKHttpSsn                 &lt;em class="replaceable"&gt;&lt;code&gt;ssnp</code>,
+    INKEvent <em><code>event</code></em>)</p>
+<p><strong>Description</strong>
+  ~ Notifies the HTTP session <code>&lt;em class="replaceable"&gt;&lt;code&gt; ssnp</code>
+    that the plugin is done processing the current hook.</p>
+<p>~ If <code>INK_EVENT_HTTP_CONTINUE</code> is specified for
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;event</code>, then the plugin wants the
+    session to continue. If <code>INK_EVENT_HTTP_ERROR</code> is specified for
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt; event</code>, then the plugin wants the
+    session to be terminated. An error is then sent back to the client
+    if no response has already been sent.</p>
+<p><strong>Returns</strong>
+  ~ <code>INK_SUCCESS</code> if the session is successfully reenabled.</p>
+<div class="codehilite"><pre><span class="sb">`INK_ERROR`</span> <span class="k">if</span> <span class="n">the</span> <span class="n">hook</span> <span class="n">is</span> <span class="ow">not</span> <span class="n">added</span><span class="o">.</span>
+</pre></div>
   </div>
 
   <div id="footer">

Modified: websites/staging/trafficserver/trunk/content/docs/trunk/sdk/HTTPSessions.en.html
URL: http://svn.apache.org/viewvc/websites/staging/trafficserver/trunk/content/docs/trunk/sdk/HTTPSessions.en.html?rev=778776&r1=778775&r2=778776&view=diff
==============================================================================
--- websites/staging/trafficserver/trunk/content/docs/trunk/sdk/HTTPSessions.en.html (original)
+++ websites/staging/trafficserver/trunk/content/docs/trunk/sdk/HTTPSessions.en.html Sat Nov  6 06:31:06 2010
@@ -4,17 +4,53 @@
 <html>
   <!-- This template is for the bulk of the site! -->
   <head>
+    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
     
     
-    <title></title>
-    
+    <title>Apache Traffic Server™ Software Developers Kit</title>
+    <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License.  You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License. -->
   </head>
 
   <body>
-    <h1></h1>
+    <h1>Apache Traffic Server™ Software Developers Kit</h1>
 
   <div id="content">
-      
+      <p><a href="AddingHooks">Prev</a> - Adding Hooks
+HTTP Transactions - <a href="HTTP_Transactions">Next</a></p>
+<h2 id="http_sessions">HTTP Sessions</h2>
+<p>An <strong>HTTP session</strong> is an object that is defined for the lifetime
+of a client's TCP session. The Traffic Server API enables you to
+add a global hook to the start or end of an HTTP session, as well
+as add session hooks that call back your plugin for every
+transaction within a given session. When a client connects to
+Traffic Server, it opens up a TCP connection and sends one or more
+HTTP requests. An individual request and its response comprise the
+HTTP transaction. The <strong>HTTP session</strong> begins when the client opens
+the connection and ends when the connection closes.</p>
+<p>The HTTP session hooks are:</p>
+<ul>
+<li>
+<p><code>INK_HTTP_SSN_START_HOOK&lt;a class="indexterm" name="id378868"&gt;&lt;/a&gt;</code></p>
+<p>Called when an HTTP session is started (a session starts when a
+client connects to Traffic Server). This hook must be added as a
+global hook.</p>
+</li>
+<li>
+<p><code>INK_HTTP_SSN_CLOSE_HOOK&lt;a class="indexterm" name="id378886"&gt;&lt;/a&gt;</code></p>
+<p>Called when an HTTP session ends (a session ends when the client
+connection is closed). This hook must be added as a global hook.</p>
+</li>
+</ul>
+<p>Use the session hooks to get a handle to a session (an <code>INKHttpSsn</code>
+object). If you want your plugin to be called back for each
+transaction within the session, then use <code>INKHttpSsnHookAdd</code>.</p>
+<p><strong>Note:</strong> you must reenable the session with <code>INKHttpSsnReenable</code>
+after processing a session hook.</p>
+<p>The session hook functions are listed below:</p>
+<ul>
+<li><a href="HTTPSessionFunctions#INKHttpSsnHookAdd" title="INKHttpSsnHookAdd">INKHttpSsnHookAdd</a></li>
+<li><a href="HTTPSessionFunctions#INKHttpSsnReenable" title="INKHttpSsnReenable">INKHttpSsnReenable</a></li>
+</ul>
   </div>
 
   <div id="footer">

Modified: websites/staging/trafficserver/trunk/content/docs/trunk/sdk/HTTPTransactionFunctions.en.html
URL: http://svn.apache.org/viewvc/websites/staging/trafficserver/trunk/content/docs/trunk/sdk/HTTPTransactionFunctions.en.html?rev=778776&r1=778775&r2=778776&view=diff
==============================================================================
--- websites/staging/trafficserver/trunk/content/docs/trunk/sdk/HTTPTransactionFunctions.en.html (original)
+++ websites/staging/trafficserver/trunk/content/docs/trunk/sdk/HTTPTransactionFunctions.en.html Sat Nov  6 06:31:06 2010
@@ -4,17 +4,796 @@
 <html>
   <!-- This template is for the bulk of the site! -->
   <head>
+    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
     
     
-    <title></title>
-    
+    <title>Apache Traffic Server™ Software Developers Kit</title>
+    <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License.  You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License. -->
   </head>
 
   <body>
-    <h1></h1>
+    <h1>Apache Traffic Server™ Software Developers Kit</h1>
 
   <div id="content">
-      
+      <p><a href="HTTPSessionFunctions">Prev</a> - Session Functions
+Initiate Connection - <a href="InitiateConnectionFunctions">Next</a></p>
+<h3 id="http_transaction_functions">HTTP Transaction Functions</h3>
+<ul>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnCacheLookupStatusGet">INKHttpTxnCacheLookupStatusGet</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnCacheLookupStatusSet">INKHttpTxnCacheLookupStatusSet</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnCachedReqGet">INKHttpTxnCachedReqGet</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnCachedRespGet">INKHttpTxnCachedRespGet</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnClientIncomingPortGet">INKHttpTxnClientIncomingPortGet</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnClientIPGet%20">INKHttpTxnClientIPGet</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnClientRemotePortGet">INKHttpTxnClientRemotePortGet</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnClientReqGet">INKHttpTxnClientReqGet</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnClientRespGet">INKHttpTxnClientRespGet</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnErrorBodySet">INKHttpTxnErrorBodySet</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnHookAdd">INKHttpTxnHookAdd</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnNextHopIPGet">INKHttpTxnNextHopIPGet</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnParentProxyGet">INKHttpTxnParentProxyGet</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnParentProxySet">INKHttpTxnParentProxySet</a></strong></li>
+<li><a href="HTTPTransactionFunctions#INKHttpTxnPristineUrlGet"><strong>INKHttpTxnPristineUrlGet</strong></a></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnReenable">INKHttpTxnReenable</a><a href="HTTPTransactionFunctions#INKHttpTxnReenable" /></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnServerIPGet">INKHttpTxnServerIPGet</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnServerReqGet">INKHttpTxnServerReqGet</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnServerRespGet">INKHttpTxnServerRespGet</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnSetRespCacheableSet">INKHttpTxnSetRespCacheableSet</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnSkipRww">INKHttpTxnSkipRww</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnSsnGet">INKHttpTxnSsnGet</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnTransformedRespCache">INKHttpTxnTransformedRespCache</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnTransformRespGet">INKHttpTxnTransformRespGet</a></strong></li>
+<li><strong><a href="HTTPTransactionFunctions#INKHttpTxnUntransformedRespCache">INKHttpTxnUntransformedRespCache</a></strong></li>
+</ul>
+<h4 id="inkhttptxncachelookupstatusget">INKHttpTxnCacheLookupStatusGet</h4>
+<p>Stores the current cache lookup status for the ongoing transaction.
+Also stores the number of cache lookup operations already
+performed.</p>
+<p><strong>Prototype</strong>
+  ~ <code>INKReturnCode INKHttpTxnCacheLookupStatusGet     (INKHttpTxn &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>,
+    int *<em><code>lookup_status</code></em>)</p>
+<p><strong>Arguments</strong>
+  ~ <code>INKHttpTxn &lt;i&gt;txnp &lt;/i&gt;</code> is the ongoing transaction.</p>
+<div class="codehilite"><pre>`int <span class="nt">&lt;i&gt;</span>*lookup_status <span class="nt">&lt;/i&gt;</span>` is set to the lookup status.
+</pre></div>
+
+
+<p><strong>Description</strong>
+  ~ Obtains the status of the current cache lookup for the ongoing
+    transaction <code>&lt;em class="replaceable"&gt;&lt;code&gt;txnp</code> in the
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;lookup_status</code> variable.</p>
+<div class="codehilite"><pre><span class="n">This</span> <span class="n">function</span> <span class="n">should</span> <span class="n">only</span> <span class="n">be</span> <span class="n">called</span> <span class="n">from</span>
+<span class="sb">`INK_HTTP_CACHE_LOOKUP_COMPLETE_HOOK`</span><span class="o">.</span>
+
+<span class="n">Possible</span> <span class="n">status</span> <span class="nb">values</span> <span class="n">returned</span> <span class="n">in</span>
+<span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;lookup_status`</span> <span class="n">are:</span>
+
+<span class="o">-</span>   <span class="sb">`INK_CACHE_LOOKUP_MISS`</span> <span class="o">-</span> <span class="n">Document</span> <span class="n">was</span> <span class="ow">not</span> <span class="n">in</span> <span class="n">the</span> <span class="n">cache</span><span class="p">,</span> <span class="n">so</span> <span class="n">it</span>
+    <span class="n">will</span> <span class="n">be</span> <span class="n">fetched</span> <span class="n">from</span> <span class="n">the</span> <span class="n">origin</span> <span class="n">server</span><span class="o">.</span>
+<span class="o">-</span>   <span class="sb">`INK_CACHE_LOOKUP_HIT_STALE`</span> <span class="o">-</span> <span class="n">Document</span> <span class="n">was</span> <span class="n">present</span> <span class="n">in</span> <span class="n">the</span>
+    <span class="n">cache</span> <span class="n">but</span> <span class="n">was</span> <span class="n">stale</span><span class="o">.</span> <span class="n">A</span> <span class="n">fresher</span> <span class="n">version</span> <span class="n">will</span> <span class="n">be</span> <span class="n">fetched</span> <span class="n">from</span> <span class="n">the</span>
+    <span class="n">origin</span> <span class="n">server</span> <span class="p">(</span><span class="n">IMS</span> <span class="n">request</span><span class="p">)</span><span class="o">.</span>
+<span class="o">-</span>   <span class="sb">`INK_CACHE_LOOKUP_HIT_FRESH`</span> <span class="o">-</span> <span class="n">Document</span> <span class="n">was</span> <span class="n">present</span> <span class="n">in</span> <span class="n">the</span>
+    <span class="n">cache</span> <span class="ow">and</span> <span class="n">was</span> <span class="n">fresh</span><span class="o">.</span> <span class="n">Document</span> <span class="n">will</span> <span class="n">be</span> <span class="n">served</span> <span class="n">from</span> <span class="n">the</span> <span class="n">cache</span><span class="o">.</span>
+<span class="o">-</span>   <span class="sb">`INK_CACHE_LOOKUP_SKIPPED`</span> <span class="o">-</span> <span class="n">Traffic</span> <span class="n">Server</span> <span class="n">didn</span><span class="s">&#39;t perform a</span>
+<span class="s">    cache lookup because the request wasn&#39;</span><span class="n">t</span> <span class="n">cacheable</span> <span class="p">(</span><span class="n">this</span> <span class="n">can</span> <span class="n">happen</span>
+    <span class="n">when</span> <span class="n">the</span> <span class="n">URL</span> <span class="n">looks</span> <span class="n">dynamic</span> <span class="ow">or</span> <span class="n">the</span> <span class="n">request</span> <span class="n">is</span> <span class="n">marked</span> <span class="n">as</span>
+    <span class="n">noncacheable</span><span class="p">)</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ <code>INK_SUCCESS</code> if the API is called successfully.</p>
+<div class="codehilite"><pre><span class="sb">`INK_ERROR`</span> <span class="k">if</span> <span class="n">an</span> <span class="n">error</span> <span class="n">occurs</span> <span class="k">while</span> <span class="n">calling</span> <span class="n">the</span> <span class="n">API</span> <span class="ow">or</span> <span class="k">if</span> <span class="n">an</span>
+<span class="n">argument</span> <span class="n">is</span> <span class="n">invalid</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxncachelookupstatusset">INKHttpTxnCacheLookupStatusSet</h4>
+<p>Sets the cache lookup status to the status that is passed in.</p>
+<p><strong>Prototype</strong>
+  ~ <code>int  INKHttpTxnCacheLookupStatusSet     (INKHttpTxn &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>,
+    int <em><code>lookup_status</code></em>)</p>
+<p><strong>Arguments</strong>
+  ~ <code>INKHttpTxn``&lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>** is the
+    ongoing transaction.</p>
+<div class="codehilite"><pre>
+</pre></div>
+
+
+<p><strong>Description</strong>
+  ~ Sets the status of the current cache lookup for the ongoing
+    transaction <code>&lt;em class="replaceable"&gt;&lt;code&gt;txnp</code> to whatever is
+    specified in the <code>&lt;em class="replaceable"&gt;&lt;code&gt;lookup_status</code>
+    variable. Changing the status from <code>INK_CACHE_LOOKUP_MISS</code> is not
+    allowed.</p>
+<p>~ For example, consider the following use-case scenario: A 'stale
+    while revalidate' plugin has to serve stale data from the cache
+    while it makes a request for new data asynchronously. The plugin
+    forces the core to serve stale data by setting the cache lookup
+    status to <code>INK_CACHE_LOOKUP_HIT_FRESH</code>.</p>
+<div class="codehilite"><pre><span class="n">Possible</span> <span class="n">status</span> <span class="nb">values</span> <span class="k">for</span>
+<span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;lookup_status`</span> <span class="n">are:</span>
+
+<span class="o">-</span>   <span class="sb">`INK_CACHE_LOOKUP_MISS`</span> <span class="o">-</span> <span class="n">Document</span> <span class="n">was</span> <span class="ow">not</span> <span class="n">in</span> <span class="n">the</span> <span class="n">cache</span><span class="p">,</span> <span class="n">so</span> <span class="n">it</span>
+    <span class="n">will</span> <span class="n">be</span> <span class="n">fetched</span> <span class="n">from</span> <span class="n">the</span> <span class="n">origin</span> <span class="n">server</span><span class="o">.</span>
+<span class="o">-</span>   <span class="sb">`INK_CACHE_LOOKUP_HIT_STALE`</span> <span class="o">-</span> <span class="n">Document</span> <span class="n">was</span> <span class="n">present</span> <span class="n">in</span> <span class="n">the</span>
+    <span class="n">cache</span> <span class="n">but</span> <span class="n">was</span> <span class="n">stale</span><span class="o">.</span> <span class="n">A</span> <span class="n">fresher</span> <span class="n">version</span> <span class="n">will</span> <span class="n">be</span> <span class="n">fetched</span> <span class="n">from</span> <span class="n">the</span>
+    <span class="n">origin</span> <span class="n">server</span> <span class="p">(</span><span class="n">IMS</span> <span class="n">request</span><span class="p">)</span><span class="o">.</span>
+<span class="o">-</span>   <span class="sb">`INK_CACHE_LOOKUP_HIT_FRESH`</span> <span class="o">-</span> <span class="n">Document</span> <span class="n">was</span> <span class="n">present</span> <span class="n">in</span> <span class="n">the</span>
+    <span class="n">cache</span> <span class="ow">and</span> <span class="n">was</span> <span class="n">fresh</span><span class="o">.</span> <span class="n">Document</span> <span class="n">will</span> <span class="n">be</span> <span class="n">served</span> <span class="n">from</span> <span class="n">the</span> <span class="n">cache</span><span class="o">.</span>
+<span class="o">-</span>   <span class="sb">`INK_CACHE_LOOKUP_SKIPPED`</span> <span class="o">-</span> <span class="n">Traffic</span> <span class="n">Server</span> <span class="n">didn</span><span class="err">&#39;</span><span class="n">t</span> <span class="n">perform</span> <span class="n">a</span>
+    <span class="n">cache</span> <span class="n">lookup</span> <span class="n">because</span> <span class="n">the</span> <span class="n">request</span> <span class="n">was</span> <span class="ow">not</span> <span class="n">cacheable</span> <span class="p">(</span><span class="n">this</span> <span class="n">can</span> <span class="n">happen</span>
+    <span class="n">when</span> <span class="n">the</span> <span class="n">URL</span> <span class="n">looks</span> <span class="n">dynamic</span> <span class="ow">or</span> <span class="n">the</span> <span class="n">request</span> <span class="n">is</span> <span class="n">marked</span> <span class="n">as</span>
+    <span class="n">noncacheable</span><span class="p">)</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ <code>1</code> if the API is called successfully.</p>
+<div class="codehilite"><pre><span class="sb">`0`</span> <span class="k">if</span> <span class="n">an</span> <span class="n">error</span> <span class="n">occurs</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxncachedreqget">INKHttpTxnCachedReqGet</h4>
+<p>Gets the cached request header for a specified HTTP transaction.</p>
+<p><strong>Prototype</strong>
+  ~ <code>INKReturnCode INKHttpTxnCachedReqGet (INKHttpTxn                 &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>,
+    INKMBuffer *<em><code>bufp</code></em>, INKMLoc *<em><code>hdr_loc</code></em>)</p>
+<p><strong>Arguments</strong>
+  ~ <code>INKHttpTxn</code> <code>&lt;em class="replaceable"&gt;&lt;code&gt;txnp</code> is the
+    ongoing transaction.</p>
+<div class="codehilite"><pre>`int <span class="nt">&lt;i&gt;</span>*<span class="nt">&lt;/i&gt;</span>`*`lookup_status`* is set to the lookup status.
+</pre></div>
+
+
+<p><strong>Description</strong>
+  ~ Obtains the status of the current cache lookup for the ongoing
+    transaction <code>&lt;em class="replaceable"&gt;&lt;code&gt;txnp</code> in the
+    <code>&lt;i&gt;lookup_status &lt;/i&gt;</code> variable.</p>
+<div class="codehilite"><pre>This function should only be called from
+`INK_HTTP_CACHE_LOOKUP_COMPLETE_HOOK`.
+
+The possible status values returned in `<span class="nt">&lt;i&gt;</span>lookup_status <span class="nt">&lt;/i&gt;</span>`
+are:
+
+-   `INK_CACHE_LOOKUP_MISS` - Document was not in the cache; it
+    will be fetched from the origin server.
+-   `INK_CACHE_LOOKUP_HIT_STALE` - Document was present in the
+    cache but was stale. A fresher version will be fetched from the
+    origin server (IMS request).
+-   `INK_CACHE_LOOKUP_HIT_FRESH` - Document was present in the
+    cache and was fresh. Document will be served from the cache.
+-   `INK_CACHE_LOOKUP_SKIPPED` - Traffic Server didn&#39;t perform a
+    cache lookup because the request was not cacheable (this can happen
+    when the URL looks dynamic or the request is marked as
+    noncacheable).
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ <code>INK_SUCCESS</code> if the API is called successfully.</p>
+<div class="codehilite"><pre><span class="sb">`INK_ERROR`</span> <span class="k">if</span> <span class="n">an</span> <span class="n">error</span> <span class="n">occurs</span> <span class="k">while</span> <span class="n">calling</span> <span class="n">the</span> <span class="n">API</span> <span class="ow">or</span> <span class="k">if</span> <span class="n">an</span>
+<span class="n">argument</span> <span class="n">is</span> <span class="n">invalid</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxncachedrespget">INKHttpTxnCachedRespGet</h4>
+<p>Gets the cached response header for a specified HTTP transaction.</p>
+<p><strong>Prototype</strong>
+  ~ <code>int INKHttpTxnCachedRespGet (INKHttpTxn                 &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>,
+    INKMBuffer *<em><code>bufp</code></em>, INKMLoc *<em><code>hdr_loc</code></em>)</p>
+<p><strong>Description</strong>
+  ~ Retrieves the cached response header from the HTTP transaction
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;txnp</code> and stores the cached response
+    header in <code>bufp</code>, at location
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;hdr_loc</code>.</p>
+<div class="codehilite"><pre><span class="n">Call</span> <span class="n">after</span> <span class="sb">`SEND_RESPONSE_HDR_HOOK`</span><span class="o">.</span>
+
+<span class="o">!</span><span class="p">[[</span><span class="n">Caution</span><span class="p">]](</span><span class="n">images</span><span class="sr">/docbook/c</span><span class="n">aution</span><span class="o">.</span><span class="n">png</span><span class="p">)</span>
+<span class="n">Caution</span>
+<span class="n">Do</span> <span class="ow">not</span> <span class="n">modify</span> <span class="n">any</span> <span class="n">cached</span> <span class="n">response</span> <span class="n">headers</span> <span class="n">returned</span> <span class="n">by</span>
+<span class="sb">`INKHttpTxnCachedRespGet`</span><span class="p">;</span> <span class="n">the</span> <span class="n">underlying</span> <span class="n">data</span> <span class="n">structure</span> <span class="n">is</span>
+<span class="nb">read</span><span class="o">-</span><span class="n">only</span><span class="o">.</span> <span class="n">Release</span> <span class="n">the</span> <span class="n">returned</span>
+<span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;hdr_loc`</span> <span class="n">with</span> <span class="n">a</span> <span class="n">call</span> <span class="n">to</span>
+<span class="sb">`INKHandleMLocRelease`</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ If the cached response header does not exist, then
+    <code>INKHttpTxnCachedRespGet</code> returns <code>0</code>.</p>
+<div class="codehilite"><pre><span class="n">Otherwise</span><span class="p">,</span> <span class="n">it</span> <span class="n">returns</span> <span class="sb">`1`</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxnclientincomingportget">INKHttpTxnClientIncomingPortGet</h4>
+<p>Gets the port on which the incoming request is received.</p>
+<p><strong>Prototype</strong>
+  ~ <code>int INKHttpTxnClientIncomingPortGet (INKHttpTxn                 &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>)</p>
+<p><strong>Description</strong>
+  ~ Returns the port on which the HTTP transaction
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;txnp</code> was received. This is not the
+    destination port in the URL; it is the proxy port to which the
+    client browser is pointed.</p>
+<div class="codehilite"><pre><span class="n">Call</span> <span class="n">after</span> <span class="sb">`TXN_START_HOOK`</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ The port number in host byte order.</p>
+<div class="codehilite"><pre><span class="n">Returns</span> <span class="sb">`-1`</span> <span class="k">if</span> <span class="n">an</span> <span class="n">error</span> <span class="n">occurred</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxnclientipget">INKHttpTxnClientIPGet</h4>
+<p>Gets the client IP address for a specified HTTP transaction.</p>
+<p><strong>Prototype</strong>
+  ~ <code>unsigned int INKHttpTxnClientIPGet (INKHttpTxn                 &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>)</p>
+<p><strong>Description</strong>
+  ~ Returns the IP address of the client for the HTTP transaction
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>.</p>
+<div class="codehilite"><pre><span class="sb">`INKHttpTxnClientIPGet`</span> <span class="n">returns</span> <span class="n">the</span> <span class="n">IP</span> <span class="n">address</span> <span class="n">in</span> <span class="n">network</span> <span class="n">byte</span>
+<span class="n">order</span><span class="o">.</span>
+
+<span class="n">Call</span> <span class="n">after</span> <span class="sb">`TXN_START_HOOK`</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ The client IP address.</p>
+<div class="codehilite"><pre><span class="n">Returns</span> <span class="sb">`0`</span> <span class="k">if</span> <span class="n">an</span> <span class="n">error</span> <span class="n">occurred</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxnclientremoteportget">INKHttpTxnClientRemotePortGet</h4>
+<p>Gets the remote host's port number for a specified HTTP
+transaction.</p>
+<p><strong>Prototype</strong>
+  ~ <code>INKReturnCode                 INKHttpTxnClientRemotePortGet(INKHttpTxn                 &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>,
+    int *<em><code>port</code></em>)</p>
+<p><strong>Arguments</strong>
+  ~ <code>INKHttpTxn</code>
+    <code>&lt;code class="code"&gt;&lt;em class="replaceable"&gt;&lt;code&gt;txnp</code> is an HTTP
+    transaction.</p>
+<div class="codehilite"><pre><span class="sb">`int                 *``&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;port`</span> <span class="n">is</span> <span class="n">set</span>
+<span class="n">to</span> <span class="n">the</span> <span class="n">client</span><span class="err">&#39;</span><span class="n">s</span> <span class="n">remote</span> <span class="n">port</span> <span class="n">value</span> <span class="p">(</span><span class="n">port</span> <span class="n">number</span> <span class="n">used</span> <span class="n">by</span> <span class="n">the</span> <span class="n">client</span>
+<span class="n">when</span> <span class="n">creating</span> <span class="n">a</span> <span class="nb">socket</span> <span class="n">connection</span> <span class="n">with</span> <span class="n">the</span> <span class="n">proxy</span> <span class="k">for</span> <span class="n">the</span>
+<span class="n">transaction</span> <span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;txnp`</span><span class="p">)</span> <span class="n">in</span> <span class="n">network</span> <span class="n">byte</span>
+<span class="n">order</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Description</strong>
+  ~ Obtains the port number of the remote host for the specified
+    HTTP transaction. The port number is returned in network byte
+    order.</p>
+<div class="codehilite"><pre><span class="o">!</span><span class="p">[[</span><span class="n">Note</span><span class="p">]](</span><span class="n">images</span><span class="sr">/docbook/</span><span class="n">note</span><span class="o">.</span><span class="n">png</span><span class="p">)</span>
+<span class="n">Note</span>
+<span class="n">This</span> <span class="n">is</span> <span class="n">an</span> <span class="n">exception</span> <span class="n">to</span> <span class="n">the</span> <span class="n">rule</span> <span class="n">that</span> <span class="n">port</span> <span class="n">numbers</span> <span class="n">are</span> <span class="n">retrieved</span> <span class="n">in</span>
+<span class="n">host</span> <span class="n">byte</span> <span class="n">order</span><span class="o">.</span>
+
+<span class="n">The</span> <span class="n">proxy</span> <span class="n">port</span> <span class="n">on</span> <span class="n">which</span> <span class="n">the</span> <span class="n">connection</span> <span class="n">was</span> <span class="n">accepted</span> <span class="n">can</span> <span class="n">be</span>
+<span class="n">retrieved</span> <span class="n">using</span> <span class="sb">`INKHttpTxnClientIncomingPortGet`</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ <code>INK_SUCCESS</code> if the API is called successfully.</p>
+<div class="codehilite"><pre><span class="sb">`INK_ERROR`</span> <span class="k">if</span> <span class="n">an</span> <span class="n">error</span> <span class="n">occurs</span> <span class="k">while</span> <span class="n">calling</span> <span class="n">the</span> <span class="n">API</span> <span class="ow">or</span> <span class="k">if</span> <span class="n">an</span>
+<span class="n">argument</span> <span class="n">is</span> <span class="n">invalid</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxnclientreqget">INKHttpTxnClientReqGet</h4>
+<p>Gets the client request header for a specified HTTP transaction.</p>
+<p><strong>Prototype</strong>
+  ~ <code>int INKHttpTxnClientReqGet (INKHttpTxn txnp,                 INKMBuffer *bufp, INKMLoc *hdr_loc)</code></p>
+<p><strong>Description</strong>
+  ~ Retrieves the client request header from the HTTP transaction
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>. <code>INKHttpTxnClientReqGet</code>
+    stores the client request header in
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;bufp</code>, at location
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;hdr_loc</code>.</p>
+<div class="codehilite"><pre><span class="n">Call</span> <span class="n">after</span> <span class="sb">`READ_REQUEST_HDR_HOOK`</span><span class="o">.</span>
+
+<span class="n">Release</span> <span class="n">the</span> <span class="n">returned</span> <span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;hdr_loc`</span> <span class="n">with</span> <span class="n">a</span>
+<span class="n">call</span> <span class="n">to</span> <span class="sb">`INKHandleMLocRelease`</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ If the client request header does not exist or if there is an
+    error, then <code>INKHttpTxnClientReqGet</code> returns <code>0</code>.</p>
+<div class="codehilite"><pre><span class="n">Otherwise</span><span class="p">,</span> <span class="sb">`1`</span> <span class="n">is</span> <span class="n">returned</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxnclientrespget">INKHttpTxnClientRespGet</h4>
+<p>Gets the client response header for a specified HTTP transaction.</p>
+<p><strong>Prototype</strong>
+  ~ <code>int INKHttpTxnClientRespGet (INKHttpTxn                 &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>,
+    INKMBuffer *<em><code>bufp</code></em>, INKMLoc *<em><code>hdr_loc</code></em>)</p>
+<p><strong>Description</strong>
+  ~ Retrieves the client response header from the HTTP transaction
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>. <code>INKHttpTxnClientRespGet</code>
+    stores the client response header in
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;bufp</code>, at location
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;hdr_loc</code>.</p>
+<div class="codehilite"><pre><span class="n">Call</span> <span class="n">after</span> <span class="sb">`SEND_RESPONSE_HOOK`</span><span class="o">.</span>
+
+<span class="n">Release</span> <span class="n">the</span> <span class="n">returned</span> <span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;hdr_loc`</span> <span class="n">with</span> <span class="n">a</span>
+<span class="n">call</span> <span class="n">to</span> <span class="sb">`INKHandleMLocRelease`</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ If the client response header does not exist or if there is an
+    error, then <code>INKHttpTxnClientRespGet</code> returns <code>0</code>.</p>
+<div class="codehilite"><pre><span class="n">Otherwise</span><span class="p">,</span> <span class="sb">`1`</span> <span class="n">is</span> <span class="n">returned</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxnerrorbodyset">INKHttpTxnErrorBodySet</h4>
+<p>Sets the format and content of the error body (or response data)
+that Traffic Server sends to clients.</p>
+<p><strong>Prototype</strong>
+  ~ <code>INKReturnCode INKHttpTxnErrorBodySet (INKHttpTxn                 &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>,
+    char *<em><code>buf</code></em>, int <em><code>buflength</code></em>, char *<em><code>mimetype</code></em>)</p>
+<p><strong>Arguments</strong>
+  ~ <code>&lt;em class="replaceable"&gt;&lt;code&gt;txnp</code> is the HTTP transaction to
+    act upon.</p>
+<div class="codehilite"><pre><span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;buf`</span> <span class="n">contains</span> <span class="n">the</span> <span class="n">error</span> <span class="p">(</span><span class="ow">or</span>
+<span class="n">response</span><span class="p">)</span> <span class="n">body</span><span class="o">.</span> <span class="n">The</span> <span class="n">error</span> <span class="n">body</span> <span class="n">can</span> <span class="n">be</span> <span class="n">text</span><span class="p">,</span> <span class="n">an</span> <span class="n">HTML</span> <span class="n">document</span><span class="p">,</span>
+<span class="n">image</span><span class="p">,</span> <span class="ow">or</span> <span class="n">another</span> <span class="nb">format</span><span class="o">.</span> <span class="n">Before</span> <span class="n">you</span> <span class="n">call</span> <span class="sb">`INKHttpTxnErrorBodySet,`</span>
+<span class="n">be</span> <span class="n">sure</span> <span class="n">to</span> <span class="n">allocate</span> <span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;buf`</span> <span class="n">using</span>
+<span class="sb">`INKmalloc`</span><span class="o">.</span>
+
+<span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;buflength`</span> <span class="n">is</span> <span class="n">the</span> <span class="nb">length</span> <span class="n">of</span> <span class="n">the</span>
+<span class="n">error</span> <span class="n">body</span><span class="o">.</span>
+
+<span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;mimetype`</span> <span class="n">contains</span> <span class="n">the</span> <span class="nb">format</span> <span class="n">of</span> <span class="n">the</span>
+<span class="n">error</span> <span class="n">body</span><span class="o">.</span> <span class="n">If</span> <span class="n">you</span> <span class="n">want</span> <span class="n">to</span> <span class="n">set</span> <span class="n">the</span>
+<span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;mimetype`</span> <span class="n">to</span> <span class="n">a</span> <span class="n">value</span> <span class="n">other</span> <span class="n">than</span>
+<span class="sb">`NULL`</span><span class="p">,</span> <span class="k">then</span> <span class="n">you</span> <span class="n">must</span> <span class="n">allocate</span>
+<span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;mimetype`</span> <span class="n">using</span> <span class="sb">`INKmalloc`</span> <span class="n">before</span>
+<span class="n">you</span> <span class="n">call</span> <span class="sb">`INKHttpTxnErrorBodySet`</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Description</strong>
+  ~ Sets the format of the error body that Traffic Server sends
+    back when sending an error or response to a client. The error body
+    data is stored in the buffer <code>&lt;em class="replaceable"&gt;&lt;code&gt;buf</code>.
+    If the error body is just plain text, then setting
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;mimetype</code> to <code>NULL</code> is sufficient.
+    If the error body is HTML, then
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;mimetype</code> should be "<code>text/html</code>".
+    If the error body is a JPEG image, then
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;mimetype</code> should be "<code>image/jpeg</code>".</p>
+<div class="codehilite"><pre><span class="o">!</span><span class="p">[[</span><span class="n">Note</span><span class="p">]](</span><span class="n">images</span><span class="sr">/docbook/</span><span class="n">note</span><span class="o">.</span><span class="n">png</span><span class="p">)</span>
+<span class="n">Note</span>
+<span class="n">Traffic</span> <span class="n">Server</span> <span class="n">automatically</span> <span class="n">calls</span> <span class="sb">`INKfree`</span> <span class="n">to</span> <span class="n">free</span>
+<span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;buf`</span> <span class="n">when</span> <span class="n">it</span> <span class="n">is</span> <span class="nb">no</span> <span class="n">longer</span> <span class="n">needed</span><span class="p">;</span>
+<span class="n">make</span> <span class="n">sure</span> <span class="n">that</span> <span class="n">the</span> <span class="n">buffer</span> <span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;buf`</span> <span class="n">is</span>
+<span class="n">allocated</span> <span class="n">by</span> <span class="n">a</span> <span class="n">call</span> <span class="n">to</span> <span class="sb">`INKmalloc`</span><span class="o">.</span> <span class="n">Similarly</span><span class="p">,</span> <span class="k">if</span> <span class="n">you</span> <span class="n">want</span> <span class="n">to</span> <span class="n">set</span>
+<span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;mimetype`</span> <span class="n">to</span> <span class="n">something</span> <span class="n">other</span> <span class="n">than</span>
+<span class="sb">`NULL`</span><span class="p">,</span> <span class="k">then</span> <span class="n">make</span> <span class="n">sure</span> <span class="n">you</span> <span class="n">allocate</span>
+<span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;mimetype`</span> <span class="n">with</span> <span class="n">a</span> <span class="n">call</span> <span class="n">to</span>
+<span class="sb">`INKmalloc`</span><span class="o">.</span> <span class="n">Traffic</span> <span class="n">Server</span> <span class="n">automatically</span> <span class="n">calls</span> <span class="sb">`INKfree`</span> <span class="n">to</span> <span class="n">free</span>
+<span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;mimetype`</span><span class="o">.</span>
+
+<span class="n">Call</span> <span class="n">after</span> <span class="sb">`SEND_RESPONSE_HDR_HOOK`</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ <code>INK_SUCCESS</code> if the operation completes successfully.</p>
+<div class="codehilite"><pre><span class="sb">`INK_ERROR`</span> <span class="k">if</span> <span class="n">an</span> <span class="n">error</span> <span class="n">occurs</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxnhookadd">INKHttpTxnHookAdd</h4>
+<p>Adds a continuation to the list of HTTP transaction hooks for a
+specified HTTP transaction.</p>
+<p><strong>Prototype</strong>
+  ~ <code>INKReturnCode INKHttpTxnHookAdd (INKHttpTxn                 &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>,
+    INKHttpHookID <em><code>id</code></em>, INKCont <em><code>contp</code></em>)</p>
+<p><strong>Description</strong>
+  ~ Adds <code>&lt;em class="replaceable"&gt;&lt;code&gt;contp</code> to the end of the
+    list of HTTP transaction hooks specified by
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;id</code>. Since
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;contp</code> is added to a transaction, it
+    is not possible to call <code>INKHttpTxnHookAdd</code> from the plugin
+    initialization routine unless the plugin has a handle to an HTTP
+    transaction.</p>
+<div class="codehilite"><pre><span class="n">Call</span> <span class="n">after</span> <span class="sb">`HTTP_TXN_START_HOOK`</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ <code>INK_SUCCESS</code> if the operation completes successfully.</p>
+<div class="codehilite"><pre><span class="sb">`INK_ERROR`</span> <span class="k">if</span> <span class="n">an</span> <span class="n">error</span> <span class="n">occurs</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxnnexthopipget">INKHttpTxnNextHopIPGet</h4>
+<p>Gets the IP address of the next server from which Traffic Server
+tries to retrieve requested HTTP content.</p>
+<p><strong>Prototype</strong>
+  ~ <code>unsigned int INKHttpTxnNextHopIPGet (INKHttpTxn                 &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>)</p>
+<p><strong>Description</strong>
+  ~ Returns the IP address of the next server from which Traffic
+    Server attempts to retrieve the requested document, in network byte
+    order. The IP address returned could be the origin server IP
+    address or it could be the parent proxy's IP address.</p>
+<div class="codehilite"><pre><span class="n">Call</span> <span class="n">after</span> <span class="sb">`SEND_REQUEST_HDR_HOOK`</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ Returns the IP address of the next server from which Traffic
+    Server attempts to retrieve the request, in network byte order.</p>
+<div class="codehilite"><pre><span class="n">Returns</span> <span class="sb">`0`</span> <span class="k">if</span> <span class="n">an</span> <span class="n">error</span> <span class="n">occurred</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxnparentproxyget">INKHttpTxnParentProxyGet</h4>
+<p>Gets the parent proxy name and port, if parent proxying is
+enabled.</p>
+<p><strong>Prototype</strong>
+  ~ <code>INKReturnCode INKHttpTxnParentProxyGet (INKHttpTxn                 &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>,
+    char **<em><code>hostname</code></em>, int *<em><code>port</code></em>)</p>
+<p><strong>Description</strong>
+  ~ Retrieves the value set previously by <code>INKHttpParentProxySet</code>.
+    Does not return values set in <code>parent.config</code> or <code>records.config</code>
+    for the <code>&lt;i&gt;proxy.config.http.parent_proxies &lt;/i&gt;</code>parameter.</p>
+<div class="codehilite"><pre>This function can be called from within any``transaction hook.
+
+The `<span class="nt">&lt;i&gt;</span>hostname <span class="nt">&lt;/i&gt;</span>` string returned must not be deallocated.
+
+![[Note]](images/docbook/note.png)
+Note
+If parent proxying is not enabled, then `INKHttpTxnParentProxyGet`
+returns `NULL` for `<span class="nt">&lt;em</span> <span class="na">class=</span><span class="s">&quot;replaceable&quot;</span><span class="nt">&gt;&lt;code&gt;</span>hostname`*``*and
+`-1` for `<span class="nt">&lt;i&gt;</span>port<span class="nt">&lt;/i&gt;</span>`.
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ <code>INK_SUCCESS</code> if the operation completes successfully.</p>
+<div class="codehilite"><pre><span class="sb">`INK_ERROR`</span> <span class="k">if</span> <span class="n">an</span> <span class="n">error</span> <span class="n">occurs</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxnparentproxyset">INKHttpTxnParentProxySet</h4>
+<p>Sets the parent proxy name and port.</p>
+<p><strong>Prototype</strong>
+  ~ <code>INKReturnCode INKHttpTxnParentProxySet (INKHttpTxn                 &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>,
+    char *<em><code>hostname</code></em>, int <em><code>port</code></em>)</p>
+<p><strong>Description</strong>
+  ~ This can be used to overwrite the value set in the
+    <code>parent.config</code> file, or in <code>records.config</code> for the parameter
+    <code>&lt;i&gt;proxy.config.http.parent_proxies&lt;/i&gt;</code>.</p>
+<div class="codehilite"><pre><span class="n">Call</span> <span class="n">before</span> <span class="ow">or</span> <span class="n">within</span> <span class="sb">`CACHE_LOOKUP_COMPLETE`</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ <code>INK_SUCCESS</code> if the operation completes successfully.</p>
+<div class="codehilite"><pre><span class="sb">`INK_ERROR`</span> <span class="k">if</span> <span class="n">an</span> <span class="n">error</span> <span class="n">occurs</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxnpristineurlget">INKHttpTxnPristineUrlGet</h4>
+<p>Gets the pristine URL (the URL that came in from the client
+request, before remap) for a specified HTTP transaction.</p>
+<p><strong>Prototype</strong>
+  ~ <code>INKReturnCode  INKHttpTxnPristineUrlGet (INKHttpTxn &lt;span class="replaceable"&gt;txnp&lt;/span&gt;, INKMBuffer *&lt;span class="replaceable"&gt;bufp&lt;/span&gt;, INKMLoc *&lt;span class="replaceable"&gt;url_loc&lt;/span&gt;);</code></p>
+<p><strong>Arguements</strong>
+  ~ <code>INKHttpTxn &lt;span class="replaceable"&gt;txnp &lt;/span&gt;</code> is the
+    ongoing transaction.</p>
+<div class="codehilite"><pre>`INKMBuffer *<span class="nt">&lt;span</span> <span class="na">class=</span><span class="s">&quot;replaceable&quot;</span><span class="nt">&gt;</span>bufp <span class="nt">&lt;/span&gt;</span>` is the header
+buffer pointer
+
+`INKMLoc *<span class="nt">&lt;span</span> <span class="na">class=</span><span class="s">&quot;replaceable&quot;</span><span class="nt">&gt;</span>url_loc <span class="nt">&lt;/span&gt;</span>` is the pointer
+to the location where the pristine URL will be written.
+</pre></div>
+
+
+<p><strong>Description</strong>
+  ~ After remap, the URL returned by <code>INKHttpHdrUrlGet</code> may not be
+    the same as the original URL. This API provides a way to access the
+    URL that was part of the client request header.</p>
+<div class="codehilite"><pre><span class="n">Retrieves</span> <span class="n">the</span> <span class="n">pristine</span> <span class="n">URL</span> <span class="n">from</span> <span class="n">the</span> <span class="n">HTTP</span> <span class="n">transaction</span> <span class="n">txnp</span><span class="o">.</span>
+<span class="sb">`INKHttpTxnPristineUrlGet`</span> <span class="n">stores</span> <span class="n">the</span> <span class="n">pristine</span> <span class="n">URL</span> <span class="n">in</span> <span class="n">bufp</span><span class="p">,</span> <span class="n">at</span>
+<span class="n">location</span> <span class="n">url</span><span class="o">\</span><span class="n">_loc</span><span class="o">.</span> <span class="n">Call</span> <span class="n">after</span> <span class="sb">`READ_REQUEST_HDR_HOOK`</span><span class="o">.</span>
+
+<span class="n">Release</span> <span class="n">the</span> <span class="n">returned</span> <span class="n">url</span><span class="o">\</span><span class="n">_loc</span> <span class="n">with</span> <span class="n">a</span> <span class="n">call</span> <span class="n">to</span>
+<span class="sb">`INKHandleMLocRelease`</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ <code>INK_SUCCESS</code> if the operation completes successfully.</p>
+<div class="codehilite"><pre><span class="sb">`INK_ERROR`</span> <span class="k">if</span> <span class="n">there</span> <span class="n">is</span> <span class="n">an</span> <span class="n">error</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Example</strong>
+  ~      if (INKHttpTxnPristineUrlGet(txnp, &amp;bufp, &amp;url_loc) == INK_SUCCESS)
+         {value = INKUrlHostGet(bufp, url_loc, &amp;len); INKDebug (DEBUG_TAG, "Pristine Host: %s", value); INKHandleMLocRelease (bufp, INK_NULL_MLOC, url_loc);}
+         else {INKError ("INKHttpTxnPristineUrlGet returns 0.n");</p>
+<h4 id="inkhttptxnreenable">INKHttpTxnReenable</h4>
+<p>Tells a transaction if the processing of a particular hook has
+completed.</p>
+<p><strong>Prototype</strong>
+  ~ <code>INKReturnCode INKHttpTxnReenable (INKHttpTxn                 &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>,
+    INKEvent <em><code>event</code></em>)</p>
+<p><strong>Description</strong>
+  ~ Notifies the HTTP transaction <code>&lt;i&gt;txnp &lt;/i&gt;</code> that the plugin is
+    finished processing the current hook. If <code>INK_EVENT_HTTP_CONTINUE</code>
+    is specified for <code>&lt;em class="replaceable"&gt;&lt;code&gt;event</code>, then the
+    plugin wants the transaction to continue. If <code>INK_EVENT_HTTP_ERROR</code>
+    is specified for <code>&lt;em class="replaceable"&gt;&lt;code&gt;event</code>, then the
+    plugin wants the transaction to be terminated and an error is sent
+    back to the client (if no response has already been sent).</p>
+<div class="codehilite"><pre><span class="n">You</span> <span class="n">must</span> <span class="n">always</span> <span class="n">reenable</span> <span class="n">the</span> <span class="n">HTTP</span> <span class="n">transaction</span> <span class="n">after</span> <span class="nb">each</span>
+<span class="n">transaction</span> <span class="n">event</span> <span class="n">is</span> <span class="n">processed</span><span class="o">.</span> <span class="n">However</span><span class="p">,</span> <span class="n">you</span> <span class="n">should</span> <span class="n">never</span> <span class="n">reenable</span>
+<span class="n">twice</span> <span class="o">-</span> <span class="n">this</span> <span class="n">is</span> <span class="n">a</span> <span class="n">serious</span> <span class="n">error</span><span class="o">.</span>
+
+<span class="n">When</span> <span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;event`</span> <span class="n">is</span> <span class="n">set</span> <span class="n">to</span>
+<span class="sb">`INK_EVENT_HTTP_ERROR`</span><span class="p">,</span> <span class="n">Traffic</span> <span class="n">Server</span> <span class="n">performs</span> <span class="n">different</span>
+<span class="n">processing</span> <span class="n">depending</span> <span class="n">on</span> <span class="n">the</span> <span class="n">type</span> <span class="n">of</span> <span class="n">hook</span> <span class="n">involved</span><span class="o">.</span>
+
+<span class="o">-</span>   <span class="sb">`INK_HTTP_TXN_START_HOOK`</span><span class="p">:</span> <span class="n">the</span> <span class="n">transaction</span> <span class="n">is</span> <span class="n">stopped</span> <span class="n">right</span>
+    <span class="n">away</span><span class="p">,</span> <span class="k">then</span> <span class="n">the</span> <span class="n">client</span> <span class="n">connection</span> <span class="n">is</span> <span class="n">closed</span> <span class="ow">and</span> <span class="nb">no</span> <span class="n">response</span> <span class="n">is</span> <span class="n">sent</span>
+    <span class="n">back</span> <span class="n">to</span> <span class="n">the</span> <span class="n">origin</span> <span class="n">server</span><span class="o">.</span>
+<span class="o">-</span>   <span class="sb">`INK_HTTP_READ_REQUEST_HDR_HOOK`</span><span class="p">:</span> <span class="n">Traffic</span> <span class="n">Server</span> <span class="n">does</span> <span class="ow">not</span> <span class="nb">send</span>
+    <span class="n">a</span> <span class="n">request</span> <span class="n">to</span> <span class="n">the</span> <span class="n">origin</span> <span class="n">server</span><span class="p">;</span> <span class="n">it</span> <span class="n">directly</span> <span class="n">sends</span> <span class="n">a</span> <span class="mi">500</span> <span class="n">to</span> <span class="n">the</span>
+    <span class="n">client</span><span class="o">.</span>
+<span class="o">-</span>   <span class="sb">`INK_HTTP_SEND_REQUEST_HDR_HOOK`</span><span class="p">:</span> <span class="n">Traffic</span> <span class="n">Server</span> <span class="n">opens</span> <span class="n">a</span>
+    <span class="n">connection</span> <span class="n">to</span> <span class="n">the</span> <span class="n">origin</span> <span class="n">server</span><span class="p">,</span> <span class="n">sends</span> <span class="n">an</span> <span class="n">empty</span> <span class="n">request</span> <span class="n">to</span> <span class="n">it</span><span class="p">,</span> <span class="ow">and</span>
+    <span class="n">sends</span> <span class="n">a</span> <span class="sb">`500`</span> <span class="n">status</span> <span class="n">message</span> <span class="n">back</span> <span class="n">to</span> <span class="n">the</span> <span class="n">client</span><span class="o">.</span> <span class="n">The</span> <span class="n">connection</span> <span class="n">to</span>
+    <span class="n">the</span> <span class="n">origin</span> <span class="n">server</span> <span class="n">is</span> <span class="k">then</span> <span class="n">closed</span><span class="o">.</span>
+<span class="o">-</span>   <span class="sb">`INK_HTTP_READ_RESPONSE_HDR_HOOK`</span><span class="p">,</span>
+    <span class="sb">`INK_HTTP_SEND_RESPONSE_HOOK`</span><span class="p">,</span> <span class="sb">`INK_HTTP_OS_DNS_HOOK`</span><span class="p">,</span>
+    <span class="sb">`INK_HTTP_READ_CACHE_HDR_HOOK`</span><span class="p">,</span> <span class="ow">and</span>
+    <span class="sb">`INK_HTTP_CACHE_LOOKUP_COMPLETE_HOOK`</span><span class="p">:</span> <span class="n">Traffic</span> <span class="n">Server</span> <span class="n">receives</span> <span class="n">all</span>
+    <span class="n">headers</span> <span class="n">in</span> <span class="n">the</span> <span class="n">origin</span> <span class="n">server</span><span class="err">&#39;</span><span class="n">s</span> <span class="n">response</span><span class="p">,</span> <span class="n">closes</span> <span class="n">the</span> <span class="n">connection</span> <span class="n">to</span>
+    <span class="n">the</span> <span class="n">origin</span> <span class="n">server</span><span class="p">,</span> <span class="ow">and</span> <span class="n">sends</span> <span class="n">a</span> <span class="sb">`500`</span> <span class="n">status</span> <span class="n">message</span> <span class="n">back</span> <span class="n">to</span> <span class="n">the</span>
+    <span class="n">client</span><span class="o">.</span> <span class="n">Traffic</span> <span class="n">Server</span> <span class="n">does</span> <span class="ow">not</span> <span class="n">receive</span> <span class="n">the</span> <span class="n">response</span> <span class="n">body</span><span class="o">.</span>
+<span class="o">-</span>   <span class="sb">`INK_HTTP_TXN_CLOSE_HOOK`</span><span class="p">:</span> <span class="n">the</span> <span class="n">client</span> <span class="n">receives</span> <span class="n">whatever</span> <span class="n">answer</span>
+    <span class="n">was</span> <span class="n">sent</span> <span class="n">by</span> <span class="n">the</span> <span class="n">origin</span> <span class="n">server</span> <span class="n">because</span> <span class="n">with</span> <span class="n">this</span> <span class="n">hook</span><span class="p">,</span> <span class="n">the</span> <span class="n">response</span>
+    <span class="n">has</span> <span class="n">already</span> <span class="n">been</span> <span class="n">sent</span> <span class="n">to</span> <span class="n">the</span> <span class="n">clie</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ <code>INK_SUCCESS</code> if the operation completes successfully.</p>
+<div class="codehilite"><pre><span class="sb">`INK_ERROR`</span> <span class="k">if</span> <span class="n">an</span> <span class="n">error</span> <span class="n">occurs</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxnserveripget">INKHttpTxnServerIPGet</h4>
+<p>Gets the origin server IP address for a specified HTTP
+transaction.</p>
+<p><strong>Prototype</strong>
+  ~ <code>unsigned int INKHttpTxnServerIPGet (INKHttpTxn                 &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>)</p>
+<p><strong>Description</strong>
+  ~ Returns the IP address of the origin server specified by the
+    client request in network byte order. <code>INKHttpTxnServerIPGet</code>
+    returns <code>0</code> if it is called before <code>INK_HTTP_OS_DNS_HOOK</code> in a
+    transaction.</p>
+<div class="codehilite"><pre><span class="n">Call</span> <span class="n">after</span> <span class="sb">`INK_HTTP_OS_DNS_HOOK`</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ Returns the origin server IP address in network byte order.</p>
+<div class="codehilite"><pre><span class="n">Returns</span> <span class="sb">`0`</span> <span class="k">if</span> <span class="n">an</span> <span class="n">error</span> <span class="n">occurred</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxnserverreqget">INKHttpTxnServerReqGet</h4>
+<p>Gets the server request header from a specified HTTP transaction.</p>
+<p><strong>Prototype</strong>
+  ~ <code>int INKHttpTxnServerReqGet (INKHttpTxn                 &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>,
+    INKMBuffer *<em><code>bufp</code></em>, INKMLoc *<em><code>hdr_loc</code></em>)</p>
+<p><strong>Description</strong>
+  ~ Retrieves the server request header from the HTTP transaction
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>. <code>INKHttpTxnServerReqGet</code>
+    stores the server request header in
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;bufp</code>, at location
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;hdr_loc</code>.</p>
+<div class="codehilite"><pre><span class="n">Call</span> <span class="n">after</span> <span class="sb">`SEND_REQUEST_HDR_HOOK`</span><span class="o">.</span>
+
+<span class="n">Release</span> <span class="n">the</span> <span class="n">returned</span> <span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;hdr_loc`</span> <span class="n">with</span> <span class="n">a</span>
+<span class="n">call</span> <span class="n">to</span> <span class="sb">`INKHandleMLocRelease`</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ If the server request header does not exist or in the case of
+    an error, then <code>INKHttpTxnServerReqGet</code> returns <code>0</code>.</p>
+<div class="codehilite"><pre><span class="n">Otherwise</span><span class="p">,</span> <span class="n">it</span> <span class="n">returns</span> <span class="sb">`1`</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxnserverrespget">INKHttpTxnServerRespGet</h4>
+<p>Gets the server response header from a specified HTTP transaction.</p>
+<p><strong>Prototype</strong>
+  ~ <code>int INKHttpTxnServerRespGet (INKHttpTxn                 &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>,
+    INKMBuffer *<em><code>bufp</code></em>, INKMLoc *<em><code>hdr_loc</code></em>)</p>
+<p><strong>Description</strong>
+  ~ Retrieves the server response header from the HTTP transaction
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>. <code>INKHttpTxnServerRespGet</code>
+    stores the server response header in
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;bufp</code>, at location
+    <code>&lt;em class="replaceable"&gt;&lt;code&gt;hdr_loc</code>.</p>
+<div class="codehilite"><pre><span class="n">Call</span> <span class="n">after</span> <span class="sb">`READ_RESPONSE_HDR_HOOK`</span><span class="o">.</span>
+
+<span class="n">Release</span> <span class="n">the</span> <span class="n">returned</span> <span class="sb">`&lt;em class=&quot;replaceable&quot;&gt;&lt;code&gt;hdr_loc`</span> <span class="n">with</span> <span class="n">a</span>
+<span class="n">call</span> <span class="n">to</span> <span class="sb">`INKHandleMLocRelease`</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ If the server response header does not exist or if there is an
+    error, then <code>INKHttpTxnServerRespGet</code> returns <code>0</code>.</p>
+<div class="codehilite"><pre><span class="n">Otherwise</span><span class="p">,</span> <span class="sb">`1`</span> <span class="n">is</span> <span class="n">returned</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxnsetrespcacheableset">INKHttpTxnSetRespCacheableSet</h4>
+<p>Makes a request/response cacheable.</p>
+<p><strong>Prototype</strong>
+  ~ <code>void INKHttpTxnSetRespCacheableSet (INKHttpTxn &lt;span class="replaceable"&gt;txnp&lt;/span&gt;)</code></p>
+<div class="codehilite"><pre>`void INKHttpTxnSetReqCacheableSet (INKHttpTxn <span class="nt">&lt;span</span> <span class="na">class=</span><span class="s">&quot;replaceable&quot;</span><span class="nt">&gt;</span>txnp<span class="nt">&lt;/span&gt;</span>);`
+</pre></div>
+
+
+<p><strong>Description</strong>
+  ~ Sets the request/response as cacheable for a given transaction
+    <code>&lt;span class="replaceable"&gt; txnp&lt;/span&gt;</code>.</p>
+<p><strong>Returns</strong>
+  ~ No values are returned by this function.</p>
+<h4 id="inkhttptxnskiprww">INKHttpTxnSkipRww</h4>
+<p>Turns off read while writing for a transaction.</p>
+<p><strong>Prototype</strong>
+  ~ <code>INKReturnCode INKHttpTxnSkipRww (INKHttpTxn &lt;span class="replaceable"&gt;txnp&lt;/span&gt;)</code></p>
+<p><strong>Description</strong>
+  ~ ((TBD: pending additional info from developer))</p>
+<div class="codehilite"><pre><span class="p">((</span><span class="n">TBD:</span> <span class="n">ts</span><span class="o">-</span><span class="mi">259</span><span class="p">))</span>
+
+<span class="p">((</span><span class="n">TBD</span><span class="p">))</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ INK_SUCCESS if successful.</p>
+<div class="codehilite"><pre><span class="n">INK</span><span class="o">\</span><span class="n">_ERROR</span> <span class="k">if</span> <span class="n">an</span> <span class="n">error</span> <span class="n">occurs</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxnssnget">INKHttpTxnSsnGet</h4>
+<p>Returns the session handle associated with a specific HTTP
+transaction.</p>
+<p><strong>Prototype</strong>
+  ~ <code>INKHttpSsn INKHttpTxnSsnGet (INKHttpTxn                 &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>)</p>
+<p><strong>Description</strong>
+  ~ Retrieves the <code>INKHttpSsn</code> handle associated with the HTTP
+    transaction <code>&lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>.</p>
+<div class="codehilite"><pre><span class="n">Call</span> <span class="n">after</span> <span class="sb">`TXN_START_HOOK`</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ The session handle associated with the specified HTTP
+    transaction.</p>
+<div class="codehilite"><pre><span class="sb">`INK_ERROR_PTR`</span> <span class="k">if</span> <span class="n">an</span> <span class="n">error</span> <span class="n">occurs</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxntransformedrespcache">INKHttpTxnTransformedRespCache</h4>
+<p>Indicates whether Traffic Server writes transformed documents to
+the cache.</p>
+<p><strong>Prototype</strong>
+  ~ <code>INKReturnCode INKHttpTxnTransformedRespCache                 (INKHttpTxn &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>,
+    int <em><code>on</code></em>)</p>
+<p><strong>Description</strong>
+  ~ Specifies whether the transformed document should be written to
+    the cache. If a transformation is occurring, then the default is
+    for the transformed copy to be written to the cache. The default
+    maintains a rule that only a single version of a document is
+    written to the cache for a single transaction. It is valid for that
+    rule to be broken if you specify that both the transformed and
+    untransformed documents be written to the cache. Calls need to be
+    made prior to the actual transformation, (i.e. at the time of
+    creating the transformation) rather than in the transformation.</p>
+<div class="codehilite"><pre><span class="o">!</span><span class="p">[[</span><span class="n">Note</span><span class="p">]](</span><span class="n">images</span><span class="sr">/docbook/</span><span class="n">note</span><span class="o">.</span><span class="n">png</span><span class="p">)</span>
+<span class="n">Note</span>
+<span class="n">This</span> <span class="n">function</span> <span class="n">does</span> <span class="ow">not</span> <span class="n">overwrite</span> <span class="n">HTTP</span> <span class="n">directives</span> <span class="p">(</span><span class="n">like</span>
+<span class="sb">`Cache-Control`</span> <span class="ow">or</span> <span class="sb">`Expires`</span><span class="p">)</span> <span class="n">that</span> <span class="n">determine</span> <span class="n">whether</span> <span class="n">a</span> <span class="n">document</span> <span class="n">is</span>
+<span class="n">cached</span><span class="o">.</span> <span class="n">If</span> <span class="n">the</span> <span class="n">document</span> <span class="n">can</span> <span class="n">be</span> <span class="n">cached</span><span class="p">,</span> <span class="k">then</span> <span class="n">this</span> <span class="n">function</span>
+<span class="n">determines</span> <span class="k">if</span> <span class="n">the</span> <span class="n">transformed</span> <span class="n">version</span> <span class="n">should</span> <span class="n">be</span> <span class="n">cached</span><span class="o">.</span>
+<span class="n">Untransformed</span> <span class="ow">and</span> <span class="n">transformed</span> <span class="n">documents</span> <span class="n">are</span> <span class="n">cached</span> <span class="n">as</span> <span class="n">HTTP</span>
+<span class="n">alternates</span><span class="o">.</span>
+
+<span class="n">Call</span> <span class="n">from</span> <span class="n">within</span> <span class="ow">or</span> <span class="n">after</span> <span class="n">the</span> <span class="n">hook</span> <span class="sb">`TXN_START_HOOK`</span><span class="o">.</span>
+
+<span class="n">If</span> <span class="n">called</span> <span class="n">after</span> <span class="n">hook</span> <span class="sb">`SEND_RESPONSE_HDR`</span><span class="p">,</span> <span class="k">then</span> <span class="n">this</span> <span class="n">function</span> <span class="n">is</span> <span class="ow">not</span>
+<span class="n">taken</span> <span class="n">into</span> <span class="n">account</span> <span class="n">by</span> <span class="n">Traffic</span> <span class="n">Server</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ <code>INK_SUCCESS</code> if the operation completes successfully.</p>
+<div class="codehilite"><pre><span class="sb">`INK_ERROR`</span> <span class="k">if</span> <span class="n">an</span> <span class="n">error</span> <span class="n">occurs</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxntransformrespget">INKHttpTxnTransformRespGet</h4>
+<p>Gets the transform response header from a specified HTTP
+transaction.</p>
+<p><strong>Prototype</strong>
+  ~ <code>int INKHttpTxnTransformRespGet (INKHttpTxn                 &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>,
+    INKMBuffer *<em><code>bufp</code></em>, INKMLoc *<em><code>offset</code></em>)</p>
+<p><strong>Description</strong>
+  ~ Retrieves the transform response header from the HTTP
+    transaction <code>&lt;em class="replaceable"&gt;&lt;code&gt;txnp</code> and stores the
+    transform response header in <code>&lt;em class="replaceable"&gt;&lt;code&gt;bufp</code>,
+    at location <code>&lt;em class="replaceable"&gt;&lt;code&gt;offset</code>.</p>
+<div class="codehilite"><pre><span class="n">Call</span> <span class="n">from</span> <span class="n">within</span> <span class="n">your</span> <span class="n">transformation</span><span class="p">,</span> <span class="n">before</span> <span class="n">transform</span> <span class="n">data</span> <span class="n">is</span>
+<span class="n">written</span> <span class="n">to</span> <span class="n">the</span> <span class="n">downstream</span> <span class="n">vconnection</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ If the transform response header does not exist, then
+    <code>INKHttpTxnTransformRespGet</code> returns <code>0</code>.</p>
+<div class="codehilite"><pre><span class="n">Otherwise</span><span class="p">,</span> <span class="sb">`1`</span> <span class="n">is</span> <span class="n">returned</span><span class="o">.</span>
+</pre></div>
+
+
+<h4 id="inkhttptxnuntransformedrespcache">INKHttpTxnUntransformedRespCache</h4>
+<p>Indicates whether Traffic Server writes untransformed documents to
+cache.</p>
+<p><strong>Prototype</strong>
+  ~ <code>INKReturnCode INKHttpTxnUntransformedRespCache                 (INKHttpTxn &lt;em class="replaceable"&gt;&lt;code&gt;txnp</code>,
+    int <em><code>on</code></em>)</p>
+<p><strong>Description</strong>
+  ~ Specifies whether the untransformed document should be written
+    to the cache. If there is no transformation occurring, then the
+    untransformed copy is written to the cache (by default). If a
+    transformation is occurring, then the untransformed copy is not
+    written to the cache (by default). The default rules dictate that
+    only a single version of a document is written to the cache for a
+    single transaction. It is valid for that rule to be broken by
+    specifying that both the transformed and untransformed document be
+    written to the cache. Calls need to be made prior to the actual
+    transformation (i.e. at the time of creating the transformation),
+    rather than in the transformation.</p>
+<div class="codehilite"><pre><span class="o">!</span><span class="p">[[</span><span class="n">Note</span><span class="p">]](</span><span class="n">images</span><span class="sr">/docbook/</span><span class="n">note</span><span class="o">.</span><span class="n">png</span><span class="p">)</span>
+<span class="n">Note</span>
+<span class="n">This</span> <span class="n">function</span> <span class="n">does</span> <span class="ow">not</span> <span class="n">overwrite</span> <span class="n">HTTP</span> <span class="n">directives</span> <span class="p">(</span><span class="n">ike</span>
+<span class="sb">`Cache-Control`</span> <span class="ow">or</span> <span class="sb">`Expires`</span><span class="p">)</span> <span class="n">that</span> <span class="n">determine</span> <span class="k">if</span> <span class="n">a</span> <span class="n">document</span> <span class="n">can</span> <span class="n">be</span>
+<span class="n">cached</span><span class="o">.</span> <span class="n">If</span> <span class="n">the</span> <span class="n">document</span> <span class="n">can</span> <span class="n">be</span> <span class="n">cached</span><span class="p">,</span> <span class="k">then</span> <span class="n">this</span> <span class="n">function</span>
+<span class="n">determines</span> <span class="k">if</span> <span class="n">the</span> <span class="n">untransformed</span> <span class="n">version</span> <span class="n">should</span> <span class="n">be</span> <span class="n">cached</span><span class="o">.</span>
+<span class="n">Untransformed</span> <span class="ow">and</span> <span class="n">transformed</span> <span class="n">documents</span> <span class="n">are</span> <span class="n">cached</span> <span class="n">as</span> <span class="n">HTTP</span>
+<span class="n">alternates</span><span class="o">.</span>
+
+<span class="n">Call</span> <span class="n">from</span> <span class="n">within</span> <span class="ow">or</span> <span class="n">after</span> <span class="n">hook</span> <span class="sb">`TXN_START_HOOK`</span><span class="o">.</span>
+
+<span class="n">If</span> <span class="n">called</span> <span class="n">after</span> <span class="n">hook</span> <span class="sb">`SEND_RESPONSE_HDR`</span><span class="p">,</span> <span class="k">then</span> <span class="n">Traffic</span> <span class="n">Server</span> <span class="n">does</span>
+<span class="ow">not</span> <span class="n">take</span> <span class="n">this</span> <span class="n">function</span> <span class="n">into</span> <span class="n">account</span><span class="o">.</span>
+</pre></div>
+
+
+<p><strong>Returns</strong>
+  ~ <code>INK_SUCCESS</code> if the operation completes successfully.</p>
+<div class="codehilite"><pre><span class="sb">`INK_ERROR`</span> <span class="k">if</span> <span class="n">an</span> <span class="n">error</span> <span class="n">occurs</span><span class="o">.</span>
+</pre></div>
   </div>
 
   <div id="footer">