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

svn commit: r1040383 [35/38] - in /trafficserver/traffic/branches/wccp: ./ build/ contrib/ contrib/perl/AdminClient/lib/Apache/TS/ example/ example/add-header/ example/app-template/ example/append-transform/ example/basic-auth/ example/blacklist-0/ exa...

Modified: trafficserver/traffic/branches/wccp/test/plugin/lookup/lookup.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/test/plugin/lookup/lookup.c?rev=1040383&r1=1040382&r2=1040383&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/test/plugin/lookup/lookup.c (original)
+++ trafficserver/traffic/branches/wccp/test/plugin/lookup/lookup.c Tue Nov 30 01:42:55 2010
@@ -35,14 +35,14 @@
    Log macros for error code return verification
 **************************************************/
 #define PLUGIN_NAME "lookup"
-#define VALID_POINTER(X) ((X != NULL) && (X != INK_ERROR_PTR))
+#define VALID_POINTER(X) ((X != NULL) && (X != TS_ERROR_PTR))
 #define LOG_SET_FUNCTION_NAME(NAME) const char * FUNCTION_NAME = NAME
 #define LOG_ERROR(API_NAME) { \
-    INKDebug(PLUGIN_NAME, "%s: %s %s %s File %s, line number %d", PLUGIN_NAME, API_NAME, "APIFAIL", \
+    TSDebug(PLUGIN_NAME, "%s: %s %s %s File %s, line number %d", PLUGIN_NAME, API_NAME, "APIFAIL", \
 	     FUNCTION_NAME, __FILE__, __LINE__); \
 }
 #define LOG_ERROR_NEG(API_NAME) { \
-    INKDebug(PLUGIN_NAME, "%s: %s %s %s File %s, line number %d", PLUGIN_NAME, API_NAME, "NEGAPIFAIL", \
+    TSDebug(PLUGIN_NAME, "%s: %s %s %s File %s, line number %d", PLUGIN_NAME, API_NAME, "NEGAPIFAIL", \
 	     FUNCTION_NAME, __FILE__, __LINE__); \
 }
 #define LOG_ERROR_AND_RETURN(API_NAME) { \
@@ -55,7 +55,7 @@
 }
 #define LOG_ERROR_AND_REENABLE(API_NAME) { \
   LOG_ERROR(API_NAME); \
-  INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE); \
+  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE); \
 }
 
 /********************************************************
@@ -74,7 +74,7 @@ const char *HOSTNAME_HDR = "Hostname";
 const char *HOSTNAME_LENGTH_HDR = "Hostname-Length";
 static char *HOSTNAME;
 static int HOSTNAME_LENGTH;
-INKMutex HOSTNAME_LOCK;
+TSMutex HOSTNAME_LOCK;
 
 /*************************************************
    Structure to store the txn continuation data
@@ -85,17 +85,17 @@ typedef struct
   int cache_lookup_status;
   int client_port;
   unsigned int ip_address;
-  INKHttpTxn txnp;
+  TSHttpTxn txnp;
 } ContData;
 
 /*******************************************************/
 /* Convert cache lookup status from constant to string */
 /*******************************************************/
 char *cacheLookupResult[] = {
-  "INK_CACHE_LOOKUP_MISS",
-  "INK_CACHE_LOOKUP_HIT_STALE",
-  "INK_CACHE_LOOKUP_HIT_FRESH",
-  "INK_CACHE_LOOKUP_SKIPPED"
+  "TS_CACHE_LOOKUP_MISS",
+  "TS_CACHE_LOOKUP_HIT_STALE",
+  "TS_CACHE_LOOKUP_HIT_FRESH",
+  "TS_CACHE_LOOKUP_SKIPPED"
 };
 
 
