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 [2/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/ exam...

Modified: trafficserver/traffic/branches/wccp/example/append-transform/readme.txt
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/example/append-transform/readme.txt?rev=1040383&r1=1040382&r2=1040383&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/example/append-transform/readme.txt (original)
+++ trafficserver/traffic/branches/wccp/example/append-transform/readme.txt Tue Nov 30 01:42:55 2010
@@ -20,7 +20,7 @@ On Solaris: append-transform.so path/to/
 Specify an absolute path to the text file, or a relative path as
 described in the file-plugin README.
 
-INKPluginInit does the following:
+TSPluginInit does the following:
 
 - makes sure that there is a text file specified in plugin.config
 	(if not, it returns an error message)
@@ -29,57 +29,57 @@ INKPluginInit does the following:
 	a buffer to be appended to HTML response bodies
 
 - sets up the global hook to call back the plugin:
-	INKHttpHookAdd(INK_HTTP_READ_RESPONSE_HDR_HOOK, 
-INKContCreate (transform_plugin, NULL)); 
+	TSHttpHookAdd(TS_HTTP_READ_RESPONSE_HDR_HOOK, 
+TSContCreate (transform_plugin, NULL)); 
 
 The load function does the following (similar to file-1.c):
 
 - opens the file specified in plugin.config using
-	INKfopen
+	TSfopen
 
 - creates a buffer for the text to be appended using
-	INKIOBufferCreate
+	TSIOBufferCreate
 
 - creates a buffer reader for the text to be appended using
-	INKIOBufferReaderAlloc
+	TSIOBufferReaderAlloc
 
 - reads the contents of the file in to the buffer using:
-	INKIOBufferStart
-	INKIOBufferBlockWriteStart
-	INKfread	
-	INKIOBufferProduce
-	INKIOBufferReaderAvail
+	TSIOBufferStart
+	TSIOBufferBlockWriteStart
+	TSfread	
+	TSIOBufferProduce
+	TSIOBufferReaderAvail
 
 - closes the file using
-	INKfclose
+	TSfclose
 
 The transform_plugin function does the following:
 
 - tests the response body to make sure it is text/html, using 
 	the function "transformable". The transformable function
 	uses the following API calls:
-	INKHttpTxnServerRespGet
-	INKHttpHdrStatusGet	
-	INKMimeHdrFieldFind
-	INKMimeFieldValueGet
+	TSHttpTxnServerRespGet
+	TSHttpHdrStatusGet	
+	TSMimeHdrFieldFind
+	TSMimeHdrFieldValueStringGet
 
 - if the response body is deemed transformable, transform_plugin calls
 	transform_add 
 
 - continues the HTTP transaction using
-	INKHttpTxnReenable
+	TSHttpTxnReenable
 
 The transform_add function does the following:
 
 - creates a continuation for the append transform, using
-	INKTransformCreate (append_transform, txnp); 
+	TSTransformCreate (append_transform, txnp); 
 	The handler function for this continuation is 
 	append_transform.
 
 - adds a transaction hook for the append transform, using
-	INKHttpTxnHookAdd(txnp, INK_HTTP_RESPONSE_TRANSFORM_HOOK, connp);
+	TSHttpTxnHookAdd(txnp, TS_HTTP_RESPONSE_TRANSFORM_HOOK, connp);
 	This transaction hook sets up a callback during transactions. 
-	When the event INK_HTTP_RESPONSE_TRANSFORM_HOOK happens,
+	When the event TS_HTTP_RESPONSE_TRANSFORM_HOOK happens,
 	the append_transform function is called back.
 
 The remaining functions in the plugin, append_transform and 

Propchange: trafficserver/traffic/branches/wccp/example/basic-auth/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Nov 30 01:42:55 2010
@@ -0,0 +1,3 @@
+Makefile.in
+Makefile
+.deps

Modified: trafficserver/traffic/branches/wccp/example/basic-auth/basic-auth.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/example/basic-auth/basic-auth.c?rev=1040383&r1=1040382&r2=1040383&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/example/basic-auth/basic-auth.c (original)
+++ trafficserver/traffic/branches/wccp/example/basic-auth/basic-auth.c Tue Nov 30 01:42:55 2010
@@ -58,7 +58,7 @@ base64_decode(const char *input)
 
   for (len = 0; (input[len] != '\0') && (input[len] != '='); len++);
 
-  output = obuf = (char *) INKmalloc((len * 6) / 8 + 3);
+  output = obuf = (char *) TSmalloc((len * 6) / 8 + 3);
 
   while (len > 0) {
     *output++ = decode(0) << 2 | decode(1) >> 4;
@@ -118,42 +118,42 @@ authorized(char *user, char *password)
 }
 
 static void
-handle_dns(INKHttpTxn txnp, INKCont contp)
+handle_dns(TSHttpTxn txnp, TSCont contp)
 {
-  INKMBuffer bufp;
-  INKMLoc hdr_loc;
-  INKMLoc field_loc;
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc field_loc;
   const char *val;
   const char *ptr;
 
   char *user, *password;
   int authval_length;
 
-  if (!INKHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
-    INKError("couldn't retrieve client request header\n");
+  if (!TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
+    TSError("couldn't retrieve client request header\n");
     goto done;
   }
 
-  field_loc = INKMimeHdrFieldRetrieve(bufp, hdr_loc, INK_MIME_FIELD_PROXY_AUTHORIZATION);
+  field_loc = TSMimeHdrFieldFind(bufp, hdr_loc, TS_MIME_FIELD_PROXY_AUTHORIZATION, TS_MIME_LEN_PROXY_AUTHORIZATION);
   if (!field_loc) {
-    INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
-    INKError("no Proxy-Authorization field\n");
+    TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+    TSError("no Proxy-Authorization field\n");
     goto done;
   }
 
-  if (INKMimeHdrFieldValueStringGet(bufp, hdr_loc, field_loc, 0, &val, &authval_length) != INK_SUCCESS) {
-    INKError("no value in Proxy-Authorization field\n");
-    INKHandleMLocRelease(bufp, hdr_loc, field_loc);
-    INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+  if (TSMimeHdrFieldValueStringGet(bufp, hdr_loc, field_loc, 0, &val, &authval_length) != TS_SUCCESS) {
+    TSError("no value in Proxy-Authorization field\n");
+    TSHandleMLocRelease(bufp, hdr_loc, field_loc);
+    TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
     goto done;
   }
   ptr = val;
 
   if (strncmp(ptr, "Basic", 5) != 0) {
-    INKError("no Basic auth type in Proxy-Authorization\n");
-    INKHandleStringRelease(bufp, field_loc, val);
-    INKHandleMLocRelease(bufp, hdr_loc, field_loc);
-    INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+    TSError("no Basic auth type in Proxy-Authorization\n");
+    TSHandleStringRelease(bufp, field_loc, val);
+    TSHandleMLocRelease(bufp, hdr_loc, field_loc);
+    TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
     goto done;
   }
 
@@ -165,78 +165,78 @@ handle_dns(INKHttpTxn txnp, INKCont cont
   user = base64_decode(ptr);
   password = strchr(user, ':');
   if (!password) {
-    INKError("no password in authorization information\n");
-    INKfree(user);
-    INKHandleStringRelease(bufp, field_loc, val);
-    INKHandleMLocRelease(bufp, hdr_loc, field_loc);
-    INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+    TSError("no password in authorization information\n");
+    TSfree(user);
+    TSHandleStringRelease(bufp, field_loc, val);
+    TSHandleMLocRelease(bufp, hdr_loc, field_loc);
+    TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
     goto done;
   }
   *password = '\0';
   password += 1;
 
   if (!authorized(user, password)) {
-    INKError("%s:%s not authorized\n", user, password);
-    INKfree(user);
-    INKHandleStringRelease(bufp, field_loc, val);
-    INKHandleMLocRelease(bufp, hdr_loc, field_loc);
-    INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+    TSError("%s:%s not authorized\n", user, password);
+    TSfree(user);
+    TSHandleStringRelease(bufp, field_loc, val);
+    TSHandleMLocRelease(bufp, hdr_loc, field_loc);
+    TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
     goto done;
   }
 
-  INKfree(user);
-  INKHandleStringRelease(bufp, field_loc, val);
-  INKHandleMLocRelease(bufp, hdr_loc, field_loc);
-  INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
-  INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+  TSfree(user);
+  TSHandleStringRelease(bufp, field_loc, val);
+  TSHandleMLocRelease(bufp, hdr_loc, field_loc);
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
   return;
 
 done:
-  INKHttpTxnHookAdd(txnp, INK_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
-  INKHttpTxnReenable(txnp, INK_EVENT_HTTP_ERROR);
+  TSHttpTxnHookAdd(txnp, TS_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
+  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_ERROR);
 }
 
 static void
-handle_response(INKHttpTxn txnp)
+handle_response(TSHttpTxn txnp)
 {
-  INKMBuffer bufp;
-  INKMLoc hdr_loc;
-  INKMLoc field_loc;
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc field_loc;
   const char *insert = "Basic realm=\"proxy\"";
   int len = strlen(insert);
 
-  if (!INKHttpTxnClientRespGet(txnp, &bufp, &hdr_loc)) {
-    INKError("couldn't retrieve client response header\n");
+  if (!TSHttpTxnClientRespGet(txnp, &bufp, &hdr_loc)) {
+    TSError("couldn't retrieve client response header\n");
     goto done;
   }
 
-  INKHttpHdrStatusSet(bufp, hdr_loc, INK_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED);
-  INKHttpHdrReasonSet(bufp, hdr_loc,
-                      INKHttpHdrReasonLookup(INK_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED),
-                      strlen(INKHttpHdrReasonLookup(INK_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED)));
-
-  field_loc = INKMimeHdrFieldCreate(bufp, hdr_loc);
-  INKMimeHdrFieldNameSet(bufp, hdr_loc, field_loc, INK_MIME_FIELD_PROXY_AUTHENTICATE, INK_MIME_LEN_PROXY_AUTHENTICATE);
-  INKMimeHdrFieldValueStringInsert(bufp, hdr_loc, field_loc, -1,  insert, len);
-  INKMimeHdrFieldAppend(bufp, hdr_loc, field_loc);
+  TSHttpHdrStatusSet(bufp, hdr_loc, TS_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED);
+  TSHttpHdrReasonSet(bufp, hdr_loc,
+                      TSHttpHdrReasonLookup(TS_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED),
+                      strlen(TSHttpHdrReasonLookup(TS_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED)));
+
+  field_loc = TSMimeHdrFieldCreate(bufp, hdr_loc);
+  TSMimeHdrFieldNameSet(bufp, hdr_loc, field_loc, TS_MIME_FIELD_PROXY_AUTHENTICATE, TS_MIME_LEN_PROXY_AUTHENTICATE);
+  TSMimeHdrFieldValueStringInsert(bufp, hdr_loc, field_loc, -1,  insert, len);
+  TSMimeHdrFieldAppend(bufp, hdr_loc, field_loc);
 
-  INKHandleMLocRelease(bufp, hdr_loc, field_loc);
-  INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+  TSHandleMLocRelease(bufp, hdr_loc, field_loc);
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
 
 done:
-  INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
 }
 
 static int
-auth_plugin(INKCont contp, INKEvent event, void *edata)
+auth_plugin(TSCont contp, TSEvent event, void *edata)
 {
-  INKHttpTxn txnp = (INKHttpTxn) edata;
+  TSHttpTxn txnp = (TSHttpTxn) edata;
 
   switch (event) {
-  case INK_EVENT_HTTP_OS_DNS:
+  case TS_EVENT_HTTP_OS_DNS:
     handle_dns(txnp, contp);
     return 0;
-  case INK_EVENT_HTTP_SEND_RESPONSE_HDR:
+  case TS_EVENT_HTTP_SEND_RESPONSE_HDR:
     handle_response(txnp);
     return 0;
   default:
@@ -250,7 +250,7 @@ int
 check_ts_version()
 {
 
-  const char *ts_version = INKTrafficServerVersionGet();
+  const char *ts_version = TSTrafficServerVersionGet();
   int result = 0;
 
   if (ts_version) {
@@ -273,21 +273,21 @@ check_ts_version()
 }
 
 void
-INKPluginInit(int argc, const char *argv[])
+TSPluginInit(int argc, const char *argv[])
 {
   int i, cc;
-  INKPluginRegistrationInfo info;
+  TSPluginRegistrationInfo info;
 
   info.plugin_name = "basic-authorization";
   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;
   }
 
@@ -307,7 +307,7 @@ INKPluginInit(int argc, const char *argv
   base64_codes['+'] = cc++;
   base64_codes['/'] = cc++;
 
-  INKHttpHookAdd(INK_HTTP_OS_DNS_HOOK, INKContCreate(auth_plugin, NULL));
+  TSHttpHookAdd(TS_HTTP_OS_DNS_HOOK, TSContCreate(auth_plugin, NULL));
 }
 
 

Modified: trafficserver/traffic/branches/wccp/example/basic-auth/readme.txt
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/example/basic-auth/readme.txt?rev=1040383&r1=1040382&r2=1040383&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/example/basic-auth/readme.txt (original)
+++ trafficserver/traffic/branches/wccp/example/basic-auth/readme.txt Tue Nov 30 01:42:55 2010
@@ -3,12 +3,12 @@ The basic-auth.c plugin performs basic H
 -- The plugin checks all client request headers for the Proxy-Authorization
    MIME field, which should contain the user name and password.
 
-     INKPluginInit sets up a global HTTP hook that calls the plugin
+     TSPluginInit sets up a global HTTP hook that calls the plugin
      whenever there is a host DNS lookup. The plugin's continuation
      handler, auth-plugin, calls handle_dns to check the 
      Proxy-Authorization field. 
 
-     handle_dns uses INKHttpTxnClientReqGet and INKMimeHdrFieldRetrieve
+     handle_dns uses TSHttpTxnClientReqGet and TSMimeHdrFieldFind
      to obtain the Proxy-Authorization field. 
 
 -- If the request does not have the Proxy-Authorization field,
@@ -23,7 +23,7 @@ The basic-auth.c plugin performs basic H
      plugin back when sending the client response. 
 
      handle_dns also reenables the transaction with
-     INK_EVENT_HTTP_ERROR, which means that the plugin wants 
+     TS_EVENT_HTTP_ERROR, which means that the plugin wants 
      Traffic Server to terminate the transaction.
 
      When Traffic Server terminates the transaction, it 
@@ -38,7 +38,7 @@ The basic-auth.c plugin performs basic H
 -- If the Proxy-Authorization MIME field is present, the plugin
    checks that the authentication scheme is "Basic".
 
-     handle_dns uses INKMimeFieldValueGet to get the value
+     handle_dns uses TSMimeFieldValueStringGet to get the value
      of the Proxy-Authorization field.
 
 -- The plugin then obtains the base64-encoded user name and password

Propchange: trafficserver/traffic/branches/wccp/example/blacklist-0/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Nov 30 01:42:55 2010
@@ -0,0 +1,3 @@
+Makefile.in
+Makefile
+.deps

Modified: trafficserver/traffic/branches/wccp/example/blacklist-0/blacklist-0.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/example/blacklist-0/blacklist-0.c?rev=1040383&r1=1040382&r2=1040383&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/example/blacklist-0/blacklist-0.c (original)
+++ trafficserver/traffic/branches/wccp/example/blacklist-0/blacklist-0.c Tue Nov 30 01:42:55 2010
@@ -38,110 +38,110 @@ static char **sites;
 static int nsites;
 
 static void
-handle_dns(INKHttpTxn txnp, INKCont contp)
+handle_dns(TSHttpTxn txnp, TSCont contp)
 {
-  INKMBuffer bufp;
-  INKMLoc hdr_loc;
-  INKMLoc url_loc;
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc url_loc;
   const char *host;
   int i;
   int host_length;
 
-  if (!INKHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
-    INKError("couldn't retrieve client request header\n");
+  if (!TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
+    TSError("couldn't retrieve client request header\n");
     goto done;
   }
 
-  url_loc = INKHttpHdrUrlGet(bufp, hdr_loc);
+  url_loc = TSHttpHdrUrlGet(bufp, hdr_loc);
   if (!url_loc) {
-    INKError("couldn't retrieve request url\n");
-    INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+    TSError("couldn't retrieve request url\n");
+    TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
     goto done;
   }
 
-  host = INKUrlHostGet(bufp, url_loc, &host_length);
+  host = TSUrlHostGet(bufp, url_loc, &host_length);
   if (!host) {
-    INKError("couldn't retrieve request hostname\n");
-    INKHandleMLocRelease(bufp, hdr_loc, url_loc);
-    INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+    TSError("couldn't retrieve request hostname\n");
+    TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+    TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
     goto done;
   }
   for (i = 0; i < nsites; i++) {
     if (strncmp(host, sites[i], host_length) == 0) {
       printf("blacklisting site: %s\n", sites[i]);
-      INKHttpTxnHookAdd(txnp, INK_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
-      INKHandleStringRelease(bufp, url_loc, host);
-      INKHandleMLocRelease(bufp, hdr_loc, url_loc);
-      INKHandleMLocRelease(bufp, INK_NULL_MLOC, url_loc);
-      INKHttpTxnReenable(txnp, INK_EVENT_HTTP_ERROR);
+      TSHttpTxnHookAdd(txnp, TS_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
+      TSHandleStringRelease(bufp, url_loc, host);
+      TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+      TSHandleMLocRelease(bufp, TS_NULL_MLOC, url_loc);
+      TSHttpTxnReenable(txnp, TS_EVENT_HTTP_ERROR);
       return;
     }
   }
-  INKHandleStringRelease(bufp, url_loc, host);
-  INKHandleMLocRelease(bufp, hdr_loc, url_loc);
-  INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+  TSHandleStringRelease(bufp, url_loc, host);
+  TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
 
 done:
-  INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
 }
 
 static void
-handle_response(INKHttpTxn txnp)
+handle_response(TSHttpTxn txnp)
 {
-  INKMBuffer bufp;
-  INKMLoc hdr_loc;
-  INKMLoc url_loc;
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc url_loc;
   char *url_str;
   char *buf;
   int url_length;
 
-  if (!INKHttpTxnClientRespGet(txnp, &bufp, &hdr_loc)) {
-    INKError("couldn't retrieve client response header\n");
+  if (!TSHttpTxnClientRespGet(txnp, &bufp, &hdr_loc)) {
+    TSError("couldn't retrieve client response header\n");
     goto done;
   }
 
-  INKHttpHdrStatusSet(bufp, hdr_loc, INK_HTTP_STATUS_FORBIDDEN);
-  INKHttpHdrReasonSet(bufp, hdr_loc,
-                      INKHttpHdrReasonLookup(INK_HTTP_STATUS_FORBIDDEN),
-                      strlen(INKHttpHdrReasonLookup(INK_HTTP_STATUS_FORBIDDEN)));
+  TSHttpHdrStatusSet(bufp, hdr_loc, TS_HTTP_STATUS_FORBIDDEN);
+  TSHttpHdrReasonSet(bufp, hdr_loc,
+                      TSHttpHdrReasonLookup(TS_HTTP_STATUS_FORBIDDEN),
+                      strlen(TSHttpHdrReasonLookup(TS_HTTP_STATUS_FORBIDDEN)));
 
-  if (!INKHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
-    INKError("couldn't retrieve client request header\n");
-    INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+  if (!TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
+    TSError("couldn't retrieve client request header\n");
+    TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
     goto done;
   }
 
-  url_loc = INKHttpHdrUrlGet(bufp, hdr_loc);
+  url_loc = TSHttpHdrUrlGet(bufp, hdr_loc);
   if (!url_loc) {
-    INKError("couldn't retrieve request url\n");
-    INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+    TSError("couldn't retrieve request url\n");
+    TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
     goto done;
   }
 
-  buf = INKmalloc(4096);
+  buf = TSmalloc(4096);
 
-  url_str = INKUrlStringGet(bufp, url_loc, &url_length);
+  url_str = TSUrlStringGet(bufp, url_loc, &url_length);
   sprintf(buf, "You are forbidden from accessing \"%s\"\n", url_str);
-  INKfree(url_str);
-  INKHandleMLocRelease(bufp, hdr_loc, url_loc);
-  INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+  TSfree(url_str);
+  TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
 
-  INKHttpTxnErrorBodySet(txnp, buf, strlen(buf), NULL);
+  TSHttpTxnErrorBodySet(txnp, buf, strlen(buf), NULL);
 
 done:
-  INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
 }
 
 static int
-blacklist_plugin(INKCont contp, INKEvent event, void *edata)
+blacklist_plugin(TSCont contp, TSEvent event, void *edata)
 {
-  INKHttpTxn txnp = (INKHttpTxn) edata;
+  TSHttpTxn txnp = (TSHttpTxn) edata;
 
   switch (event) {
-  case INK_EVENT_HTTP_OS_DNS:
+  case TS_EVENT_HTTP_OS_DNS:
     handle_dns(txnp, contp);
     return 0;
-  case INK_EVENT_HTTP_SEND_RESPONSE_HDR:
+  case TS_EVENT_HTTP_SEND_RESPONSE_HDR:
     handle_response(txnp);
     return 0;
   default:
@@ -154,7 +154,7 @@ int
 check_ts_version()
 {
 
-  const char *ts_version = INKTrafficServerVersionGet();
+  const char *ts_version = TSTrafficServerVersionGet();
   int result = 0;
 
   if (ts_version) {
@@ -177,34 +177,34 @@ check_ts_version()
 }
 
 void
-INKPluginInit(int argc, const char *argv[])
+TSPluginInit(int argc, const char *argv[])
 {
   int i;
-  INKPluginRegistrationInfo info;
+  TSPluginRegistrationInfo info;
 
   info.plugin_name = "blacklist-0";
   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;
   }
 
 
   nsites = argc - 1;
   if (nsites > 0) {
-    sites = (char **) INKmalloc(sizeof(char *) * nsites);
+    sites = (char **) TSmalloc(sizeof(char *) * nsites);
 
     for (i = 0; i < nsites; i++) {
-      sites[i] = INKstrdup(argv[i + 1]);
+      sites[i] = TSstrdup(argv[i + 1]);
     }
 
-    INKHttpHookAdd(INK_HTTP_OS_DNS_HOOK, INKContCreate(blacklist_plugin, NULL));
+    TSHttpHookAdd(TS_HTTP_OS_DNS_HOOK, TSContCreate(blacklist_plugin, NULL));
   }
 }

Propchange: trafficserver/traffic/branches/wccp/example/blacklist-1/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Nov 30 01:42:55 2010
@@ -0,0 +1,3 @@
+Makefile.in
+Makefile
+.deps

Modified: trafficserver/traffic/branches/wccp/example/blacklist-1/blacklist-1.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/example/blacklist-1/blacklist-1.c?rev=1040383&r1=1040382&r2=1040383&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/example/blacklist-1/blacklist-1.c (original)
+++ trafficserver/traffic/branches/wccp/example/blacklist-1/blacklist-1.c Tue Nov 30 01:42:55 2010
@@ -44,11 +44,11 @@
 
 static char *sites[MAX_NSITES];
 static int nsites;
-static INKMutex sites_mutex;
-static INKTextLogObject log;
-static INKCont global_contp;
+static TSMutex sites_mutex;
+static TSTextLogObject log;
+static TSCont global_contp;
 
-static void handle_txn_start(INKCont contp, INKHttpTxn txnp);
+static void handle_txn_start(TSCont contp, TSHttpTxn txnp);
 
 typedef struct contp_data
 {
@@ -60,179 +60,179 @@ typedef struct contp_data
     READ_BLACKLIST
   } cf;
 
-  INKHttpTxn txnp;
+  TSHttpTxn txnp;
 
 } cdata;
 
 static void
-destroy_continuation(INKHttpTxn txnp, INKCont contp)
+destroy_continuation(TSHttpTxn txnp, TSCont contp)
 {
   cdata *cd = NULL;
 
-  cd = (cdata *) INKContDataGet(contp);
+  cd = (cdata *) TSContDataGet(contp);
   if (cd != NULL) {
-    INKfree(cd);
+    TSfree(cd);
   }
-  INKContDestroy(contp);
-  INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+  TSContDestroy(contp);
+  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
   return;
 }
 
 
 static void
-handle_dns(INKHttpTxn txnp, INKCont contp)
+handle_dns(TSHttpTxn txnp, TSCont contp)
 {
-  INKMBuffer bufp;
-  INKMLoc hdr_loc;
-  INKMLoc url_loc;
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc url_loc;
   const char *host;
   int i;
   int host_length;
   int lock;
-  INKReturnCode ret_code;
+  TSReturnCode ret_code;
 
-  if (!INKHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
-    INKError("couldn't retrieve client request header\n");
+  if (!TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
+    TSError("couldn't retrieve client request header\n");
     goto done;
   }
 
-  url_loc = INKHttpHdrUrlGet(bufp, hdr_loc);
+  url_loc = TSHttpHdrUrlGet(bufp, hdr_loc);
   if (!url_loc) {
-    INKError("couldn't retrieve request url\n");
-    INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+    TSError("couldn't retrieve request url\n");
+    TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
     goto done;
   }
 
-  host = INKUrlHostGet(bufp, url_loc, &host_length);
+  host = TSUrlHostGet(bufp, url_loc, &host_length);
   if (!host) {
-    INKError("couldn't retrieve request hostname\n");
-    INKHandleMLocRelease(bufp, hdr_loc, url_loc);
-    INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+    TSError("couldn't retrieve request hostname\n");
+    TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+    TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
     goto done;
   }
 
   /* We need to lock the sites_mutex as that is the mutex that is
      protecting the global list of all blacklisted sites. */
 
-  ret_code = INKMutexLockTry(sites_mutex, &lock);
+  ret_code = TSMutexLockTry(sites_mutex, &lock);
 
-  if (ret_code == INK_ERROR) {
-    INKError("Error while locking mutex. Cannot check URL against list. Allowing Site....");
-    INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+  if (ret_code == TS_ERROR) {
+    TSError("Error while locking mutex. Cannot check URL against list. Allowing Site....");
+    TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
     return;
   }
 
   if (!lock) {
-    INKDebug("blacklist-1", "Unable to get lock. Will retry after some time");
-    INKHandleStringRelease(bufp, url_loc, host);
-    INKHandleMLocRelease(bufp, hdr_loc, url_loc);
-    INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
-    INKContSchedule(contp, RETRY_TIME);
+    TSDebug("blacklist-1", "Unable to get lock. Will retry after some time");
+    TSHandleStringRelease(bufp, url_loc, host);
+    TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+    TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+    TSContSchedule(contp, RETRY_TIME);
     return;
   }
 
   for (i = 0; i < nsites; i++) {
     if (strncmp(host, sites[i], host_length) == 0) {
       if (log) {
-        INKTextLogObjectWrite(log, "blacklisting site: %s", sites[i]);
+        TSTextLogObjectWrite(log, "blacklisting site: %s", sites[i]);
       } else {
-        INKDebug("blacklist-1", "blacklisting site: %s\n", sites[i]);
+        TSDebug("blacklist-1", "blacklisting site: %s\n", sites[i]);
       }
-      INKHttpTxnHookAdd(txnp, INK_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
-      INKHandleStringRelease(bufp, url_loc, host);
-      INKHandleMLocRelease(bufp, hdr_loc, url_loc);
-      INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
-      INKHttpTxnReenable(txnp, INK_EVENT_HTTP_ERROR);
-      INKMutexUnlock(sites_mutex);
+      TSHttpTxnHookAdd(txnp, TS_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
+      TSHandleStringRelease(bufp, url_loc, host);
+      TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+      TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+      TSHttpTxnReenable(txnp, TS_EVENT_HTTP_ERROR);
+      TSMutexUnlock(sites_mutex);
       return;
     }
   }
 
-  INKMutexUnlock(sites_mutex);
-  INKHandleStringRelease(bufp, url_loc, host);
-  INKHandleMLocRelease(bufp, hdr_loc, url_loc);
-  INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+  TSMutexUnlock(sites_mutex);
+  TSHandleStringRelease(bufp, url_loc, host);
+  TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
 
 done:
-  INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
 }
 
 static void
-handle_response(INKHttpTxn txnp, INKCont contp)
+handle_response(TSHttpTxn txnp, TSCont contp)
 {
-  INKMBuffer bufp;
-  INKMLoc hdr_loc;
-  INKMLoc url_loc;
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc url_loc;
   char *url_str;
   char *buf;
   int url_length;
 
-  if (!INKHttpTxnClientRespGet(txnp, &bufp, &hdr_loc)) {
-    INKError("couldn't retrieve client response header\n");
+  if (!TSHttpTxnClientRespGet(txnp, &bufp, &hdr_loc)) {
+    TSError("couldn't retrieve client response header\n");
     goto done;
   }
 
-  INKHttpHdrStatusSet(bufp, hdr_loc, INK_HTTP_STATUS_FORBIDDEN);
-  INKHttpHdrReasonSet(bufp, hdr_loc,
-                      INKHttpHdrReasonLookup(INK_HTTP_STATUS_FORBIDDEN),
-                      strlen(INKHttpHdrReasonLookup(INK_HTTP_STATUS_FORBIDDEN)));
-
-  if (!INKHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
-    INKError("couldn't retrieve client request header\n");
-    INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+  TSHttpHdrStatusSet(bufp, hdr_loc, TS_HTTP_STATUS_FORBIDDEN);
+  TSHttpHdrReasonSet(bufp, hdr_loc,
+                      TSHttpHdrReasonLookup(TS_HTTP_STATUS_FORBIDDEN),
+                      strlen(TSHttpHdrReasonLookup(TS_HTTP_STATUS_FORBIDDEN)));
+
+  if (!TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
+    TSError("couldn't retrieve client request header\n");
+    TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
     goto done;
   }
 
-  url_loc = INKHttpHdrUrlGet(bufp, hdr_loc);
+  url_loc = TSHttpHdrUrlGet(bufp, hdr_loc);
   if (!url_loc) {
-    INKError("couldn't retrieve request url\n");
-    INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+    TSError("couldn't retrieve request url\n");
+    TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
     goto done;
   }
 
-  buf = (char *) INKmalloc(4096);
+  buf = (char *) TSmalloc(4096);
 
-  url_str = INKUrlStringGet(bufp, url_loc, &url_length);
+  url_str = TSUrlStringGet(bufp, url_loc, &url_length);
   sprintf(buf, "You are forbidden from accessing \"%s\"\n", url_str);
-  INKfree(url_str);
-  INKHandleMLocRelease(bufp, hdr_loc, url_loc);
-  INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+  TSfree(url_str);
+  TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
 
-  INKHttpTxnErrorBodySet(txnp, buf, strlen(buf), NULL);
+  TSHttpTxnErrorBodySet(txnp, buf, strlen(buf), NULL);
 
 done:
-  INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
 }
 
 static void
-read_blacklist(INKCont contp)
+read_blacklist(TSCont contp)
 {
   char blacklist_file[1024];
-  INKFile file;
+  TSFile file;
   int lock;
-  INKReturnCode ret_code;
+  TSReturnCode ret_code;
 
-  sprintf(blacklist_file, "%s/blacklist.txt", INKPluginDirGet());
-  file = INKfopen(blacklist_file, "r");
+  sprintf(blacklist_file, "%s/blacklist.txt", TSPluginDirGet());
+  file = TSfopen(blacklist_file, "r");
 
-  ret_code = INKMutexLockTry(sites_mutex, &lock);
+  ret_code = TSMutexLockTry(sites_mutex, &lock);
 
-  if (ret_code == INK_ERROR) {
-    INKError("Failed to lock mutex. Cannot read new blacklist file. Exiting ...\n");
+  if (ret_code == TS_ERROR) {
+    TSError("Failed to lock mutex. Cannot read new blacklist file. Exiting ...\n");
     return;
   }
   nsites = 0;
 
   /* If the Mutext lock is not successful try again in RETRY_TIME */
   if (!lock) {
-    INKContSchedule(contp, RETRY_TIME);
+    TSContSchedule(contp, RETRY_TIME);
     return;
   }
 
   if (file != NULL) {
     char buffer[1024];
 
-    while (INKfgets(file, buffer, sizeof(buffer) - 1) != NULL && nsites < MAX_NSITES) {
+    while (TSfgets(file, buffer, sizeof(buffer) - 1) != NULL && nsites < MAX_NSITES) {
       char *eol;
       if ((eol = strstr(buffer, "\r\n")) != NULL) {
         /* To handle newlines on Windows */
@@ -244,71 +244,71 @@ read_blacklist(INKCont contp)
         continue;
       }
       if (sites[nsites] != NULL) {
-        INKfree(sites[nsites]);
+        TSfree(sites[nsites]);
       }
-      sites[nsites] = INKstrdup(buffer);
+      sites[nsites] = TSstrdup(buffer);
       nsites++;
     }
 
-    INKfclose(file);
+    TSfclose(file);
   } else {
-    INKError("unable to open %s\n", blacklist_file);
-    INKError("all sites will be allowed\n", blacklist_file);
+    TSError("unable to open %s\n", blacklist_file);
+    TSError("all sites will be allowed\n", blacklist_file);
   }
 
-  INKMutexUnlock(sites_mutex);
+  TSMutexUnlock(sites_mutex);
 
 }
 
 static int
-blacklist_plugin(INKCont contp, INKEvent event, void *edata)
+blacklist_plugin(TSCont contp, TSEvent event, void *edata)
 {
-  INKHttpTxn txnp;
+  TSHttpTxn txnp;
   cdata *cd;
 
   switch (event) {
-  case INK_EVENT_HTTP_TXN_START:
-    txnp = (INKHttpTxn) edata;
+  case TS_EVENT_HTTP_TXN_START:
+    txnp = (TSHttpTxn) edata;
     handle_txn_start(contp, txnp);
     return 0;
-  case INK_EVENT_HTTP_OS_DNS:
+  case TS_EVENT_HTTP_OS_DNS:
     if (contp != global_contp) {
-      cd = (cdata *) INKContDataGet(contp);
+      cd = (cdata *) TSContDataGet(contp);
       cd->cf = HANDLE_DNS;
       handle_dns(cd->txnp, contp);
       return 0;
     } else {
       break;
     }
-  case INK_EVENT_HTTP_TXN_CLOSE:
-    txnp = (INKHttpTxn) edata;
+  case TS_EVENT_HTTP_TXN_CLOSE:
+    txnp = (TSHttpTxn) edata;
     if (contp != global_contp) {
       destroy_continuation(txnp, contp);
     }
     break;
-  case INK_EVENT_HTTP_SEND_RESPONSE_HDR:
+  case TS_EVENT_HTTP_SEND_RESPONSE_HDR:
     if (contp != global_contp) {
-      cd = (cdata *) INKContDataGet(contp);
+      cd = (cdata *) TSContDataGet(contp);
       cd->cf = HANDLE_RESPONSE;
       handle_response(cd->txnp, contp);
       return 0;
     } else {
       break;
     }
-  case INK_EVENT_MGMT_UPDATE:
+  case TS_EVENT_MGMT_UPDATE:
     if (contp == global_contp) {
       read_blacklist(contp);
       return 0;
     } else {
       break;
     }
-  case INK_EVENT_TIMEOUT:
+  case TS_EVENT_TIMEOUT:
     /* when mutex lock is not acquired and continuation is rescheduled,
-       the plugin is called back with INK_EVENT_TIMEOUT with a NULL
+       the plugin is called back with TS_EVENT_TIMEOUT with a NULL
        edata. We need to decide, in which function did the MutexLock
        failed and call that function again */
     if (contp != global_contp) {
-      cd = (cdata *) INKContDataGet(contp);
+      cd = (cdata *) TSContDataGet(contp);
       switch (cd->cf) {
       case HANDLE_DNS:
         handle_dns(cd->txnp, contp);
@@ -330,22 +330,22 @@ blacklist_plugin(INKCont contp, INKEvent
 }
 
 static void
-handle_txn_start(INKCont contp, INKHttpTxn txnp)
+handle_txn_start(TSCont contp, TSHttpTxn txnp)
 {
-  INKCont txn_contp;
+  TSCont txn_contp;
   cdata *cd;
 
-  txn_contp = INKContCreate((INKEventFunc) blacklist_plugin, INKMutexCreate());
+  txn_contp = TSContCreate((TSEventFunc) blacklist_plugin, TSMutexCreate());
   /* create the data that'll be associated with the continuation */
-  cd = (cdata *) INKmalloc(sizeof(cdata));
-  INKContDataSet(txn_contp, cd);
+  cd = (cdata *) TSmalloc(sizeof(cdata));
+  TSContDataSet(txn_contp, cd);
 
   cd->txnp = txnp;
 
-  INKHttpTxnHookAdd(txnp, INK_HTTP_OS_DNS_HOOK, txn_contp);
-  INKHttpTxnHookAdd(txnp, INK_HTTP_TXN_CLOSE_HOOK, txn_contp);
+  TSHttpTxnHookAdd(txnp, TS_HTTP_OS_DNS_HOOK, txn_contp);
+  TSHttpTxnHookAdd(txnp, TS_HTTP_TXN_CLOSE_HOOK, txn_contp);
 
-  INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
 }
 
 
@@ -353,7 +353,7 @@ int
 check_ts_version()
 {
 
-  const char *ts_version = INKTrafficServerVersionGet();
+  const char *ts_version = TSTrafficServerVersionGet();
   int result = 0;
 
   if (ts_version) {
@@ -376,43 +376,43 @@ check_ts_version()
 }
 
 void
-INKPluginInit(int argc, const char *argv[])
+TSPluginInit(int argc, const char *argv[])
 {
   int i;
-  INKPluginRegistrationInfo info;
-  INKReturnCode error;
+  TSPluginRegistrationInfo info;
+  TSReturnCode error;
 
   info.plugin_name = "blacklist-1";
   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;
   }
 
-  /* create an INKTextLogObject to log blacklisted requests to */
-  error = INKTextLogObjectCreate("blacklist", INK_LOG_MODE_ADD_TIMESTAMP, &log);
-  if (!log || error == INK_ERROR) {
-    INKDebug("blacklist-1", "error while creating log");
+  /* create an TSTextLogObject to log blacklisted requests to */
+  error = TSTextLogObjectCreate("blacklist", TS_LOG_MODE_ADD_TIMESTAMP, &log);
+  if (!log || error == TS_ERROR) {
+    TSDebug("blacklist-1", "error while creating log");
   }
 
-  sites_mutex = INKMutexCreate();
+  sites_mutex = TSMutexCreate();
 
   nsites = 0;
   for (i = 0; i < MAX_NSITES; i++) {
     sites[i] = NULL;
   }
 
-  global_contp = INKContCreate(blacklist_plugin, sites_mutex);
+  global_contp = TSContCreate(blacklist_plugin, sites_mutex);
   read_blacklist(global_contp);
 
-  /*INKHttpHookAdd (INK_HTTP_OS_DNS_HOOK, contp); */
-  INKHttpHookAdd(INK_HTTP_TXN_START_HOOK, global_contp);
+  /*TSHttpHookAdd (TS_HTTP_OS_DNS_HOOK, contp); */
+  TSHttpHookAdd(TS_HTTP_TXN_START_HOOK, global_contp);
 
-  INKMgmtUpdateRegister(global_contp, "Inktomi Blacklist Plugin", "blacklist.cgi");
+  TSMgmtUpdateRegister(global_contp, "Inktomi Blacklist Plugin", "blacklist.cgi");
 }

Propchange: trafficserver/traffic/branches/wccp/example/bnull-transform/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Nov 30 01:42:55 2010
@@ -0,0 +1,3 @@
+Makefile.in
+Makefile
+.deps

Modified: trafficserver/traffic/branches/wccp/example/bnull-transform/bnull-transform.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/example/bnull-transform/bnull-transform.c?rev=1040383&r1=1040382&r2=1040383&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/example/bnull-transform/bnull-transform.c (original)
+++ trafficserver/traffic/branches/wccp/example/bnull-transform/bnull-transform.c Tue Nov 30 01:42:55 2010
@@ -38,16 +38,16 @@
 #include <stdio.h>
 #include <ts/ts.h>
 
-#define INK_NULL_MUTEX      NULL
+#define TS_NULL_MUTEX      NULL
 #define STATE_BUFFER_DATA   0
 #define STATE_OUTPUT_DATA   1
 
 typedef struct
 {
   int state;
-  INKVIO output_vio;
-  INKIOBuffer output_buffer;
-  INKIOBufferReader output_reader;
+  TSVIO output_vio;
+  TSIOBuffer output_buffer;
+  TSIOBufferReader output_reader;
 } MyData;
 
 static MyData *
@@ -55,7 +55,7 @@ my_data_alloc()
 {
   MyData *data;
 
-  data = (MyData *) INKmalloc(sizeof(MyData));
+  data = (MyData *) TSmalloc(sizeof(MyData));
   data->state = STATE_BUFFER_DATA;
   data->output_vio = NULL;
   data->output_buffer = NULL;
@@ -69,16 +69,16 @@ my_data_destroy(MyData * data)
 {
   if (data) {
     if (data->output_buffer) {
-      INKIOBufferDestroy(data->output_buffer);
+      TSIOBufferDestroy(data->output_buffer);
     }
-    INKfree(data);
+    TSfree(data);
   }
 }
 
 static int
-handle_buffering(INKCont contp, MyData * data)
+handle_buffering(TSCont contp, MyData * data)
 {
-  INKVIO write_vio;
+  TSVIO write_vio;
   int towrite;
   int avail;
 
@@ -86,14 +86,14 @@ handle_buffering(INKCont contp, MyData *
      ourself. This VIO contains the buffer that we are to read from
      as well as the continuation we are to call when the buffer is
      empty. */
-  write_vio = INKVConnWriteVIOGet(contp);
+  write_vio = TSVConnWriteVIOGet(contp);
 
   /* Create the output buffer and its associated reader */
   if (!data->output_buffer) {
-    data->output_buffer = INKIOBufferCreate();
-    INKAssert(data->output_buffer);
-    data->output_reader = INKIOBufferReaderAlloc(data->output_buffer);
-    INKAssert(data->output_reader);
+    data->output_buffer = TSIOBufferCreate();
+    TSAssert(data->output_buffer);
+    data->output_reader = TSIOBufferReaderAlloc(data->output_buffer);
+    TSAssert(data->output_reader);
   }
 
   /* We also check to see if the write VIO's buffer is non-NULL. A
@@ -102,7 +102,7 @@ handle_buffering(INKCont contp, MyData *
      more WRITE_READY or WRITE_COMPLETE events. For this buffered
      transformation that means we're done buffering data. */
 
-  if (!INKVIOBufferGet(write_vio)) {
+  if (!TSVIOBufferGet(write_vio)) {
     data->state = STATE_OUTPUT_DATA;
     return 0;
   }
@@ -111,53 +111,53 @@ handle_buffering(INKCont contp, MyData *
      transform plugin this is also the amount of data we have left
      to write to the output connection. */
 
-  towrite = INKVIONTodoGet(write_vio);
+  towrite = TSVIONTodoGet(write_vio);
   if (towrite > 0) {
     /* The amount of data left to read needs to be truncated by
        the amount of data actually in the read buffer. */
 
-    avail = INKIOBufferReaderAvail(INKVIOReaderGet(write_vio));
+    avail = TSIOBufferReaderAvail(TSVIOReaderGet(write_vio));
     if (towrite > avail) {
       towrite = avail;
     }
 
     if (towrite > 0) {
       /* Copy the data from the read buffer to the input buffer. */
-      if (INKIOBufferCopy(data->output_buffer, INKVIOReaderGet(write_vio), towrite, 0) == INK_ERROR) {
-        INKError("[bnull-transform] Unable to copy read buffer\n");
+      if (TSIOBufferCopy(data->output_buffer, TSVIOReaderGet(write_vio), towrite, 0) == TS_ERROR) {
+        TSError("[bnull-transform] Unable to copy read buffer\n");
         goto Lerror;
       }
 
       /* Tell the read buffer that we have read the data and are no
          longer interested in it. */
-      if (INKIOBufferReaderConsume(INKVIOReaderGet(write_vio), towrite) == INK_ERROR) {
-        INKError("[bnull-transform] Unable to copy read buffer\n");
+      if (TSIOBufferReaderConsume(TSVIOReaderGet(write_vio), towrite) == TS_ERROR) {
+        TSError("[bnull-transform] Unable to copy read buffer\n");
         goto Lerror;
       }
 
       /* Modify the write VIO to reflect how much data we've
          completed. */
-      if (INKVIONDoneSet(write_vio, INKVIONDoneGet(write_vio)
-                         + towrite) == INK_ERROR) {
-        INKError("[bnull-transform] Unable to copy read buffer\n");
+      if (TSVIONDoneSet(write_vio, TSVIONDoneGet(write_vio)
+                         + towrite) == TS_ERROR) {
+        TSError("[bnull-transform] Unable to copy read buffer\n");
         goto Lerror;
       }
     }
   }
 
   /* Now we check the write VIO to see if there is data left to read. */
-  if (INKVIONTodoGet(write_vio) > 0) {
+  if (TSVIONTodoGet(write_vio) > 0) {
     if (towrite > 0) {
       /* Call back the write VIO continuation to let it know that we
          are ready for more data. */
-      INKContCall(INKVIOContGet(write_vio), INK_EVENT_VCONN_WRITE_READY, write_vio);
+      TSContCall(TSVIOContGet(write_vio), TS_EVENT_VCONN_WRITE_READY, write_vio);
     }
   } else {
     data->state = STATE_OUTPUT_DATA;
 
     /* Call back the write VIO continuation to let it know that we
        have completed the write operation. */
-    INKContCall(INKVIOContGet(write_vio), INK_EVENT_VCONN_WRITE_COMPLETE, write_vio);
+    TSContCall(TSVIOContGet(write_vio), TS_EVENT_VCONN_WRITE_COMPLETE, write_vio);
   }
 
   return 1;
@@ -165,31 +165,31 @@ handle_buffering(INKCont contp, MyData *
 Lerror:
 
   /* If we are in this code path then something is seriously wrong. */
-  INKError("[bnull-transform] Fatal error in plugin");
-  INKReleaseAssert(!"[bnull-transform] Fatal error in plugin\n");
+  TSError("[bnull-transform] Fatal error in plugin");
+  TSReleaseAssert(!"[bnull-transform] Fatal error in plugin\n");
   return 0;
 }
 
 static int
-handle_output(INKCont contp, MyData * data)
+handle_output(TSCont contp, MyData * data)
 {
   /* Check to see if we need to initiate the output operation. */
   if (!data->output_vio) {
-    INKVConn output_conn;
+    TSVConn output_conn;
 
     /* Get the output connection where we'll write data to. */
-    output_conn = INKTransformOutputVConnGet(contp);
+    output_conn = TSTransformOutputVConnGet(contp);
 
     data->output_vio =
-      INKVConnWrite(output_conn, contp, data->output_reader, INKIOBufferReaderAvail(data->output_reader));
+      TSVConnWrite(output_conn, contp, data->output_reader, TSIOBufferReaderAvail(data->output_reader));
 
-    INKAssert(data->output_vio);
+    TSAssert(data->output_vio);
   }
   return 1;
 }
 
 static void
-handle_transform(INKCont contp)
+handle_transform(TSCont contp)
 {
   MyData *data;
   int done;
@@ -199,10 +199,10 @@ handle_transform(INKCont contp)
      private data structure pointer is NULL, then we'll create it
      and initialize its internals. */
 
-  data = INKContDataGet(contp);
+  data = TSContDataGet(contp);
   if (!data) {
     data = my_data_alloc();
-    INKContDataSet(contp, data);
+    TSContDataSet(contp, data);
   }
 
   do {
@@ -221,40 +221,40 @@ handle_transform(INKCont contp)
 }
 
 static int
-bnull_transform(INKCont contp, INKEvent event, void *edata)
+bnull_transform(TSCont contp, TSEvent event, void *edata)
 {
   /* Check to see if the transformation has been closed by a
-     call to INKVConnClose. */
+     call to TSVConnClose. */
 
-  if (INKVConnClosedGet(contp)) {
-    my_data_destroy(INKContDataGet(contp));
-    INKAssert(INKContDestroy(contp) == INK_SUCCESS);
+  if (TSVConnClosedGet(contp)) {
+    my_data_destroy(TSContDataGet(contp));
+    TSAssert(TSContDestroy(contp) == TS_SUCCESS);
   } else {
     switch (event) {
-    case INK_EVENT_ERROR:{
-        INKVIO write_vio;
+    case TS_EVENT_ERROR:{
+        TSVIO write_vio;
 
         /* Get the write VIO for the write operation that was
            performed on ourself. This VIO contains the continuation of
            our parent transformation. */
-        write_vio = INKVConnWriteVIOGet(contp);
+        write_vio = TSVConnWriteVIOGet(contp);
 
         /* Call back the write VIO continuation to let it know that we
            have completed the write operation. */
-        INKContCall(INKVIOContGet(write_vio), INK_EVENT_ERROR, write_vio);
+        TSContCall(TSVIOContGet(write_vio), TS_EVENT_ERROR, write_vio);
         break;
       }
 
-    case INK_EVENT_VCONN_WRITE_COMPLETE:
+    case TS_EVENT_VCONN_WRITE_COMPLETE:
       /* When our output connection says that it has finished
          reading all the data we've written to it then we should
          shutdown the write portion of its connection to
          indicate that we don't want to hear about it anymore. */
 
-      INKAssert(INKVConnShutdown(INKTransformOutputVConnGet(contp), 0, 1) != INK_ERROR);
+      TSAssert(TSVConnShutdown(TSTransformOutputVConnGet(contp), 0, 1) != TS_ERROR);
       break;
 
-    case INK_EVENT_VCONN_WRITE_READY:
+    case TS_EVENT_VCONN_WRITE_READY:
     default:
       /* If we get a WRITE_READY event or any other type of event
          (sent, perhaps, because we were reenabled) then we'll attempt
@@ -268,52 +268,52 @@ bnull_transform(INKCont contp, INKEvent 
 }
 
 static int
-transformable(INKHttpTxn txnp)
+transformable(TSHttpTxn txnp)
 {
-  INKMBuffer bufp;
-  INKMLoc hdr_loc;
-  INKHttpStatus resp_status;
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSHttpStatus resp_status;
   int retv;
 
   /* We are only interested in transforming "200 OK" responses. */
 
-  INKHttpTxnServerRespGet(txnp, &bufp, &hdr_loc);
-  resp_status = INKHttpHdrStatusGet(bufp, hdr_loc);
-  retv = (resp_status == INK_HTTP_STATUS_OK);
+  TSHttpTxnServerRespGet(txnp, &bufp, &hdr_loc);
+  resp_status = TSHttpHdrStatusGet(bufp, hdr_loc);
+  retv = (resp_status == TS_HTTP_STATUS_OK);
 
-  if (INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc) == INK_ERROR) {
-    INKError("[bnull-transform] Error releasing MLOC while checking " "header status\n");
+  if (TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc) == TS_ERROR) {
+    TSError("[bnull-transform] Error releasing MLOC while checking " "header status\n");
   }
 
   return retv;
 }
 
 static void
-transform_add(INKHttpTxn txnp)
+transform_add(TSHttpTxn txnp)
 {
-  INKVConn connp;
+  TSVConn connp;
 
-  connp = INKTransformCreate(bnull_transform, txnp);
-  if (INKHttpTxnHookAdd(txnp, INK_HTTP_RESPONSE_TRANSFORM_HOOK, connp)
-      == INK_ERROR) {
+  connp = TSTransformCreate(bnull_transform, txnp);
+  if (TSHttpTxnHookAdd(txnp, TS_HTTP_RESPONSE_TRANSFORM_HOOK, connp)
+      == TS_ERROR) {
     /* this should not happen */
-    INKError("[bnull-transform] Error adding transform to transaction\n");
+    TSError("[bnull-transform] Error adding transform to transaction\n");
   }
 
   return;
 }
 
 static int
-transform_plugin(INKCont contp, INKEvent event, void *edata)
+transform_plugin(TSCont contp, TSEvent event, void *edata)
 {
-  INKHttpTxn txnp = (INKHttpTxn) edata;
+  TSHttpTxn txnp = (TSHttpTxn) edata;
 
   switch (event) {
-  case INK_EVENT_HTTP_READ_RESPONSE_HDR:
+  case TS_EVENT_HTTP_READ_RESPONSE_HDR:
     if (transformable(txnp)) {
       transform_add(txnp);
     }
-    INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+    TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
     return 0;
   default:
     break;
@@ -325,7 +325,7 @@ transform_plugin(INKCont contp, INKEvent
 int
 check_ts_version()
 {
-  const char *ts_version = INKTrafficServerVersionGet();
+  const char *ts_version = TSTrafficServerVersionGet();
   int result = 0;
 
   if (ts_version) {
@@ -349,35 +349,35 @@ check_ts_version()
 }
 
 void
-INKPluginInit(int argc, const char *argv[])
+TSPluginInit(int argc, const char *argv[])
 {
-  INKPluginRegistrationInfo info;
-  INKMutex mutex = INK_NULL_MUTEX;
+  TSPluginRegistrationInfo info;
+  TSMutex mutex = TS_NULL_MUTEX;
 
   info.plugin_name = "buffered-null-transform";
   info.vendor_name = "MyCompany";
   info.support_email = "ts-api-support@MyCompany.com";
 
-  if (!INKPluginRegister(INK_SDK_VERSION_2_0, &info)) {
-    INKError("[bnull-transform] Plugin registration failed.\n");
+  if (!TSPluginRegister(TS_SDK_VERSION_2_0, &info)) {
+    TSError("[bnull-transform] Plugin registration failed.\n");
     goto Lerror;
   }
 
   if (!check_ts_version()) {
-    INKError("[bnull-transform] Plugin requires Traffic Server 2.0" " or later\n");
+    TSError("[bnull-transform] Plugin requires Traffic Server 2.0" " or later\n");
     goto Lerror;
   }
 
   /* This is call we could use if we need to protect global data */
-  /* INKReleaseAssert ((mutex = INKMutexCreate()) != INK_NULL_MUTEX); */
+  /* TSReleaseAssert ((mutex = TSMutexCreate()) != TS_NULL_MUTEX); */
 
-  if (INKHttpHookAdd(INK_HTTP_READ_RESPONSE_HDR_HOOK, INKContCreate(transform_plugin, mutex)) == INK_ERROR) {
-    INKError("[bnull-transform] Unable to add READ_RESPONSE_HDR_HOOK\n");
+  if (TSHttpHookAdd(TS_HTTP_READ_RESPONSE_HDR_HOOK, TSContCreate(transform_plugin, mutex)) == TS_ERROR) {
+    TSError("[bnull-transform] Unable to add READ_RESPONSE_HDR_HOOK\n");
     goto Lerror;
   }
 
   return;
 
 Lerror:
-  INKError("[bnull-transform] Plugin disabled\n");
+  TSError("[bnull-transform] Plugin disabled\n");
 }

Propchange: trafficserver/traffic/branches/wccp/example/cache_scan/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Nov 30 01:42:55 2010
@@ -0,0 +1,3 @@
+Makefile.in
+Makefile
+.deps

Modified: trafficserver/traffic/branches/wccp/example/cache_scan/cache_scan.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/example/cache_scan/cache_scan.cc?rev=1040383&r1=1040382&r2=1040383&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/example/cache_scan/cache_scan.cc (original)
+++ trafficserver/traffic/branches/wccp/example/cache_scan/cache_scan.cc Tue Nov 30 01:42:55 2010
@@ -22,7 +22,7 @@
  */
 
 /*
- * cache_scan.cc:  use INKCacheScan to print URLs and headers for objects in
+ * cache_scan.cc:  use TSCacheScan to print URLs and headers for objects in
  *                 the cache when endpoint /show-cache is requested
  */
 
@@ -33,24 +33,24 @@
 #include <ts/ts.h>
 #include <ts/experimental.h>
 
-static INKCont global_contp;
+static TSCont global_contp;
 
 struct cache_scan_state_t
 {
-  INKVConn net_vc;
-  INKVConn cache_vc;
-  INKVIO read_vio;
-  INKVIO write_vio;
-
-  INKIOBuffer req_buffer;
-  INKIOBuffer resp_buffer;
-  INKIOBufferReader resp_reader;
-
-  INKHttpTxn http_txnp;
-  INKAction pending_action;
-  INKCacheKey key_to_delete;
+  TSVConn net_vc;
+  TSVConn cache_vc;
+  TSVIO read_vio;
+  TSVIO write_vio;
+
+  TSIOBuffer req_buffer;
+  TSIOBuffer resp_buffer;
+  TSIOBufferReader resp_reader;
+
+  TSHttpTxn http_txnp;
+  TSAction pending_action;
+  TSCacheKey key_to_delete;
 
-  INK64 total_bytes;
+  int64 total_bytes;
   int total_items;
   int done;
 
@@ -62,103 +62,103 @@ typedef struct cache_scan_state_t cache_
 
 //----------------------------------------------------------------------------
 static int
-handle_scan(INKCont contp, INKEvent event, void *edata)
+handle_scan(TSCont contp, TSEvent event, void *edata)
 {
-  INKCacheHttpInfo cache_infop;
-  cache_scan_state *cstate = (cache_scan_state *) INKContDataGet(contp);
+  TSCacheHttpInfo cache_infop;
+  cache_scan_state *cstate = (cache_scan_state *) TSContDataGet(contp);
 
-  if (event == INK_EVENT_CACHE_REMOVE) {
+  if (event == TS_EVENT_CACHE_REMOVE) {
     cstate->done = 1;
     const char error[] = "Cache remove operation succeeded";
-    cstate->cache_vc = (INKVConn) edata;
-    cstate->write_vio = INKVConnWrite(cstate->net_vc, contp, cstate->resp_reader, INT_MAX);
-    cstate->total_bytes += INKIOBufferWrite(cstate->resp_buffer, error, sizeof(error) - 1);
-    INKVIONBytesSet(cstate->write_vio, cstate->total_bytes);
-    INKVIOReenable(cstate->write_vio);
+    cstate->cache_vc = (TSVConn) edata;
+    cstate->write_vio = TSVConnWrite(cstate->net_vc, contp, cstate->resp_reader, INT_MAX);
+    cstate->total_bytes += TSIOBufferWrite(cstate->resp_buffer, error, sizeof(error) - 1);
+    TSVIONBytesSet(cstate->write_vio, cstate->total_bytes);
+    TSVIOReenable(cstate->write_vio);
     return 0;
   }
 
-  if (event == INK_EVENT_CACHE_REMOVE_FAILED) {
+  if (event == TS_EVENT_CACHE_REMOVE_FAILED) {
     cstate->done = 1;
     const char error[] = "Cache remove operation failed error=";
     char rc[12];
     snprintf(rc, 12, "%p", edata);
-    cstate->cache_vc = (INKVConn) edata;
-    cstate->write_vio = INKVConnWrite(cstate->net_vc, contp, cstate->resp_reader, INT_MAX);
-    cstate->total_bytes += INKIOBufferWrite(cstate->resp_buffer, error, sizeof(error) - 1);
-    cstate->total_bytes += INKIOBufferWrite(cstate->resp_buffer, rc, strlen(rc));
+    cstate->cache_vc = (TSVConn) edata;
+    cstate->write_vio = TSVConnWrite(cstate->net_vc, contp, cstate->resp_reader, INT_MAX);
+    cstate->total_bytes += TSIOBufferWrite(cstate->resp_buffer, error, sizeof(error) - 1);
+    cstate->total_bytes += TSIOBufferWrite(cstate->resp_buffer, rc, strlen(rc));
 
-    INKVIONBytesSet(cstate->write_vio, cstate->total_bytes);
-    INKVIOReenable(cstate->write_vio);
+    TSVIONBytesSet(cstate->write_vio, cstate->total_bytes);
+    TSVIOReenable(cstate->write_vio);
     return 0;
   }
 
   //first scan event, save vc and start write
-  if (event == INK_EVENT_CACHE_SCAN) {
-    cstate->cache_vc = (INKVConn) edata;
-    cstate->write_vio = INKVConnWrite(cstate->net_vc, contp, cstate->resp_reader, INT_MAX);
-    return INK_EVENT_CONTINUE;
+  if (event == TS_EVENT_CACHE_SCAN) {
+    cstate->cache_vc = (TSVConn) edata;
+    cstate->write_vio = TSVConnWrite(cstate->net_vc, contp, cstate->resp_reader, INT_MAX);
+    return TS_EVENT_CONTINUE;
   }
   //just stop scanning if blocked or failed
-  if (event == INK_EVENT_CACHE_SCAN_FAILED ||
-      event == INK_EVENT_CACHE_SCAN_OPERATION_BLOCKED || event == INK_EVENT_CACHE_SCAN_OPERATION_FAILED) {
+  if (event == TS_EVENT_CACHE_SCAN_FAILED ||
+      event == TS_EVENT_CACHE_SCAN_OPERATION_BLOCKED || event == TS_EVENT_CACHE_SCAN_OPERATION_FAILED) {
     cstate->done = 1;
     if (cstate->resp_buffer) {
       const char error[] = "Cache scan operation blocked or failed";
-      cstate->total_bytes += INKIOBufferWrite(cstate->resp_buffer, error, sizeof(error) - 1);
+      cstate->total_bytes += TSIOBufferWrite(cstate->resp_buffer, error, sizeof(error) - 1);
     }
     if (cstate->write_vio) {
-      INKVIONBytesSet(cstate->write_vio, cstate->total_bytes);
-      INKVIOReenable(cstate->write_vio);
+      TSVIONBytesSet(cstate->write_vio, cstate->total_bytes);
+      TSVIOReenable(cstate->write_vio);
     }
-    return INK_CACHE_SCAN_RESULT_DONE;
+    return TS_CACHE_SCAN_RESULT_DONE;
   }
 
   //grab header and print url to outgoing vio
-  if (event == INK_EVENT_CACHE_SCAN_OBJECT) {
+  if (event == TS_EVENT_CACHE_SCAN_OBJECT) {
     if (cstate->done) {
-      return INK_CACHE_SCAN_RESULT_DONE;
+      return TS_CACHE_SCAN_RESULT_DONE;
     }
-    cache_infop = (INKCacheHttpInfo) edata;
+    cache_infop = (TSCacheHttpInfo) edata;
 
-    INKMBuffer req_bufp, resp_bufp;
-    INKMLoc req_hdr_loc, resp_hdr_loc;
-    INKMLoc url_loc;
+    TSMBuffer req_bufp, resp_bufp;
+    TSMLoc req_hdr_loc, resp_hdr_loc;
+    TSMLoc url_loc;
 
     char *url;
     int url_len;
     const char s1[] = "URL: ", s2[] = "\n";
-    cstate->total_bytes += INKIOBufferWrite(cstate->resp_buffer, s1, sizeof(s1) - 1);
-    INKCacheHttpInfoReqGet(cache_infop, &req_bufp, &req_hdr_loc);
-    url_loc = INKHttpHdrUrlGet(req_bufp, req_hdr_loc);
-    url = INKUrlStringGet(req_bufp, url_loc, &url_len);
-
-    cstate->total_bytes += INKIOBufferWrite(cstate->resp_buffer, url, url_len);
-    cstate->total_bytes += INKIOBufferWrite(cstate->resp_buffer, s2, sizeof(s2) - 1);
-
-    INKfree(url);
-    INKHandleMLocRelease(req_bufp, req_hdr_loc, url_loc);
-    INKHandleMLocRelease(req_bufp, INK_NULL_MLOC, req_hdr_loc);
+    cstate->total_bytes += TSIOBufferWrite(cstate->resp_buffer, s1, sizeof(s1) - 1);
+    TSCacheHttpInfoReqGet(cache_infop, &req_bufp, &req_hdr_loc);
+    url_loc = TSHttpHdrUrlGet(req_bufp, req_hdr_loc);
+    url = TSUrlStringGet(req_bufp, url_loc, &url_len);
+
+    cstate->total_bytes += TSIOBufferWrite(cstate->resp_buffer, url, url_len);
+    cstate->total_bytes += TSIOBufferWrite(cstate->resp_buffer, s2, sizeof(s2) - 1);
+
+    TSfree(url);
+    TSHandleMLocRelease(req_bufp, req_hdr_loc, url_loc);
+    TSHandleMLocRelease(req_bufp, TS_NULL_MLOC, req_hdr_loc);
 
 
     //print the response headers
-    INKCacheHttpInfoRespGet(cache_infop, &resp_bufp, &resp_hdr_loc);
-    cstate->total_bytes += INKMimeHdrLengthGet(resp_bufp, resp_hdr_loc);
-    INKMimeHdrPrint(resp_bufp, resp_hdr_loc, cstate->resp_buffer);
-    INKHandleMLocRelease(resp_bufp, INK_NULL_MLOC, resp_hdr_loc);
+    TSCacheHttpInfoRespGet(cache_infop, &resp_bufp, &resp_hdr_loc);
+    cstate->total_bytes += TSMimeHdrLengthGet(resp_bufp, resp_hdr_loc);
+    TSMimeHdrPrint(resp_bufp, resp_hdr_loc, cstate->resp_buffer);
+    TSHandleMLocRelease(resp_bufp, TS_NULL_MLOC, resp_hdr_loc);
 
 
-    cstate->total_bytes += INKIOBufferWrite(cstate->resp_buffer, s2, sizeof(s2) - 1);
+    cstate->total_bytes += TSIOBufferWrite(cstate->resp_buffer, s2, sizeof(s2) - 1);
     if (!cstate->write_pending) {
       cstate->write_pending = 1;
-      INKVIOReenable(cstate->write_vio);
+      TSVIOReenable(cstate->write_vio);
     }
 
     cstate->total_items++;
-    return INK_CACHE_SCAN_RESULT_CONTINUE;
+    return TS_CACHE_SCAN_RESULT_CONTINUE;
   }
   //CACHE_SCAN_DONE: ready to close the vc on the next write reenable
-  if (event == INK_EVENT_CACHE_SCAN_DONE) {
+  if (event == TS_EVENT_CACHE_SCAN_DONE) {
     cstate->done = 1;
     char s[512];
     int s_len = snprintf(s, sizeof(s),
@@ -167,45 +167,45 @@ handle_scan(INKCont contp, INKEvent even
                          "Enter URL to delete: <input type=\"text\" size=\"40\" name=\"remove_url\">"
                          "<input type=\"submit\"  value=\"Delete URL\">",
                          cstate->total_items);
-    cstate->total_bytes += INKIOBufferWrite(cstate->resp_buffer, s, s_len);
-    INKVIONBytesSet(cstate->write_vio, cstate->total_bytes);
+    cstate->total_bytes += TSIOBufferWrite(cstate->resp_buffer, s, s_len);
+    TSVIONBytesSet(cstate->write_vio, cstate->total_bytes);
     if (!cstate->write_pending) {
       cstate->write_pending = 1;
-      INKVIOReenable(cstate->write_vio);
+      TSVIOReenable(cstate->write_vio);
     }
-    return INK_CACHE_SCAN_RESULT_DONE;
+    return TS_CACHE_SCAN_RESULT_DONE;
   }
 
-  INKError("Unknown event in handle_scan: %d", event);
+  TSError("Unknown event in handle_scan: %d", event);
   return -1;
 }
 
 //----------------------------------------------------------------------------
 static int
-handle_accept(INKCont contp, INKEvent event, INKVConn vc)
+handle_accept(TSCont contp, TSEvent event, TSVConn vc)
 {
-  cache_scan_state *cstate = (cache_scan_state *) INKContDataGet(contp);
+  cache_scan_state *cstate = (cache_scan_state *) TSContDataGet(contp);
 
-  if (event == INK_EVENT_NET_ACCEPT) {
+  if (event == TS_EVENT_NET_ACCEPT) {
     if (cstate) {
       //setup vc, buffers
       cstate->net_vc = vc;
 
-      cstate->req_buffer = INKIOBufferCreate();
-      cstate->resp_buffer = INKIOBufferCreate();
-      cstate->resp_reader = INKIOBufferReaderAlloc(cstate->resp_buffer);
+      cstate->req_buffer = TSIOBufferCreate();
+      cstate->resp_buffer = TSIOBufferCreate();
+      cstate->resp_reader = TSIOBufferReaderAlloc(cstate->resp_buffer);
 
-      cstate->read_vio = INKVConnRead(cstate->net_vc, contp, cstate->req_buffer, INT_MAX);
+      cstate->read_vio = TSVConnRead(cstate->net_vc, contp, cstate->req_buffer, INT_MAX);
     } else {
-      INKVConnClose(vc);
-      INKContDestroy(contp);
+      TSVConnClose(vc);
+      TSContDestroy(contp);
     }
   } else {
     //net_accept failed
     if (cstate) {
-      INKfree(cstate);
+      TSfree(cstate);
     }
-    INKContDestroy(contp);
+    TSContDestroy(contp);
   }
 
   return 0;
@@ -213,95 +213,95 @@ handle_accept(INKCont contp, INKEvent ev
 
 //----------------------------------------------------------------------------
 static void
-cleanup(INKCont contp)
+cleanup(TSCont contp)
 {
 
   //shutdown vc and free memory
-  cache_scan_state *cstate = (cache_scan_state *) INKContDataGet(contp);
+  cache_scan_state *cstate = (cache_scan_state *) TSContDataGet(contp);
 
   if (cstate) {
     // cancel any pending cache scan actions, since we will be destroying the
     // continuation
     if (cstate->pending_action) {
-      INKActionCancel(cstate->pending_action);
+      TSActionCancel(cstate->pending_action);
     }
 
     if (cstate->net_vc) {
-      INKVConnShutdown(cstate->net_vc, 1, 1);
+      TSVConnShutdown(cstate->net_vc, 1, 1);
     }
 
     if (cstate->req_buffer) {
-      if (INKIOBufferDestroy(cstate->req_buffer) == INK_ERROR) {
-        INKError("failed to destroy req_buffer");
+      if (TSIOBufferDestroy(cstate->req_buffer) == TS_ERROR) {
+        TSError("failed to destroy req_buffer");
       }
       cstate->req_buffer = NULL;
     }
 
     if (cstate->key_to_delete) {
-      if (INKCacheKeyDestroy(cstate->key_to_delete) == INK_ERROR) {
-        INKError("failed to destroy cache key");
+      if (TSCacheKeyDestroy(cstate->key_to_delete) == TS_ERROR) {
+        TSError("failed to destroy cache key");
       }
       cstate->key_to_delete = NULL;
     }
 
     if (cstate->resp_buffer) {
-      if (INKIOBufferDestroy(cstate->resp_buffer) == INK_ERROR) {
-        INKError("failed to destroy resp_buffer");
+      if (TSIOBufferDestroy(cstate->resp_buffer) == TS_ERROR) {
+        TSError("failed to destroy resp_buffer");
       }
       cstate->resp_buffer = NULL;
     }
 
-    if (INKVConnClose(cstate->net_vc) == INK_ERROR) {
-      INKError("INKVConnClose failed");
+    if (TSVConnClose(cstate->net_vc) == TS_ERROR) {
+      TSError("TSVConnClose failed");
     }
 
-    INKfree(cstate);
+    TSfree(cstate);
   }
-  INKContDestroy(contp);
+  TSContDestroy(contp);
 }
 
 //----------------------------------------------------------------------------
 static int
-handle_io(INKCont contp, INKEvent event, void *edata)
+handle_io(TSCont contp, TSEvent event, void *edata)
 {
-  cache_scan_state *cstate = (cache_scan_state *) INKContDataGet(contp);
+  cache_scan_state *cstate = (cache_scan_state *) TSContDataGet(contp);
 
   switch (event) {
-  case INK_EVENT_VCONN_READ_READY:
-  case INK_EVENT_VCONN_READ_COMPLETE:
+  case TS_EVENT_VCONN_READ_READY:
+  case TS_EVENT_VCONN_READ_COMPLETE:
     {
       //we don't care about the request, so just shut down the read vc
-      if (INKVConnShutdown(cstate->net_vc, 1, 0) == INK_ERROR) {
-        INKError("INKVConnShutdown failed");
+      if (TSVConnShutdown(cstate->net_vc, 1, 0) == TS_ERROR) {
+        TSError("TSVConnShutdown failed");
         cleanup(contp);
         return 0;
       }
       //setup the response headers so we are ready to write body
       char hdrs[] = "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n";
-      cstate->total_bytes = INKIOBufferWrite(cstate->resp_buffer, hdrs, sizeof(hdrs) - 1);
+      cstate->total_bytes = TSIOBufferWrite(cstate->resp_buffer, hdrs, sizeof(hdrs) - 1);
 
       if (cstate->key_to_delete) {
-        INKAction actionp = INKCacheRemove(contp, cstate->key_to_delete);
-        if (actionp != INK_ERROR_PTR) {
-          if (!INKActionDone(actionp)) {
+        TSAction actionp = TSCacheRemove(contp, cstate->key_to_delete);
+        if (actionp != TS_ERROR_PTR) {
+          if (!TSActionDone(actionp)) {
             cstate->pending_action = actionp;
           }
         } else {
-          INKError("CacheRemove action failed");
+          TSError("CacheRemove action failed");
           cleanup(contp);
           return 0;
         }
       } else {
         char head[] = "<h3>Cache Contents:</h3>\n<p><pre>\n";
-        cstate->total_bytes += INKIOBufferWrite(cstate->resp_buffer, head, sizeof(head) - 1);
+        cstate->total_bytes += TSIOBufferWrite(cstate->resp_buffer, head, sizeof(head) - 1);
         //start scan
-        INKAction actionp = INKCacheScan(contp, 0, 512000);
-        if (actionp != INK_ERROR_PTR) {
-          if (!INKActionDone(actionp)) {
+        TSAction actionp = TSCacheScan(contp, 0, 512000);
+        if (actionp != TS_ERROR_PTR) {
+          if (!TSActionDone(actionp)) {
             cstate->pending_action = actionp;
           }
         } else {
-          INKError("CacheScan action failed");
+          TSError("CacheScan action failed");
           cleanup(contp);
           return 0;
         }
@@ -309,18 +309,18 @@ handle_io(INKCont contp, INKEvent event,
 
       return 0;
     }
-  case INK_EVENT_VCONN_WRITE_READY:
+  case TS_EVENT_VCONN_WRITE_READY:
     {
-      INKDebug("cache_iter", "ndone: %d total_bytes: %d", INKVIONDoneGet(cstate->write_vio), cstate->total_bytes);
+      TSDebug("cache_iter", "ndone: %d total_bytes: %d", TSVIONDoneGet(cstate->write_vio), cstate->total_bytes);
       cstate->write_pending = 0;
       // the cache scan handler should call vio reenable when there is
       // available data
-      //INKVIOReenable(cstate->write_vio);
+      //TSVIOReenable(cstate->write_vio);
       return 0;
     }
-  case INK_EVENT_VCONN_WRITE_COMPLETE:
-    INKDebug("cache_iter", "write complete");
-  case INK_EVENT_VCONN_EOS:
+  case TS_EVENT_VCONN_WRITE_COMPLETE:
+    TSDebug("cache_iter", "write complete");
+  case TS_EVENT_VCONN_EOS:
   default:
     cstate->done = 1;
     cleanup(contp);
@@ -333,34 +333,34 @@ handle_io(INKCont contp, INKEvent event,
 //----------------------------------------------------------------------------
 // handler for VConnection and CacheScan events
 static int
-cache_intercept(INKCont contp, INKEvent event, void *edata)
+cache_intercept(TSCont contp, TSEvent event, void *edata)
 {
-  INKDebug("cache_iter", "cache_intercept event: %d", event);
+  TSDebug("cache_iter", "cache_intercept event: %d", event);
 
   switch (event) {
-  case INK_EVENT_NET_ACCEPT:
-  case INK_EVENT_NET_ACCEPT_FAILED:
-    return handle_accept(contp, event, (INKVConn) edata);
-  case INK_EVENT_VCONN_READ_READY:
-  case INK_EVENT_VCONN_READ_COMPLETE:
-  case INK_EVENT_VCONN_WRITE_READY:
-  case INK_EVENT_VCONN_WRITE_COMPLETE:
-  case INK_EVENT_VCONN_EOS:
+  case TS_EVENT_NET_ACCEPT:
+  case TS_EVENT_NET_ACCEPT_FAILED:
+    return handle_accept(contp, event, (TSVConn) edata);
+  case TS_EVENT_VCONN_READ_READY:
+  case TS_EVENT_VCONN_READ_COMPLETE:
+  case TS_EVENT_VCONN_WRITE_READY:
+  case TS_EVENT_VCONN_WRITE_COMPLETE:
+  case TS_EVENT_VCONN_EOS:
     return handle_io(contp, event, edata);
-  case INK_EVENT_CACHE_SCAN:
-  case INK_EVENT_CACHE_SCAN_FAILED:
-  case INK_EVENT_CACHE_SCAN_OBJECT:
-  case INK_EVENT_CACHE_SCAN_OPERATION_BLOCKED:
-  case INK_EVENT_CACHE_SCAN_OPERATION_FAILED:
-  case INK_EVENT_CACHE_SCAN_DONE:
-  case INK_EVENT_CACHE_REMOVE:
-  case INK_EVENT_CACHE_REMOVE_FAILED:
+  case TS_EVENT_CACHE_SCAN:
+  case TS_EVENT_CACHE_SCAN_FAILED:
+  case TS_EVENT_CACHE_SCAN_OBJECT:
+  case TS_EVENT_CACHE_SCAN_OPERATION_BLOCKED:
+  case TS_EVENT_CACHE_SCAN_OPERATION_FAILED:
+  case TS_EVENT_CACHE_SCAN_DONE:
+  case TS_EVENT_CACHE_REMOVE:
+  case TS_EVENT_CACHE_REMOVE_FAILED:
     return handle_scan(contp, event, edata);
-  case INK_EVENT_ERROR:
+  case TS_EVENT_ERROR:
     cleanup(contp);
     return 0;
   default:
-    INKError("Unknown event in cache_intercept: %d", event);
+    TSError("Unknown event in cache_intercept: %d", event);
     cleanup(contp);
     return 0;
   }
@@ -404,50 +404,50 @@ unescapifyStr(char *buffer)
 
 //----------------------------------------------------------------------------
 static int
-setup_request(INKCont contp, INKHttpTxn txnp)
+setup_request(TSCont contp, TSHttpTxn txnp)
 {
 
-  INKMBuffer bufp;
-  INKMLoc hdr_loc;
-  INKMLoc url_loc;
-  INKCont scan_contp;
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc url_loc;
+  TSCont scan_contp;
   const char *path, *query;
   cache_scan_state *cstate;
   int path_len, query_len;
 
-  INKAssert(contp == global_contp);
+  TSAssert(contp == global_contp);
 
-  if (!INKHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
-    INKError("couldn't retrieve client request header");
-    return INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+  if (!TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc)) {
+    TSError("couldn't retrieve client request header");
+    return TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
   }
 
-  url_loc = INKHttpHdrUrlGet(bufp, hdr_loc);
+  url_loc = TSHttpHdrUrlGet(bufp, hdr_loc);
   if (!url_loc) {
-    INKError("couldn't retrieve request url");
-    INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
-    return INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+    TSError("couldn't retrieve request url");
+    TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+    return TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
   }
 
-  path = INKUrlPathGet(bufp, url_loc, &path_len);
+  path = TSUrlPathGet(bufp, url_loc, &path_len);
   if (!path) {
-    INKError("couldn't retrieve request path");
-    INKHandleMLocRelease(bufp, hdr_loc, url_loc);
-    INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
-    return INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+    TSError("couldn't retrieve request path");
+    TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+    TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+    return TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
   }
 
-  query = INKUrlHttpQueryGet(bufp, url_loc, &query_len);
+  query = TSUrlHttpQueryGet(bufp, url_loc, &query_len);
 
   if (path_len == 10 && !strncmp(path, "show-cache", 10)) {
 
-    scan_contp = INKContCreate(cache_intercept, INKMutexCreate());
-    if (INKHttpTxnIntercept(scan_contp, txnp) != INK_SUCCESS) {
-      INKError("HttpTxnIntercept failed");
-      INKContDestroy(scan_contp);
+    scan_contp = TSContCreate(cache_intercept, TSMutexCreate());
+    if (TSHttpTxnIntercept(scan_contp, txnp) != TS_SUCCESS) {
+      TSError("HttpTxnIntercept failed");
+      TSContDestroy(scan_contp);
       goto Ldone;
     }
-    cstate = (cache_scan_state *) INKmalloc(sizeof(cache_scan_state));
+    cstate = (cache_scan_state *) TSmalloc(sizeof(cache_scan_state));
     memset(cstate, 0, sizeof(cache_scan_state));
     cstate->http_txnp = txnp;
 
@@ -468,69 +468,69 @@ setup_request(INKCont contp, INKHttpTxn 
         del_url_len = strlen(start);
         end = start + del_url_len;
 
-        if (INKCacheKeyCreate(&cstate->key_to_delete) != INK_SUCCESS) {
-          INKError("CacheKeyCreate failed");
-          INKfree(cstate);
+        if (TSCacheKeyCreate(&cstate->key_to_delete) != TS_SUCCESS) {
+          TSError("CacheKeyCreate failed");
+          TSfree(cstate);
           goto Ldone;
         }
 
-        INKDebug("cache_iter", "deleting url: %s", start);
+        TSDebug("cache_iter", "deleting url: %s", start);
 
-        INKMBuffer urlBuf = INKMBufferCreate();
-        INKMLoc urlLoc = INKUrlCreate(urlBuf);
+        TSMBuffer urlBuf = TSMBufferCreate();
+        TSMLoc urlLoc = TSUrlCreate(urlBuf);
 
-        if (INKUrlParse(urlBuf, urlLoc, (const char **) &start, end) != INK_PARSE_DONE
-            || INKCacheKeyDigestFromUrlSet(cstate->key_to_delete, urlLoc)
-            != INK_SUCCESS) {
-          INKError("CacheKeyDigestFromUrlSet failed");
-          INKfree(cstate);
-          INKUrlDestroy(urlBuf, urlLoc);
-          INKHandleMLocRelease(urlBuf, NULL, urlLoc);
-          INKCacheKeyDestroy(cstate->key_to_delete);
+        if (TSUrlParse(urlBuf, urlLoc, (const char **) &start, end) != TS_PARSE_DONE
+            || TSCacheKeyDigestFromUrlSet(cstate->key_to_delete, urlLoc)
+            != TS_SUCCESS) {
+          TSError("CacheKeyDigestFromUrlSet failed");
+          TSfree(cstate);
+          TSUrlDestroy(urlBuf, urlLoc);
+          TSHandleMLocRelease(urlBuf, NULL, urlLoc);
+          TSCacheKeyDestroy(cstate->key_to_delete);
           goto Ldone;
         }
-        INKUrlDestroy(urlBuf, urlLoc);
-        INKHandleMLocRelease(urlBuf, NULL, urlLoc);
+        TSUrlDestroy(urlBuf, urlLoc);
+        TSHandleMLocRelease(urlBuf, NULL, urlLoc);
       }
     }
 
-    if (INKContDataSet(scan_contp, cstate) != INK_SUCCESS) {
-      INKError("ContDataSet failed");
-      INKfree(cstate);
+    if (TSContDataSet(scan_contp, cstate) != TS_SUCCESS) {
+      TSError("ContDataSet failed");
+      TSfree(cstate);
       goto Ldone;
     }
-    INKDebug("cache_iter", "setup cache intercept");
+    TSDebug("cache_iter", "setup cache intercept");
   } else {
-    INKDebug("cache_iter", "not a cache iter request");
+    TSDebug("cache_iter", "not a cache iter request");
   }
 
 Ldone:
-  INKHandleStringRelease(bufp, url_loc, path);
-  INKHandleStringRelease(bufp, url_loc, query);
-  INKHandleMLocRelease(bufp, hdr_loc, url_loc);
-  INKHandleMLocRelease(bufp, INK_NULL_MLOC, hdr_loc);
+  TSHandleStringRelease(bufp, url_loc, path);
+  TSHandleStringRelease(bufp, url_loc, query);
+  TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
 
-  return INKHttpTxnReenable(txnp, INK_EVENT_HTTP_CONTINUE);
+  return TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
 }
 
 //----------------------------------------------------------------------------
 // handler for http txn events
 static int
-cache_print_plugin(INKCont contp, INKEvent event, void *edata)
+cache_print_plugin(TSCont contp, TSEvent event, void *edata)
 {
   switch (event) {
-  case INK_EVENT_HTTP_READ_REQUEST_HDR:
-    return setup_request(contp, (INKHttpTxn) edata);
+  case TS_EVENT_HTTP_READ_REQUEST_HDR:
+    return setup_request(contp, (TSHttpTxn) edata);
   default:
     break;
   }
-  return INKHttpTxnReenable((INKHttpTxn) edata, INK_EVENT_HTTP_CONTINUE);
+  return TSHttpTxnReenable((TSHttpTxn) edata, TS_EVENT_HTTP_CONTINUE);
 }
 
 //----------------------------------------------------------------------------
 void
-INKPluginInit(int argc, const char *argv[])
+TSPluginInit(int argc, const char *argv[])
 {
-  global_contp = INKContCreate(cache_print_plugin, INKMutexCreate());
-  INKHttpHookAdd(INK_HTTP_READ_REQUEST_HDR_HOOK, global_contp);
+  global_contp = TSContCreate(cache_print_plugin, TSMutexCreate());
+  TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, global_contp);
 }

Propchange: trafficserver/traffic/branches/wccp/example/file-1/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Nov 30 01:42:55 2010
@@ -0,0 +1,3 @@
+Makefile.in
+Makefile
+.deps

Modified: trafficserver/traffic/branches/wccp/example/file-1/file-1.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/example/file-1/file-1.c?rev=1040383&r1=1040382&r2=1040383&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/example/file-1/file-1.c (original)
+++ trafficserver/traffic/branches/wccp/example/file-1/file-1.c Tue Nov 30 01:42:55 2010
@@ -41,7 +41,7 @@ int
 check_ts_version()
 {
 
-  const char *ts_version = INKTrafficServerVersionGet();
+  const char *ts_version = TSTrafficServerVersionGet();
   int result = 0;
 
   if (ts_version) {
@@ -63,37 +63,37 @@ check_ts_version()
 }
 
 void
-INKPluginInit(int argc, const char *argv[])
+TSPluginInit(int argc, const char *argv[])
 {
-  INKFile filep;
+  TSFile filep;
   char buf[4096];
   int i;
-  INKPluginRegistrationInfo info;
+  TSPluginRegistrationInfo info;
 
   info.plugin_name = "file_plugin";
   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;
   }
 
   for (i = 1; i < argc; i++) {
-    filep = INKfopen(argv[i], "r");
+    filep = TSfopen(argv[i], "r");
     if (!filep) {
       continue;
     }
 
-    while (INKfgets(filep, buf, 4096)) {
-      INKDebug("debug-file", "%s", buf);
+    while (TSfgets(filep, buf, 4096)) {
+      TSDebug("debug-file", "%s", buf);
     }
 
-    INKfclose(filep);
+    TSfclose(filep);
   }
 }
 

Modified: trafficserver/traffic/branches/wccp/example/file-1/readme.txt
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/example/file-1/readme.txt?rev=1040383&r1=1040382&r2=1040383&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/example/file-1/readme.txt (original)
+++ trafficserver/traffic/branches/wccp/example/file-1/readme.txt Tue Nov 30 01:42:55 2010
@@ -22,15 +22,15 @@ If you use a relative pathname, the path
 respect to the Traffic Server install directory.  (That is, the path 
 contained in /etc/traffic_server.)
 
-The only function defined is INKPluginInit.
+The only function defined is TSPluginInit.
 
 It does the following:
 
 - opens the file specified in plugin.config, using
-	INKfopen
+	TSfopen
 
 - reads the content of the file into a buffer using 
-	INKfgets
+	TSfgets
 
 - closes the file using 
-	INKfclose
+	TSfclose

Propchange: trafficserver/traffic/branches/wccp/example/gzip-transform/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Nov 30 01:42:55 2010
@@ -0,0 +1,3 @@
+Makefile.in
+Makefile
+.deps