@@ -103,20 +103,20 @@ char *cacheLookupResult[] = {
    Allocate and initialize the continuation data
 **************************************************/
 void
-initContData(INKCont txn_contp)
+initContData(TSCont txn_contp)
 {
   LOG_SET_FUNCTION_NAME("initContData");
 
   ContData *contData;
 
-  contData = (ContData *) INKmalloc(sizeof(ContData));
+  contData = (ContData *) TSmalloc(sizeof(ContData));
   contData->called_cache = 0;
   contData->cache_lookup_status = -1;
   contData->client_port = 0;
   contData->ip_address = 0;
   contData->txnp = NULL;
-  if (INKContDataSet(txn_contp, contData) == INK_ERROR) {
-    LOG_ERROR("INKContDataSet");
+  if (TSContDataSet(txn_contp, contData) == TS_ERROR) {
+    LOG_ERROR("TSContDataSet");
   }
 }
 
@@ -124,17 +124,17 @@ initContData(INKCont txn_contp)
    Cleanup the txn continuation data
 **************************************/
 void
-destroyContData(INKCont txn_contp)
+destroyContData(TSCont txn_contp)
 {
   LOG_SET_FUNCTION_NAME("destroyContData");
 
   ContData *contData;
-  contData = INKContDataGet(txn_contp);
-  if (contData == INK_ERROR_PTR) {
-    LOG_ERROR("INKContDataGet");
+  contData = TSContDataGet(txn_contp);
+  if (contData == TS_ERROR_PTR) {
+    LOG_ERROR("TSContDataGet");
   } else {
     /* txn_contp->txnp = NULL; */
-    INKfree(contData);
+    TSfree(contData);
   }
 }
 
@@ -145,14 +145,14 @@ destroyContData(INKCont txn_contp)
 **************************************/
 /* Comment out because it seems to be
    working at every hook after
-   INK_HTTP_TXN_CACHE_LOOKUP_COMPLETE */
-/* void neg_cache_lookup_bad_hook(INKHttpTxn txnp) { */
+   TS_HTTP_TXN_CACHE_LOOKUP_COMPLETE */
+/* void neg_cache_lookup_bad_hook(TSHttpTxn txnp) { */
 /*     LOG_SET_FUNCTION_NAME("neg_cache_lookup_bad_hook"); */
 
 /*     int cache_lookup = 0; */
-/*     if (INKHttpTxnCacheLookupStatusGet(txnp, &cache_lookup) != INK_ERROR) { */
-/* 	LOG_ERROR_NEG("INKHttpTxnCacheLookupStatusGet"); */
-/* 	INKDebug(DEBUG_TAG, */
+/*     if (TSHttpTxnCacheLookupStatusGet(txnp, &cache_lookup) != TS_ERROR) { */
+/* 	LOG_ERROR_NEG("TSHttpTxnCacheLookupStatusGet"); */
+/* 	TSDebug(DEBUG_TAG, */
 /* 		 "neg_cache_lookup_bad_hook, Got %s\n", cacheLookupResult[cache_lookup]); */
 /*     }  */
 /* } */
@@ -168,8 +168,8 @@ neg_cache_lookup_bad_arg()
   LOG_SET_FUNCTION_NAME("neg_cache_lookup_bad_arg");
 
   int cache_lookup = 0;
-  if (INKHttpTxnCacheLookupStatusGet(NULL, &cache_lookup) != INK_ERROR) {
-    LOG_ERROR_NEG("INKHttpTxnCacheLookupStatusGet");
+  if (TSHttpTxnCacheLookupStatusGet(NULL, &cache_lookup) != TS_ERROR) {
+    LOG_ERROR_NEG("TSHttpTxnCacheLookupStatusGet");
   }
 }
 
@@ -178,33 +178,33 @@ neg_cache_lookup_bad_arg()
     neg1_host_lookup
 **************************************/
 static int
-fake_handler1(INKCont fake_contp, INKEvent event, void *edata)
+fake_handler1(TSCont fake_contp, TSEvent event, void *edata)
 {
 
-  INKDebug(NEG_DEBUG_TAG, "Received event %d", event);
-  INKContDestroy(fake_contp);
+  TSDebug(NEG_DEBUG_TAG, "Received event %d", event);
+  TSContDestroy(fake_contp);
   return 0;
 }
 
 /**************************************
     Fake handler used for neg test
-    INKHttpHookAdd
+    TSHttpHookAdd
 **************************************/
 static int
-fake_handler2(INKCont fake_contp, INKEvent event, void *edata)
+fake_handler2(TSCont fake_contp, TSEvent event, void *edata)
 {
   LOG_SET_FUNCTION_NAME("fake_handler2");
 
-  INKDebug(NEG_DEBUG_TAG, "Received event %d", event);
-  INKContDestroy(fake_contp);
-  LOG_ERROR_NEG("INKHttpHookAdd");
-  INKHttpTxnReenable((INKHttpTxn) edata, INK_EVENT_HTTP_CONTINUE);
+  TSDebug(NEG_DEBUG_TAG, "Received event %d", event);
+  TSContDestroy(fake_contp);
+  LOG_ERROR_NEG("TSHttpHookAdd");
+  TSHttpTxnReenable((TSHttpTxn) edata, TS_EVENT_HTTP_CONTINUE);
   return 0;
 }
 
 /**************************************
     Negative testing 1 for host lookup:
-    Call the INKHostLookup with bad
+    Call the TSHostLookup with bad
     arguments and verify it returns an
     error
 **************************************/
@@ -213,35 +213,35 @@ neg1_host_lookup()
 {
   LOG_SET_FUNCTION_NAME("neg1_host_lookup");
 
-  INKCont fake_contp1, fake_contp2;
-  INKAction pending_action;
+  TSCont fake_contp1, fake_contp2;
+  TSAction pending_action;
 
   /* Create fake continuations */
-  fake_contp1 = INKContCreate(fake_handler1, INKMutexCreate());
-  fake_contp2 = INKContCreate(fake_handler1, INKMutexCreate());
+  fake_contp1 = TSContCreate(fake_handler1, TSMutexCreate());
+  fake_contp2 = TSContCreate(fake_handler1, TSMutexCreate());
 
   /* call with NULL continuation */
-  pending_action = INKHostLookup(NULL, HOSTNAME, HOSTNAME_LENGTH);
-  if (pending_action != INK_ERROR_PTR) {
-    LOG_ERROR_NEG("INKHostLookup");
+  pending_action = TSHostLookup(NULL, HOSTNAME, HOSTNAME_LENGTH);
+  if (pending_action != TS_ERROR_PTR) {
+    LOG_ERROR_NEG("TSHostLookup");
   } else {
     /* Call with NULL hostname */
-    pending_action = INKHostLookup(fake_contp1, NULL, HOSTNAME_LENGTH);
-    if (pending_action != INK_ERROR_PTR) {
-      LOG_ERROR_NEG("INKHostLookup");
+    pending_action = TSHostLookup(fake_contp1, NULL, HOSTNAME_LENGTH);
+    if (pending_action != TS_ERROR_PTR) {
+      LOG_ERROR_NEG("TSHostLookup");
     } else {
       /* Destroy fake_contp1 */
-      INKContDestroy(fake_contp1);
+      TSContDestroy(fake_contp1);
 
       /* Call with a 0 HOSTNAME_LENGTH */
       /* Use different continuation to call this API because it is reentrant,
          i.e. we might use fake_contp1 while it has already been destroyed */
-      pending_action = INKHostLookup(fake_contp2, HOSTNAME, 0);
-      if (pending_action != INK_ERROR_PTR) {
-        LOG_ERROR_NEG("INKHostLookup");
+      pending_action = TSHostLookup(fake_contp2, HOSTNAME, 0);
+      if (pending_action != TS_ERROR_PTR) {
+        LOG_ERROR_NEG("TSHostLookup");
       } else {
         /* Destroy fake_contp2 */
-        INKContDestroy(fake_contp2);
+        TSContDestroy(fake_contp2);
       }
     }
   }
@@ -249,7 +249,7 @@ neg1_host_lookup()
 
 /**************************************
     Negative testing 2 for host lookup:
-    Call the INKHostLookupResultIPGet
+    Call the TSHostLookupResultIPGet
     with NULL lookup result and verify
     it returns an error
 **************************************/
@@ -261,42 +261,42 @@ neg2_host_lookup()
   unsigned int ip;
 
   /* call with NULL lookup result */
-  if (INKHostLookupResultIPGet(NULL, &ip) != INK_ERROR) {
-    LOG_ERROR_NEG("INKHostLookupResultIPGet");
+  if (TSHostLookupResultIPGet(NULL, &ip) != TS_ERROR) {
+    LOG_ERROR_NEG("TSHostLookupResultIPGet");
   }
 }
 
 /**************************************************
     This function is called to verify that the
-    value returned by INKHttpTxnClientRemotePortGet
+    value returned by TSHttpTxnClientRemotePortGet
     remains consistent along the HTTP state machine
 ***************************************************/
 int
-check_client_port(INKHttpTxn txnp, ContData * contData)
+check_client_port(TSHttpTxn txnp, ContData * contData)
 {
   LOG_SET_FUNCTION_NAME("check_client_port");
 
   int clientPortGot = 0;
 
-  /* INKHttpTxnClientRemotePortGet  */
-  if (INKHttpTxnClientRemotePortGet(txnp, &clientPortGot) == INK_ERROR) {
-    LOG_ERROR_AND_RETURN("INKHttpTxnClientRemotePortGet");
+  /* TSHttpTxnClientRemotePortGet  */
+  if (TSHttpTxnClientRemotePortGet(txnp, &clientPortGot) == TS_ERROR) {
+    LOG_ERROR_AND_RETURN("TSHttpTxnClientRemotePortGet");
   } else {
-    INKDebug(DEBUG_TAG, "INKHttpTxnClientRemotePortGet returned %d", clientPortGot);
+    TSDebug(DEBUG_TAG, "TSHttpTxnClientRemotePortGet returned %d", clientPortGot);
     /* Make sure the client port was set at Read_request hook, to avoid
        firing the assert because the client aborted */
     if (contData->client_port != 0) {
       if (clientPortGot != contData->client_port) {
-        INKDebug(DEBUG_TAG, "Bad client port: Expected %d, Got %d", contData->client_port, clientPortGot);
-        INKReleaseAssert(!"INKHttpTxnClientRemotePortGet returned bad client port");
+        TSDebug(DEBUG_TAG, "Bad client port: Expected %d, Got %d", contData->client_port, clientPortGot);
+        TSReleaseAssert(!"TSHttpTxnClientRemotePortGet returned bad client port");
       }
     }
   }
 
 /* NEGATIVE TEST for client port */
 #ifdef DEBUG
-  if (INKHttpTxnClientRemotePortGet(NULL, &clientPortGot) != INK_ERROR) {
-    LOG_ERROR_NEG("INKHttpTxnClientRemotePortGet");
+  if (TSHttpTxnClientRemotePortGet(NULL, &clientPortGot) != TS_ERROR) {
+    LOG_ERROR_NEG("TSHttpTxnClientRemotePortGet");
   }
 #endif
 
@@ -307,21 +307,21 @@ check_client_port(INKHttpTxn txnp, ContD
    Release the txn_contp data and destroy it
 ***************************************************/
 int
-handle_txn_close(INKHttpTxn txnp, INKCont txn_contp)
+handle_txn_close(TSHttpTxn txnp, TSCont txn_contp)
 {
   LOG_SET_FUNCTION_NAME("handle_txn_close");
 
 /* NEGATIVE TEST for cache lookup */
 #ifdef DEBUG
 /*     neg_cache_lookup_bad_hook(txnp); */
-/*     INKDebug(DEBUG_TAG, */
+/*     TSDebug(DEBUG_TAG, */
 /* 	     "NEGATIVE test cache lookup bad hook in %s passed", FUNCTION_NAME); */
   neg_cache_lookup_bad_arg();
 #endif
 
   destroyContData(txn_contp);
-  if (INKContDestroy(txn_contp) == INK_ERROR) {
-    LOG_ERROR("INKContDestroy");
+  if (TSContDestroy(txn_contp) == TS_ERROR) {
+    LOG_ERROR("TSContDestroy");
   }
 
   return 0;
@@ -331,35 +331,35 @@ handle_txn_close(INKHttpTxn txnp, INKCon
    Insert the Host-IP header in the client response
 ***************************************************/
 int
-handle_send_response(INKHttpTxn txnp, ContData * contData)
+handle_send_response(TSHttpTxn txnp, ContData * contData)
 {
   LOG_SET_FUNCTION_NAME("handle_send_response");
 
   char ipGot[100];
   char temp[25];
-  INKMBuffer respBuf;
-  INKMLoc respLoc, hostIPLoc;
+  TSMBuffer respBuf;
+  TSMLoc respLoc, hostIPLoc;
 
   /* Check Client Port is consistent */
   check_client_port(txnp, contData);
 
   /*  Get client response */
-  if (!INKHttpTxnClientRespGet(txnp, &respBuf, &respLoc)) {
-    LOG_ERROR_AND_RETURN("INKHttpTxnClientRespGet");
+  if (!TSHttpTxnClientRespGet(txnp, &respBuf, &respLoc)) {
+    LOG_ERROR_AND_RETURN("TSHttpTxnClientRespGet");
   }
 
   /* Create Host-IP header */
-  hostIPLoc = INKMimeHdrFieldCreate(respBuf, respLoc);
-  if (hostIPLoc == INK_ERROR_PTR) {
-    LOG_ERROR_AND_CLEANUP("INKMimeHdrFieldCreate");
+  hostIPLoc = TSMimeHdrFieldCreate(respBuf, respLoc);
+  if (hostIPLoc == TS_ERROR_PTR) {
+    LOG_ERROR_AND_CLEANUP("TSMimeHdrFieldCreate");
   }
   /* Append Host-IP hdr to client response */
-  if (INKMimeHdrFieldAppend(respBuf, respLoc, hostIPLoc) == INK_ERROR) {
-    LOG_ERROR_AND_CLEANUP("INKMimeHdrFieldAppend");
+  if (TSMimeHdrFieldAppend(respBuf, respLoc, hostIPLoc) == TS_ERROR) {
+    LOG_ERROR_AND_CLEANUP("TSMimeHdrFieldAppend");
   }
   /* Set Host-IP hdr Name */
-  if (INKMimeHdrFieldNameSet(respBuf, respLoc, hostIPLoc, HOSTIP_HDR, strlen(HOSTIP_HDR))) {
-    LOG_ERROR_AND_CLEANUP("INKMimeHdrFieldNameSet");
+  if (TSMimeHdrFieldNameSet(respBuf, respLoc, hostIPLoc, HOSTIP_HDR, strlen(HOSTIP_HDR))) {
+    LOG_ERROR_AND_CLEANUP("TSMimeHdrFieldNameSet");
   }
   /* Get Host-IP hdr value from unsigned integer to a string */
   if (contData->ip_address != 0) {
@@ -373,31 +373,31 @@ handle_send_response(INKHttpTxn txnp, Co
     strcat(ipGot, ".");
     sprintf(temp, "%u", IP_d(contData->ip_address));
     strcat(ipGot, temp);
-    INKDebug(DEBUG_TAG, "IP@ = %s", ipGot);
+    TSDebug(DEBUG_TAG, "IP@ = %s", ipGot);
   } else {
     sprintf(ipGot, "%d", 0);
   }
   /* Set Host-IP hdr value */
-  if (INKMimeHdrFieldValueStringSet(respBuf, respLoc, hostIPLoc, -1, ipGot, -1) == INK_ERROR) {
-    LOG_ERROR("INKMimeHdrFieldValueStringSet");
+  if (TSMimeHdrFieldValueStringSet(respBuf, respLoc, hostIPLoc, -1, ipGot, -1) == TS_ERROR) {
+    LOG_ERROR("TSMimeHdrFieldValueStringSet");
   }
 
 Lcleanup:
   if (VALID_POINTER(hostIPLoc)) {
-    if (INKHandleMLocRelease(respBuf, respLoc, hostIPLoc) == INK_ERROR) {
-      LOG_ERROR("INKHandleMLocRelease");
+    if (TSHandleMLocRelease(respBuf, respLoc, hostIPLoc) == TS_ERROR) {
+      LOG_ERROR("TSHandleMLocRelease");
     }
   }
   if (VALID_POINTER(respLoc)) {
-    if (INKHandleMLocRelease(respBuf, INK_NULL_MLOC, respLoc) == INK_ERROR) {
-      LOG_ERROR("INKHandleMLocRelease");
+    if (TSHandleMLocRelease(respBuf, TS_NULL_MLOC, respLoc) == TS_ERROR) {
+      LOG_ERROR("TSHandleMLocRelease");
     }
   }
 
 /* NEGATIVE TEST for cache lookup */
 #ifdef DEBUG
 /*     neg_cache_lookup_bad_hook(txnp); */
-/*     INKDebug(DEBUG_TAG, */
+/*     TSDebug(DEBUG_TAG, */
 /* 	     "NEGATIVE test cache lookup bad hook in %s passed", FUNCTION_NAME); */
   neg_cache_lookup_bad_arg();
 #endif
@@ -410,7 +410,7 @@ Lcleanup:
    Verify cache lookup is consistent
 ***************************************************/
 int
-handle_read_response(INKHttpTxn txnp, ContData * contData)
+handle_read_response(TSHttpTxn txnp, ContData * contData)
 {
   LOG_SET_FUNCTION_NAME("handle_read_response");
 
@@ -418,13 +418,13 @@ handle_read_response(INKHttpTxn txnp, Co
   check_client_port(txnp, contData);
 
   /* Verify cache_lookup_status is consistent */
-  /* Should not be a INK_CACHE_LOOKUP_HIT_FRESH */
-  INKReleaseAssert(contData->cache_lookup_status != INK_CACHE_LOOKUP_HIT_FRESH);
+  /* Should not be a TS_CACHE_LOOKUP_HIT_FRESH */
+  TSReleaseAssert(contData->cache_lookup_status != TS_CACHE_LOOKUP_HIT_FRESH);
 
 /* NEGATIVE TEST for cache lookup */
 #ifdef DEBUG
 /*     neg_cache_lookup_bad_hook(txnp); */
-/*     INKDebug(DEBUG_TAG, */
+/*     TSDebug(DEBUG_TAG, */
 /* 	     "NEGATIVE test cache lookup bad hook in %s passed", FUNCTION_NAME); */
   neg_cache_lookup_bad_arg();
 #endif
@@ -437,7 +437,7 @@ handle_read_response(INKHttpTxn txnp, Co
    Verify cache lookup is consistent
 ***************************************************/
 int
-handle_send_request(INKHttpTxn txnp, ContData * contData)
+handle_send_request(TSHttpTxn txnp, ContData * contData)
 {
   LOG_SET_FUNCTION_NAME("handle_send_request");
 
@@ -445,13 +445,13 @@ handle_send_request(INKHttpTxn txnp, Con
   check_client_port(txnp, contData);
 
   /* Verify cache_lookup_status is consistent */
-  /* Should not be a INK_CACHE_LOOKUP_HIT_FRESH */
-  INKReleaseAssert(contData->cache_lookup_status != INK_CACHE_LOOKUP_HIT_FRESH);
+  /* Should not be a TS_CACHE_LOOKUP_HIT_FRESH */
+  TSReleaseAssert(contData->cache_lookup_status != TS_CACHE_LOOKUP_HIT_FRESH);
 
 /* NEGATIVE TEST for cache lookup */
 #ifdef DEBUG
 /*     neg_cache_lookup_bad_hook(txnp); */
-/*     INKDebug(DEBUG_TAG, */
+/*     TSDebug(DEBUG_TAG, */
 /* 	     "NEGATIVE test cache lookup bad hook in %s passed", FUNCTION_NAME); */
   neg_cache_lookup_bad_arg();
 #endif
@@ -464,7 +464,7 @@ handle_send_request(INKHttpTxn txnp, Con
    Set cache_lookup_status
 ***************************************************/
 int
-handle_cache_lookup_complete(INKHttpTxn txnp, ContData * contData)
+handle_cache_lookup_complete(TSHttpTxn txnp, ContData * contData)
 {
   LOG_SET_FUNCTION_NAME("handle_cache_lookup_complete");
 
@@ -475,25 +475,25 @@ handle_cache_lookup_complete(INKHttpTxn 
   /* Cache Lookup */
     /****************/
   /* Get cache lookup status */
-  if (INKHttpTxnCacheLookupStatusGet(txnp, &contData->cache_lookup_status) == INK_ERROR) {
-    LOG_ERROR_AND_RETURN("INKHttpTxnCacheLookupStatusGet");
+  if (TSHttpTxnCacheLookupStatusGet(txnp, &contData->cache_lookup_status) == TS_ERROR) {
+    LOG_ERROR_AND_RETURN("TSHttpTxnCacheLookupStatusGet");
   }
-  INKDebug(DEBUG_TAG, "Got cache lookup status %s", cacheLookupResult[contData->cache_lookup_status]);
+  TSDebug(DEBUG_TAG, "Got cache lookup status %s", cacheLookupResult[contData->cache_lookup_status]);
   /* Verify cache_lookup_status and called_cache are consistent */
-  if (contData->cache_lookup_status == INK_CACHE_LOOKUP_MISS) {
+  if (contData->cache_lookup_status == TS_CACHE_LOOKUP_MISS) {
     /* called_cache should not be set */
-    INKReleaseAssert(!contData->called_cache);
-  } else if (contData->cache_lookup_status == INK_CACHE_LOOKUP_HIT_STALE) {
+    TSReleaseAssert(!contData->called_cache);
+  } else if (contData->cache_lookup_status == TS_CACHE_LOOKUP_HIT_STALE) {
     /* called_cache should be set */
-    INKReleaseAssert(contData->called_cache);
-  } else if (contData->cache_lookup_status == INK_CACHE_LOOKUP_HIT_FRESH) {
+    TSReleaseAssert(contData->called_cache);
+  } else if (contData->cache_lookup_status == TS_CACHE_LOOKUP_HIT_FRESH) {
     /* called_cache should be set */
-    INKReleaseAssert(contData->called_cache);
-  } else if (contData->cache_lookup_status == INK_CACHE_LOOKUP_SKIPPED) {
+    TSReleaseAssert(contData->called_cache);
+  } else if (contData->cache_lookup_status == TS_CACHE_LOOKUP_SKIPPED) {
     /* called_cache should not be set */
-    INKReleaseAssert(!contData->called_cache);
+    TSReleaseAssert(!contData->called_cache);
   } else
-    INKReleaseAssert(!"Bad Cache Lookup Status");
+    TSReleaseAssert(!"Bad Cache Lookup Status");
 
 /* NEGATIVE TEST for cache lookup */
 #ifdef DEBUG
@@ -508,7 +508,7 @@ handle_cache_lookup_complete(INKHttpTxn 
    Set called_cache
 ***************************************************/
 int
-handle_read_cache(INKHttpTxn txnp, ContData * contData)
+handle_read_cache(TSHttpTxn txnp, ContData * contData)
 {
   LOG_SET_FUNCTION_NAME("handle_read_cache");
 
@@ -521,7 +521,7 @@ handle_read_cache(INKHttpTxn txnp, ContD
 /* NEGATIVE TEST for cache lookup */
 #ifdef DEBUG
 /*     neg_cache_lookup_bad_hook(txnp); */
-/*     INKDebug(DEBUG_TAG, */
+/*     TSDebug(DEBUG_TAG, */
 /* 	     "NEGATIVE test cache lookup bad hook in %s passed", FUNCTION_NAME); */
   neg_cache_lookup_bad_arg();
 #endif
@@ -533,49 +533,49 @@ handle_read_cache(INKHttpTxn txnp, ContD
    Set client_port
    Parse HOSTNAME and HOSTNAME-LENGTH from client
    request
-   Call INKHostLookup
+   Call TSHostLookup
 ***************************************************/
 int
-handle_read_request(INKHttpTxn txnp, INKCont txn_contp)
+handle_read_request(TSHttpTxn txnp, TSCont txn_contp)
 {
   LOG_SET_FUNCTION_NAME("handle_read_request");
 
   int clientPortGot = 0;
   const char *hostnameString = NULL, *hostnameLengthString = NULL;
   int hostnameStringLength = 0, hostnameLengthStringLength = 0;
-  INKMBuffer clientReqBuf;
-  INKMLoc clientReqLoc, hostnameLoc, hostnameLengthLoc;
+  TSMBuffer clientReqBuf;
+  TSMLoc clientReqLoc, hostnameLoc, hostnameLengthLoc;
   ContData *contData;
 
   /* Get client request */
-  if (!INKHttpTxnClientReqGet(txnp, &clientReqBuf, &clientReqLoc)) {
-    LOG_ERROR_AND_RETURN("INKHttpTxnClientReqGet");
+  if (!TSHttpTxnClientReqGet(txnp, &clientReqBuf, &clientReqLoc)) {
+    LOG_ERROR_AND_RETURN("TSHttpTxnClientReqGet");
   }
 
     /***************/
   /* Client port */
     /***************/
   /* Get txn_contp data pointer */
-  contData = INKContDataGet(txn_contp);
-  if (contData == INK_ERROR_PTR) {
-    LOG_ERROR("INKContDataGet");
+  contData = TSContDataGet(txn_contp);
+  if (contData == TS_ERROR_PTR) {
+    LOG_ERROR("TSContDataGet");
   } else {
-    /* INKHttpTxnClientRemotePortGet  */
-    if (INKHttpTxnClientRemotePortGet(txnp, &contData->client_port) == INK_ERROR) {
-      LOG_ERROR_AND_CLEANUP("INKHttpTxnClientRemotePortGet");
+    /* TSHttpTxnClientRemotePortGet  */
+    if (TSHttpTxnClientRemotePortGet(txnp, &contData->client_port) == TS_ERROR) {
+      LOG_ERROR_AND_CLEANUP("TSHttpTxnClientRemotePortGet");
     } else {
-      INKDebug(DEBUG_TAG, "INKHttpTxnClientRemotePortGet returned %d", contData->client_port);
+      TSDebug(DEBUG_TAG, "TSHttpTxnClientRemotePortGet returned %d", contData->client_port);
     }
   }
 
 /* NEGATIVE TEST for client port, cache lookup and host lookup */
 #ifdef DEBUG
-  if (INKHttpTxnClientRemotePortGet(NULL, &clientPortGot) != INK_ERROR) {
-    LOG_ERROR_NEG("INKHttpTxnClientRemotePortGet");
+  if (TSHttpTxnClientRemotePortGet(NULL, &clientPortGot) != TS_ERROR) {
+    LOG_ERROR_NEG("TSHttpTxnClientRemotePortGet");
   }
 
 /*     neg_cache_lookup_bad_hook(txnp); */
-/*     INKDebug(DEBUG_TAG, */
+/*     TSDebug(DEBUG_TAG, */
 /* 	     "NEGATIVE test cache lookup bad hook in %s passed", FUNCTION_NAME); */
   neg_cache_lookup_bad_arg();
 
@@ -586,97 +586,97 @@ handle_read_request(INKHttpTxn txnp, INK
 #endif
 
     /*****************/
-  /* INKHostLookup */
+  /* TSHostLookup */
     /*****************/
   /* Get "Hostname" header */
-  hostnameLoc = INKMimeHdrFieldFind(clientReqBuf, clientReqLoc, HOSTNAME_HDR, strlen(HOSTNAME_HDR));
-  if (hostnameLoc == INK_ERROR_PTR) {
-    LOG_ERROR("INKMimeHdrFieldFind");
+  hostnameLoc = TSMimeHdrFieldFind(clientReqBuf, clientReqLoc, HOSTNAME_HDR, strlen(HOSTNAME_HDR));
+  if (hostnameLoc == TS_ERROR_PTR) {
+    LOG_ERROR("TSMimeHdrFieldFind");
   } else if (!hostnameLoc) {
     /* Client did not send header, use default */
-    INKDebug(DEBUG_TAG, "No Hostname header in client's request");
+    TSDebug(DEBUG_TAG, "No Hostname header in client's request");
   } else {
     /* Get the hostname value. If fails use default */
-    if (INKMimeHdrFieldValueStringGet
-        (clientReqBuf, clientReqLoc, hostnameLoc, 0, &hostnameString, &hostnameStringLength) == INK_ERROR) {
-      LOG_ERROR("INKMimeHdrFieldValueStringGet");
+    if (TSMimeHdrFieldValueStringGet
+        (clientReqBuf, clientReqLoc, hostnameLoc, 0, &hostnameString, &hostnameStringLength) == TS_ERROR) {
+      LOG_ERROR("TSMimeHdrFieldValueStringGet");
     } else if ((!hostnameString) || (hostnameStringLength == 0)) {
       /* Client sent header without value  */
-      INKDebug(DEBUG_TAG, "No Hostname header value in client's request");
+      TSDebug(DEBUG_TAG, "No Hostname header value in client's request");
     } else {
       /* Set HOSTNAME */
-      if (INKMutexLock(HOSTNAME_LOCK) == INK_ERROR) {
-        LOG_ERROR("INKMutexLock");
+      if (TSMutexLock(HOSTNAME_LOCK) == TS_ERROR) {
+        LOG_ERROR("TSMutexLock");
       }
-      /* 1rst free the previous INKstrdup */
-      INKfree(HOSTNAME);
-      HOSTNAME = INKstrdup(hostnameString);
-      INKMutexUnlock(HOSTNAME_LOCK);
+      /* 1rst free the previous TSstrdup */
+      TSfree(HOSTNAME);
+      HOSTNAME = TSstrdup(hostnameString);
+      TSMutexUnlock(HOSTNAME_LOCK);
     }
   }
   /* Get "Hostname-Length" header */
-  hostnameLengthLoc = INKMimeHdrFieldFind(clientReqBuf, clientReqLoc, HOSTNAME_LENGTH_HDR, strlen(HOSTNAME_LENGTH_HDR));
-  if (hostnameLengthLoc == INK_ERROR_PTR) {
-    LOG_ERROR("INKMimeHdrFieldFind");
+  hostnameLengthLoc = TSMimeHdrFieldFind(clientReqBuf, clientReqLoc, HOSTNAME_LENGTH_HDR, strlen(HOSTNAME_LENGTH_HDR));
+  if (hostnameLengthLoc == TS_ERROR_PTR) {
+    LOG_ERROR("TSMimeHdrFieldFind");
   } else if (!hostnameLengthLoc) {
     /* Client did not send header, use default */
-    INKDebug(DEBUG_TAG, "No Hostname-Length header in client's request");
+    TSDebug(DEBUG_TAG, "No Hostname-Length header in client's request");
   } else {
     /* Get the hostname length value. If fails use default */
-    if (INKMimeHdrFieldValueStringGet
+    if (TSMimeHdrFieldValueStringGet
         (clientReqBuf, clientReqLoc, hostnameLengthLoc, 0, &hostnameLengthString,
-         &hostnameLengthStringLength) == INK_ERROR) {
-      LOG_ERROR("INKMimeHdrFieldValueStringGet");
+         &hostnameLengthStringLength) == TS_ERROR) {
+      LOG_ERROR("TSMimeHdrFieldValueStringGet");
     } else if ((!hostnameLengthString) || (hostnameLengthStringLength == 0)) {
       /* Client sent header without value  */
-      INKDebug(DEBUG_TAG, "No Hostname-Length header value in client's request");
+      TSDebug(DEBUG_TAG, "No Hostname-Length header value in client's request");
     } else {
       if (!isnan(atoi(hostnameLengthString))) {
         /* Set HOSTNAME_LENGTH */
-        if (INKMutexLock(HOSTNAME_LOCK) == INK_ERROR) {
-          LOG_ERROR("INKMutexLock");
+        if (TSMutexLock(HOSTNAME_LOCK) == TS_ERROR) {
+          LOG_ERROR("TSMutexLock");
         }
         HOSTNAME_LENGTH = atoi(hostnameLengthString);
-        INKMutexUnlock(HOSTNAME_LOCK);
+        TSMutexUnlock(HOSTNAME_LOCK);
       }
     }
   }
 
 Lcleanup:
   if (VALID_POINTER(hostnameString)) {
-    if (INKHandleStringRelease(clientReqBuf, hostnameLoc, hostnameString) == INK_ERROR) {
-      LOG_ERROR("INKHandleStringRelease");
+    if (TSHandleStringRelease(clientReqBuf, hostnameLoc, hostnameString) == TS_ERROR) {
+      LOG_ERROR("TSHandleStringRelease");
     }
   }
   if (VALID_POINTER(hostnameLengthString)) {
-    if (INKHandleStringRelease(clientReqBuf, hostnameLengthLoc, hostnameLengthString) == INK_ERROR) {
-      LOG_ERROR("INKHandleStringRelease");
+    if (TSHandleStringRelease(clientReqBuf, hostnameLengthLoc, hostnameLengthString) == TS_ERROR) {
+      LOG_ERROR("TSHandleStringRelease");
     }
   }
   if (VALID_POINTER(hostnameLoc)) {
-    if (INKHandleMLocRelease(clientReqBuf, clientReqLoc, hostnameLoc) == INK_ERROR) {
-      LOG_ERROR("INKHandleMLocRelease");
+    if (TSHandleMLocRelease(clientReqBuf, clientReqLoc, hostnameLoc) == TS_ERROR) {
+      LOG_ERROR("TSHandleMLocRelease");
     }
   }
   if (VALID_POINTER(hostnameLengthLoc)) {
-    if (INKHandleMLocRelease(clientReqBuf, clientReqLoc, hostnameLengthLoc) == INK_ERROR) {
-      LOG_ERROR("INKHandleMLocRelease");
+    if (TSHandleMLocRelease(clientReqBuf, clientReqLoc, hostnameLengthLoc) == TS_ERROR) {
+      LOG_ERROR("TSHandleMLocRelease");
     }
   }
   if (VALID_POINTER(clientReqLoc)) {
-    if (INKHandleMLocRelease(clientReqBuf, INK_NULL_MLOC, clientReqLoc) == INK_ERROR) {
-      LOG_ERROR("INKHandleMLocRelease");
+    if (TSHandleMLocRelease(clientReqBuf, TS_NULL_MLOC, clientReqLoc) == TS_ERROR) {
+      LOG_ERROR("TSHandleMLocRelease");
     }
   }
 
-  /* Call INKHostLookup */
+  /* Call TSHostLookup */
   /* Called completly at the end because right after the call,
      the DNS processor might call back txn_contp wih the
-     INK_EVENT_HOST_LOOKUP, and txnp will be reenabled while
+     TS_EVENT_HOST_LOOKUP, and txnp will be reenabled while
      txnp is still being accessed in this handler, that would
      be bad!!! */
-  if (INKHostLookup(txn_contp, HOSTNAME, HOSTNAME_LENGTH) == INK_ERROR_PTR) {
-    LOG_ERROR("INKHostLookup");
+  if (TSHostLookup(txn_contp, HOSTNAME, HOSTNAME_LENGTH) == TS_ERROR_PTR) {
+    LOG_ERROR("TSHostLookup");
   }
   /* Do nothing after this call, return right away */
   return 0;
@@ -689,9 +689,9 @@ Lcleanup:
    - be called back by the DNS processor when the host lookup is done
    - store all the transaction specific data
    Tricks:
-   - when called back with INK_EVENT_HTTP_READ_REQUEST_HDR, do not
+   - when called back with TS_EVENT_HTTP_READ_REQUEST_HDR, do not
    reenable the transaction, instead return, and reenable the
-   transaction when called back with INK_EVENT_HOST_LOOKUP, so that
+   transaction when called back with TS_EVENT_HOST_LOOKUP, so that
    when we don't need to maintain a state in the continuation. And
    also when we need the host lookup result at the send response hook
    we are sure that the result will be available.
@@ -700,93 +700,93 @@ Lcleanup:
    asynchronous part (host lookup)
 **********************************************************************/
 static int
-txn_cont_handler(INKCont txn_contp, INKEvent event, void *edata)
+txn_cont_handler(TSCont txn_contp, TSEvent event, void *edata)
 {
   LOG_SET_FUNCTION_NAME("hostlookup");
 
-  INKHostLookupResult result;
-  INKHttpTxn txnp;
+  TSHostLookupResult result;
+  TSHttpTxn txnp;
   ContData *contData;
 
-  contData = INKContDataGet(txn_contp);
+  contData = TSContDataGet(txn_contp);
 
   switch (event) {
         /***************/
     /* HTTP events */
         /***************/
-  case INK_EVENT_HTTP_READ_REQUEST_HDR:
-    txnp = (INKHttpTxn) edata;
+  case TS_EVENT_HTTP_READ_REQUEST_HDR:
+    txnp = (TSHttpTxn) edata;
     handle_read_request(txnp, txn_contp);
     return 0;
-  case INK_EVENT_HTTP_READ_CACHE_HDR:
-    txnp = (INKHttpTxn) edata;
-    if (contData == INK_ERROR_PTR) {
-      LOG_ERROR("INKContDataGet");
+  case TS_EVENT_HTTP_READ_CACHE_HDR:
+    txnp = (TSHttpTxn) edata;
+    if (contData == TS_ERROR_PTR) {
+      LOG_ERROR("TSContDataGet");
     } else {
       handle_read_cache(txnp, contData);
     }
     break;
-  case INK_EVENT_HTTP_CACHE_LOOKUP_COMPLETE:
-    txnp = (INKHttpTxn) edata;
+  case TS_EVENT_HTTP_CACHE_LOOKUP_COMPLETE:
+    txnp = (TSHttpTxn) edata;
     handle_cache_lookup_complete(txnp, contData);
     break;
-  case INK_EVENT_HTTP_SEND_REQUEST_HDR:
-    txnp = (INKHttpTxn) edata;
+  case TS_EVENT_HTTP_SEND_REQUEST_HDR:
+    txnp = (TSHttpTxn) edata;
     handle_send_request(txnp, contData);
     break;
-  case INK_EVENT_HTTP_READ_RESPONSE_HDR:
-    txnp = (INKHttpTxn) edata;
+  case TS_EVENT_HTTP_READ_RESPONSE_HDR:
+    txnp = (TSHttpTxn) edata;
     handle_read_response(txnp, contData);
     break;
-  case INK_EVENT_HTTP_SEND_RESPONSE_HDR:
-    txnp = (INKHttpTxn) edata;
-    if (contData == INK_ERROR_PTR) {
-      LOG_ERROR("INKContDataGet");
+  case TS_EVENT_HTTP_SEND_RESPONSE_HDR:
+    txnp = (TSHttpTxn) edata;
+    if (contData == TS_ERROR_PTR) {
+      LOG_ERROR("TSContDataGet");
     } else {
       handle_send_response(txnp, contData);
     }
     break;
-  case INK_EVENT_HTTP_TXN_CLOSE:
-    txnp = (INKHttpTxn) edata;
+  case TS_EVENT_HTTP_TXN_CLOSE:
+    txnp = (TSHttpTxn) edata;
     handle_txn_close(txnp, txn_contp);
     break;
 
         /*********************/
     /* Host Lookup event */
         /*********************/
-  case INK_EVENT_HOST_LOOKUP:
-    if (contData == INK_ERROR_PTR) {
+  case TS_EVENT_HOST_LOOKUP:
+    if (contData == TS_ERROR_PTR) {
       /* In this case we are stuck, we cannot get the continuation
          data which contains the HTTP txn pointer, i.e. we cannot
          reenable the transaction, so we might as well assert here */
-      LOG_ERROR("INKContDataGet");
-      INKReleaseAssert(!"Could not get contp data");
+      LOG_ERROR("TSContDataGet");
+      TSReleaseAssert(!"Could not get contp data");
     }
     txnp = contData->txnp;
-    result = (INKHostLookupResult) edata;
+    result = (TSHostLookupResult) edata;
     if (result != NULL) {
       /* Get the IP@ */
-      if (INKHostLookupResultIPGet(result, &contData->ip_address) == INK_ERROR) {
-        LOG_ERROR("INKHostLookupResultIPGet");
+      if (TSHostLookupResultIPGet(result, &contData->ip_address) == TS_ERROR) {
+        LOG_ERROR("TSHostLookupResultIPGet");
       }
     } else {
-      INKDebug(DEBUG_TAG, "Hostlookup continuation called back with NULL result");
+      TSDebug(DEBUG_TAG, "Hostlookup continuation called back with NULL result");
     }
 /* NEGATIVE TEST for host lookup */
 #ifdef DEBUG
-    /* Comment out because of INKqa12283 */
+    /* Comment out because of TSqa12283 */
     neg1_host_lookup(txn_contp);
     neg2_host_lookup();
 #endif
     break;
 
   default:
-    INKAssert(!"Unexpected Event");
+    TSAssert(!"Unexpected Event");
     break;
   }
 
-  if (INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE) == INK_ERROR) {
-    LOG_ERROR("INKHttpTxnReenable");
+  if (TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE) == TS_ERROR) {
+    LOG_ERROR("TSHttpTxnReenable");
   }
 
   return 0;
@@ -802,105 +802,105 @@ txn_cont_handler(INKCont txn_contp, INKE
     other HTTP hooks.
 ***************************************************************/
 int
-handle_txn_start(INKHttpTxn txnp)
+handle_txn_start(TSHttpTxn txnp)
 {
   LOG_SET_FUNCTION_NAME("handle_txn_start");
 
-  INKMBuffer fake_mbuffer;
-  INKCont txn_contp, fake_contp;
+  TSMBuffer fake_mbuffer;
+  TSCont txn_contp, fake_contp;
   ContData *contData, *fakeData;
-  INKMutex mutexp;
+  TSMutex mutexp;
 
   /* Create mutex for new txn_contp */
-  mutexp = INKMutexCreate();
-  if (mutexp == INK_ERROR_PTR) {
-    LOG_ERROR_AND_RETURN("INKMutexCreate");
+  mutexp = TSMutexCreate();
+  if (mutexp == TS_ERROR_PTR) {
+    LOG_ERROR_AND_RETURN("TSMutexCreate");
   }
   /* Create the HTTP txn continuation */
-  txn_contp = INKContCreate(txn_cont_handler, mutexp);
-  if (txn_contp == INK_ERROR_PTR) {
-    LOG_ERROR_AND_RETURN("INKContCreate");
+  txn_contp = TSContCreate(txn_cont_handler, mutexp);
+  if (txn_contp == TS_ERROR_PTR) {
+    LOG_ERROR_AND_RETURN("TSContCreate");
   }
   /* Init this continuation data  */
   initContData(txn_contp);
   /* Get this continuation data */
-  contData = INKContDataGet(txn_contp);
-  if (contData == INK_ERROR_PTR) {
-    LOG_ERROR_AND_RETURN("INKContDataGet");
+  contData = TSContDataGet(txn_contp);
+  if (contData == TS_ERROR_PTR) {
+    LOG_ERROR_AND_RETURN("TSContDataGet");
   }
   /* Set the transaction pointer */
   contData->txnp = txnp;
 
-  /* Add the INK_HTTP_CACHE_LOOKUP_COMPLETE_HOOK to this transaction  */
-  if (INKHttpTxnHookAdd(txnp, INK_HTTP_READ_REQUEST_HDR_HOOK, txn_contp) == INK_ERROR) {
-    LOG_ERROR("INKHttpTxnHookAdd");
+  /* Add the TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK to this transaction  */
+  if (TSHttpTxnHookAdd(txnp, TS_HTTP_READ_REQUEST_HDR_HOOK, txn_contp) == TS_ERROR) {
+    LOG_ERROR("TSHttpTxnHookAdd");
   }
-  if (INKHttpTxnHookAdd(txnp, INK_HTTP_READ_CACHE_HDR_HOOK, txn_contp) == INK_ERROR) {
-    LOG_ERROR("INKHttpTxnHookAdd");
+  if (TSHttpTxnHookAdd(txnp, TS_HTTP_READ_CACHE_HDR_HOOK, txn_contp) == TS_ERROR) {
+    LOG_ERROR("TSHttpTxnHookAdd");
   }
-  if (INKHttpTxnHookAdd(txnp, INK_HTTP_CACHE_LOOKUP_COMPLETE_HOOK, txn_contp) == INK_ERROR) {
-    LOG_ERROR("INKHttpTxnHookAdd");
+  if (TSHttpTxnHookAdd(txnp, TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK, txn_contp) == TS_ERROR) {
+    LOG_ERROR("TSHttpTxnHookAdd");
   }
-  if (INKHttpTxnHookAdd(txnp, INK_HTTP_SEND_REQUEST_HDR_HOOK, txn_contp) == INK_ERROR) {
-    LOG_ERROR("INKHttpTxnHookAdd");
+  if (TSHttpTxnHookAdd(txnp, TS_HTTP_SEND_REQUEST_HDR_HOOK, txn_contp) == TS_ERROR) {
+    LOG_ERROR("TSHttpTxnHookAdd");
   }
-  if (INKHttpTxnHookAdd(txnp, INK_HTTP_READ_RESPONSE_HDR_HOOK, txn_contp) == INK_ERROR) {
-    LOG_ERROR("INKHttpTxnHookAdd");
+  if (TSHttpTxnHookAdd(txnp, TS_HTTP_READ_RESPONSE_HDR_HOOK, txn_contp) == TS_ERROR) {
+    LOG_ERROR("TSHttpTxnHookAdd");
   }
-  if (INKHttpTxnHookAdd(txnp, INK_HTTP_SEND_RESPONSE_HDR_HOOK, txn_contp) == INK_ERROR) {
-    LOG_ERROR("INKHttpTxnHookAdd");
+  if (TSHttpTxnHookAdd(txnp, TS_HTTP_SEND_RESPONSE_HDR_HOOK, txn_contp) == TS_ERROR) {
+    LOG_ERROR("TSHttpTxnHookAdd");
   }
-  if (INKHttpTxnHookAdd(txnp, INK_HTTP_TXN_CLOSE_HOOK, txn_contp) == INK_ERROR) {
-    LOG_ERROR("INKHttpTxnHookAdd");
+  if (TSHttpTxnHookAdd(txnp, TS_HTTP_TXN_CLOSE_HOOK, txn_contp) == TS_ERROR) {
+    LOG_ERROR("TSHttpTxnHookAdd");
   }
 
-/* NEGATIVE TEST for cache lookup, INKHttpTxnHookAdd,
-   INKMutexLock, INKMutexLockTry, INKMutexUnlock,
-   INKHandleMLocRelease and INKHttpTxnReenable */
+/* NEGATIVE TEST for cache lookup, TSHttpTxnHookAdd,
+   TSMutexLock, TSMutexLockTry, TSMutexUnlock,
+   TSHandleMLocRelease and TSHttpTxnReenable */
 #ifdef DEBUG
 /*     neg_cache_lookup_bad_hook(txnp); */
-/*     INKDebug(DEBUG_TAG, */
+/*     TSDebug(DEBUG_TAG, */
 /* 	     "NEGATIVE test cache lookup bad hook in %s passed", FUNCTION_NAME); */
   neg_cache_lookup_bad_arg();
 
-  if (INKHttpTxnHookAdd(NULL, -1, NULL) != INK_ERROR) {
-    LOG_ERROR_NEG("INKHttpTxnHookAdd");
+  if (TSHttpTxnHookAdd(NULL, -1, NULL) != TS_ERROR) {
+    LOG_ERROR_NEG("TSHttpTxnHookAdd");
   } else
-    INKDebug(NEG_DEBUG_TAG, "Neg Test INKHttpTxnHookAdd 1 passed\n");
-  fake_contp = INKContCreate(fake_handler2, INKMutexCreate());
-  if (INKHttpTxnHookAdd(NULL, INK_HTTP_TXN_START_HOOK, NULL) != INK_ERROR) {
-    LOG_ERROR_NEG("INKHttpTxnHookAdd");
-  } else
-    INKDebug(NEG_DEBUG_TAG, "Neg Test INKHttpTxnHookAdd 2  passed\n");
-  if (INKHttpTxnHookAdd(NULL, -1, fake_contp) != INK_ERROR) {
-    LOG_ERROR_NEG("INKHttpTxnHookAdd");
-  } else
-    INKDebug(NEG_DEBUG_TAG, "Neg Test INKHttpTxnHookAdd 3  passed\n");
-  if (INKMutexLock(NULL) != INK_ERROR) {
-    LOG_ERROR_NEG("INKMutexLock");
-  } else
-    INKDebug(NEG_DEBUG_TAG, "Neg Test INKMutexLock passed\n");
-  if (INKMutexLockTry(NULL, NULL) != INK_ERROR) {
-    LOG_ERROR_NEG("INKMutexLockTry");
-  } else
-    INKDebug(NEG_DEBUG_TAG, "Neg Test INKMutexTryLock passed\n");
-  if (INKMutexUnlock(NULL) != INK_ERROR) {
-    LOG_ERROR_NEG("INKMutexUnlock");
-  } else
-    INKDebug(NEG_DEBUG_TAG, "Neg Test INKMutexUnlock passed\n");
-  if (INKHandleMLocRelease(NULL, INK_NULL_MLOC, NULL)) {
-    LOG_ERROR_NEG("INKHandleMLocRelease");
-  } else
-    INKDebug(NEG_DEBUG_TAG, "Neg Test INKHandleMLocRelease 1 passed\n");
-  fake_mbuffer = INKMBufferCreate();
-  if (INKHandleMLocRelease(fake_mbuffer, INK_NULL_MLOC, NULL)) {
-    LOG_ERROR_NEG("INKHandleMLocRelease");
-  } else
-    INKDebug(NEG_DEBUG_TAG, "Neg Test INKHandleMLocRelease 1 passed\n");
-  if (INKHttpTxnReenable(NULL, 0) != INK_ERROR) {
-    LOG_ERROR_NEG("INKHttpTxnReenable");
+    TSDebug(NEG_DEBUG_TAG, "Neg Test TSHttpTxnHookAdd 1 passed\n");
+  fake_contp = TSContCreate(fake_handler2, TSMutexCreate());
+  if (TSHttpTxnHookAdd(NULL, TS_HTTP_TXN_START_HOOK, NULL) != TS_ERROR) {
+    LOG_ERROR_NEG("TSHttpTxnHookAdd");
+  } else
+    TSDebug(NEG_DEBUG_TAG, "Neg Test TSHttpTxnHookAdd 2  passed\n");
+  if (TSHttpTxnHookAdd(NULL, -1, fake_contp) != TS_ERROR) {
+    LOG_ERROR_NEG("TSHttpTxnHookAdd");
+  } else
+    TSDebug(NEG_DEBUG_TAG, "Neg Test TSHttpTxnHookAdd 3  passed\n");
+  if (TSMutexLock(NULL) != TS_ERROR) {
+    LOG_ERROR_NEG("TSMutexLock");
+  } else
+    TSDebug(NEG_DEBUG_TAG, "Neg Test TSMutexLock passed\n");
+  if (TSMutexLockTry(NULL, NULL) != TS_ERROR) {
+    LOG_ERROR_NEG("TSMutexLockTry");
+  } else
+    TSDebug(NEG_DEBUG_TAG, "Neg Test TSMutexLockTry passed\n");
+  if (TSMutexUnlock(NULL) != TS_ERROR) {
+    LOG_ERROR_NEG("TSMutexUnlock");
+  } else
+    TSDebug(NEG_DEBUG_TAG, "Neg Test TSMutexUnlock passed\n");
+  if (TSHandleMLocRelease(NULL, TS_NULL_MLOC, NULL)) {
+    LOG_ERROR_NEG("TSHandleMLocRelease");
+  } else
+    TSDebug(NEG_DEBUG_TAG, "Neg Test TSHandleMLocRelease 1 passed\n");
+  fake_mbuffer = TSMBufferCreate();
+  if (TSHandleMLocRelease(fake_mbuffer, TS_NULL_MLOC, NULL)) {
+    LOG_ERROR_NEG("TSHandleMLocRelease");
+  } else
+    TSDebug(NEG_DEBUG_TAG, "Neg Test TSHandleMLocRelease 1 passed\n");
+  if (TSHttpTxnReenable(NULL, 0) != TS_ERROR) {
+    LOG_ERROR_NEG("TSHttpTxnReenable");
   } else
-    INKDebug(NEG_DEBUG_TAG, "Neg Test INKHttpTxnReenable passed\n");
+    TSDebug(NEG_DEBUG_TAG, "Neg Test TSHttpTxnReenable passed\n");
 #endif
 
   return 0;
@@ -909,27 +909,27 @@ handle_txn_start(INKHttpTxn txnp)
 /********************************************************
    Plugin Continuation handler:
    The plugin continuation will be called back by every
-   HTTP transaction when it reach INK_HTTP_TXN_START_HOOK
+   HTTP transaction when it reach TS_HTTP_TXN_START_HOOK
 ********************************************************/
 static int
-plugin_cont_handler(INKCont contp, INKEvent event, void *edata)
+plugin_cont_handler(TSCont contp, TSEvent event, void *edata)
 {
   LOG_SET_FUNCTION_NAME("process_plugin");
 
-  INKHttpTxn txnp = (INKHttpTxn) edata;
+  TSHttpTxn txnp = (TSHttpTxn) edata;
 
   switch (event) {
-  case INK_EVENT_HTTP_TXN_START:
+  case TS_EVENT_HTTP_TXN_START:
     handle_txn_start(txnp);
     break;
 
   default:
-    INKAssert(!"Unexpected Event");
+    TSAssert(!"Unexpected Event");
     break;
   }
 
-  if (INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE) == INK_ERROR) {
-    LOG_ERROR("INKHttpTxnReenable");
+  if (TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE) == TS_ERROR) {
+    LOG_ERROR("TSHttpTxnReenable");
   }
 
   return 0;
@@ -941,38 +941,38 @@ plugin_cont_handler(INKCont contp, INKEv
    Here, there is no need to grab the HOSTNAME_LOCK, this
    code should be executes before any HTTP state machine
    is created.
-   Register globally INK_HTTP_TXN_START_HOOK
+   Register globally TS_HTTP_TXN_START_HOOK
 ********************************************************/
 void
-INKPluginInit(int argc, const char *argv[])
+TSPluginInit(int argc, const char *argv[])
 {
-  LOG_SET_FUNCTION_NAME("INKPluginInit");
+  LOG_SET_FUNCTION_NAME("TSPluginInit");
 
   /* Plugin continuation */
-  INKCont contp, fake_contp;
+  TSCont contp, fake_contp;
   ContData *fakeData;
 
   /* Create hostname lock */
-  HOSTNAME_LOCK = INKMutexCreate();
+  HOSTNAME_LOCK = TSMutexCreate();
 
   /* Initialize global variables hostname and hostname length  */
   /* No need to grab the lock here  */
-  HOSTNAME = INKstrdup("tsdev.inktomi.com");
+  HOSTNAME = TSstrdup("tsdev.inktomi.com");
   HOSTNAME_LENGTH = strlen(HOSTNAME) + 1;
 
   /* Parse the eventual 2 plugin arguments */
   if (argc < 3) {
-    INKDebug(DEBUG_TAG, "Usage: lookup.so hostname hostname_length");
+    TSDebug(DEBUG_TAG, "Usage: lookup.so hostname hostname_length");
     printf("[lookup_plugin] Usage: lookup.so hostname hostname_length\n");
     printf("[lookup_plugin] Wrong arguments. Using default\n");
   } else {
-    HOSTNAME = INKstrdup(argv[1]);
-    INKDebug(DEBUG_TAG, "using hostname %s", HOSTNAME);
+    HOSTNAME = TSstrdup(argv[1]);
+    TSDebug(DEBUG_TAG, "using hostname %s", HOSTNAME);
     printf("[lookup_plugin] using hostname %s\n", HOSTNAME);
 
     if (!isnan(atoi(argv[2]))) {
       HOSTNAME_LENGTH = atoi(argv[2]);
-      INKDebug(DEBUG_TAG, "using hostname length %d", HOSTNAME_LENGTH);
+      TSDebug(DEBUG_TAG, "using hostname length %d", HOSTNAME_LENGTH);
       printf("[lookup_plugin] using hostname length %d\n", HOSTNAME_LENGTH);
     } else {
       printf("[lookup_plugin] Wrong argument for hostname length");
@@ -980,50 +980,50 @@ INKPluginInit(int argc, const char *argv
     }
   }
 
-/* Negative test for INKContCreate, INKHttpHookAdd, INKContDataGet/Set, INKContDestroy */
+/* Negative test for TSContCreate, TSHttpHookAdd, TSContDataGet/Set, TSContDestroy */
 #ifdef DEBUG
-  if (INKHttpHookAdd(-1, NULL) != INK_ERROR) {
-    LOG_ERROR_NEG("INKHttpHookAdd");
+  if (TSHttpHookAdd(-1, NULL) != TS_ERROR) {
+    LOG_ERROR_NEG("TSHttpHookAdd");
   } else
-    INKDebug(NEG_DEBUG_TAG, "Neg Test INKHttpHookAdd 1 passed\n");
-  if (INKHttpHookAdd(INK_HTTP_TXN_START_HOOK, NULL) != INK_ERROR) {
-    LOG_ERROR_NEG("INKHttpHookAdd");
-  } else
-    INKDebug(NEG_DEBUG_TAG, "Neg Test INKHttpHookAdd 2 passed\n");
-  fake_contp = INKContCreate(fake_handler2, INKMutexCreate());
-  if (INKHttpHookAdd(-1, fake_contp) != INK_ERROR) {
-    LOG_ERROR_NEG("INKHttpHookAdd");
-  } else
-    INKDebug(NEG_DEBUG_TAG, "Neg Test INKHttpHookAdd 3 passed\n");
-  if (INKContDataGet(NULL) != INK_ERROR_PTR) {
-    LOG_ERROR_NEG("INKContDataGet");
-  } else
-    INKDebug(NEG_DEBUG_TAG, "Neg Test INKContDataGet passed\n");
-  if (INKContDataSet(NULL, NULL) != INK_ERROR) {
-    LOG_ERROR_NEG("INKContDataSet");
+    TSDebug(NEG_DEBUG_TAG, "Neg Test TSHttpHookAdd 1 passed\n");
+  if (TSHttpHookAdd(TS_HTTP_TXN_START_HOOK, NULL) != TS_ERROR) {
+    LOG_ERROR_NEG("TSHttpHookAdd");
+  } else
+    TSDebug(NEG_DEBUG_TAG, "Neg Test TSHttpHookAdd 2 passed\n");
+  fake_contp = TSContCreate(fake_handler2, TSMutexCreate());
+  if (TSHttpHookAdd(-1, fake_contp) != TS_ERROR) {
+    LOG_ERROR_NEG("TSHttpHookAdd");
+  } else
+    TSDebug(NEG_DEBUG_TAG, "Neg Test TSHttpHookAdd 3 passed\n");
+  if (TSContDataGet(NULL) != TS_ERROR_PTR) {
+    LOG_ERROR_NEG("TSContDataGet");
+  } else
+    TSDebug(NEG_DEBUG_TAG, "Neg Test TSContDataGet passed\n");
+  if (TSContDataSet(NULL, NULL) != TS_ERROR) {
+    LOG_ERROR_NEG("TSContDataSet");
   } else
-    INKDebug(NEG_DEBUG_TAG, "Neg Test INKContDataSet 1 passed\n");
-  fakeData = (ContData *) INKmalloc(sizeof(ContData));
+    TSDebug(NEG_DEBUG_TAG, "Neg Test TSContDataSet 1 passed\n");
+  fakeData = (ContData *) TSmalloc(sizeof(ContData));
   fakeData->called_cache = 0;
   fakeData->cache_lookup_status = -1;
   fakeData->client_port = 0;
   fakeData->ip_address = 0;
   fakeData->txnp = NULL;
-  if (INKContDataSet(NULL, fakeData) != INK_ERROR) {
-    LOG_ERROR_NEG("INKContDataSet");
+  if (TSContDataSet(NULL, fakeData) != TS_ERROR) {
+    LOG_ERROR_NEG("TSContDataSet");
   } else
-    INKDebug(NEG_DEBUG_TAG, "Neg Test INKContDataSet 3 passed\n");
-  if (INKContDestroy(NULL) != INK_ERROR) {
-    LOG_ERROR_NEG("INKContDestroy");
+    TSDebug(NEG_DEBUG_TAG, "Neg Test TSContDataSet 3 passed\n");
+  if (TSContDestroy(NULL) != TS_ERROR) {
+    LOG_ERROR_NEG("TSContDestroy");
   } else
-    INKDebug(NEG_DEBUG_TAG, "Neg Test INKContDestroy passed\n");
+    TSDebug(NEG_DEBUG_TAG, "Neg Test TSContDestroy passed\n");
 #endif
 
-  if ((contp = INKContCreate(plugin_cont_handler, NULL)) == INK_ERROR_PTR) {
-    LOG_ERROR("INKContCreate");
+  if ((contp = TSContCreate(plugin_cont_handler, NULL)) == TS_ERROR_PTR) {
+    LOG_ERROR("TSContCreate");
   } else {
-    if (INKHttpHookAdd(INK_HTTP_TXN_START_HOOK, contp) == INK_ERROR) {
-      LOG_ERROR("INKHttpHookAdd");
+    if (TSHttpHookAdd(TS_HTTP_TXN_START_HOOK, contp) == TS_ERROR) {
+      LOG_ERROR("TSHttpHookAdd");
     }
   }
 }

Modified: trafficserver/traffic/branches/wccp/test/plugin/order/README.txt
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/test/plugin/order/README.txt?rev=1040383&r1=1040382&r2=1040383&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/test/plugin/order/README.txt (original)
+++ trafficserver/traffic/branches/wccp/test/plugin/order/README.txt Tue Nov 30 01:42:55 2010
@@ -16,15 +16,15 @@ The parameter passed to the plugin shoul
 
 These plugins gets the counter from the header, checks if it is invoked in the correct sequence and then updates the counter. The above plugins are added to the following hooks:
 
-INK_HTTP_READ_REQUEST_HDR_HOOK
-INK_HTTP_OS_DNS_HOOK
-INK_HTTP_SEND_REQUEST_HDR_HOOK
-INK_HTTP_READ_CACHE_HDR_HOOK
-INK_HTTP_READ_RESPONSE_HDR_HOOK
-INK_HTTP_SEND_RESPONSE_HDR_HOOK
+TS_HTTP_READ_REQUEST_HDR_HOOK
+TS_HTTP_OS_DNS_HOOK
+TS_HTTP_SEND_REQUEST_HDR_HOOK
+TS_HTTP_READ_CACHE_HDR_HOOK
+TS_HTTP_READ_RESPONSE_HDR_HOOK
+TS_HTTP_SEND_RESPONSE_HDR_HOOK
 
 At each hook the sequence of invoking the plugins is checked. If the plugins are not invoked in the sequnce of their listing in plugin.config file, then an error message is logged in logs/error.log file.
 
 The assumption in these plugins is that only one plugin is attached to all hooks from one .so/.dll file. To a specific hook either all or none of the plugins are attached.
 
- 
\ No newline at end of file
+ 

Modified: trafficserver/traffic/branches/wccp/test/plugin/order/orderplugin1.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/test/plugin/order/orderplugin1.c?rev=1040383&r1=1040382&r2=1040383&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/test/plugin/order/orderplugin1.c (original)
+++ trafficserver/traffic/branches/wccp/test/plugin/order/orderplugin1.c Tue Nov 30 01:42:55 2010
@@ -50,42 +50,42 @@
 int value;
 
 static int
-plugin1(INKCont contp, INKEvent event, void *edata)
+plugin1(TSCont contp, TSEvent event, void *edata)
 {
 
-  INKMBuffer bufp;
-  INKMLoc hdr_loc;
-  INKMLoc field_loc;
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc field_loc;
 
-  int count;
+  TSHttpTxn txnp = (TSHttpTxn) edata;
 
-  INKHttpTxn txnp = (INKHttpTxn) edata;
-
-  if (!INKHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
+  if (!TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
     printf("Couldn't retrieve Client Request Header\n");
-    INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+    TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
     return 0;
   }
 
-  if ((field_loc = INKMimeHdrFieldFind(bufp, hdr_loc, FIELD_NAME, -1)) != 0) {
-    count = INKMimeFieldValueGetInt(bufp, field_loc, 0);
+  if ((field_loc = TSMimeHdrFieldFind(bufp, hdr_loc, FIELD_NAME, -1)) != 0) {
+    int count;
+
+    TSMimeHdrFieldValueIntGet(bufp, hrd_loc, field_loc, 0, &count);
     if (value != ++count) {
-      INKError("Incorrect sequence of calling...orderplugin1\n");
+      TSError("Incorrect sequence of calling...orderplugin1\n");
     }
-    INKMimeFieldValueSetInt(bufp, field_loc, 0, value);
+    TSMimeHdrFieldValueIntSet(bufp, hdr_loc, field_loc, 0, value);
   }
 
-  INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
   return 0;
 }
 
 void
-INKPluginInit(int argc, const char *argv[])
+TSPluginInit(int argc, const char *argv[])
 {
 
-  INKMutex lock1;
+  TSMutex lock1;
 
-  INKCont contp;
+  TSCont contp;
 
   if (argc != 2) {
     printf("Usage: orderplugin1.so <valuei>\n");
@@ -94,16 +94,16 @@ INKPluginInit(int argc, const char *argv
 
   sscanf(argv[1], "%d", &value);
 
-  lock1 = INKMutexCreate();
+  lock1 = TSMutexCreate();
 
-  contp = INKContCreate(plugin1, lock1);
+  contp = TSContCreate(plugin1, lock1);
 
-  INKHttpHookAdd(INK_HTTP_READ_REQUEST_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_OS_DNS_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_SEND_REQUEST_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_READ_CACHE_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_READ_RESPONSE_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_OS_DNS_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_SEND_REQUEST_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_READ_CACHE_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_READ_RESPONSE_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
 
 
 }

Modified: trafficserver/traffic/branches/wccp/test/plugin/order/orderplugin2.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/test/plugin/order/orderplugin2.c?rev=1040383&r1=1040382&r2=1040383&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/test/plugin/order/orderplugin2.c (original)
+++ trafficserver/traffic/branches/wccp/test/plugin/order/orderplugin2.c Tue Nov 30 01:42:55 2010
@@ -50,43 +50,42 @@
 int value;
 
 static int
-plugin2(INKCont contp, INKEvent event, void *edata)
+plugin2(TSCont contp, TSEvent event, void *edata)
 {
 
-  INKMBuffer bufp;
-  INKMLoc hdr_loc;
-  INKMLoc field_loc;
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc field_loc;
+  TSHttpTxn txnp = (TSHttpTxn) edata;
 
-  int count;
-
-  INKHttpTxn txnp = (INKHttpTxn) edata;
-
-  if (!INKHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
+  if (!TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
     printf("Couldn't retrieve Client Request Header\n");
-    INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+    TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
     return 0;
   }
 
-  if ((field_loc = INKMimeHdrFieldFind(bufp, hdr_loc, FIELD_NAME, -1)) != 0) {
-    count = INKMimeFieldValueGetInt(bufp, field_loc, 0);
+  if ((field_loc = TSMimeHdrFieldFind(bufp, hdr_loc, FIELD_NAME, -1)) != 0) {
+    int count;
+
+    TSMimeHdrFieldValueIntGet(bufp, hdr_loc, field_loc, 0, &count);
     if (value != ++count) {
-      INKError("Incorrect sequence of calling...orderplugin2\n");
+      TSError("Incorrect sequence of calling...orderplugin2\n");
     }
-    INKMimeFieldValueSetInt(bufp, field_loc, 0, value);
+    TSMimeHdrFieldValueIntSet(bufp, hdr_loc, field_loc, 0, value);
 
   }
 
-  INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
   return 0;
 }
 
 void
-INKPluginInit(int argc, const char *argv[])
+TSPluginInit(int argc, const char *argv[])
 {
 
-  INKMutex lock1;
+  TSMutex lock1;
 
-  INKCont contp;
+  TSCont contp;
 
 
   if (argc != 2) {
@@ -96,16 +95,16 @@ INKPluginInit(int argc, const char *argv
 
   sscanf(argv[1], "%d", &value);
 
-  lock1 = INKMutexCreate();
+  lock1 = TSMutexCreate();
 
-  contp = INKContCreate(plugin2, lock1);
+  contp = TSContCreate(plugin2, lock1);
 
-  INKHttpHookAdd(INK_HTTP_READ_REQUEST_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_OS_DNS_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_SEND_REQUEST_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_READ_CACHE_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_READ_RESPONSE_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_OS_DNS_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_SEND_REQUEST_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_READ_CACHE_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_READ_RESPONSE_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
 
 
 }

Modified: trafficserver/traffic/branches/wccp/test/plugin/order/orderplugin3.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/test/plugin/order/orderplugin3.c?rev=1040383&r1=1040382&r2=1040383&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/test/plugin/order/orderplugin3.c (original)
+++ trafficserver/traffic/branches/wccp/test/plugin/order/orderplugin3.c Tue Nov 30 01:42:55 2010
@@ -50,43 +50,43 @@
 int value;
 
 static int
-plugin3(INKCont contp, INKEvent event, void *edata)
+plugin3(TSCont contp, TSEvent event, void *edata)
 {
 
-  INKMBuffer bufp;
-  INKMLoc hdr_loc;
-  INKMLoc field_loc;
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc field_loc;
 
-  int count;
+  TSHttpTxn txnp = (TSHttpTxn) edata;
 
-  INKHttpTxn txnp = (INKHttpTxn) edata;
-
-  if (!INKHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
+  if (!TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
     printf("Couldn't retrieve Client Request Header\n");
-    INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+    TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
     return 0;
   }
 
-  if ((field_loc = INKMimeHdrFieldFind(bufp, hdr_loc, FIELD_NAME, -1)) != 0) {
-    count = INKMimeFieldValueGetInt(bufp, field_loc, 0);
+  if ((field_loc = TSMimeHdrFieldFind(bufp, hdr_loc, FIELD_NAME, -1)) != 0) {
+    int count;
+
+    TSMimeHdrFieldValueIntGet(bufp, hdr_loc, field_loc, 0, &count);
     if (value != ++count) {
-      INKError("Incorrect sequence of calling...orderplugin3\n");
+      TSError("Incorrect sequence of calling...orderplugin3\n");
     }
-    INKMimeFieldValueSetInt(bufp, field_loc, 0, value);
+    TSMimeHdrFieldValueIntSet(bufp, hdr_loc, field_loc, 0, value);
 
   }
 
-  INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
   return 0;
 }
 
 void
-INKPluginInit(int argc, const char *argv[])
+TSPluginInit(int argc, const char *argv[])
 {
 
-  INKMutex lock1;
+  TSMutex lock1;
 
-  INKCont contp;
+  TSCont contp;
 
 
   if (argc != 2) {
@@ -96,16 +96,16 @@ INKPluginInit(int argc, const char *argv
 
   sscanf(argv[1], "%d", &value);
 
-  lock1 = INKMutexCreate();
+  lock1 = TSMutexCreate();
 
-  contp = INKContCreate(plugin3, lock1);
+  contp = TSContCreate(plugin3, lock1);
 
-  INKHttpHookAdd(INK_HTTP_READ_REQUEST_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_OS_DNS_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_SEND_REQUEST_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_READ_CACHE_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_READ_RESPONSE_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_OS_DNS_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_SEND_REQUEST_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_READ_CACHE_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_READ_RESPONSE_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
 
 
 }

Modified: trafficserver/traffic/branches/wccp/test/plugin/order/orderplugin4.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/test/plugin/order/orderplugin4.c?rev=1040383&r1=1040382&r2=1040383&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/test/plugin/order/orderplugin4.c (original)
+++ trafficserver/traffic/branches/wccp/test/plugin/order/orderplugin4.c Tue Nov 30 01:42:55 2010
@@ -50,43 +50,43 @@
 int value;
 
 static int
-plugin4(INKCont contp, INKEvent event, void *edata)
+plugin4(TSCont contp, TSEvent event, void *edata)
 {
 
-  INKMBuffer bufp;
-  INKMLoc hdr_loc;
-  INKMLoc field_loc;
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc field_loc;
 
-  int count;
+  TSHttpTxn txnp = (TSHttpTxn) edata;
 
-  INKHttpTxn txnp = (INKHttpTxn) edata;
-
-  if (!INKHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
+  if (!TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
     printf("Couldn't retrieve Client Request Header\n");
-    INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+    TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
     return 0;
   }
 
-  if ((field_loc = INKMimeHdrFieldFind(bufp, hdr_loc, FIELD_NAME, -1)) != 0) {
-    count = INKMimeFieldValueGetInt(bufp, field_loc, 0);
+  if ((field_loc = TSMimeHdrFieldFind(bufp, hdr_loc, FIELD_NAME, -1)) != 0) {
+    int count;
+    
+    TSMimeHdrFieldValueIntGet(bufp, hdr_loc, field_loc, 0, &count);
     if (value != ++count) {
-      INKError("Incorrect sequence of calling...orderplugin4\n");
+      TSError("Incorrect sequence of calling...orderplugin4\n");
     }
-    INKMimeFieldValueSetInt(bufp, field_loc, 0, value);
+    TSMimeHdrFieldValueIntSet(bufp, hdr_loc, field_loc, 0, value);
 
   }
 
-  INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
   return 0;
 }
 
 void
-INKPluginInit(int argc, const char *argv[])
+TSPluginInit(int argc, const char *argv[])
 {
 
-  INKMutex lock1;
+  TSMutex lock1;
 
-  INKCont contp;
+  TSCont contp;
 
   if (argc != 2) {
     printf("Usage: orderplugin4.so <valuei>\n");
@@ -95,16 +95,16 @@ INKPluginInit(int argc, const char *argv
 
   sscanf(argv[1], "%d", &value);
 
-  lock1 = INKMutexCreate();
+  lock1 = TSMutexCreate();
 
-  contp = INKContCreate(plugin4, lock1);
+  contp = TSContCreate(plugin4, lock1);
 
-  INKHttpHookAdd(INK_HTTP_READ_REQUEST_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_OS_DNS_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_SEND_REQUEST_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_READ_CACHE_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_READ_RESPONSE_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_OS_DNS_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_SEND_REQUEST_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_READ_CACHE_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_READ_RESPONSE_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
 
 
 }

Modified: trafficserver/traffic/branches/wccp/test/plugin/order/orderstartplugin.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/test/plugin/order/orderstartplugin.c?rev=1040383&r1=1040382&r2=1040383&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/test/plugin/order/orderstartplugin.c (original)
+++ trafficserver/traffic/branches/wccp/test/plugin/order/orderstartplugin.c Tue Nov 30 01:42:55 2010
@@ -45,53 +45,51 @@
 int value;
 
 static int
-startplugin(INKCont contp, INKEvent event, void *edata)
+startplugin(TSCont contp, TSEvent event, void *edata)
 {
 
-  INKMBuffer bufp;
-  INKMLoc hdr_loc;
-  INKMLoc field_loc;
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc field_loc;
+  TSHttpTxn txnp = (TSHttpTxn) edata;
 
-  int count;
-
-
-  INKHttpTxn txnp = (INKHttpTxn) edata;
-
-  if (!INKHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
+  if (!TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
     printf("Couldn't retrieve Client Request Header\n");
-    INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+    TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
     return 0;
   }
 
-  if ((field_loc = INKMimeHdrFieldFind(bufp, hdr_loc, FIELD_NAME, -1)) != 0) {
-    count = INKMimeFieldValueGetInt(bufp, field_loc, 0);
-    INKMimeFieldValueSetInt(bufp, field_loc, 0, value);
+  if ((field_loc = TSMimeHdrFieldFind(bufp, hdr_loc, FIELD_NAME, -1)) != 0) {
+    int count;
+
+    TSMimeHdrFieldValueIntGet(bufp, hdr_loc, field_loc, 0, &count);
+    TSMimehdrFieldValueIntSet(bufp, hdr_loc, field_loc, 0, value);
   } else {
-    field_loc = INKMimeFieldCreate(bufp);
-    INKMimeFieldNameSet(bufp, field_loc, FIELD_NAME, -1);
-    INKMimeFieldValueInsertInt(bufp, field_loc, value, -1);
-    INKMimeHdrFieldInsert(bufp, hdr_loc, field_loc, -1);
+    field_loc = TSMimeHdrFieldCreate(bufp, hdr_loc);
+    TSMimeHdrFieldNameSet(bufp, hdr_loc, field_loc, FIELD_NAME, -1);
+    TSMimeHdrFieldValueIntInsert(bufp, hdr_loc, field_loc, -1, value);
+    TSMimeHdrFieldAppend(bufp, hdr_loc, field_loc);
   }
 
-  INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
   return 0;
 }
 
 void
-INKPluginInit(int argc, const char *argv[])
+TSPluginInit(int argc, const char *argv[])
 {
 
 
-  INKMutex lock1 = INKMutexCreate();
+  TSMutex lock1 = TSMutexCreate();
 
-  INKCont contp = INKContCreate(startplugin, lock1);
+  TSCont contp = TSContCreate(startplugin, lock1);
 
   value = 0;
 
-  INKHttpHookAdd(INK_HTTP_READ_REQUEST_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_OS_DNS_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_SEND_REQUEST_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_READ_CACHE_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_READ_RESPONSE_HDR_HOOK, contp);
-  INKHttpHookAdd(INK_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_OS_DNS_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_SEND_REQUEST_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_READ_CACHE_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_READ_RESPONSE_HDR_HOOK, contp);
+  TSHttpHookAdd(TS_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
 }

Modified: trafficserver/traffic/branches/wccp/test/plugin/plugin_as_origin/http_connect_bridge.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/test/plugin/plugin_as_origin/http_connect_bridge.c?rev=1040383&r1=1040382&r2=1040383&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/test/plugin/plugin_as_origin/http_connect_bridge.c (original)
+++ trafficserver/traffic/branches/wccp/test/plugin/plugin_as_origin/http_connect_bridge.c Tue Nov 30 01:42:55 2010
@@ -21,7 +21,7 @@
   limitations under the License.
  */
 
-/*   http_connect_bridge.c - Test program for INKHttpConnect() interface.
+/*   http_connect_bridge.c - Test program for TSHttpConnect() interface.
  *     Listens on a port and forwards all traffic to http system
  *     allowing the use all existing test & load tools
  *
@@ -45,14 +45,14 @@
    Log macros for error code return verification
 **************************************************/
 #define PLUGIN_NAME "http_connect_bridge"
-#define VALID_POINTER(X) ((X != NULL) && (X != INK_ERROR_PTR))
+#define VALID_POINTER(X) ((X != NULL) && (X != TS_ERROR_PTR))
 #define LOG_SET_FUNCTION_NAME(NAME) const char * FUNCTION_NAME = NAME
 #define LOG_ERROR(API_NAME) { \
-    INKDebug(PLUGIN_NAME, "%s: %s %s %s File %s, line number %d", PLUGIN_NAME, API_NAME, "APIFAIL", \
+    TSDebug(PLUGIN_NAME, "%s: %s %s %s File %s, line number %d", PLUGIN_NAME, API_NAME, "APIFAIL", \
 	     FUNCTION_NAME, __FILE__, __LINE__); \
 }
 #define LOG_ERROR_NEG(API_NAME) { \
-    INKDebug(PLUGIN_NAME, "%s: %s %s %s File %s, line number %d", PLUGIN_NAME, API_NAME, "NEGAPIFAIL", \
+    TSDebug(PLUGIN_NAME, "%s: %s %s %s File %s, line number %d", PLUGIN_NAME, API_NAME, "NEGAPIFAIL", \
 	     FUNCTION_NAME, __FILE__, __LINE__); \
 }
 #define LOG_ERROR_AND_RETURN(API_NAME) { \
@@ -65,11 +65,11 @@
 }
 #define LOG_ERROR_AND_REENABLE(API_NAME) { \
   LOG_ERROR(API_NAME); \
-  INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE); \
+  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE); \
 }
 
 /* Global variables */
-INKAction *accept_action;
+TSAction *accept_action;
 static int plugin_port = 2499;
 static unsigned int plugin_ip = 0;
 
@@ -79,19 +79,19 @@ static unsigned int plugin_ip = 0;
 struct pvc_state_t
 {
 
-  INKVConn http_vc;
-  INKVIO h_read_vio;
-  INKVIO h_write_vio;
-
-  INKVConn net_vc;
-  INKVIO n_read_vio;
-  INKVIO n_write_vio;
+  TSVConn http_vc;
+  TSVIO h_read_vio;
+  TSVIO h_write_vio;
+
+  TSVConn net_vc;
+  TSVIO n_read_vio;
+  TSVIO n_write_vio;
 
-  INKIOBuffer req_buffer;
-  INKIOBufferReader req_reader;
+  TSIOBuffer req_buffer;
+  TSIOBufferReader req_reader;
 
-  INKIOBuffer resp_buffer;
-  INKIOBufferReader resp_reader;
+  TSIOBuffer resp_buffer;
+  TSIOBufferReader resp_reader;
 
   int req_finished;
   int resp_finished;
@@ -100,257 +100,257 @@ struct pvc_state_t
 typedef struct pvc_state_t pvc_state;
 
 static void
-pvc_cleanup(INKCont contp, pvc_state * my_state)
+pvc_cleanup(TSCont contp, pvc_state * my_state)
 {
   LOG_SET_FUNCTION_NAME("pvc_cleanup");
 
   if (my_state->req_buffer) {
-    if (INKIOBufferDestroy(my_state->req_buffer) == INK_ERROR) {
-      LOG_ERROR("INKIOBufferDestroy");
+    if (TSIOBufferDestroy(my_state->req_buffer) == TS_ERROR) {
+      LOG_ERROR("TSIOBufferDestroy");
     }
     my_state->req_buffer = NULL;
   }
 
   if (my_state->resp_buffer) {
-    if (INKIOBufferDestroy(my_state->resp_buffer) == INK_ERROR) {
-      LOG_ERROR("INKIOBufferDestroy");
+    if (TSIOBufferDestroy(my_state->resp_buffer) == TS_ERROR) {
+      LOG_ERROR("TSIOBufferDestroy");
     }
     my_state->resp_buffer = NULL;
   }
 
-  INKfree(my_state);
-  if (INKContDestroy(contp) == INK_ERROR) {
-    LOG_ERROR("INKContDestroy");
+  TSfree(my_state);
+  if (TSContDestroy(contp) == TS_ERROR) {
+    LOG_ERROR("TSContDestroy");
   }
 }
 
 static void
-pvc_check_done(INKCont contp, pvc_state * my_state)
+pvc_check_done(TSCont contp, pvc_state * my_state)
 {
   LOG_SET_FUNCTION_NAME("pvc_check_done");
 
   if (my_state->req_finished && my_state->resp_finished) {
-    if (INKVConnClose(my_state->http_vc) == INK_ERROR) {
-      LOG_ERROR("INKVConnClose");
+    if (TSVConnClose(my_state->http_vc) == TS_ERROR) {
+      LOG_ERROR("TSVConnClose");
     }
-    if (INKVConnClose(my_state->net_vc) == INK_ERROR) {
-      LOG_ERROR("INKVConnClose");
+    if (TSVConnClose(my_state->net_vc) == TS_ERROR) {
+      LOG_ERROR("TSVConnClose");
     }
     pvc_cleanup(contp, my_state);
   }
 }
 
 static void
-pvc_process_n_read(INKCont contp, INKEvent event, pvc_state * my_state)
+pvc_process_n_read(TSCont contp, TSEvent event, pvc_state * my_state)
 {
   LOG_SET_FUNCTION_NAME("pvc_process_n_read");
 
   int bytes;
 
-  INKDebug(DEBUG_TAG, "plugin called: pvc_process_n_read with event %d", event);
+  TSDebug(DEBUG_TAG, "plugin called: pvc_process_n_read with event %d", event);
 
   switch (event) {
-  case INK_EVENT_VCONN_READ_READY:
-    if (INKVIOReenable(my_state->h_write_vio) == INK_ERROR) {
-      LOG_ERROR("INKVIOReenable");
+  case TS_EVENT_VCONN_READ_READY:
+    if (TSVIOReenable(my_state->h_write_vio) == TS_ERROR) {
+      LOG_ERROR("TSVIOReenable");
     }
     break;
-  case INK_EVENT_VCONN_READ_COMPLETE:
-  case INK_EVENT_VCONN_EOS:
-  case INK_EVENT_ERROR:
+  case TS_EVENT_VCONN_READ_COMPLETE:
+  case TS_EVENT_VCONN_EOS:
+  case TS_EVENT_ERROR:
     {
       /* We're finished reading from the net vc */
-      int ndone = INKVIONDoneGet(my_state->n_read_vio);
+      int ndone = TSVIONDoneGet(my_state->n_read_vio);
       int todo;
 
-      if (ndone == INK_ERROR) {
-        LOG_ERROR("INKVIONDoneGet");
+      if (ndone == TS_ERROR) {
+        LOG_ERROR("TSVIONDoneGet");
       }
       my_state->n_read_vio = NULL;
-      if (INKVIONBytesSet(my_state->h_write_vio, ndone) == INK_ERROR) {
-        LOG_ERROR("INKVIONBytesSet");
+      if (TSVIONBytesSet(my_state->h_write_vio, ndone) == TS_ERROR) {
+        LOG_ERROR("TSVIONBytesSet");
       }
-      if (INKVConnShutdown(my_state->net_vc, 1, 0) == INK_ERROR) {
-        LOG_ERROR("INKVConnShutdown");
+      if (TSVConnShutdown(my_state->net_vc, 1, 0) == TS_ERROR) {
+        LOG_ERROR("TSVConnShutdown");
       }
 
-      todo = INKVIONTodoGet(my_state->h_write_vio);
-      if (todo == INK_ERROR) {
-        LOG_ERROR("INKVIONTodoGet");
+      todo = TSVIONTodoGet(my_state->h_write_vio);
+      if (todo == TS_ERROR) {
+        LOG_ERROR("TSVIONTodoGet");
         /* Error so set it to 0 to cleanup */
         todo = 0;
       }
 
       if (todo == 0) {
         my_state->req_finished = 1;
-        if (INKVConnShutdown(my_state->http_vc, 0, 1) == INK_ERROR) {
-          LOG_ERROR("INKVConnShutdown");
+        if (TSVConnShutdown(my_state->http_vc, 0, 1) == TS_ERROR) {
+          LOG_ERROR("TSVConnShutdown");
         }
         pvc_check_done(contp, my_state);
       } else {
-        if (INKVIOReenable(my_state->h_write_vio) == INK_ERROR) {
-          LOG_ERROR("INKVIOReenable");
+        if (TSVIOReenable(my_state->h_write_vio) == TS_ERROR) {
+          LOG_ERROR("TSVIOReenable");
         }
       }
 
       break;
     }
   default:
-    INKReleaseAssert(!"Unexpected Event");
+    TSReleaseAssert(!"Unexpected Event");
     break;
   }
 }
 
 static void
-pvc_process_h_write(INKCont contp, INKEvent event, pvc_state * my_state)
+pvc_process_h_write(TSCont contp, TSEvent event, pvc_state * my_state)
 {
   LOG_SET_FUNCTION_NAME("pvc_process_h_write");
 
   int bytes;
 
-  INKDebug(DEBUG_TAG, "plugin called: pvc_process_h_write with event %d", event);
+  TSDebug(DEBUG_TAG, "plugin called: pvc_process_h_write with event %d", event);
 
   switch (event) {
-  case INK_EVENT_VCONN_WRITE_READY:
+  case TS_EVENT_VCONN_WRITE_READY:
     if (my_state->n_read_vio) {
-      if (INKVIOReenable(my_state->n_read_vio) == INK_ERROR) {
-        LOG_ERROR("INKVIOReenable");
+      if (TSVIOReenable(my_state->n_read_vio) == TS_ERROR) {
+        LOG_ERROR("TSVIOReenable");
       }
     }
     break;
-  case INK_EVENT_ERROR:
+  case TS_EVENT_ERROR:
     if (my_state->n_read_vio) {
-      if (INKVConnShutdown(my_state->net_vc, 1, 0) == INK_ERROR) {
-        LOG_ERROR("INKVConnShutdown");
+      if (TSVConnShutdown(my_state->net_vc, 1, 0) == TS_ERROR) {
+        LOG_ERROR("TSVConnShutdown");
       }
       my_state->n_read_vio = NULL;
     }
     /* FALL THROUGH */
-  case INK_EVENT_VCONN_WRITE_COMPLETE:
+  case TS_EVENT_VCONN_WRITE_COMPLETE:
     /* We should have already shutdown read pvc side */
-    INKAssert(my_state->n_read_vio == NULL);
-    if (INKVConnShutdown(my_state->http_vc, 0, 1) == INK_ERROR) {
-      LOG_ERROR("INKVConnShutdown");
+    TSAssert(my_state->n_read_vio == NULL);
+    if (TSVConnShutdown(my_state->http_vc, 0, 1) == TS_ERROR) {
+      LOG_ERROR("TSVConnShutdown");
     }
     my_state->req_finished = 1;
     pvc_check_done(contp, my_state);
     break;
   default:
-    INKReleaseAssert(!"Unexpected Event");
+    TSReleaseAssert(!"Unexpected Event");
     break;
   }
 }
 
 static void
-pvc_process_h_read(INKCont contp, INKEvent event, pvc_state * my_state)
+pvc_process_h_read(TSCont contp, TSEvent event, pvc_state * my_state)
 {
   LOG_SET_FUNCTION_NAME("pvc_process_h_read");
 
   int bytes;
 
-  INKDebug(DEBUG_TAG, "plugin called: pvc_process_h_read with event %d", event);
+  TSDebug(DEBUG_TAG, "plugin called: pvc_process_h_read with event %d", event);
 
   switch (event) {
-  case INK_EVENT_VCONN_READ_READY:
-    if (INKVIOReenable(my_state->n_write_vio) == INK_ERROR) {
-      LOG_ERROR("INKVIOReenable");
+  case TS_EVENT_VCONN_READ_READY:
+    if (TSVIOReenable(my_state->n_write_vio) == TS_ERROR) {
+      LOG_ERROR("TSVIOReenable");
     }
     break;
-  case INK_EVENT_VCONN_READ_COMPLETE:
-  case INK_EVENT_VCONN_EOS:
-  case INK_EVENT_ERROR:
+  case TS_EVENT_VCONN_READ_COMPLETE:
+  case TS_EVENT_VCONN_EOS:
+  case TS_EVENT_ERROR:
     {
       /* We're finished reading from the http vc */
       int ndone;
       int todo;
 
-      if ((ndone = INKVIONDoneGet(my_state->h_read_vio)) == INK_ERROR) {
-        LOG_ERROR("INKVIONDoneGet");
+      if ((ndone = TSVIONDoneGet(my_state->h_read_vio)) == TS_ERROR) {
+        LOG_ERROR("TSVIONDoneGet");
       }
 
       my_state->h_read_vio = NULL;
-      if (INKVIONBytesSet(my_state->n_write_vio, ndone) == INK_ERROR) {
-        LOG_ERROR("INKVIONBytesSet");
+      if (TSVIONBytesSet(my_state->n_write_vio, ndone) == TS_ERROR) {
+        LOG_ERROR("TSVIONBytesSet");
       }
-      if (INKVConnShutdown(my_state->http_vc, 1, 0) == INK_ERROR) {
-        LOG_ERROR("INKVConnShutdown");
+      if (TSVConnShutdown(my_state->http_vc, 1, 0) == TS_ERROR) {
+        LOG_ERROR("TSVConnShutdown");
       }
 
-      todo = INKVIONTodoGet(my_state->n_write_vio);
-      if (todo == INK_ERROR) {
-        LOG_ERROR("INKVIONTodoGet");
+      todo = TSVIONTodoGet(my_state->n_write_vio);
+      if (todo == TS_ERROR) {
+        LOG_ERROR("TSVIONTodoGet");
         /* Error so set it to 0 to cleanup */
         todo = 0;
       }
 
       if (todo == 0) {
         my_state->resp_finished = 1;
-        if (INKVConnShutdown(my_state->net_vc, 0, 1) == INK_ERROR) {
-          LOG_ERROR("INKVConnShutdown");
+        if (TSVConnShutdown(my_state->net_vc, 0, 1) == TS_ERROR) {
+          LOG_ERROR("TSVConnShutdown");
         }
         pvc_check_done(contp, my_state);
       } else {
-        if (INKVIOReenable(my_state->n_write_vio) == INK_ERROR) {
-          LOG_ERROR("INKVIOReenable");
+        if (TSVIOReenable(my_state->n_write_vio) == TS_ERROR) {
+          LOG_ERROR("TSVIOReenable");
         }
       }
 
       break;
     }
   default:
-    INKReleaseAssert(!"Unexpected Event");
+    TSReleaseAssert(!"Unexpected Event");
     break;
   }
 }
 
 static void
-pvc_process_n_write(INKCont contp, INKEvent event, pvc_state * my_state)
+pvc_process_n_write(TSCont contp, TSEvent event, pvc_state * my_state)
 {
   LOG_SET_FUNCTION_NAME("pvc_process_n_write");
 
   int bytes;
 
-  INKDebug(DEBUG_TAG, "plugin called: pvc_process_n_write with event %d", event);
+  TSDebug(DEBUG_TAG, "plugin called: pvc_process_n_write with event %d", event);
 
   switch (event) {
-  case INK_EVENT_VCONN_WRITE_READY:
+  case TS_EVENT_VCONN_WRITE_READY:
     if (my_state->h_read_vio) {
-      if (INKVIOReenable(my_state->h_read_vio) == INK_ERROR) {
-        LOG_ERROR("INKVIOReenable");
+      if (TSVIOReenable(my_state->h_read_vio) == TS_ERROR) {
+        LOG_ERROR("TSVIOReenable");
       }
     }
     break;
-  case INK_EVENT_ERROR:
+  case TS_EVENT_ERROR:
     if (my_state->h_read_vio) {
-      if (INKVConnShutdown(my_state->http_vc, 1, 0) == INK_ERROR) {
-        LOG_ERROR("INKVConnShutdown");
+      if (TSVConnShutdown(my_state->http_vc, 1, 0) == TS_ERROR) {
+        LOG_ERROR("TSVConnShutdown");
       }
       my_state->h_read_vio = NULL;
     }
     /* FALL THROUGH */
-  case INK_EVENT_VCONN_WRITE_COMPLETE:
+  case TS_EVENT_VCONN_WRITE_COMPLETE:
     /* We should have already shutdown read http side */
-    INKAssert(my_state->h_read_vio == NULL);
-    if (INKVConnShutdown(my_state->net_vc, 0, 1) == INK_ERROR) {
-      LOG_ERROR("INKVConnShutdown");
+    TSAssert(my_state->h_read_vio == NULL);
+    if (TSVConnShutdown(my_state->net_vc, 0, 1) == TS_ERROR) {
+      LOG_ERROR("TSVConnShutdown");
     }
     my_state->resp_finished = 1;
     pvc_check_done(contp, my_state);
     break;
   default:
-    INKReleaseAssert(!"Unexpected Event");
+    TSReleaseAssert(!"Unexpected Event");
     break;
   }
 }
 
 static int
-pvc_plugin(INKCont contp, INKEvent event, void *edata)
+pvc_plugin(TSCont contp, TSEvent event, void *edata)
 {
   LOG_SET_FUNCTION_NAME("pvc_plugin");
 
-  pvc_state *my_state = INKContDataGet(contp);
-  if (my_state == INK_ERROR_PTR) {
-    LOG_ERROR("INKContDataGet");
+  pvc_state *my_state = TSContDataGet(contp);
+  if (my_state == TS_ERROR_PTR) {
+    LOG_ERROR("TSContDataGet");
   }
 
   if (edata == my_state->h_read_vio) {
@@ -362,37 +362,37 @@ pvc_plugin(INKCont contp, INKEvent event
   } else if (edata == my_state->n_write_vio) {
     pvc_process_n_write(contp, event, my_state);
   } else {
-    INKAssert(0);
+    TSAssert(0);
   }
 
   return 0;
 }
 
 static void
-pvc_process_accept(INKVConn net_vc)
+pvc_process_accept(TSVConn net_vc)
 {
   LOG_SET_FUNCTION_NAME("pvc_process_accept");
 
-  INKMutex mutexp;
-  INKCont contp;
-  pvc_state *my_state = (pvc_state *) INKmalloc(sizeof(pvc_state));
+  TSMutex mutexp;
+  TSCont contp;
+  pvc_state *my_state = (pvc_state *) TSmalloc(sizeof(pvc_state));
   unsigned int remote_ip;
 
-  mutexp = INKMutexCreate();
-  if (mutexp == INK_ERROR_PTR) {
-    LOG_ERROR("INKMutexCreate");
+  mutexp = TSMutexCreate();
+  if (mutexp == TS_ERROR_PTR) {
+    LOG_ERROR("TSMutexCreate");
     return;
   }
-  contp = INKContCreate(pvc_plugin, mutexp);
-  if (contp == INK_ERROR_PTR) {
-    LOG_ERROR("INKContCreate");
+  contp = TSContCreate(pvc_plugin, mutexp);
+  if (contp == TS_ERROR_PTR) {
+    LOG_ERROR("TSContCreate");
     return;
   }
 
   /* We need to lock the mutex to prevent I/O callbacks before
      we set everything up */
-  if (INKMutexLock(mutexp) == INK_ERROR) {
-    LOG_ERROR("INKMutexLock");
+  if (TSMutexLock(mutexp) == TS_ERROR) {
+    LOG_ERROR("TSMutexLock");
   }
 
   my_state->net_vc = net_vc;
@@ -400,83 +400,83 @@ pvc_process_accept(INKVConn net_vc)
   my_state->req_finished = 0;
   my_state->resp_finished = 0;
 
-  my_state->req_buffer = INKIOBufferCreate();
-  my_state->req_reader = INKIOBufferReaderAlloc(my_state->req_buffer);
-  my_state->resp_buffer = INKIOBufferCreate();
-  my_state->resp_reader = INKIOBufferReaderAlloc(my_state->resp_buffer);
-  if ((my_state->req_buffer == INK_ERROR_PTR) || (my_state->req_reader == INK_ERROR_PTR) ||
-      (my_state->resp_buffer == INK_ERROR_PTR) || (my_state->resp_reader == INK_ERROR_PTR)) {
-    if (INKVConnClose(my_state->net_vc) == INK_ERROR) {
-      LOG_ERROR("INKVConnClose");
+  my_state->req_buffer = TSIOBufferCreate();
+  my_state->req_reader = TSIOBufferReaderAlloc(my_state->req_buffer);
+  my_state->resp_buffer = TSIOBufferCreate();
+  my_state->resp_reader = TSIOBufferReaderAlloc(my_state->resp_buffer);
+  if ((my_state->req_buffer == TS_ERROR_PTR) || (my_state->req_reader == TS_ERROR_PTR) ||
+      (my_state->resp_buffer == TS_ERROR_PTR) || (my_state->resp_reader == TS_ERROR_PTR)) {
+    if (TSVConnClose(my_state->net_vc) == TS_ERROR) {
+      LOG_ERROR("TSVConnClose");
     }
     pvc_cleanup(contp, my_state);
-    LOG_ERROR_AND_CLEANUP("INKIOBufferCreate || INKIOBufferReaderAlloc");
+    LOG_ERROR_AND_CLEANUP("TSIOBufferCreate || TSIOBufferReaderAlloc");
   }
 
-  if (INKNetVConnRemoteIPGet(my_state->net_vc, &remote_ip) == INK_ERROR) {
-    LOG_ERROR_AND_CLEANUP("INKNetVConnRemoteIPGet");
+  if (TSNetVConnRemoteIPGet(my_state->net_vc, &remote_ip) == TS_ERROR) {
+    LOG_ERROR_AND_CLEANUP("TSNetVConnRemoteIPGet");
   }
-/*     if (INKHttpConnect(ntohl(remote_ip), 0, &(my_state->http_vc)) == INK_ERROR) { */
-/* 	LOG_ERROR_AND_CLEANUP("INKHttpConnect"); */
+/*     if (TSHttpConnect(ntohl(remote_ip), 0, &(my_state->http_vc)) == TS_ERROR) { */
+/* 	LOG_ERROR_AND_CLEANUP("TSHttpConnect"); */
 /*     } */
-  if (INKHttpConnect(remote_ip, plugin_port, &(my_state->http_vc)) == INK_ERROR) {
-    LOG_ERROR_AND_CLEANUP("INKHttpConnect");
+  if (TSHttpConnect(remote_ip, plugin_port, &(my_state->http_vc)) == TS_ERROR) {
+    LOG_ERROR_AND_CLEANUP("TSHttpConnect");
   }
 
-/* Negative test for INKHttpConnect */
+/* Negative test for TSHttpConnect */
 #ifdef DEBUG
-  if (INKHttpConnect(plugin_ip, plugin_port, NULL) != INK_ERROR) {
-    LOG_ERROR_NEG("INKHttpConnect");
+  if (TSHttpConnect(plugin_ip, plugin_port, NULL) != TS_ERROR) {
+    LOG_ERROR_NEG("TSHttpConnect");
   }
 #endif
 
-  if (INKContDataSet(contp, my_state) == INK_ERROR) {
-    LOG_ERROR_AND_CLEANUP("INKHttpConnect");
+  if (TSContDataSet(contp, my_state) == TS_ERROR) {
+    LOG_ERROR_AND_CLEANUP("TSHttpConnect");
   }
 
-  my_state->h_read_vio = INKVConnRead(my_state->http_vc, contp, my_state->resp_buffer, INT_MAX);
-  if (my_state->h_read_vio == INK_ERROR_PTR) {
-    LOG_ERROR_AND_CLEANUP("INKVConnRead");
+  my_state->h_read_vio = TSVConnRead(my_state->http_vc, contp, my_state->resp_buffer, INT_MAX);
+  if (my_state->h_read_vio == TS_ERROR_PTR) {
+    LOG_ERROR_AND_CLEANUP("TSVConnRead");
   }
-  my_state->h_write_vio = INKVConnWrite(my_state->http_vc, contp, my_state->req_reader, INT_MAX);
-  if (my_state->h_write_vio == INK_ERROR_PTR) {
-    LOG_ERROR_AND_CLEANUP("INKVConnWrite");
+  my_state->h_write_vio = TSVConnWrite(my_state->http_vc, contp, my_state->req_reader, INT_MAX);
+  if (my_state->h_write_vio == TS_ERROR_PTR) {
+    LOG_ERROR_AND_CLEANUP("TSVConnWrite");
   }
 
-  my_state->n_read_vio = INKVConnRead(my_state->net_vc, contp, my_state->req_buffer, INT_MAX);
-  if (my_state->n_read_vio == INK_ERROR_PTR) {
-    LOG_ERROR_AND_CLEANUP("INKVConnRead");
+  my_state->n_read_vio = TSVConnRead(my_state->net_vc, contp, my_state->req_buffer, INT_MAX);
+  if (my_state->n_read_vio == TS_ERROR_PTR) {
+    LOG_ERROR_AND_CLEANUP("TSVConnRead");
   }
-  my_state->n_write_vio = INKVConnWrite(my_state->net_vc, contp, my_state->resp_reader, INT_MAX);
-  if (my_state->n_write_vio == INK_ERROR_PTR) {
-    LOG_ERROR_AND_CLEANUP("INKVConnWrite");
+  my_state->n_write_vio = TSVConnWrite(my_state->net_vc, contp, my_state->resp_reader, INT_MAX);
+  if (my_state->n_write_vio == TS_ERROR_PTR) {
+    LOG_ERROR_AND_CLEANUP("TSVConnWrite");
   }
 
 Lcleanup:
-  if (INKMutexUnlock(mutexp) == INK_ERROR) {
-    LOG_ERROR("INKMutexUnlock");
+  if (TSMutexUnlock(mutexp) == TS_ERROR) {
+    LOG_ERROR("TSMutexUnlock");
   }
 }
 
 
 static int
-accept_func(INKCont contp, INKEvent event, void *edata)
+accept_func(TSCont contp, TSEvent event, void *edata)
 {
   LOG_SET_FUNCTION_NAME("accept_func");
 
   switch (event) {
-  case INK_EVENT_NET_ACCEPT:
-    pvc_process_accept((INKVConn) edata);
+  case TS_EVENT_NET_ACCEPT:
+    pvc_process_accept((TSVConn) edata);
     break;
 
-  case INK_EVENT_NET_ACCEPT_FAILED:
-    LOG_ERROR("INK_EVENT_NET_ACCEPT_FAILED");
-    INKError("Accept failed\n");
+  case TS_EVENT_NET_ACCEPT_FAILED:
+    LOG_ERROR("TS_EVENT_NET_ACCEPT_FAILED");
+    TSError("Accept failed\n");
     break;
 
   default:
-    INKDebug(PLUGIN_NAME, "Bad event %d", event);
-    INKReleaseAssert(!"Unexpected event");
+    TSDebug(PLUGIN_NAME, "Bad event %d", event);
+    TSReleaseAssert(!"Unexpected event");
     break;
   }
 
@@ -487,7 +487,7 @@ int
 check_ts_version()
 {
 
-  const char *ts_version = INKTrafficServerVersionGet();
+  const char *ts_version = TSTrafficServerVersionGet();
   int result = 0;
 
   if (ts_version) {
@@ -510,56 +510,56 @@ check_ts_version()
 }
 
 void
-INKPluginInit(int argc, const char *argv[])
+TSPluginInit(int argc, const char *argv[])
 {
-  LOG_SET_FUNCTION_NAME("INKPluginInit");
+  LOG_SET_FUNCTION_NAME("TSPluginInit");
 
-  INKMLoc field_loc;
+  TSMLoc field_loc;
   const char *p;
   int i;
-  INKPluginRegistrationInfo info;
-  INKCont accept_cont;
-  INKMutex mutex;
+  TSPluginRegistrationInfo info;
+  TSCont accept_cont;
+  TSMutex mutex;
   int port;
 
   info.plugin_name = "test-pos";
   info.vendor_name = "MyCompany";
   info.support_email = "ts-api-support@MyCompany.com";
 
-  if (!INKPluginRegister(INK_SDK_VERSION_2_0, &info)) {
-    INKError("Plugin registration failed.\n");
+  if (!TSPluginRegister(TS_SDK_VERSION_2_0, &info)) {
+    TSError("Plugin registration failed.\n");
   }
 
   if (!check_ts_version()) {
-    INKError("Plugin requires Traffic Server 2.0 or later\n");
+    TSError("Plugin requires Traffic Server 2.0 or later\n");
     return;
   }
 
   if (argc != 2) {
-    INKError("No accept port specified\n");
+    TSError("No accept port specified\n");
     return;
   }
   port = atoi(argv[1]);
 
   if (port <= 0) {
-    INKError("Bad port specified\n");
+    TSError("Bad port specified\n");
   } else if (port <= 1024) {
-    INKError("Priveledged port specified\n");
+    TSError("Priveledged port specified\n");
   }
 
-  mutex = INKMutexCreate();
-  if (mutex == INK_ERROR_PTR) {
-    LOG_ERROR("INKMutexCreate");
+  mutex = TSMutexCreate();
+  if (mutex == TS_ERROR_PTR) {
+    LOG_ERROR("TSMutexCreate");
     return;
   }
-  accept_cont = INKContCreate(accept_func, mutex);
-  if (accept_cont == INK_ERROR_PTR) {
-    LOG_ERROR("INKContCreate");
+  accept_cont = TSContCreate(accept_func, mutex);
+  if (accept_cont == TS_ERROR_PTR) {
+    LOG_ERROR("TSContCreate");
     return;
   }
-  accept_action = INKNetAccept(accept_cont, port);
-  if (accept_action == INK_ERROR_PTR) {
-    LOG_ERROR("INKNetAccept");
+  accept_action = TSNetAccept(accept_cont, port);
+  if (accept_action == TS_ERROR_PTR) {
+    LOG_ERROR("TSNetAccept");
     return;
   }
 }