You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2014/01/31 21:45:44 UTC

[1/6] git commit: TS-2534 Make sure RecRecord structs are always properly initialized

Updated Branches:
  refs/heads/master 8824fbe93 -> d081cdf34


TS-2534 Make sure RecRecord structs are always properly initialized


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/58d3c53c
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/58d3c53c
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/58d3c53c

Branch: refs/heads/master
Commit: 58d3c53c1833a83caca7e399cd34494274b1f2d9
Parents: 8824fbe
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri Jan 31 11:11:24 2014 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Jan 31 12:16:26 2014 -0700

----------------------------------------------------------------------
 lib/records/I_RecMutex.h |  1 +
 lib/records/P_RecCore.cc | 17 +++++++++++++----
 lib/records/P_RecUtils.h |  9 ++++++++-
 lib/records/RecCore.cc   |  1 -
 lib/records/RecMutex.cc  | 11 ++++++++---
 lib/records/RecUtils.cc  | 20 ++++++++++++++++++--
 6 files changed, 48 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/58d3c53c/lib/records/I_RecMutex.h
----------------------------------------------------------------------
diff --git a/lib/records/I_RecMutex.h b/lib/records/I_RecMutex.h
index 5c59ea2..ace1d26 100644
--- a/lib/records/I_RecMutex.h
+++ b/lib/records/I_RecMutex.h
@@ -40,6 +40,7 @@ struct RecMutex
 };
 
 int rec_mutex_init(RecMutex * m, const char *name = NULL);
+int rec_mutex_destroy(RecMutex * m);
 int rec_mutex_acquire(RecMutex * m);
 int rec_mutex_release(RecMutex * m);
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/58d3c53c/lib/records/P_RecCore.cc
----------------------------------------------------------------------
diff --git a/lib/records/P_RecCore.cc b/lib/records/P_RecCore.cc
index b90a5d3..b8498e4 100644
--- a/lib/records/P_RecCore.cc
+++ b/lib/records/P_RecCore.cc
@@ -33,6 +33,7 @@
 
 RecModeT g_mode_type = RECM_NULL;
 
+
 //-------------------------------------------------------------------------
 // send_reset_message
 //-------------------------------------------------------------------------
@@ -439,7 +440,8 @@ RecSetRecord(RecT rec_type, const char *name, RecDataT data_type, RecData *data,
       // We don't need to ats_strdup() here as we will make copies of any
       // strings when we marshal them into our RecMessage buffer.
       RecRecord r2;
-      memset(&r2, 0, sizeof(RecRecord));
+
+      RecRecordInit(&r2);
       r2.rec_type = rec_type;
       r2.name = name;
       r2.data_type = (data_type != RECD_NULL) ? data_type : r1->data_type;
@@ -448,6 +450,7 @@ RecSetRecord(RecT rec_type, const char *name, RecDataT data_type, RecData *data,
         r2.stat_meta.data_raw = *data_raw;
       }
       err = send_set_message(&r2);
+      RecRecordFree(&r2);
     }
   } else {
     // Add the record but do not set the 'registered' flag, as this
@@ -850,13 +853,15 @@ RecResetStatRecord(const char *name)
       err = REC_ERR_OKAY;
     } else {
       RecRecord r2;
-      memset(&r2, 0, sizeof(RecRecord));
+
+      RecRecordInit(&r2);
       r2.rec_type = r1->rec_type;
       r2.name = r1->name;
       r2.data_type = r1->data_type;
       r2.data = r1->data_default;
 
       err = send_reset_message(&r2);
+      RecRecordFree(&r2);
     }
   } else {
     err = REC_ERR_FAIL;
@@ -893,13 +898,15 @@ RecResetStatRecord(RecT type, bool all)
         rec_mutex_release(&(r1->lock));
       } else {
         RecRecord r2;
-        memset(&r2, 0, sizeof(RecRecord));
+
+        RecRecordInit(&r2);
         r2.rec_type = r1->rec_type;
         r2.name = r1->name;
         r2.data_type = r1->data_type;
         r2.data = r1->data_default;
 
         err = send_reset_message(&r2);
+        RecRecordFree(&r2);
       }
     }
   }
@@ -936,13 +943,15 @@ RecSetSyncRequired(char *name, bool lock)
 
       /*
          RecRecord r2;
-         memset(&r2, 0, sizeof(RecRecord));
+
+         RecRecordInit(&r2);
          r2.rec_type  = r1->rec_type;
          r2.name      = r1->name;
          r2.data_type = r1->data_type;
          r2.data      = r1->data_default;
 
          err = send_set_message(&r2);
+         RecRecordFree(&r2);
        */
     }
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/58d3c53c/lib/records/P_RecUtils.h
----------------------------------------------------------------------
diff --git a/lib/records/P_RecUtils.h b/lib/records/P_RecUtils.h
index ee90f70..de8f018 100644
--- a/lib/records/P_RecUtils.h
+++ b/lib/records/P_RecUtils.h
@@ -45,10 +45,17 @@
 
 
 //-------------------------------------------------------------------------
+// RecRecord Utils
+//-------------------------------------------------------------------------
+void RecRecordInit(RecRecord *r);
+void RecRecordFree(RecRecord *r);
+RecRecord *RecAlloc(RecT rec_type, const char *name, RecDataT data_type);
+
+
+//-------------------------------------------------------------------------
 // RecData Utils
 //-------------------------------------------------------------------------
 
-RecRecord *RecAlloc(RecT rec_type, const char *name, RecDataT data_type);
 void RecDataClear(RecDataT type, RecData * data);
 void RecDataSetMax(RecDataT type, RecData * data);
 void RecDataSetMin(RecDataT type, RecData * data);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/58d3c53c/lib/records/RecCore.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecCore.cc b/lib/records/RecCore.cc
index 1ed4e10..bcfe6c6 100644
--- a/lib/records/RecCore.cc
+++ b/lib/records/RecCore.cc
@@ -170,7 +170,6 @@ RecCoreInit(RecModeT mode_type, Diags *_diags)
 
   // initialize record array for our internal stats (this can be reallocated later)
   g_records = (RecRecord *)ats_malloc(REC_MAX_RECORDS * sizeof(RecRecord));
-  memset(g_records, 0, REC_MAX_RECORDS * sizeof(RecRecord));
 
   // initialize record hash index
   g_records_ht = ink_hash_table_create(InkHashTableKeyType_String);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/58d3c53c/lib/records/RecMutex.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecMutex.cc b/lib/records/RecMutex.cc
index 888c96c..797e285 100644
--- a/lib/records/RecMutex.cc
+++ b/lib/records/RecMutex.cc
@@ -33,6 +33,14 @@ rec_mutex_init(RecMutex * m, const char *name)
 }
 
 int
+rec_mutex_destroy(RecMutex * m)
+{
+  ink_assert(m->nthread_holding == 0);
+  ink_assert(m->thread_holding == 0);
+  return ink_mutex_destroy(&(m->the_mutex));
+}
+
+int
 rec_mutex_acquire(RecMutex * m)
 {
 
@@ -45,7 +53,6 @@ rec_mutex_acquire(RecMutex * m)
 
   m->nthread_holding++;
   return 0;
-
 }
 
 int
@@ -59,7 +66,5 @@ rec_mutex_release(RecMutex * m)
       ink_mutex_release(&(m->the_mutex));
     }
   }
-
   return 0;
-
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/58d3c53c/lib/records/RecUtils.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecUtils.cc b/lib/records/RecUtils.cc
index 8485984..97feec0 100644
--- a/lib/records/RecUtils.cc
+++ b/lib/records/RecUtils.cc
@@ -27,6 +27,22 @@
 #include "P_RecTree.h"
 
 //-------------------------------------------------------------------------
+// RecRecord initializer / Free
+//-------------------------------------------------------------------------
+void
+RecRecordInit(RecRecord *r)
+{
+  ink_zero(*r);
+  rec_mutex_init(&(r->lock), NULL);
+}
+
+void
+RecRecordFree(RecRecord *r)
+{
+  rec_mutex_destroy(&(r->lock));
+}
+
+//-------------------------------------------------------------------------
 // RecAlloc
 //-------------------------------------------------------------------------
 RecRecord*
@@ -39,12 +55,12 @@ RecAlloc(RecT rec_type, const char *name, RecDataT data_type)
 
   int i = ink_atomic_increment(&g_num_records, 1);
   RecRecord *r = &(g_records[i]);
-  // Note: record should already be memset to 0 from RecCoreInit()
+
+  RecRecordInit(r);
   r->rec_type = rec_type;
   r->name = ats_strdup(name);
   r->order = i;
   r->data_type = data_type;
-  rec_mutex_init(&(r->lock), NULL);
 
   g_records_tree->rec_tree_insert(r->name);
 


[2/6] git commit: TS-2517 Cleanup of AdminClient.pm

Posted by zw...@apache.org.
TS-2517 Cleanup of AdminClient.pm

This will

     - Refactor the reader, and fix the timeout (it's in seconds, sigh)
     - Better handling of finding the socket
     - Updated the docs
     - Add a new get_config() method (which is the same as get_stat()


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/f3baeb2e
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/f3baeb2e
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/f3baeb2e

Branch: refs/heads/master
Commit: f3baeb2e850de1cb946cdb400aecfd034635532d
Parents: 3da547d
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri Jan 31 09:44:33 2014 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Jan 31 13:00:52 2014 -0700

----------------------------------------------------------------------
 lib/perl/lib/Apache/TS/AdminClient.pm | 161 +++++++++++++++++------------
 tools/traffic_shell.pl                |   2 +-
 2 files changed, 98 insertions(+), 65 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f3baeb2e/lib/perl/lib/Apache/TS/AdminClient.pm
----------------------------------------------------------------------
diff --git a/lib/perl/lib/Apache/TS/AdminClient.pm b/lib/perl/lib/Apache/TS/AdminClient.pm
index d90e645..61a0f6a 100644
--- a/lib/perl/lib/Apache/TS/AdminClient.pm
+++ b/lib/perl/lib/Apache/TS/AdminClient.pm
@@ -78,25 +78,45 @@ use constant {
     TS_ERR_FAIL                => 12
 };
 
+
+# Semi-intelligent way of finding the mgmtapi socket.
+sub _find_socket {
+    my $path = shift || "";
+    my $name = shift || "mgmtapisocket";
+    my @sockets_def = (
+        $path,
+        Apache::TS::PREFIX . '/' . Apache::TS::REL_RUNTIMEDIR . '/' . 'mgmtapisocket',
+        '/usr/local/var/trafficserver',
+        '/usr/local/var/run/trafficserver',
+        '/usr/local/var/run',
+        '/var/trafficserver',
+        '/var/run/trafficserver',
+        '/var/run',
+        '/opt/ats/var/trafficserver',
+    );
+
+    foreach my $socket (@sockets_def) {
+        return $socket if (-S $socket);
+        return "${socket}/${name}" if (-S "${socket}/${name}");
+
+    }
+    return undef;
+}
+
 #
 # Constructor
 #
 sub new {
-    my ( $class, %args ) = @_;
+    my ($class, %args) = @_;
     my $self = {};
 
-    $self->{_socket_path} = $args{socket_path} || _find_socket();
+    $self->{_socket_path} = _find_socket($args{socket_path});
     $self->{_socket} = undef;
     croak
 "Unable to locate socket, please pass socket_path with the management api socket location to Apache::TS::AdminClient"
-      if ( !$self->{_socket_path} );
-    if (   ( !-r $self->{_socket_path} )
-        or ( !-w $self->{_socket_path} )
-        or ( !-S $self->{_socket_path} ) )
-    {
+      if (!$self->{_socket_path});
+    if ((!-r $self->{_socket_path}) or (!-w $self->{_socket_path}) or (!-S $self->{_socket_path})) {
         croak "Unable to open $self->{_socket_path} for reads or writes";
-
-        # see croak in "sub open_socket()" for other source of carp errors
     }
 
     $self->{_select} = IO::Select->new();
@@ -107,20 +127,6 @@ sub new {
     return $self;
 }
 
-# Keeping this primarily for backwards compatibility, the new autoconf generated path is usually
-# what you want.
-sub _find_socket {
-    my @sockets_def = (
-        Apache::TS::PREFIX . '/' . Apache::TS::REL_RUNTIMEDIR . '/' . 'mgmtapisocket',
-        '/usr/local/var/trafficserver/mgmtapisocket',
-        '/var/trafficserver/mgmtapisocket'
-    );
-    foreach my $socket (@sockets_def) {
-        return $socket if ( -S $socket );
-    }
-    return undef;
-}
-
 #
 # Destructor
 #
@@ -136,8 +142,8 @@ sub open_socket {
     my $self = shift;
     my %args = @_;
 
-    if ( defined( $self->{_socket} ) ) {
-        if ( $args{force} || $args{reopen} ) {
+    if (defined($self->{_socket})) {
+        if ($args{force} || $args{reopen}) {
             $self->close_socket();
         }
         else {
@@ -148,10 +154,10 @@ sub open_socket {
     $self->{_socket} = IO::Socket::UNIX->new(
         Type => SOCK_STREAM,
         Peer => $self->{_socket_path}
-    ) or croak("Error opening socket - $@");
+   ) or croak("Error opening socket - $@");
 
-    return undef unless defined( $self->{_socket} );
-    $self->{_select}->add( $self->{_socket} );
+    return undef unless defined($self->{_socket});
+    $self->{_select}->add($self->{_socket});
 
     return $self;
 }
@@ -160,10 +166,10 @@ sub close_socket {
     my $self = shift;
 
     # if socket doesn't exist, return as there's nothing to do.
-    return unless defined( $self->{_socket} );
+    return unless defined($self->{_socket});
 
     # gracefully close socket.
-    $self->{_select}->remove( $self->{_socket} );
+    $self->{_select}->remove($self->{_socket});
     $self->{_socket}->close();
     $self->{_socket} = undef;
 
@@ -171,52 +177,61 @@ sub close_socket {
 }
 
 #
+# Do reads()'s on our Unix domain socket, takes an optional timeout, in ms's.
+#
+sub _do_read {
+    my $self = shift;
+    my $timeout = shift || 1/1000.0; # 1ms by default
+    my $res = "";
+
+    while ($self->{_select}->can_read($timeout)) {
+        my $rc = $self->{_socket}->sysread($res, 1024, length($res));
+    }
+
+    return $res || undef;
+}
+
+
+#
 # Get (read) a stat out of the local manager. Note that the assumption is
 # that you are calling this with an existing stats "name".
 #
 sub get_stat {
-    my ( $self, $stat ) = @_;
+    my ($self, $stat) = @_;
     my $res               = "";
     my $max_read_attempts = 25;
 
-    return undef unless defined( $self->{_socket} );
+    return undef unless defined($self->{_socket});
     return undef unless $self->{_select}->can_write(10);
 
 # This is a total hack for now, we need to wrap this into the proper mgmt API library.
-    $self->{_socket}
-      ->print( pack( "sla*", TS_RECORD_GET, length($stat) ), $stat );
-
-    while ( $res eq "" ) {
-        return undef if ( $max_read_attempts-- < 0 );
-        return undef unless $self->{_select}->can_read(10);
+    $self->{_socket}->print(pack("sla*", TS_RECORD_GET, length($stat)), $stat);
+    $res = $self->_do_read();
 
-        my $status = $self->{_socket}->sysread( $res, 1024 );
-        return undef unless defined($status) || ( $status == 0 );
+    my @resp = unpack("sls", $res);
+    return undef unless (scalar(@resp) == 3);
 
-    }
-    my @resp = unpack( "sls", $res );
-    return undef unless ( scalar(@resp) == 3 );
-
-    if ( $resp[0] == TS_ERR_OKAY ) {
-        if ( $resp[2] < TS_REC_FLOAT ) {
-            @resp = unpack( "slsq", $res );
-            return undef unless ( scalar(@resp) == 4 );
-            return int( $resp[3] );
+    if ($resp[0] == TS_ERR_OKAY) {
+        if ($resp[2] < TS_REC_FLOAT) {
+            @resp = unpack("slsq", $res);
+            return undef unless (scalar(@resp) == 4);
+            return int($resp[3]);
         }
-        elsif ( $resp[2] == TS_REC_FLOAT ) {
-            @resp = unpack( "slsf", $res );
-            return undef unless ( scalar(@resp) == 4 );
+        elsif ($resp[2] == TS_REC_FLOAT) {
+            @resp = unpack("slsf", $res);
+            return undef unless (scalar(@resp) == 4);
             return $resp[3];
         }
-        elsif ( $resp[2] == TS_REC_STRING ) {
-            @resp = unpack( "slsa*", $res );
-            return undef unless ( scalar(@resp) == 4 );
+        elsif ($resp[2] == TS_REC_STRING) {
+            @resp = unpack("slsa*", $res);
+            return undef unless (scalar(@resp) == 4);
             return $resp[3];
         }
     }
 
     return undef;
 }
+*get_config = \&get_stat;
 
 1;
 
@@ -246,25 +261,43 @@ request strings can be found in RecordsConfig.cc which is included with Apache T
 A list of valid request strings are included with this documentation, but this included list may not be complete
 as future releases of Apache Traffic Server may include new request strings or remove existing ones.  
 
-=head1 OPTIONS
+=head1 CONSTRUCTOR
+
+When the object is created for this module, it assumes the 'Unix Domain Socket' is at the default location from
+the Apache Traffic Server installation. This can be changed when creating the object by setting B<'socket_path'>.
+For example: 
+
+=over 4
+
+=item my $cli = AdminClient->new(socket_path=> "/var/trafficserver");
+
+
+This would make the module look for the 'Unix Domain Socket' in the directory '/var/trafficserver'. The path
+can optionally include the name of the Socket file, without it the constructor defaults to 'mgmtapisocket'.
+
+=back
+
+=head1 PUBLIC METHODS
+
+To read a single metric (or configuration), two APIs are available:
+
+=over 4
 
-=head2 socket_path
+=item $cli->get_stat($stats_name);
 
-When the object is created for this module, it assumes the 'Unix Domain Socket' is at the default location of 
-B<'/usr/local/var/trafficserver/cli'>  This can be changed when creating the object by setting B<'socket_path'>. For example: 
+=item $cli->get_config($config_name);
 
-  my $cli = AdminClient->new(socket_path=> "/dev/null");
+This will return a (scalar) value for this metric or configuration.
 
-would make the module look for the 'Unix Domain Socket' at /dev/null.  Of course this isn't a realistic example, but can be used when
-modified appropiately.  
+=back
 
-=head2 traffic_line
+=head1 traffic_line
 
 There is a command line tool included with Apache Traffic Server called traffic_line which overlaps with this module.  traffic_line 
 can be used to read and write statistics or config settings that this module can.  Hence if you don't want to write a perl one-liner to 
 get to this information, traffic_line is your tool.
 
-=head1 List of Request Strings
+=head1 List of configurations
 
 The Apache Traffic Server Administration Manual will explain what these strings represent.  (http://trafficserver.apache.org/docs/)
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f3baeb2e/tools/traffic_shell.pl
----------------------------------------------------------------------
diff --git a/tools/traffic_shell.pl b/tools/traffic_shell.pl
index 4ace56e..95046d4 100755
--- a/tools/traffic_shell.pl
+++ b/tools/traffic_shell.pl
@@ -23,7 +23,7 @@ use Apache::TS::AdminClient;
 
 # Global mgmt API connection...
 my $CLI = Apache::TS::AdminClient->new() || die "Can't connect to the mgmt port";
-my $ETC_PATH = Apache::TS::PREFIX . '/' . $CLI->get_stat("proxy.config.config_dir");
+my $ETC_PATH = Apache::TS::PREFIX . '/' . $CLI->get_config("proxy.config.config_dir");
 
 # Helper functions around reading other configs
 sub print_config {


[4/6] git commit: TS-2517 First implementation of traffic_shell.pl, and reorg the modules a bit

Posted by zw...@apache.org.
TS-2517 First implementation of traffic_shell.pl, and reorg the modules a bit


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/3da547d8
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/3da547d8
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/3da547d8

Branch: refs/heads/master
Commit: 3da547d87ad55854a52739cc219e10258fe88f4b
Parents: 58d3c53
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri Jan 31 08:24:27 2014 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Jan 31 13:00:52 2014 -0700

----------------------------------------------------------------------
 configure.ac                             |   2 +-
 lib/perl/lib/Apache/TS.pm                |  73 ---
 lib/perl/lib/Apache/TS.pm.in             |  90 +++
 lib/perl/lib/Apache/TS/AdminClient.pm    | 731 +++++++++++++++++++++
 lib/perl/lib/Apache/TS/AdminClient.pm.in | 728 ---------------------
 tools/traffic_shell.pl                   | 900 ++++++++++++++++++++++++++
 6 files changed, 1722 insertions(+), 802 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3da547d8/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 5823f2a..5d916bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1920,7 +1920,7 @@ AC_CONFIG_FILES([
   lib/atscppapi/examples/async_timer/Makefile
   lib/wccp/Makefile
   lib/perl/Makefile
-  lib/perl/lib/Apache/TS/AdminClient.pm
+  lib/perl/lib/Apache/TS.pm
   mgmt/Makefile
   mgmt/api/Makefile
   mgmt/api/include/Makefile

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3da547d8/lib/perl/lib/Apache/TS.pm
----------------------------------------------------------------------
diff --git a/lib/perl/lib/Apache/TS.pm b/lib/perl/lib/Apache/TS.pm
deleted file mode 100644
index 8084dae..0000000
--- a/lib/perl/lib/Apache/TS.pm
+++ /dev/null
@@ -1,73 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-package Apache::TS;
-
-use warnings;
-use strict;
-
-require 5.006;
-
-# ToDo: This should be auto-generated by the build process.
-our $VERSION = "3.4.0";
-
-1;
-
-__END__
-
-#-=-=-=-=-=-=-=-= Give us some POD please =-=-=-=-=-=-=-=- 
-
-=head1 NAME:
-
-Apache::TS - a collection of Perl interfaces to manage Apache Traffic Server installations.
-
-=head1 SYNOPSIS
-
-  #!/usr/bin/perl
-  use Apache::TS::AdminClient;
-
-  my $cli = Apache::TS::AdminClient->new(%input);
-  my $string = $cli->get_stat("proxy.config.product_company");
-  print "$string\n";
-
-
-=head1 DESCRIPTION
-
-This is the main module for Apache::TS, in includes the following sub-modules
-  Apache::TS::AdminClient
-  Apache::TS::Config
-  Apache::TS::Config::Records
-
-=head1 LICENSE
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-=cut
-
-#-=-=-=-=-=-=-=-= No more POD for you =-=-=-=-=-=-=-=- 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3da547d8/lib/perl/lib/Apache/TS.pm.in
----------------------------------------------------------------------
diff --git a/lib/perl/lib/Apache/TS.pm.in b/lib/perl/lib/Apache/TS.pm.in
new file mode 100644
index 0000000..0f49505
--- /dev/null
+++ b/lib/perl/lib/Apache/TS.pm.in
@@ -0,0 +1,90 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+package Apache::TS;
+
+use warnings;
+use strict;
+
+require 5.006;
+our $VERSION = "@TS_VERSION_STRING@";
+
+# Version constants
+use constant {
+    VERSION_STRING => "@TS_VERSION_STRING@",
+    VERSION_NUMBER => @TS_VERSION_NUMBER@,
+    VERSION_MAJOR => @TS_VERSION_MAJOR@,
+    VERSION_MINOR => @TS_VERSION_MINOR@,
+    VERSION_MICRO => @TS_VERSION_MICRO@
+};
+
+# Build (configure) constants, for various path and path components
+use constant {
+    PREFIX => "@prefix@",
+    REL_RUNTIMEDIR => "@rel_runtimedir@",
+};
+
+1;
+
+__END__
+
+#-=-=-=-=-=-=-=-= Give us some POD please =-=-=-=-=-=-=-=- 
+
+=head1 NAME:
+
+Apache::TS - a collection of Perl interfaces to manage Apache Traffic Server installations.
+
+=head1 SYNOPSIS
+
+  #!/usr/bin/perl
+  use Apache::TS::AdminClient;
+
+  my $cli = Apache::TS::AdminClient->new(%input);
+  my $string = $cli->get_stat("proxy.config.product_company");
+  print "$string\n";
+
+
+=head1 DESCRIPTION
+
+This is the main module for Apache::TS, in includes the following sub-modules
+  Apache::TS::AdminClient
+  Apache::TS::Config
+  Apache::TS::Config::Records
+
+
+This module, Apache:TS, only defines a set of constants, which are used by both
+the sub-modules as well as scripts.
+
+=head1 LICENSE
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+=cut
+
+#-=-=-=-=-=-=-=-= No more POD for you =-=-=-=-=-=-=-=- 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3da547d8/lib/perl/lib/Apache/TS/AdminClient.pm
----------------------------------------------------------------------
diff --git a/lib/perl/lib/Apache/TS/AdminClient.pm b/lib/perl/lib/Apache/TS/AdminClient.pm
new file mode 100644
index 0000000..d90e645
--- /dev/null
+++ b/lib/perl/lib/Apache/TS/AdminClient.pm
@@ -0,0 +1,731 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+package Apache::TS::AdminClient;
+
+use warnings;
+use strict;
+
+require 5.006;
+
+use Carp;
+use IO::Socket::UNIX;
+use IO::Select;
+
+use Apache::TS;
+
+
+# Mgmt API command constants, should track ts/mgmtapi.h
+use constant {
+    TS_FILE_READ            => 0,
+    TS_FILE_WRITE           => 1,
+    TS_RECORD_SET           => 2,
+    TS_RECORD_GET           => 3,
+    TS_PROXY_STATE_GET      => 4,
+    TS_PROXY_STATE_SET      => 5,
+    TS_RECONFIGURE          => 6,
+    TS_RESTART              => 7,
+    TS_BOUNCE               => 8,
+    TS_EVENT_RESOLVE        => 9,
+    TS_EVENT_GET_MLT        => 10,
+    TS_EVENT_ACTIVE         => 11,
+    TS_EVENT_REG_CALLBACK   => 12,
+    TS_EVENT_UNREG_CALLBACK => 13,
+    TS_EVENT_NOTIFY         => 14,
+    TS_SNAPSHOT_TAKE        => 15,
+    TS_SNAPSHOT_RESTORE     => 16,
+    TS_SNAPSHOT_REMOVE      => 17,
+    TS_SNAPSHOT_GET_MLT     => 18,
+    TS_DIAGS                => 19,
+    TS_STATS_RESET          => 20
+};
+
+# We treat both REC_INT and REC_COUNTER the same here
+use constant {
+    TS_REC_INT     => 0,
+    TS_REC_COUNTER => 0,
+    TS_REC_FLOAT   => 2,
+    TS_REC_STRING  => 3
+};
+
+use constant {
+    TS_ERR_OKAY                => 0,
+    TS_ERR_READ_FILE           => 1,
+    TS_ERR_WRITE_FILE          => 2,
+    TS_ERR_PARSE_CONFIG_RULE   => 3,
+    TS_ERR_INVALID_CONFIG_RULE => 4,
+    TS_ERR_NET_ESTABLISH       => 5,
+    TS_ERR_NET_READ            => 6,
+    TS_ERR_NET_WRITE           => 7,
+    TS_ERR_NET_EOF             => 8,
+    TS_ERR_NET_TIMEOUT         => 9,
+    TS_ERR_SYS_CALL            => 10,
+    TS_ERR_PARAMS              => 11,
+    TS_ERR_FAIL                => 12
+};
+
+#
+# Constructor
+#
+sub new {
+    my ( $class, %args ) = @_;
+    my $self = {};
+
+    $self->{_socket_path} = $args{socket_path} || _find_socket();
+    $self->{_socket} = undef;
+    croak
+"Unable to locate socket, please pass socket_path with the management api socket location to Apache::TS::AdminClient"
+      if ( !$self->{_socket_path} );
+    if (   ( !-r $self->{_socket_path} )
+        or ( !-w $self->{_socket_path} )
+        or ( !-S $self->{_socket_path} ) )
+    {
+        croak "Unable to open $self->{_socket_path} for reads or writes";
+
+        # see croak in "sub open_socket()" for other source of carp errors
+    }
+
+    $self->{_select} = IO::Select->new();
+    bless $self, $class;
+
+    $self->open_socket();
+
+    return $self;
+}
+
+# Keeping this primarily for backwards compatibility, the new autoconf generated path is usually
+# what you want.
+sub _find_socket {
+    my @sockets_def = (
+        Apache::TS::PREFIX . '/' . Apache::TS::REL_RUNTIMEDIR . '/' . 'mgmtapisocket',
+        '/usr/local/var/trafficserver/mgmtapisocket',
+        '/var/trafficserver/mgmtapisocket'
+    );
+    foreach my $socket (@sockets_def) {
+        return $socket if ( -S $socket );
+    }
+    return undef;
+}
+
+#
+# Destructor
+#
+sub DESTROY {
+    my $self = shift;
+    return $self->close_socket();
+}
+
+#
+# Open the socket (Unix domain)
+#
+sub open_socket {
+    my $self = shift;
+    my %args = @_;
+
+    if ( defined( $self->{_socket} ) ) {
+        if ( $args{force} || $args{reopen} ) {
+            $self->close_socket();
+        }
+        else {
+            return undef;
+        }
+    }
+
+    $self->{_socket} = IO::Socket::UNIX->new(
+        Type => SOCK_STREAM,
+        Peer => $self->{_socket_path}
+    ) or croak("Error opening socket - $@");
+
+    return undef unless defined( $self->{_socket} );
+    $self->{_select}->add( $self->{_socket} );
+
+    return $self;
+}
+
+sub close_socket {
+    my $self = shift;
+
+    # if socket doesn't exist, return as there's nothing to do.
+    return unless defined( $self->{_socket} );
+
+    # gracefully close socket.
+    $self->{_select}->remove( $self->{_socket} );
+    $self->{_socket}->close();
+    $self->{_socket} = undef;
+
+    return $self;
+}
+
+#
+# Get (read) a stat out of the local manager. Note that the assumption is
+# that you are calling this with an existing stats "name".
+#
+sub get_stat {
+    my ( $self, $stat ) = @_;
+    my $res               = "";
+    my $max_read_attempts = 25;
+
+    return undef unless defined( $self->{_socket} );
+    return undef unless $self->{_select}->can_write(10);
+
+# This is a total hack for now, we need to wrap this into the proper mgmt API library.
+    $self->{_socket}
+      ->print( pack( "sla*", TS_RECORD_GET, length($stat) ), $stat );
+
+    while ( $res eq "" ) {
+        return undef if ( $max_read_attempts-- < 0 );
+        return undef unless $self->{_select}->can_read(10);
+
+        my $status = $self->{_socket}->sysread( $res, 1024 );
+        return undef unless defined($status) || ( $status == 0 );
+
+    }
+    my @resp = unpack( "sls", $res );
+    return undef unless ( scalar(@resp) == 3 );
+
+    if ( $resp[0] == TS_ERR_OKAY ) {
+        if ( $resp[2] < TS_REC_FLOAT ) {
+            @resp = unpack( "slsq", $res );
+            return undef unless ( scalar(@resp) == 4 );
+            return int( $resp[3] );
+        }
+        elsif ( $resp[2] == TS_REC_FLOAT ) {
+            @resp = unpack( "slsf", $res );
+            return undef unless ( scalar(@resp) == 4 );
+            return $resp[3];
+        }
+        elsif ( $resp[2] == TS_REC_STRING ) {
+            @resp = unpack( "slsa*", $res );
+            return undef unless ( scalar(@resp) == 4 );
+            return $resp[3];
+        }
+    }
+
+    return undef;
+}
+
+1;
+
+__END__
+
+#-=-=-=-=-=-=-=-= Give us some POD please =-=-=-=-=-=-=-=- 
+
+=head1 NAME:
+
+Apache::TS::AdminClient - a perl interface to the statistics and configuration settings stored within Apache Traffic Server.
+
+=head1 SYNOPSIS
+
+  #!/usr/bin/perl
+  use Apache::TS::AdminClient;
+
+  my $cli = Apache::TS::AdminClient->new(%input);
+  my $string = $cli->get_stat("proxy.config.product_company");
+  print "$string\n";
+
+
+=head1 DESCRIPTION:
+
+AdminClient opens a TCP connection to a unix domain socket on local disk.  When the connection is established, 
+AdminClient will write requests to the socket and wait for Apache Traffic Server to return a response.  Valid 
+request strings can be found in RecordsConfig.cc which is included with Apache Traffic Server source.  
+A list of valid request strings are included with this documentation, but this included list may not be complete
+as future releases of Apache Traffic Server may include new request strings or remove existing ones.  
+
+=head1 OPTIONS
+
+=head2 socket_path
+
+When the object is created for this module, it assumes the 'Unix Domain Socket' is at the default location of 
+B<'/usr/local/var/trafficserver/cli'>  This can be changed when creating the object by setting B<'socket_path'>. For example: 
+
+  my $cli = AdminClient->new(socket_path=> "/dev/null");
+
+would make the module look for the 'Unix Domain Socket' at /dev/null.  Of course this isn't a realistic example, but can be used when
+modified appropiately.  
+
+=head2 traffic_line
+
+There is a command line tool included with Apache Traffic Server called traffic_line which overlaps with this module.  traffic_line 
+can be used to read and write statistics or config settings that this module can.  Hence if you don't want to write a perl one-liner to 
+get to this information, traffic_line is your tool.
+
+=head1 List of Request Strings
+
+The Apache Traffic Server Administration Manual will explain what these strings represent.  (http://trafficserver.apache.org/docs/)
+
+ proxy.config.accept_threads
+ proxy.config.task_threads
+ proxy.config.admin.admin_user
+ proxy.config.admin.autoconf.localhost_only
+ proxy.config.admin.autoconf.pac_filename
+ proxy.config.admin.autoconf_port
+ proxy.config.admin.autoconf.doc_root
+ proxy.config.admin.cli_path
+ proxy.config.admin.number_config_bak
+ proxy.config.admin.user_id
+ proxy.config.alarm.abs_path
+ proxy.config.alarm.bin
+ proxy.config.alarm_email
+ proxy.config.alarm.script_runtime
+ proxy.config.bandwidth_mgmt.filename
+ proxy.config.bin_path
+ proxy.config.body_factory.enable_customizations
+ proxy.config.body_factory.enable_logging
+ proxy.config.body_factory.response_suppression_mode
+ proxy.config.body_factory.template_sets_dir
+ proxy.config.cache.agg_write_backlog
+ proxy.config.cache.alt_rewrite_max_size
+ proxy.config.cache.control.filename
+ proxy.config.cache.dir.sync_frequency
+ proxy.config.cache.enable_checksum
+ proxy.config.cache.enable_read_while_writer
+ proxy.config.cache.hostdb.disable_reverse_lookup
+ proxy.config.cache.hostdb.sync_frequency
+ proxy.config.cache.hosting_filename
+ proxy.config.cache.ip_allow.filename
+ proxy.config.cache.limits.http.max_alts
+ proxy.config.cache.max_disk_errors
+ proxy.config.cache.max_doc_size
+ proxy.config.cache.min_average_object_size
+ proxy.config.cache.volume_filename
+ proxy.config.cache.permit.pinning
+ proxy.config.cache.ram_cache_cutoff
+ proxy.config.cache.ram_cache.size
+ proxy.config.cache.select_alternate
+ proxy.config.cache.storage_filename
+ proxy.config.cache.threads_per_disk
+ proxy.config.cache.url_hash_method
+ proxy.config.cache.vary_on_user_agent
+ proxy.config.cache.mutex_retry_delay
+ proxy.config.cluster.cluster_configuration
+ proxy.config.cluster.cluster_load_clear_duration
+ proxy.config.cluster.cluster_load_exceed_duration
+ proxy.config.cluster.cluster_port
+ proxy.config.cluster.delta_thresh
+ proxy.config.cluster.enable_monitor
+ proxy.config.cluster.ethernet_interface
+ proxy.config.cluster.load_compute_interval_msecs
+ proxy.config.cluster.load_monitor_enabled
+ proxy.config.cluster.log_bogus_mc_msgs
+ proxy.config.cluster.mc_group_addr
+ proxy.config.cluster.mcport
+ proxy.config.cluster.mc_ttl
+ proxy.config.cluster.monitor_interval_secs
+ proxy.config.cluster.msecs_per_ping_response_bucket
+ proxy.config.cluster.peer_timeout
+ proxy.config.cluster.periodic_timer_interval_msecs
+ proxy.config.cluster.ping_history_buf_length
+ proxy.config.cluster.ping_latency_threshold_msecs
+ proxy.config.cluster.ping_response_buckets
+ proxy.config.cluster.ping_send_interval_msecs
+ proxy.config.cluster.receive_buffer_size
+ proxy.config.cluster.rpc_cache_cluster
+ proxy.config.cluster.rsport
+ proxy.config.cluster.send_buffer_size
+ proxy.config.cluster.sock_option_flag
+ proxy.config.cluster.startup_timeout
+ proxy.config.cluster.threads
+ proxy.config.config_dir
+ proxy.config.cop.core_signal
+ proxy.config.cop.linux_min_memfree_kb
+ proxy.config.cop.linux_min_swapfree_kb
+ proxy.config.core_limit
+ proxy.config.diags.action.enabled
+ proxy.config.diags.action.tags
+ proxy.config.diags.debug.enabled
+ proxy.config.diags.debug.tags
+ proxy.config.diags.output.alert
+ proxy.config.diags.output.debug
+ proxy.config.diags.output.diag
+ proxy.config.diags.output.emergency
+ proxy.config.diags.output.error
+ proxy.config.diags.output.fatal
+ proxy.config.diags.output.note
+ proxy.config.diags.output.status
+ proxy.config.diags.output.warning
+ proxy.config.diags.show_location
+ proxy.config.dns.failover_number
+ proxy.config.dns.failover_period
+ proxy.config.dns.lookup_timeout
+ proxy.config.dns.max_dns_in_flight
+ proxy.config.dns.nameservers
+ proxy.config.dns.resolv_conf
+ proxy.config.dns.retries
+ proxy.config.dns.round_robin_nameservers
+ proxy.config.dns.search_default_domains
+ proxy.config.dns.splitDNS.enabled
+ proxy.config.dns.splitdns.filename
+ proxy.config.dns.url_expansions
+ proxy.config.dump_mem_info_frequency
+ proxy.config.env_prep
+ proxy.config.exec_thread.autoconfig
+ proxy.config.exec_thread.autoconfig.scale
+ proxy.config.exec_thread.limit
+ proxy.config.header.parse.no_host_url_redirect
+ proxy.config.hostdb
+ proxy.config.hostdb.cluster
+ proxy.config.hostdb.cluster.round_robin
+ proxy.config.hostdb.fail.timeout
+ proxy.config.hostdb.filename
+ proxy.config.hostdb.lookup_timeout
+ proxy.config.hostdb.migrate_on_demand
+ proxy.config.hostdb.re_dns_on_reload
+ proxy.config.hostdb.serve_stale_for
+ proxy.config.hostdb.size
+ proxy.config.hostdb.storage_path
+ proxy.config.hostdb.storage_size
+ proxy.config.hostdb.strict_round_robin
+ proxy.config.hostdb.timeout
+ proxy.config.hostdb.ttl_mode
+ proxy.config.hostdb.verify_after
+ proxy.config.http.accept_encoding_filter.filename
+ proxy.config.http.accept_no_activity_timeout
+ proxy.config.http.anonymize_insert_client_ip
+ proxy.config.http.anonymize_other_header_list
+ proxy.config.http.anonymize_remove_client_ip
+ proxy.config.http.anonymize_remove_cookie
+ proxy.config.http.anonymize_remove_from
+ proxy.config.http.anonymize_remove_referer
+ proxy.config.http.anonymize_remove_user_agent
+ proxy.config.http.background_fill_active_timeout
+ proxy.config.http.background_fill_completed_threshold
+ proxy.config.http.cache.cache_responses_to_cookies
+ proxy.config.http.cache.cache_urls_that_look_dynamic
+ proxy.config.http.cache.enable_default_vary_headers
+ proxy.config.http.cache.fuzz.min_time
+ proxy.config.http.cache.fuzz.probability
+ proxy.config.http.cache.fuzz.time
+ proxy.config.http.cache.guaranteed_max_lifetime
+ proxy.config.http.cache.guaranteed_min_lifetime
+ proxy.config.http.cache.heuristic_lm_factor
+ proxy.config.http.cache.heuristic_max_lifetime
+ proxy.config.http.cache.heuristic_min_lifetime
+ proxy.config.http.cache.http
+ proxy.config.http.cache.ignore_accept_charset_mismatch
+ proxy.config.http.cache.ignore_accept_encoding_mismatch
+ proxy.config.http.cache.ignore_accept_language_mismatch
+ proxy.config.http.cache.ignore_accept_mismatch
+ proxy.config.http.cache.ignore_authentication
+ proxy.config.http.cache.ignore_client_cc_max_age
+ proxy.config.http.cache.cluster_cache_local
+ proxy.config.http.cache.ignore_client_no_cache
+ proxy.config.http.cache.ignore_server_no_cache
+ proxy.config.http.cache.ims_on_client_no_cache
+ proxy.config.http.cache.max_open_read_retries
+ proxy.config.http.cache.max_open_write_retries
+ proxy.config.http.cache.max_stale_age
+ proxy.config.http.cache.open_read_retry_time
+ proxy.config.http.cache.range.lookup
+ proxy.config.http.cache.required_headers
+ proxy.config.http.cache.vary_default_images
+ proxy.config.http.cache.vary_default_other
+ proxy.config.http.cache.vary_default_text
+ proxy.config.http.cache.when_to_add_no_cache_to_msie_requests
+ proxy.config.http.cache.when_to_revalidate
+ proxy.config.http.chunking_enabled
+ proxy.config.http.congestion_control.default.client_wait_interval
+ proxy.config.http.congestion_control.default.congestion_scheme
+ proxy.config.http.congestion_control.default.dead_os_conn_retries
+ proxy.config.http.congestion_control.default.dead_os_conn_timeout
+ proxy.config.http.congestion_control.default.error_page
+ proxy.config.http.congestion_control.default.fail_window
+ proxy.config.http.congestion_control.default.live_os_conn_retries
+ proxy.config.http.congestion_control.default.live_os_conn_timeout
+ proxy.config.http.congestion_control.default.max_connection
+ proxy.config.http.congestion_control.default.max_connection_failures
+ proxy.config.http.congestion_control.default.proxy_retry_interval
+ proxy.config.http.congestion_control.default.wait_interval_alpha
+ proxy.config.http.congestion_control.enabled
+ proxy.config.http.congestion_control.filename
+ proxy.config.http.congestion_control.localtime
+ proxy.config.http.connect_attempts_max_retries
+ proxy.config.http.connect_attempts_max_retries_dead_server
+ proxy.config.http.connect_attempts_rr_retries
+ proxy.config.http.connect_attempts_timeout
+ proxy.config.http.connect_ports
+ proxy.config.http.default_buffer_size
+ proxy.config.http.default_buffer_water_mark
+ proxy.config.http.doc_in_cache_skip_dns
+ proxy.config.http.down_server.abort_threshold
+ proxy.config.http.down_server.cache_time
+ proxy.config.http.enabled
+ proxy.config.http.enable_http_info
+ proxy.config.http.enable_http_stats
+ proxy.config.http.enable_url_expandomatic
+ proxy.config.http.errors.log_error_pages
+ proxy.config.http.forward.proxy_auth_to_parent
+ proxy.config.http.global_user_agent_header
+ proxy.config.http.insert_age_in_response
+ proxy.config.http.insert_request_via_str
+ proxy.config.http.insert_response_via_str
+ proxy.config.http.insert_squid_x_forwarded_for
+ proxy.config.http.keep_alive_enabled_in
+ proxy.config.http.keep_alive_enabled_out
+ proxy.config.http.keep_alive_no_activity_timeout_in
+ proxy.config.http.keep_alive_no_activity_timeout_out
+ proxy.config.http.keep_alive_post_out
+ proxy.config.http.negative_caching_enabled
+ proxy.config.http.negative_caching_lifetime
+ proxy.config.http.negative_revalidating_enabled
+ proxy.config.http.negative_revalidating_lifetime
+ proxy.config.http.no_dns_just_forward_to_parent
+ proxy.config.http.no_origin_server_dns
+ proxy.config.http.normalize_ae_gzip
+ proxy.config.http.number_of_redirections
+ proxy.config.http.origin_max_connections
+ proxy.config.http.origin_min_keep_alive_connections
+ proxy.config.http.parent_proxies
+ proxy.config.http.parent_proxy.connect_attempts_timeout
+ proxy.config.http.parent_proxy.fail_threshold
+ proxy.config.http.parent_proxy.file
+ proxy.config.http.parent_proxy.per_parent_connect_attempts
+ proxy.config.http.parent_proxy.retry_time
+ proxy.config.http.parent_proxy_routing_enable
+ proxy.config.http.parent_proxy.total_connect_attempts
+ proxy.config.http.post_connect_attempts_timeout
+ proxy.config.http.post_copy_size
+ proxy.config.http.push_method_enabled
+ proxy.config.http.quick_filter.mask
+ proxy.config.http.record_heartbeat
+ proxy.config.http.record_tcp_mem_hit
+ proxy.config.http.redirection_enabled
+ proxy.config.http.referer_default_redirect
+ proxy.config.http.referer_filter
+ proxy.config.http.referer_format_redirect
+ proxy.config.http.request_header_max_size
+ proxy.config.http.request_via_str
+ proxy.config.http.response_header_max_size
+ proxy.config.http.response_server_enabled
+ proxy.config.http.response_server_str
+ proxy.config.http.response_via_str
+ proxy.config.http.send_http11_requests
+ proxy.config.http.server_max_connections
+ proxy.config.http.server_port
+ proxy.config.http.server_port_attr
+ proxy.config.http.share_server_sessions
+ proxy.config.http.slow.log.threshold
+ proxy.config.http.connect_ports
+ proxy.config.http.transaction_active_timeout_in
+ proxy.config.http.transaction_active_timeout_out
+ proxy.config.http.transaction_no_activity_timeout_in
+ proxy.config.http.transaction_no_activity_timeout_out
+ proxy.config.http_ui_enabled
+ proxy.config.http.uncacheable_requests_bypass_parent
+ proxy.config.icp.default_reply_port
+ proxy.config.icp.enabled
+ proxy.config.icp.icp_configuration
+ proxy.config.icp.icp_interface
+ proxy.config.icp.icp_port
+ proxy.config.icp.lookup_local
+ proxy.config.icp.multicast_enabled
+ proxy.config.icp.query_timeout
+ proxy.config.icp.reply_to_unknown_peer
+ proxy.config.icp.stale_icp_enabled
+ proxy.config.io.max_buffer_size
+ proxy.config.lm.pserver_timeout_msecs
+ proxy.config.lm.pserver_timeout_secs
+ proxy.config.lm.sem_id
+ proxy.config.local_state_dir
+ proxy.config.log.ascii_buffer_size
+ proxy.config.log.auto_delete_rolled_files
+ proxy.config.log.collation_host
+ proxy.config.log.collation_host_tagged
+ proxy.config.log.collation_max_send_buffers
+ proxy.config.log.collation_port
+ proxy.config.log.collation_retry_sec
+ proxy.config.log.collation_secret
+ proxy.config.log.common_log_enabled
+ proxy.config.log.common_log_header
+ proxy.config.log.common_log_is_ascii
+ proxy.config.log.common_log_name
+ proxy.config.log.custom_logs_enabled
+ proxy.config.log.extended2_log_enabled
+ proxy.config.log.extended2_log_header
+ proxy.config.log.extended2_log_is_ascii
+ proxy.config.log.extended2_log_name
+ proxy.config.log.extended_log_enabled
+ proxy.config.log.extended_log_header
+ proxy.config.log.extended_log_is_ascii
+ proxy.config.log.extended_log_name
+ proxy.config.log.file_stat_frequency
+ proxy.config.log.hostname
+ proxy.config.log.hosts_config_file
+ proxy.config.log.log_buffer_size
+ proxy.config.log.logfile_dir
+ proxy.config.log.logfile_perm
+ proxy.config.log.logging_enabled
+ proxy.config.log.max_line_size
+ proxy.config.log.max_secs_per_buffer
+ proxy.config.log.max_space_mb_for_logs
+ proxy.config.log.max_space_mb_for_orphan_logs
+ proxy.config.log.max_space_mb_headroom
+ proxy.config.log.overspill_report_count
+ proxy.config.log.rolling_enabled
+ proxy.config.log.rolling_interval_sec
+ proxy.config.log.rolling_offset_hr
+ proxy.config.log.rolling_size_mb
+ proxy.config.log.sampling_frequency
+ proxy.config.log.search_log_enabled
+ proxy.config.log.search_log_filters
+ proxy.config.log.search_rolling_interval_sec
+ proxy.config.log.search_server_ip_addr
+ proxy.config.log.search_server_port
+ proxy.config.log.search_top_sites
+ proxy.config.log.search_url_filter
+ proxy.config.log.separate_host_logs
+ proxy.config.log.separate_icp_logs
+ proxy.config.log.space_used_frequency
+ proxy.config.log.squid_log_enabled
+ proxy.config.log.squid_log_header
+ proxy.config.log.squid_log_is_ascii
+ proxy.config.log.squid_log_name
+ proxy.config.log.xml_config_file
+ proxy.config.manager_binary
+ proxy.config.net.connections_throttle
+ proxy.config.net.listen_backlog
+ proxy.config.net_snapshot_filename
+ proxy.config.net.sock_mss_in
+ proxy.config.net.sock_option_flag_in
+ proxy.config.net.sock_option_flag_out
+ proxy.config.net.sock_recv_buffer_size_in
+ proxy.config.net.sock_recv_buffer_size_out
+ proxy.config.net.sock_send_buffer_size_in
+ proxy.config.net.sock_send_buffer_size_out
+ proxy.config.net.defer_accept
+ proxy.config.output.logfile
+ proxy.config.ping.npacks_to_trans
+ proxy.config.ping.timeout_sec
+ proxy.config.plugin.plugin_dir
+ proxy.config.plugin.plugin_mgmt_dir
+ proxy.config.prefetch.child_port
+ proxy.config.prefetch.config_file
+ proxy.config.prefetch.default_data_proto
+ proxy.config.prefetch.default_url_proto
+ proxy.config.prefetch.keepalive_timeout
+ proxy.config.prefetch.max_object_size
+ proxy.config.prefetch.max_recursion
+ proxy.config.prefetch.prefetch_enabled
+ proxy.config.prefetch.push_cached_objects
+ proxy.config.prefetch.redirection
+ proxy.config.prefetch.url_buffer_size
+ proxy.config.prefetch.url_buffer_timeout
+ proxy.config.process_manager.enable_mgmt_port
+ proxy.config.process_manager.mgmt_port
+ proxy.config.process_manager.timeout
+ proxy.config.product_company
+ proxy.config.product_name
+ proxy.config.product_vendor
+ proxy.config.proxy.authenticate.basic.realm
+ proxy.config.proxy_binary
+ proxy.config.proxy_binary_opts
+ proxy.config.proxy_name
+ proxy.config.remap.num_remap_threads
+ proxy.config.res_track_memory
+ proxy.config.reverse_proxy.enabled
+ proxy.config.reverse_proxy.oldasxbehavior
+ proxy.config.snapshot_dir
+ proxy.config.socks.accept_enabled
+ proxy.config.socks.accept_port
+ proxy.config.socks.connection_attempts
+ proxy.config.socks.default_servers
+ proxy.config.socks.http_port
+ proxy.config.socks.per_server_connection_attempts
+ proxy.config.socks.server_connect_timeout
+ proxy.config.socks.server_fail_threshold
+ proxy.config.socks.server_retry_time
+ proxy.config.socks.server_retry_timeout
+ proxy.config.socks.socks_config_file
+ proxy.config.socks.socks_needed
+ proxy.config.socks.socks_timeout
+ proxy.config.socks.socks_version
+ proxy.config.srv_enabled
+ proxy.config.ssl.CA.cert.filename
+ proxy.config.ssl.CA.cert.path
+ proxy.config.ssl.client.CA.cert.filename
+ proxy.config.ssl.client.CA.cert.path
+ proxy.config.ssl.client.cert.filename
+ proxy.config.ssl.client.certification_level
+ proxy.config.ssl.client.cert.path
+ proxy.config.ssl.client.private_key.filename
+ proxy.config.ssl.client.private_key.path
+ proxy.config.ssl.client.verify.server
+ proxy.config.ssl.enabled
+ proxy.config.ssl.number.threads
+ proxy.config.ssl.server.cert_chain.filename
+ proxy.config.ssl.server.cert.path
+ proxy.config.ssl.server.cipher_suite
+ proxy.config.ssl.server.honor_cipher_order
+ proxy.config.ssl.SSLv2
+ proxy.config.ssl.SSLv3
+ proxy.config.ssl.TLSv1
+ proxy.config.ssl.compression
+ proxy.config.ssl.server.multicert.filename
+ proxy.config.ssl.server_port
+ proxy.config.ssl.server.private_key.path
+ proxy.config.stack_dump_enabled
+ proxy.config.stat_collector.interval
+ proxy.config.stat_collector.port
+ proxy.config.stats.config_file
+ proxy.config.stats.snap_file
+ proxy.config.stats.snap_frequency
+ proxy.config.syslog_facility
+ proxy.config.system.mmap_max
+ proxy.config.thread.default.stacksize
+ proxy.config.udp.free_cancelled_pkts_sec
+ proxy.config.udp.periodic_cleanup
+ proxy.config.udp.send_retries
+ proxy.config.update.concurrent_updates
+ proxy.config.update.enabled
+ proxy.config.update.force
+ proxy.config.update.max_update_state_machines
+ proxy.config.update.memory_use_mb
+ proxy.config.update.retry_count
+ proxy.config.update.retry_interval
+ proxy.config.update.update_configuration
+ proxy.config.url_remap.default_to_server_pac
+ proxy.config.url_remap.default_to_server_pac_port
+ proxy.config.url_remap.filename
+ proxy.config.url_remap.pristine_host_hdr
+ proxy.config.url_remap.remap_required
+ proxy.config.user_name
+ proxy.config.vmap.addr_file
+ proxy.config.vmap.down_up_timeout
+ proxy.config.vmap.enabled
+
+=head1 LICENSE
+
+ Simple Apache Traffic Server client object, to communicate with the local manager.
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+=cut
+
+#-=-=-=-=-=-=-=-= No more POD for you =-=-=-=-=-=-=-=- 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3da547d8/lib/perl/lib/Apache/TS/AdminClient.pm.in
----------------------------------------------------------------------
diff --git a/lib/perl/lib/Apache/TS/AdminClient.pm.in b/lib/perl/lib/Apache/TS/AdminClient.pm.in
deleted file mode 100644
index 30d5850..0000000
--- a/lib/perl/lib/Apache/TS/AdminClient.pm.in
+++ /dev/null
@@ -1,728 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Apache::TS::AdminClient;
-
-use warnings;
-use strict;
-
-require 5.006;
-
-use Carp;
-use IO::Socket::UNIX;
-use IO::Select;
-our $VERSION = "0.01";
-
-use constant {
-    TS_FILE_READ            => 0,
-    TS_FILE_WRITE           => 1,
-    TS_RECORD_SET           => 2,
-    TS_RECORD_GET           => 3,
-    TS_PROXY_STATE_GET      => 4,
-    TS_PROXY_STATE_SET      => 5,
-    TS_RECONFIGURE          => 6,
-    TS_RESTART              => 7,
-    TS_BOUNCE               => 8,
-    TS_EVENT_RESOLVE        => 9,
-    TS_EVENT_GET_MLT        => 10,
-    TS_EVENT_ACTIVE         => 11,
-    TS_EVENT_REG_CALLBACK   => 12,
-    TS_EVENT_UNREG_CALLBACK => 13,
-    TS_EVENT_NOTIFY         => 14,
-    TS_SNAPSHOT_TAKE        => 15,
-    TS_SNAPSHOT_RESTORE     => 16,
-    TS_SNAPSHOT_REMOVE      => 17,
-    TS_SNAPSHOT_GET_MLT     => 18,
-    TS_DIAGS                => 19,
-    TS_STATS_RESET          => 20
-};
-
-# We treat both REC_INT and REC_COUNTER the same here
-use constant {
-    TS_REC_INT     => 0,
-    TS_REC_COUNTER => 0,
-    TS_REC_FLOAT   => 2,
-    TS_REC_STRING  => 3
-};
-
-use constant {
-    TS_ERR_OKAY                => 0,
-    TS_ERR_READ_FILE           => 1,
-    TS_ERR_WRITE_FILE          => 2,
-    TS_ERR_PARSE_CONFIG_RULE   => 3,
-    TS_ERR_INVALID_CONFIG_RULE => 4,
-    TS_ERR_NET_ESTABLISH       => 5,
-    TS_ERR_NET_READ            => 6,
-    TS_ERR_NET_WRITE           => 7,
-    TS_ERR_NET_EOF             => 8,
-    TS_ERR_NET_TIMEOUT         => 9,
-    TS_ERR_SYS_CALL            => 10,
-    TS_ERR_PARAMS              => 11,
-    TS_ERR_FAIL                => 12
-};
-
-#
-# Constructor
-#
-sub new {
-    my ( $class, %args ) = @_;
-    my $self = {};
-
-    $self->{_socket_path} = $args{socket_path} || _find_socket();
-    $self->{_socket} = undef;
-    croak
-"Unable to locate socket, please pass socket_path with the management api socket location to Apache::TS::AdminClient"
-      if ( !$self->{_socket_path} );
-    if (   ( !-r $self->{_socket_path} )
-        or ( !-w $self->{_socket_path} )
-        or ( !-S $self->{_socket_path} ) )
-    {
-        croak "Unable to open $self->{_socket_path} for reads or writes";
-
-        # see croak in "sub open_socket()" for other source of carp errors
-    }
-
-    $self->{_select} = IO::Select->new();
-    bless $self, $class;
-
-    $self->open_socket();
-
-    return $self;
-}
-
-# Keeping this primarily for backwards compatibility, the new autoconf generated path is usually
-# what you want.
-sub _find_socket {
-    my @sockets_def = (
-        '@prefix@/@rel_runtimedir@/mgmtapisocket',
-        '/usr/local/var/trafficserver/mgmtapisocket',
-        '/var/trafficserver/mgmtapisocket'
-    );
-    foreach my $socket (@sockets_def) {
-        return $socket if ( -S $socket );
-    }
-    return undef;
-}
-
-#
-# Destructor
-#
-sub DESTROY {
-    my $self = shift;
-    return $self->close_socket();
-}
-
-#
-# Open the socket (Unix domain)
-#
-sub open_socket {
-    my $self = shift;
-    my %args = @_;
-
-    if ( defined( $self->{_socket} ) ) {
-        if ( $args{force} || $args{reopen} ) {
-            $self->close_socket();
-        }
-        else {
-            return undef;
-        }
-    }
-
-    $self->{_socket} = IO::Socket::UNIX->new(
-        Type => SOCK_STREAM,
-        Peer => $self->{_socket_path}
-    ) or croak("Error opening socket - $@");
-
-    return undef unless defined( $self->{_socket} );
-    $self->{_select}->add( $self->{_socket} );
-
-    return $self;
-}
-
-sub close_socket {
-    my $self = shift;
-
-    # if socket doesn't exist, return as there's nothing to do.
-    return unless defined( $self->{_socket} );
-
-    # gracefully close socket.
-    $self->{_select}->remove( $self->{_socket} );
-    $self->{_socket}->close();
-    $self->{_socket} = undef;
-
-    return $self;
-}
-
-#
-# Get (read) a stat out of the local manager. Note that the assumption is
-# that you are calling this with an existing stats "name".
-#
-sub get_stat {
-    my ( $self, $stat ) = @_;
-    my $res               = "";
-    my $max_read_attempts = 25;
-
-    return undef unless defined( $self->{_socket} );
-    return undef unless $self->{_select}->can_write(10);
-
-# This is a total hack for now, we need to wrap this into the proper mgmt API library.
-    $self->{_socket}
-      ->print( pack( "sla*", TS_RECORD_GET, length($stat) ), $stat );
-
-    while ( $res eq "" ) {
-        return undef if ( $max_read_attempts-- < 0 );
-        return undef unless $self->{_select}->can_read(10);
-
-        my $status = $self->{_socket}->sysread( $res, 1024 );
-        return undef unless defined($status) || ( $status == 0 );
-
-    }
-    my @resp = unpack( "sls", $res );
-    return undef unless ( scalar(@resp) == 3 );
-
-    if ( $resp[0] == TS_ERR_OKAY ) {
-        if ( $resp[2] < TS_REC_FLOAT ) {
-            @resp = unpack( "slsq", $res );
-            return undef unless ( scalar(@resp) == 4 );
-            return int( $resp[3] );
-        }
-        elsif ( $resp[2] == TS_REC_FLOAT ) {
-            @resp = unpack( "slsf", $res );
-            return undef unless ( scalar(@resp) == 4 );
-            return $resp[3];
-        }
-        elsif ( $resp[2] == TS_REC_STRING ) {
-            @resp = unpack( "slsa*", $res );
-            return undef unless ( scalar(@resp) == 4 );
-            return $resp[3];
-        }
-    }
-
-    return undef;
-}
-
-1;
-
-__END__
-
-#-=-=-=-=-=-=-=-= Give us some POD please =-=-=-=-=-=-=-=- 
-
-=head1 NAME:
-
-Apache::TS::AdminClient - a perl interface to the statistics and configuration settings stored within Apache Traffic Server.
-
-=head1 SYNOPSIS
-
-  #!/usr/bin/perl
-  use Apache::TS::AdminClient;
-
-  my $cli = Apache::TS::AdminClient->new(%input);
-  my $string = $cli->get_stat("proxy.config.product_company");
-  print "$string\n";
-
-
-=head1 DESCRIPTION:
-
-AdminClient opens a TCP connection to a unix domain socket on local disk.  When the connection is established, 
-AdminClient will write requests to the socket and wait for Apache Traffic Server to return a response.  Valid 
-request strings can be found in RecordsConfig.cc which is included with Apache Traffic Server source.  
-A list of valid request strings are included with this documentation, but this included list may not be complete
-as future releases of Apache Traffic Server may include new request strings or remove existing ones.  
-
-=head1 OPTIONS
-
-=head2 socket_path
-
-When the object is created for this module, it assumes the 'Unix Domain Socket' is at the default location of 
-B<'/usr/local/var/trafficserver/cli'>  This can be changed when creating the object by setting B<'socket_path'>. For example: 
-
-  my $cli = AdminClient->new(socket_path=> "/dev/null");
-
-would make the module look for the 'Unix Domain Socket' at /dev/null.  Of course this isn't a realistic example, but can be used when
-modified appropiately.  
-
-=head2 traffic_line
-
-There is a command line tool included with Apache Traffic Server called traffic_line which overlaps with this module.  traffic_line 
-can be used to read and write statistics or config settings that this module can.  Hence if you don't want to write a perl one-liner to 
-get to this information, traffic_line is your tool.
-
-=head1 List of Request Strings
-
-The Apache Traffic Server Administration Manual will explain what these strings represent.  (http://trafficserver.apache.org/docs/)
-
- proxy.config.accept_threads
- proxy.config.task_threads
- proxy.config.admin.admin_user
- proxy.config.admin.autoconf.localhost_only
- proxy.config.admin.autoconf.pac_filename
- proxy.config.admin.autoconf_port
- proxy.config.admin.autoconf.doc_root
- proxy.config.admin.cli_path
- proxy.config.admin.number_config_bak
- proxy.config.admin.user_id
- proxy.config.alarm.abs_path
- proxy.config.alarm.bin
- proxy.config.alarm_email
- proxy.config.alarm.script_runtime
- proxy.config.bandwidth_mgmt.filename
- proxy.config.bin_path
- proxy.config.body_factory.enable_customizations
- proxy.config.body_factory.enable_logging
- proxy.config.body_factory.response_suppression_mode
- proxy.config.body_factory.template_sets_dir
- proxy.config.cache.agg_write_backlog
- proxy.config.cache.alt_rewrite_max_size
- proxy.config.cache.control.filename
- proxy.config.cache.dir.sync_frequency
- proxy.config.cache.enable_checksum
- proxy.config.cache.enable_read_while_writer
- proxy.config.cache.hostdb.disable_reverse_lookup
- proxy.config.cache.hostdb.sync_frequency
- proxy.config.cache.hosting_filename
- proxy.config.cache.ip_allow.filename
- proxy.config.cache.limits.http.max_alts
- proxy.config.cache.max_disk_errors
- proxy.config.cache.max_doc_size
- proxy.config.cache.min_average_object_size
- proxy.config.cache.volume_filename
- proxy.config.cache.permit.pinning
- proxy.config.cache.ram_cache_cutoff
- proxy.config.cache.ram_cache.size
- proxy.config.cache.select_alternate
- proxy.config.cache.storage_filename
- proxy.config.cache.threads_per_disk
- proxy.config.cache.url_hash_method
- proxy.config.cache.vary_on_user_agent
- proxy.config.cache.mutex_retry_delay
- proxy.config.cluster.cluster_configuration
- proxy.config.cluster.cluster_load_clear_duration
- proxy.config.cluster.cluster_load_exceed_duration
- proxy.config.cluster.cluster_port
- proxy.config.cluster.delta_thresh
- proxy.config.cluster.enable_monitor
- proxy.config.cluster.ethernet_interface
- proxy.config.cluster.load_compute_interval_msecs
- proxy.config.cluster.load_monitor_enabled
- proxy.config.cluster.log_bogus_mc_msgs
- proxy.config.cluster.mc_group_addr
- proxy.config.cluster.mcport
- proxy.config.cluster.mc_ttl
- proxy.config.cluster.monitor_interval_secs
- proxy.config.cluster.msecs_per_ping_response_bucket
- proxy.config.cluster.peer_timeout
- proxy.config.cluster.periodic_timer_interval_msecs
- proxy.config.cluster.ping_history_buf_length
- proxy.config.cluster.ping_latency_threshold_msecs
- proxy.config.cluster.ping_response_buckets
- proxy.config.cluster.ping_send_interval_msecs
- proxy.config.cluster.receive_buffer_size
- proxy.config.cluster.rpc_cache_cluster
- proxy.config.cluster.rsport
- proxy.config.cluster.send_buffer_size
- proxy.config.cluster.sock_option_flag
- proxy.config.cluster.startup_timeout
- proxy.config.cluster.threads
- proxy.config.config_dir
- proxy.config.cop.core_signal
- proxy.config.cop.linux_min_memfree_kb
- proxy.config.cop.linux_min_swapfree_kb
- proxy.config.core_limit
- proxy.config.diags.action.enabled
- proxy.config.diags.action.tags
- proxy.config.diags.debug.enabled
- proxy.config.diags.debug.tags
- proxy.config.diags.output.alert
- proxy.config.diags.output.debug
- proxy.config.diags.output.diag
- proxy.config.diags.output.emergency
- proxy.config.diags.output.error
- proxy.config.diags.output.fatal
- proxy.config.diags.output.note
- proxy.config.diags.output.status
- proxy.config.diags.output.warning
- proxy.config.diags.show_location
- proxy.config.dns.failover_number
- proxy.config.dns.failover_period
- proxy.config.dns.lookup_timeout
- proxy.config.dns.max_dns_in_flight
- proxy.config.dns.nameservers
- proxy.config.dns.resolv_conf
- proxy.config.dns.retries
- proxy.config.dns.round_robin_nameservers
- proxy.config.dns.search_default_domains
- proxy.config.dns.splitDNS.enabled
- proxy.config.dns.splitdns.filename
- proxy.config.dns.url_expansions
- proxy.config.dump_mem_info_frequency
- proxy.config.env_prep
- proxy.config.exec_thread.autoconfig
- proxy.config.exec_thread.autoconfig.scale
- proxy.config.exec_thread.limit
- proxy.config.header.parse.no_host_url_redirect
- proxy.config.hostdb
- proxy.config.hostdb.cluster
- proxy.config.hostdb.cluster.round_robin
- proxy.config.hostdb.fail.timeout
- proxy.config.hostdb.filename
- proxy.config.hostdb.lookup_timeout
- proxy.config.hostdb.migrate_on_demand
- proxy.config.hostdb.re_dns_on_reload
- proxy.config.hostdb.serve_stale_for
- proxy.config.hostdb.size
- proxy.config.hostdb.storage_path
- proxy.config.hostdb.storage_size
- proxy.config.hostdb.strict_round_robin
- proxy.config.hostdb.timeout
- proxy.config.hostdb.ttl_mode
- proxy.config.hostdb.verify_after
- proxy.config.http.accept_encoding_filter.filename
- proxy.config.http.accept_no_activity_timeout
- proxy.config.http.anonymize_insert_client_ip
- proxy.config.http.anonymize_other_header_list
- proxy.config.http.anonymize_remove_client_ip
- proxy.config.http.anonymize_remove_cookie
- proxy.config.http.anonymize_remove_from
- proxy.config.http.anonymize_remove_referer
- proxy.config.http.anonymize_remove_user_agent
- proxy.config.http.background_fill_active_timeout
- proxy.config.http.background_fill_completed_threshold
- proxy.config.http.cache.cache_responses_to_cookies
- proxy.config.http.cache.cache_urls_that_look_dynamic
- proxy.config.http.cache.enable_default_vary_headers
- proxy.config.http.cache.fuzz.min_time
- proxy.config.http.cache.fuzz.probability
- proxy.config.http.cache.fuzz.time
- proxy.config.http.cache.guaranteed_max_lifetime
- proxy.config.http.cache.guaranteed_min_lifetime
- proxy.config.http.cache.heuristic_lm_factor
- proxy.config.http.cache.heuristic_max_lifetime
- proxy.config.http.cache.heuristic_min_lifetime
- proxy.config.http.cache.http
- proxy.config.http.cache.ignore_accept_charset_mismatch
- proxy.config.http.cache.ignore_accept_encoding_mismatch
- proxy.config.http.cache.ignore_accept_language_mismatch
- proxy.config.http.cache.ignore_accept_mismatch
- proxy.config.http.cache.ignore_authentication
- proxy.config.http.cache.ignore_client_cc_max_age
- proxy.config.http.cache.cluster_cache_local
- proxy.config.http.cache.ignore_client_no_cache
- proxy.config.http.cache.ignore_server_no_cache
- proxy.config.http.cache.ims_on_client_no_cache
- proxy.config.http.cache.max_open_read_retries
- proxy.config.http.cache.max_open_write_retries
- proxy.config.http.cache.max_stale_age
- proxy.config.http.cache.open_read_retry_time
- proxy.config.http.cache.range.lookup
- proxy.config.http.cache.required_headers
- proxy.config.http.cache.vary_default_images
- proxy.config.http.cache.vary_default_other
- proxy.config.http.cache.vary_default_text
- proxy.config.http.cache.when_to_add_no_cache_to_msie_requests
- proxy.config.http.cache.when_to_revalidate
- proxy.config.http.chunking_enabled
- proxy.config.http.congestion_control.default.client_wait_interval
- proxy.config.http.congestion_control.default.congestion_scheme
- proxy.config.http.congestion_control.default.dead_os_conn_retries
- proxy.config.http.congestion_control.default.dead_os_conn_timeout
- proxy.config.http.congestion_control.default.error_page
- proxy.config.http.congestion_control.default.fail_window
- proxy.config.http.congestion_control.default.live_os_conn_retries
- proxy.config.http.congestion_control.default.live_os_conn_timeout
- proxy.config.http.congestion_control.default.max_connection
- proxy.config.http.congestion_control.default.max_connection_failures
- proxy.config.http.congestion_control.default.proxy_retry_interval
- proxy.config.http.congestion_control.default.wait_interval_alpha
- proxy.config.http.congestion_control.enabled
- proxy.config.http.congestion_control.filename
- proxy.config.http.congestion_control.localtime
- proxy.config.http.connect_attempts_max_retries
- proxy.config.http.connect_attempts_max_retries_dead_server
- proxy.config.http.connect_attempts_rr_retries
- proxy.config.http.connect_attempts_timeout
- proxy.config.http.connect_ports
- proxy.config.http.default_buffer_size
- proxy.config.http.default_buffer_water_mark
- proxy.config.http.doc_in_cache_skip_dns
- proxy.config.http.down_server.abort_threshold
- proxy.config.http.down_server.cache_time
- proxy.config.http.enabled
- proxy.config.http.enable_http_info
- proxy.config.http.enable_http_stats
- proxy.config.http.enable_url_expandomatic
- proxy.config.http.errors.log_error_pages
- proxy.config.http.forward.proxy_auth_to_parent
- proxy.config.http.global_user_agent_header
- proxy.config.http.insert_age_in_response
- proxy.config.http.insert_request_via_str
- proxy.config.http.insert_response_via_str
- proxy.config.http.insert_squid_x_forwarded_for
- proxy.config.http.keep_alive_enabled_in
- proxy.config.http.keep_alive_enabled_out
- proxy.config.http.keep_alive_no_activity_timeout_in
- proxy.config.http.keep_alive_no_activity_timeout_out
- proxy.config.http.keep_alive_post_out
- proxy.config.http.negative_caching_enabled
- proxy.config.http.negative_caching_lifetime
- proxy.config.http.negative_revalidating_enabled
- proxy.config.http.negative_revalidating_lifetime
- proxy.config.http.no_dns_just_forward_to_parent
- proxy.config.http.no_origin_server_dns
- proxy.config.http.normalize_ae_gzip
- proxy.config.http.number_of_redirections
- proxy.config.http.origin_max_connections
- proxy.config.http.origin_min_keep_alive_connections
- proxy.config.http.parent_proxies
- proxy.config.http.parent_proxy.connect_attempts_timeout
- proxy.config.http.parent_proxy.fail_threshold
- proxy.config.http.parent_proxy.file
- proxy.config.http.parent_proxy.per_parent_connect_attempts
- proxy.config.http.parent_proxy.retry_time
- proxy.config.http.parent_proxy_routing_enable
- proxy.config.http.parent_proxy.total_connect_attempts
- proxy.config.http.post_connect_attempts_timeout
- proxy.config.http.post_copy_size
- proxy.config.http.push_method_enabled
- proxy.config.http.quick_filter.mask
- proxy.config.http.record_heartbeat
- proxy.config.http.record_tcp_mem_hit
- proxy.config.http.redirection_enabled
- proxy.config.http.referer_default_redirect
- proxy.config.http.referer_filter
- proxy.config.http.referer_format_redirect
- proxy.config.http.request_header_max_size
- proxy.config.http.request_via_str
- proxy.config.http.response_header_max_size
- proxy.config.http.response_server_enabled
- proxy.config.http.response_server_str
- proxy.config.http.response_via_str
- proxy.config.http.send_http11_requests
- proxy.config.http.server_max_connections
- proxy.config.http.server_port
- proxy.config.http.server_port_attr
- proxy.config.http.share_server_sessions
- proxy.config.http.slow.log.threshold
- proxy.config.http.connect_ports
- proxy.config.http.transaction_active_timeout_in
- proxy.config.http.transaction_active_timeout_out
- proxy.config.http.transaction_no_activity_timeout_in
- proxy.config.http.transaction_no_activity_timeout_out
- proxy.config.http_ui_enabled
- proxy.config.http.uncacheable_requests_bypass_parent
- proxy.config.icp.default_reply_port
- proxy.config.icp.enabled
- proxy.config.icp.icp_configuration
- proxy.config.icp.icp_interface
- proxy.config.icp.icp_port
- proxy.config.icp.lookup_local
- proxy.config.icp.multicast_enabled
- proxy.config.icp.query_timeout
- proxy.config.icp.reply_to_unknown_peer
- proxy.config.icp.stale_icp_enabled
- proxy.config.io.max_buffer_size
- proxy.config.lm.pserver_timeout_msecs
- proxy.config.lm.pserver_timeout_secs
- proxy.config.lm.sem_id
- proxy.config.local_state_dir
- proxy.config.log.ascii_buffer_size
- proxy.config.log.auto_delete_rolled_files
- proxy.config.log.collation_host
- proxy.config.log.collation_host_tagged
- proxy.config.log.collation_max_send_buffers
- proxy.config.log.collation_port
- proxy.config.log.collation_retry_sec
- proxy.config.log.collation_secret
- proxy.config.log.common_log_enabled
- proxy.config.log.common_log_header
- proxy.config.log.common_log_is_ascii
- proxy.config.log.common_log_name
- proxy.config.log.custom_logs_enabled
- proxy.config.log.extended2_log_enabled
- proxy.config.log.extended2_log_header
- proxy.config.log.extended2_log_is_ascii
- proxy.config.log.extended2_log_name
- proxy.config.log.extended_log_enabled
- proxy.config.log.extended_log_header
- proxy.config.log.extended_log_is_ascii
- proxy.config.log.extended_log_name
- proxy.config.log.file_stat_frequency
- proxy.config.log.hostname
- proxy.config.log.hosts_config_file
- proxy.config.log.log_buffer_size
- proxy.config.log.logfile_dir
- proxy.config.log.logfile_perm
- proxy.config.log.logging_enabled
- proxy.config.log.max_line_size
- proxy.config.log.max_secs_per_buffer
- proxy.config.log.max_space_mb_for_logs
- proxy.config.log.max_space_mb_for_orphan_logs
- proxy.config.log.max_space_mb_headroom
- proxy.config.log.overspill_report_count
- proxy.config.log.rolling_enabled
- proxy.config.log.rolling_interval_sec
- proxy.config.log.rolling_offset_hr
- proxy.config.log.rolling_size_mb
- proxy.config.log.sampling_frequency
- proxy.config.log.search_log_enabled
- proxy.config.log.search_log_filters
- proxy.config.log.search_rolling_interval_sec
- proxy.config.log.search_server_ip_addr
- proxy.config.log.search_server_port
- proxy.config.log.search_top_sites
- proxy.config.log.search_url_filter
- proxy.config.log.separate_host_logs
- proxy.config.log.separate_icp_logs
- proxy.config.log.space_used_frequency
- proxy.config.log.squid_log_enabled
- proxy.config.log.squid_log_header
- proxy.config.log.squid_log_is_ascii
- proxy.config.log.squid_log_name
- proxy.config.log.xml_config_file
- proxy.config.manager_binary
- proxy.config.net.connections_throttle
- proxy.config.net.listen_backlog
- proxy.config.net_snapshot_filename
- proxy.config.net.sock_mss_in
- proxy.config.net.sock_option_flag_in
- proxy.config.net.sock_option_flag_out
- proxy.config.net.sock_recv_buffer_size_in
- proxy.config.net.sock_recv_buffer_size_out
- proxy.config.net.sock_send_buffer_size_in
- proxy.config.net.sock_send_buffer_size_out
- proxy.config.net.defer_accept
- proxy.config.output.logfile
- proxy.config.ping.npacks_to_trans
- proxy.config.ping.timeout_sec
- proxy.config.plugin.plugin_dir
- proxy.config.plugin.plugin_mgmt_dir
- proxy.config.prefetch.child_port
- proxy.config.prefetch.config_file
- proxy.config.prefetch.default_data_proto
- proxy.config.prefetch.default_url_proto
- proxy.config.prefetch.keepalive_timeout
- proxy.config.prefetch.max_object_size
- proxy.config.prefetch.max_recursion
- proxy.config.prefetch.prefetch_enabled
- proxy.config.prefetch.push_cached_objects
- proxy.config.prefetch.redirection
- proxy.config.prefetch.url_buffer_size
- proxy.config.prefetch.url_buffer_timeout
- proxy.config.process_manager.enable_mgmt_port
- proxy.config.process_manager.mgmt_port
- proxy.config.process_manager.timeout
- proxy.config.product_company
- proxy.config.product_name
- proxy.config.product_vendor
- proxy.config.proxy.authenticate.basic.realm
- proxy.config.proxy_binary
- proxy.config.proxy_binary_opts
- proxy.config.proxy_name
- proxy.config.remap.num_remap_threads
- proxy.config.res_track_memory
- proxy.config.reverse_proxy.enabled
- proxy.config.reverse_proxy.oldasxbehavior
- proxy.config.snapshot_dir
- proxy.config.socks.accept_enabled
- proxy.config.socks.accept_port
- proxy.config.socks.connection_attempts
- proxy.config.socks.default_servers
- proxy.config.socks.http_port
- proxy.config.socks.per_server_connection_attempts
- proxy.config.socks.server_connect_timeout
- proxy.config.socks.server_fail_threshold
- proxy.config.socks.server_retry_time
- proxy.config.socks.server_retry_timeout
- proxy.config.socks.socks_config_file
- proxy.config.socks.socks_needed
- proxy.config.socks.socks_timeout
- proxy.config.socks.socks_version
- proxy.config.srv_enabled
- proxy.config.ssl.CA.cert.filename
- proxy.config.ssl.CA.cert.path
- proxy.config.ssl.client.CA.cert.filename
- proxy.config.ssl.client.CA.cert.path
- proxy.config.ssl.client.cert.filename
- proxy.config.ssl.client.certification_level
- proxy.config.ssl.client.cert.path
- proxy.config.ssl.client.private_key.filename
- proxy.config.ssl.client.private_key.path
- proxy.config.ssl.client.verify.server
- proxy.config.ssl.enabled
- proxy.config.ssl.number.threads
- proxy.config.ssl.server.cert_chain.filename
- proxy.config.ssl.server.cert.path
- proxy.config.ssl.server.cipher_suite
- proxy.config.ssl.server.honor_cipher_order
- proxy.config.ssl.SSLv2
- proxy.config.ssl.SSLv3
- proxy.config.ssl.TLSv1
- proxy.config.ssl.compression
- proxy.config.ssl.server.multicert.filename
- proxy.config.ssl.server_port
- proxy.config.ssl.server.private_key.path
- proxy.config.stack_dump_enabled
- proxy.config.stat_collector.interval
- proxy.config.stat_collector.port
- proxy.config.stats.config_file
- proxy.config.stats.snap_file
- proxy.config.stats.snap_frequency
- proxy.config.syslog_facility
- proxy.config.system.mmap_max
- proxy.config.thread.default.stacksize
- proxy.config.udp.free_cancelled_pkts_sec
- proxy.config.udp.periodic_cleanup
- proxy.config.udp.send_retries
- proxy.config.update.concurrent_updates
- proxy.config.update.enabled
- proxy.config.update.force
- proxy.config.update.max_update_state_machines
- proxy.config.update.memory_use_mb
- proxy.config.update.retry_count
- proxy.config.update.retry_interval
- proxy.config.update.update_configuration
- proxy.config.url_remap.default_to_server_pac
- proxy.config.url_remap.default_to_server_pac_port
- proxy.config.url_remap.filename
- proxy.config.url_remap.pristine_host_hdr
- proxy.config.url_remap.remap_required
- proxy.config.user_name
- proxy.config.vmap.addr_file
- proxy.config.vmap.down_up_timeout
- proxy.config.vmap.enabled
-
-=head1 LICENSE
-
- Simple Apache Traffic Server client object, to communicate with the local manager.
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-=cut
-
-#-=-=-=-=-=-=-=-= No more POD for you =-=-=-=-=-=-=-=- 


[6/6] git commit: Updated CHANGES for TS-2483, TS-2517 and TS-2534

Posted by zw...@apache.org.
Updated CHANGES for TS-2483, TS-2517 and TS-2534


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/d081cdf3
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/d081cdf3
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/d081cdf3

Branch: refs/heads/master
Commit: d081cdf347820d9c9e606bec5696dca874154950
Parents: 09da159
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri Jan 31 13:13:37 2014 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Jan 31 13:13:37 2014 -0700

----------------------------------------------------------------------
 CHANGES | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d081cdf3/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 230d5c1..9593111 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,16 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2534] Make sure RecRecord structs are always properly initialized.
+
+  *) [TS-2483] Add a new metric, proxy.node.restarts.proxy.cache_ready_time,
+   tracking absolute time when the cache started (finished
+   initialization). Until cache is available, or no cache configured, this
+   metric stays at a value of "0".
+
+  *) [TS-2517 First implementation of traffic_shell.pl, and reorg the modules
+   a bit for more consistency. Also fixes a timeout issue in AdminClient.pm.
+
   *) [TS-1467] Disable client initiated renegotiation (SSL) DDoS by default
 
   *) [TS-2538] Cleanup of ProcessMutex (unused) and InkMutex (dupe of
@@ -94,11 +104,6 @@ Changes with Apache Traffic Server 4.2.0
 
   *) [TS-2486] Eliminate SIMPLE_MEMCPY_INIT define.
 
-  *) [TS-2483] Add a new metric, proxy.node.restarts.proxy.cache_ready_time,
-   tracking absolute time when the cache started (finished
-   initialization). Until cache is available, or no cache configured, this
-   metric stays at a value of "0".
-
   *) [TS-2476] Fix size_t format string.
    Author: Radim Kolar <hs...@sendmail.cz>
 


[5/6] git commit: TS-2483 Add a new metric, proxy.node.restarts.proxy.cache_ready_time

Posted by zw...@apache.org.
TS-2483 Add a new metric, proxy.node.restarts.proxy.cache_ready_time


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/09da159b
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/09da159b
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/09da159b

Branch: refs/heads/master
Commit: 09da159b812e1bedfb1a1f1ebeb0b6814aef0441
Parents: f3baeb2
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri Jan 31 11:13:22 2014 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Jan 31 13:00:52 2014 -0700

----------------------------------------------------------------------
 CHANGES               | 5 +++++
 mgmt/RecordsConfig.cc | 2 ++
 proxy/Main.cc         | 4 ++++
 3 files changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/09da159b/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 3877c68..230d5c1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -94,6 +94,11 @@ Changes with Apache Traffic Server 4.2.0
 
   *) [TS-2486] Eliminate SIMPLE_MEMCPY_INIT define.
 
+  *) [TS-2483] Add a new metric, proxy.node.restarts.proxy.cache_ready_time,
+   tracking absolute time when the cache started (finished
+   initialization). Until cache is available, or no cache configured, this
+   metric stays at a value of "0".
+
   *) [TS-2476] Fix size_t format string.
    Author: Radim Kolar <hs...@sendmail.cz>
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/09da159b/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 76028c9..659abe9 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1374,6 +1374,8 @@ RecordElement RecordsConfig[] = {
   ,
   {RECT_NODE, "proxy.node.restarts.proxy.start_time", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
+  {RECT_NODE, "proxy.node.restarts.proxy.cache_ready_time", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
   {RECT_NODE, "proxy.node.restarts.proxy.stop_time", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
   {RECT_NODE, "proxy.node.restarts.proxy.restart_count", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/09da159b/proxy/Main.cc
----------------------------------------------------------------------
diff --git a/proxy/Main.cc b/proxy/Main.cc
index f224e9b..fd07c09 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -399,6 +399,10 @@ CB_After_Cache_Init()
     Debug("http_listen", "Delayed listen enable, cache initialization finished");
     start_HttpProxyServer();
   }
+
+  time_t cache_ready_at = time(NULL);
+  RecSetRecordInt("proxy.node.restarts.proxy.cache_ready_time", cache_ready_at);
+
   // Alert the plugins the cache is initialized.
   hook = lifecycle_hooks->get(TS_LIFECYCLE_CACHE_READY_HOOK);
   while (hook) {


[3/6] TS-2517 First implementation of traffic_shell.pl, and reorg the modules a bit

Posted by zw...@apache.org.
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3da547d8/tools/traffic_shell.pl
----------------------------------------------------------------------
diff --git a/tools/traffic_shell.pl b/tools/traffic_shell.pl
new file mode 100755
index 0000000..4ace56e
--- /dev/null
+++ b/tools/traffic_shell.pl
@@ -0,0 +1,900 @@
+#!/usr/bin/perl
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+use warnings;
+use strict;
+
+use Apache::TS;
+use Apache::TS::AdminClient;
+
+# Global mgmt API connection...
+my $CLI = Apache::TS::AdminClient->new() || die "Can't connect to the mgmt port";
+my $ETC_PATH = Apache::TS::PREFIX . '/' . $CLI->get_stat("proxy.config.config_dir");
+
+# Helper functions around reading other configs
+sub print_config {
+  my $file = shift;
+
+  open(FILE, "<${ETC_PATH}/$file") || die "Can't open $file";
+  print <FILE>;
+  close(FILE);
+}
+sub param_die {
+  my ($param, $cmd) = @_;
+  die "Unknown argument `${param}' to ${cmd}";
+}
+
+
+# Some helper functions around common metrics
+sub get_on_off {
+  my $stat = shift;
+  return int($CLI->get_stat($stat)) > 0 ? "on" : "off";
+}
+sub get_string {
+  my $stat = shift;
+  return $CLI->get_stat($stat);
+}
+sub get_int {
+  my $stat = shift;
+  return int($CLI->get_stat($stat));
+}
+sub get_float {
+  my $stat = shift;
+  return sprintf("%.6f", $CLI->get_stat($stat));
+}
+sub get_pcnt {
+  my $stat = shift;
+  return sprintf("%.6f", $CLI->get_stat($stat) * 100);
+}
+sub get_with_si {
+  my $stat = shift;
+  my $si = shift;
+  my $val = int($CLI->get_stat($stat));
+  my $multi = 1;
+
+  $multi = 1024*1024*1024 if $si eq "G";
+  $multi = 1024*1024 if $si eq "M";
+  $multi = 1024 if $si eq "K";
+
+  return int($val / $multi);
+}
+sub get_switch {
+  my $stat = shift;
+  my $switch = shift;
+  my $val = $CLI->get_stat($stat);
+
+  return $switch->{$val} if exists($switch->{$val});
+  return $switch->{"default"};
+}
+
+
+# Command: show:alarms
+#
+sub show_alarms {
+    print "Not implemented, use 'traffic_line --alarms' instead\n";
+}
+
+
+# Command: show:cache
+#
+sub show_cache {
+  my $param = shift || "";
+
+  if ($param eq "") {
+    my $http_cache = get_on_off("proxy.config.http.cache.http");
+    my $max_obj = get_int("proxy.config.cache.max_doc_size");
+    my $min_life = get_int("proxy.config.http.cache.heuristic_min_lifetime");
+    my $max_life = get_int("proxy.config.http.cache.heuristic_max_lifetime");
+    my $dynamic_urls = get_on_off("proxy.config.http.cache.cache_urls_that_look_dynamic");
+    my $alternates = get_on_off("proxy.config.http.cache.enable_default_vary_headers");
+    my $vary_def_text = get_string("proxy.config.http.cache.vary_default_text");
+    my $vary_def_image = get_string("proxy.config.http.cache.vary_default_images");
+    my $vary_def_other = get_string("proxy.config.http.cache.vary_default_other");
+
+    my $when_reval = get_switch("proxy.config.http.cache.when_to_revalidate", {
+      "0" => "When The Object Has Expired",
+      "1" => "When The Object Has No Expiry Date",
+      "2" => "Always",
+      "3" => "Never",
+      "default" => "unknown" });
+
+    my $reqd_headers = get_switch("proxy.config.http.cache.required_headers", {
+      "0" => "Nothing",
+      "1" => "A Last Modified Time",
+      "2" => "An Explicit Lifetime",
+      "default" => "unknown" });
+
+    my $cookies = get_switch("proxy.config.http.cache.cache_responses_to_cookies", {
+      "0" => "No Content-types",
+      "1" => "All Content-types",
+      "2" => "Only Image-content Types",
+      "3" => "Content Types which are not Text",
+      "4" => "Content Types which are not Text with some exceptions\n",
+      "default" => "" });
+
+    print <<__EOL;
+HTTP Caching --------------------------- $http_cache
+Maximum HTTP Object Size ----------- NONE
+Freshness
+  Verify Freshness By Checking --------- $when_reval
+  Minimum Information to be Cacheable -- $reqd_headers
+  If Object has no Expiration Date:
+    Leave it in Cache for at least ----- $min_life s
+    but no more than ------------------- $max_life s
+Variable Content
+  Cache Responses to URLs that contain
+    "?",";","cgi" or end in ".asp" ----- $dynamic_urls
+  Alternates Enabled ------------------- $alternates
+  Vary on HTTP Header Fields:
+    Text ------------------------------- $vary_def_text
+    Images ----------------------------- $vary_def_image
+    Other ------------------------------ $vary_def_other
+  Cache responses to requests containing cookies for:
+    $cookies
+__EOL
+  } elsif ($param eq "rules") {
+    print "cache.config rules\n";
+    print "-------------------\n";
+    print_config("cache.config");
+  } elsif ($param eq "storage") {
+    print "storage.config rules\n";
+    print "--------------------\n";
+    print_config("storage.config");
+  } else {
+    param_die($param, "show:cache");
+  }
+}
+
+
+# Command: show:cache-stats
+#
+sub show_cache_stats {
+  my $bytes_used = get_with_si("proxy.process.cache.bytes_used", "G");
+  my $bytes_total = get_with_si("proxy.process.cache.bytes_total", "G");
+
+  my $ram_cache_total_bytes = get_int("proxy.process.cache.ram_cache.total_bytes");
+  my $ram_cache_bytes_used = get_int("proxy.process.cache.ram_cache.bytes_used");
+  my $ram_cache_hits = get_int("proxy.process.cache.ram_cache.hits");
+  my $ram_cache_misses = get_int("proxy.process.cache.ram_cache.misses");
+  my $lookup_active = get_int("proxy.process.cache.lookup.active");
+  my $lookup_success = get_int("proxy.process.cache.lookup.success");
+  my $lookup_failure = get_int("proxy.process.cache.lookup.failure");
+  my $read_active = get_int("proxy.process.cache.read.active");
+  my $read_success = get_int("proxy.process.cache.read.success");
+  my $read_failure = get_int("proxy.process.cache.read.failure");
+  my $write_active = get_int("proxy.process.cache.write.active");
+  my $write_success = get_int("proxy.process.cache.write.success");
+  my $write_failure = get_int("proxy.process.cache.write.failure");
+  my $update_active = get_int("proxy.process.cache.update.active");
+  my $update_success = get_int("proxy.process.cache.update.success");
+  my $update_failure = get_int("proxy.process.cache.update.failure");
+  my $remove_active = get_int("proxy.process.cache.remove.active");
+  my $remove_success = get_int("proxy.process.cache.remove.success");
+  my $remove_failure = get_int("proxy.process.cache.remove.failure");
+
+  print <<__EOL
+Bytes Used --- $bytes_used GB
+Cache Size --- $bytes_used GB
+--RAM Cache--
+Total Bytes -- $ram_cache_total_bytes
+Bytes Used --- $ram_cache_bytes_used
+Hits --------- $ram_cache_hits
+Misses ------- $ram_cache_misses
+--Lookups--
+In Progress -- $lookup_active
+Hits --------- $lookup_success
+Misses ------- $lookup_failure
+--Reads--
+In Progress -- $read_active
+Hits --------- $read_success
+Misses ------- $read_failure
+--Writes--
+In Progress -- $write_active
+Hits --------- $write_success
+Misses ------- $write_failure
+--Updates--
+In Progress -- $update_active
+Hits --------- $update_success
+Misses ------- $update_failure
+--Removes--
+In Progress -- $remove_active
+Hits --------- $remove_success
+Misses ------- $remove_failure
+__EOL
+}
+
+
+# Command: show:cluster
+#
+sub show_cluster {
+  my $cluster = get_int("proxy.config.cluster.cluster_port");
+  my $cluster_rs = get_int("proxy.config.cluster.rsport");
+  my $cluster_mc = get_int("proxy.config.cluster.mcport");
+
+  print <<__EOF
+Cluster Port ----------- $cluster
+Cluster RS Port -------- $cluster_rs
+Cluster MC Port -------- $cluster_mc
+__EOF
+}
+
+
+# Command: show:dns-resolver
+#
+sub show_dns_resolver {
+  my $dns_search_default_domains = get_on_off("proxy.config.dns.search_default_domains");
+  my $http_enable_url_expandomatic = get_on_off("proxy.config.http.enable_url_expandomatic");
+  print <<__EOF
+Local Domain Expansion -- $dns_search_default_domains
+.com Domain Expansion --- $http_enable_url_expandomatic
+__EOF
+}
+
+
+# Command: show:dns-stats
+#
+sub show_dns_stats {
+  my $lookups_per_second = get_float("proxy.node.dns.lookups_per_second");
+
+  print <<__EOF
+DNS Lookups Per Second -- $lookups_per_second
+__EOF
+}
+
+
+# Command: show:hostdb
+#
+sub show_hostdb {
+  my $lookup_timeout = get_int("proxy.config.hostdb.lookup_timeout");
+  my $timeout = get_int("proxy.config.hostdb.timeout");
+  my $verify_after = get_int("proxy.config.hostdb.verify_after");
+  my $fail_timeout = get_int("proxy.config.hostdb.fail.timeout");
+  my $re_dns_on_reload = get_on_off("proxy.config.hostdb.re_dns_on_reload");
+  my $dns_lookup_timeout = get_int("proxy.config.dns.lookup_timeout");
+  my $dns_retries = get_int("proxy.config.dns.retries");
+  print <<__EOF
+Lookup Timeout ----------- $lookup_timeout s
+Foreground Timeout ------- $timeout s
+Background Timeout ------- $verify_after s
+Invalid Host Timeout ----- $fail_timeout s
+Re-DNS on Reload --------- $re_dns_on_reload
+Resolve Attempt Timeout -- $dns_lookup_timeout s
+Number of retries -------- $dns_retries
+__EOF
+}
+
+
+# Command: show:hostdb-stats
+#
+sub show_hostdb_stats {
+  my $hit_ratio = get_float("proxy.node.hostdb.hit_ratio");
+  my $lookups_per_second = get_float("proxy.node.dns.lookups_per_second");
+
+  print <<__EOF
+Host Database hit Rate -- $hit_ratio % *
+DNS Lookups Per Second -- $lookups_per_second
+
+* Value reprensents 10 second average.
+__EOF
+}
+
+
+# Command: show:http
+#
+sub show_http {
+  my $http_enabled = get_on_off("proxy.config.http.cache.http");
+  my $http_server = get_string("proxy.config.http.server_ports");
+  my $keepalive_timeout_in = get_int("proxy.config.http.keep_alive_no_activity_timeout_in");
+  my $keepalive_timeout_out = get_int("proxy.config.http.keep_alive_no_activity_timeout_out");
+  my $inactivity_timeout_in = get_int("proxy.config.http.transaction_no_activity_timeout_in");
+  my $inactivity_timeout_out = get_int("proxy.config.http.transaction_no_activity_timeout_out");
+  my $activity_timeout_in = get_int("proxy.config.http.transaction_active_timeout_in");
+  my $activity_timeout_out = get_int("proxy.config.http.transaction_active_timeout_out");
+  my $max_alts = get_int("proxy.config.cache.limits.http.max_alts");
+  my $remove_from = get_int("proxy.config.http.anonymize_remove_from");
+  my $remove_referer = get_int("proxy.config.http.anonymize_remove_referer");
+  my $remove_user_agent = get_int("proxy.config.http.anonymize_remove_user_agent");
+  my $remove_cookie = get_int("proxy.config.http.anonymize_remove_cookie");
+  my $other_header_list = get_string("proxy.config.http.anonymize_other_header_list");
+  my $insert_client_ip = get_int("proxy.config.http.anonymize_insert_client_ip");
+  my $remove_client_ip = get_int("proxy.config.http.anonymize_remove_client_ip");
+  my $global_user_agent = get_string("proxy.config.http.global_user_agent_header");
+
+  # A bunch of strings here are optional...
+  my $optional = "";
+
+  if ($remove_from || $remove_referer || $remove_user_agent || $remove_cookie) {
+    $optional = "Remove the following common headers -- \n";
+    $optional .= "From\n" if $remove_from;
+    $optional .= "Referer\n" if $remove_referer;
+    $optional .= "User-Agent\n" if $remove_user_agent;
+    $optional .= "Cookie\n" if $remove_cookie;
+  }
+
+  if ($other_header_list ne "NULL") {
+    $optional .= "Remove additional headers ----- $other_header_list\n";
+  }
+
+  if ($insert_client_ip) {
+    $optional .= "Insert Client IP Address into Header\n";
+  }
+
+  if ($remove_client_ip) {
+    $optional .= "Remove Client IP Address from Header\n";
+  }
+
+  if ($global_user_agent ne "NULL") {
+    $optional .= "Set User-Agent header to $global_user_agent\n";
+  }
+
+
+  print <<__EOF
+HTTP Caching ------------------ $http_enabled
+HTTP Server Port(s) ----------- $http_server
+Keep-Alive Timeout Inbound ---- $keepalive_timeout_in s
+Keep-Alive Timeout Outbound --- $keepalive_timeout_out s
+Inactivity Timeout Inbound ---- $inactivity_timeout_in s
+Inactivity Timeout Outbound --- $inactivity_timeout_out s
+Activity Timeout Inbound ------ $activity_timeout_in s
+Activity Timeout Outbound ----- $activity_timeout_out s
+Maximum Number of Alternates -- $max_alts
+${optional}
+__EOF
+}
+
+
+# Command: show:http-stats
+#
+sub show_http_stats {
+  my $user_agent_response_document_total_size = get_with_si("proxy.process.http.user_agent_response_document_total_size", "M");
+  my $user_agent_response_header_total_size = get_with_si("proxy.process.http.user_agent_response_header_total_size", "M");
+  my $current_client_connections = get_int("proxy.process.http.current_client_connections");
+  my $current_client_transactions = get_int("proxy.process.http.current_client_transactions");
+  my $origin_server_response_document_total_size = get_with_si("proxy.process.http.origin_server_response_document_total_size", "M");
+  my $origin_server_response_header_total_size = get_with_si("proxy.process.http.origin_server_response_header_total_size", "M");
+  my $current_server_connections = get_int("proxy.process.http.current_server_connections");
+  my $current_server_transactions = get_int("proxy.process.http.current_server_transactions");
+
+  print <<__EOF
+Total Document Bytes ----- $user_agent_response_document_total_size MB
+Total Header Bytes ------- $user_agent_response_header_total_size MB
+Total Connections -------- $current_client_connections
+Transactins In Progress -- $current_client_transactions
+--Server--
+Total Document Bytes ----- $origin_server_response_document_total_size MB
+Total Header Bytes ------- $origin_server_response_header_total_size MB
+Total Connections -------- $current_server_connections
+Transactins In Progress -- $current_server_transactions
+__EOF
+}
+
+
+# Command: show:http-trans-stats
+#
+sub show_http_trans_stats {
+  my $frac_avg_10s_hit_fresh = get_pcnt("proxy.node.http.transaction_frac_avg_10s.hit_fresh");
+  my $frac_avg_10s_hit_revalidated = get_pcnt("proxy.node.http.transaction_frac_avg_10s.hit_revalidated");
+  my $frac_avg_10s_miss_cold = get_pcnt("proxy.node.http.transaction_frac_avg_10s.miss_cold");
+  my $frac_avg_10s_miss_not_cachable = get_pcnt("proxy.node.http.transaction_frac_avg_10s.miss_not_cacheable");
+  my $frac_avg_10s_miss_changed = get_pcnt("proxy.node.http.transaction_frac_avg_10s.miss_changed");
+  my $frac_avg_10s_miss_client_no_cache = get_pcnt("proxy.node.http.transaction_frac_avg_10s.miss_client_no_cache");
+  my $frac_avg_10s_errors_connect_failed = get_pcnt("proxy.node.http.transaction_frac_avg_10s.errors.connect_failed");
+  my $frac_avg_10s_errors_other = get_pcnt("proxy.node.http.transaction_frac_avg_10s.errors.other");
+  my $frac_avg_10s_errors_aborts = get_pcnt("proxy.node.http.transaction_frac_avg_10s.errors.aborts");
+  my $frac_avg_10s_errors_possible_aborts = get_pcnt("proxy.node.http.transaction_frac_avg_10s.errors.possible_aborts");
+  my $frac_avg_10s_errors_early_hangups = get_pcnt("proxy.node.http.transaction_frac_avg_10s.errors.early_hangups");
+  my $frac_avg_10s_errors_empty_hangups = get_pcnt("proxy.node.http.transaction_frac_avg_10s.errors.empty_hangups");
+  my $frac_avg_10s_errors_pre_accept_hangups = get_pcnt("proxy.node.http.transaction_frac_avg_10s.errors.pre_accept_hangups");
+  my $frac_avg_10s_other_unclassified = get_pcnt("proxy.node.http.transaction_frac_avg_10s.other.unclassified");
+
+  my $msec_avg_10s_hit_fresh = get_int("proxy.node.http.transaction_msec_avg_10s.hit_fresh");
+  my $msec_avg_10s_hit_revalidated = get_int("proxy.node.http.transaction_msec_avg_10s.hit_revalidated");
+  my $msec_avg_10s_miss_cold = get_int("proxy.node.http.transaction_msec_avg_10s.miss_cold");
+  my $msec_avg_10s_miss_not_cachable = get_int("proxy.node.http.transaction_msec_avg_10s.miss_not_cacheable");
+  my $msec_avg_10s_miss_changed = get_int("proxy.node.http.transaction_msec_avg_10s.miss_changed");
+  my $msec_avg_10s_miss_client_no_cache = get_int("proxy.node.http.transaction_msec_avg_10s.miss_client_no_cache");
+  my $msec_avg_10s_errors_connect_failed = get_int("proxy.node.http.transaction_msec_avg_10s.errors.connect_failed");
+  my $msec_avg_10s_errors_other = get_int("proxy.node.http.transaction_msec_avg_10s.errors.other");
+  my $msec_avg_10s_errors_aborts = get_int("proxy.node.http.transaction_msec_avg_10s.errors.aborts");
+  my $msec_avg_10s_errors_possible_aborts = get_int("proxy.node.http.transaction_msec_avg_10s.errors.possible_aborts");
+  my $msec_avg_10s_errors_early_hangups = get_int("proxy.node.http.transaction_msec_avg_10s.errors.early_hangups");
+  my $msec_avg_10s_errors_empty_hangups = get_int("proxy.node.http.transaction_msec_avg_10s.errors.empty_hangups");
+  my $msec_avg_10s_errors_pre_accept_hangups = get_int("proxy.node.http.transaction_msec_avg_10s.errors.pre_accept_hangups");
+  my $msec_avg_10s_other_unclassified = get_int("proxy.node.http.transaction_msec_avg_10s.other.unclassified");
+
+  print <<__EOF
+HTTP Transaction Frequency and Speeds
+Transaction Type              Frequency   Speed(ms)
+--Hits--
+Fresh ----------------------- $frac_avg_10s_hit_fresh %  $msec_avg_10s_hit_fresh
+Stale Revalidated ----------- $frac_avg_10s_hit_revalidated %  $msec_avg_10s_hit_revalidated
+--Misses--
+Now Cached ------------------ $frac_avg_10s_miss_cold %  $msec_avg_10s_miss_cold
+Server No Cache ------------- $frac_avg_10s_miss_not_cachable %  $msec_avg_10s_miss_not_cachable
+Stale Reloaded -------------- $frac_avg_10s_miss_changed %  $msec_avg_10s_miss_changed
+Client No Cache ------------- $frac_avg_10s_miss_client_no_cache %  $msec_avg_10s_miss_client_no_cache
+--Errors--
+Connection Failures --------- $frac_avg_10s_errors_connect_failed %  $msec_avg_10s_errors_connect_failed
+Other Errors ---------------- $frac_avg_10s_errors_other %  $msec_avg_10s_errors_other
+--Aborted Transactions--
+Client Aborts --------------- $frac_avg_10s_errors_aborts %  $msec_avg_10s_errors_aborts
+Questionable Client Aborts -- $frac_avg_10s_errors_possible_aborts %  $msec_avg_10s_errors_possible_aborts
+Partial Request Hangups ----- $frac_avg_10s_errors_early_hangups %  $msec_avg_10s_errors_early_hangups
+Pre-Request Hangups --------- $frac_avg_10s_errors_empty_hangups %  $msec_avg_10s_errors_empty_hangups
+Pre-Connect Hangups --------- $frac_avg_10s_errors_pre_accept_hangups %  $msec_avg_10s_errors_pre_accept_hangups
+--Other Transactions--
+Unclassified ---------------- $frac_avg_10s_other_unclassified %  $msec_avg_10s_other_unclassified
+__EOF
+}
+
+
+# Command: show:icp
+#
+sub show_icp {
+  my $param = shift || "";
+
+  if ($param eq "") {
+    my $icp_enabled = get_on_off("proxy.config.icp.enabled");
+    my $icp_port = get_int("proxy.config.icp.icp_port");
+    my $multicast_enabled = get_on_off("proxy.config.icp.multicast_enabled");
+    my $query_timeout = get_int("proxy.config.icp.query_timeout");
+    print <<__EOF
+ICP Mode Enabled ------- $icp_enabled
+ICP Port --------------- $icp_port
+ICP Multicast Enabled -- $multicast_enabled
+ICP Query Timeout ------ $query_timeout s
+__EOF
+  } elsif ($param eq "peers") {
+    print "icp.config Rules\n";
+    print "----------------\n";
+    print_config("icp.config");
+  } else {
+    param_die($param, "show:icp");
+  }
+}
+
+
+# Command: show:icp-stats
+#
+sub show_icp_stats {
+  my $icp_query_requests = get_int("proxy.process.icp.icp_query_requests");
+  my $total_udp_send_queries = get_int("proxy.process.icp.total_udp_send_queries");
+  my $icp_query_hits = get_int("proxy.process.icp.icp_query_hits");
+  my $icp_query_misses = get_int("proxy.process.icp.icp_query_misses");
+  my $icp_remote_responses = get_int("proxy.process.icp.icp_remote_responses");
+  my $total_icp_response_time = get_float("proxy.process.icp.total_icp_response_time");
+  my $total_icp_request_time = get_float("proxy.process.icp.total_icp_request_time");
+  my $icp_remote_query_requests = get_int("proxy.process.icp.icp_remote_query_requests");
+  my $cache_lookup_success = get_int("proxy.process.icp.cache_lookup_success");
+  my $cache_lookup_fail = get_int("proxy.process.icp.cache_lookup_fail");
+  my $query_response_write = get_int("proxy.process.icp.query_response_write");
+  
+  print <<__EOF
+--Queries Originating From This Node--
+Query Requests ----------------------------- $icp_query_requests
+Query Messages Sent ------------------------ $total_udp_send_queries
+Peer Hit Messages Received ----------------- $icp_query_hits
+Peer Miss Messages Received ---------------- $icp_query_misses
+Total Responses Received ------------------- $icp_remote_responses
+Average ICP Message Response Time ---------- $total_icp_response_time ms
+Average ICP Request Time ------------------- $total_icp_request_time ms
+
+--Queries Originating from ICP Peers--
+Query Messages Received -------------------- $icp_remote_query_requests
+Remote Query Hits -------------------------- $cache_lookup_success
+Remote Query Misses ------------------------ $cache_lookup_fail
+Successful Response Message Sent to Peers -- $query_response_write
+__EOF
+}
+
+
+# Command: show:logging
+#
+sub show_logging {
+  my $logging_enabled = get_switch("proxy.config.log.logging_enabled", {
+    "0" => "no logging",
+    "1" => "errors only",
+    "2" => "transactions only",
+    "3" => "errors and transactions",
+    "default" => "invalid mode"});
+
+  my $log_space = get_int("proxy.config.log.max_space_mb_for_logs");
+  my $headroom_space = get_int("proxy.config.log.max_space_mb_headroom");
+
+  my $collation_mode = get_on_off("proxy.local.log.collation_mode");
+  my $collation_host = get_string("proxy.config.log.collation_host");
+  my $collation_port = get_int("proxy.config.log.collation_port");
+  my $collation_secret = get_string("proxy.config.log.collation_secret");
+  my $host_tag = get_on_off("proxy.config.log.collation_host_tagged");
+  my $preproc_threads = get_on_off("proxy.config.log.collation_preproc_threads");
+  my $orphan_space = get_int("proxy.config.log.max_space_mb_for_orphan_logs");
+
+  my $squid_log = get_on_off("proxy.config.log.squid_log_enabled");
+  my $squid_is_ascii = get_switch("proxy.config.log.squid_log_is_ascii", {
+    "0" => "BINARY",
+    "default" => "ASCII"});
+  my $squid_file_name = get_string("proxy.config.log.squid_log_name");
+  my $squid_file_header = get_string("proxy.config.log.squid_log_header");
+  
+  my $common_log = get_on_off("proxy.config.log.common_log_enabled");
+  my $common_is_ascii = get_switch("proxy.config.log.common_log_is_ascii", {
+    "0" => "BINARY",
+    "default" => "ASCII"});
+  my $common_file_name = get_string("proxy.config.log.common_log_name");
+  my $common_file_header = get_string("proxy.config.log.common_log_header");
+  
+  my $extended_log = get_on_off("proxy.config.log.extended_log_enabled");
+  my $extended_is_ascii = get_switch("proxy.config.log.extended_log_is_ascii", {
+    "0" => "BINARY",
+    "default" => "ASCII"});
+  my $extended_file_name = get_string("proxy.config.log.extended_log_name");
+  my $extended_file_header = get_string("proxy.config.log.extended_log_header");
+  
+  my $extended2_log = get_on_off("proxy.config.log.extended2_log_enabled");
+  my $extended2_is_ascii = get_switch("proxy.config.log.extended2_log_is_ascii", {
+    "0" => "BINARY",
+    "default" => "ASCII"});
+  my $extended2_file_name = get_string("proxy.config.log.extended2_log_name");
+  my $extended2_file_header = get_string("proxy.config.log.extended2_log_header");
+  
+  my $icp_log = get_on_off("proxy.config.log.separate_icp_logs");
+  my $http_host_log = get_on_off("proxy.config.log.separate_host_logs");
+
+  my $custom_log = get_on_off("proxy.config.log.custom_logs_enabled");
+
+  my $rolling = get_on_off("proxy.config.log.rolling_enabled");
+  my $roll_offset_hr = get_int("proxy.config.log.rolling_offset_hr");
+  my $roll_interval = get_int("proxy.config.log.rolling_interval_sec");
+  my $auto_delete = get_on_off("proxy.config.log.auto_delete_rolled_files");
+  
+  print <<__EOF
+Logging Mode ----------------------------- $logging_enabled
+
+Management
+  Log Space Limit ------------------------ $log_space MB
+  Log Space Headroom --------------------- $headroom_space MB
+
+Log Collation ---------------------------- $collation_mode
+  Host ----------------------------------- $collation_host
+  Port ----------------------------------- $collation_port
+  Secret --------------------------------- $collation_secret
+  Host Tagged ---------------------------- $host_tag
+  Preproc Threads ------------------------ $preproc_threads
+  Space Limit for Orphan Files ----------- $orphan_space MB
+
+Squid Format ----------------------------- $squid_log
+  File Type ------------------------------ $squid_is_ascii
+  File Name ------------------------------ $squid_file_name
+  File Header ---------------------------- $squid_file_header
+
+Netscape Common -------------------------- $common_log
+  File Type ------------------------------ $common_is_ascii
+  File Name ------------------------------ $common_file_name
+  File Header ---------------------------- $common_file_header
+
+Netscape Extended ------------------------ $extended_log
+  File Type ------------------------------ $extended_is_ascii
+  File Name ------------------------------ $extended_file_name
+  File Header ---------------------------- $extended_file_header
+
+Netscape Extended2 ----------------------- $extended2_log
+  File Type ------------------------------ $extended2_is_ascii
+  File Name   ---------------------------- $extended2_file_name
+  File Header ---------------------------- $extended2_file_header
+
+Splitting
+  ICP Log Splitting ---------------------- $icp_log
+  HTTP Host Log Splitting ---------------- $http_host_log
+
+Custom Logs ------------------------------ $custom_log
+
+Rolling ---------------------------------- $rolling
+  Roll Offset Hour ----------------------- $roll_offset_hr
+  Roll Interval -------------------------- $roll_interval s
+  Auto-delete rolled files (low space) --- $auto_delete
+__EOF
+}
+
+
+# Command: show:logging-stats
+#
+sub show_logging_stats {
+  my $log_file_open = get_int("proxy.process.log.log_files_open");
+  my $log_files_space_used = get_int("proxy.process.log.log_files_space_used");
+  my $event_log_access = get_int("proxy.process.log.event_log_access");
+  my $event_log_access_skip = get_int("proxy.process.log.event_log_access_skip");
+  my $event_log_error = get_int("proxy.process.log.event_log_error");
+  
+  print <<__EOF
+Current Open Log Files ----------- $log_file_open
+Space Used For Log Files --------- $log_files_space_used
+Number of Access Events Logged --- $event_log_access
+Number of Access Events Skipped -- $event_log_access_skip
+Number of Error Events Logged ---- $event_log_error
+__EOF
+}
+
+
+# Command: show:parent
+#
+sub show_parent {
+  my $param = shift || "";
+
+  if ($param eq "") {
+    my $parent_enabled = get_on_off("proxy.config.http.parent_proxy_routing_enable");
+    my $parent_cache = get_string("proxy.config.http.parent_proxies");
+
+    print <<__EOF
+Parent Caching -- $parent_enabled
+Parent Cache ---- $parent_cache
+__EOF
+  } elsif ($param eq "rules") {
+    print "parent.config rules\n";
+    print "-------------------\n";
+    print_config("parent.config");
+  } else {
+    param_die($param, "show:parent");
+  }
+}
+
+
+# Command: show:proxy
+#
+sub show_proxy {
+  my $name = get_string("proxy.config.proxy_name");
+  print "Name -- ", $name, "\n";
+}
+
+
+# Command: show:proxy-stats
+#
+sub show_proxy_stats {
+  my $cache_hit_ratio = get_pcnt("proxy.node.cache_hit_ratio");
+  my $cache_hit_mem_ratio = get_pcnt("proxy.node.cache_hit_mem_ratio");
+  my $bandwidth_hit_ratio = get_pcnt("proxy.node.bandwidth_hit_ratio");
+  my $percent_free = get_pcnt("proxy.node.cache.percent_free");
+
+  my $current_server_connection = get_int("proxy.node.current_server_connections");
+  my $current_client_connection = get_int("proxy.node.current_client_connections");
+  my $current_cache_connection = get_int("proxy.node.current_cache_connections");
+
+  my $client_throughput_out = get_float("proxy.node.client_throughput_out");
+  my $xacts_per_second = get_float("proxy.node.user_agent_xacts_per_second");
+  
+  print <<__EOF
+Document Hit Rate -------- $cache_hit_ratio % *
+Ram cache Hit Rate ------- $cache_hit_mem_ratio % *
+Bandwidth Saving --------- $bandwidth_hit_ratio % *
+Cache Percent Free ------- $percent_free %
+Open Server Connections -- $current_server_connection
+Open Client Connections -- $current_client_connection
+Open Cache Connections --- $current_cache_connection
+Client Throughput -------- $client_throughput_out MBit/Sec
+Transaction Per Second --- $xacts_per_second
+
+* Value represents 10 second average.
+__EOF
+}
+
+
+# Command: show:remap
+#
+sub show_remap {
+  print "remap.config rules\n";
+  print "-------------------\n";
+  print_config("remap.config");
+}
+
+
+# Command: show:scheduled-update
+#
+sub show_scheduled_update {
+  my $param = shift || "";
+
+  if ($param eq "") {
+    my $enabled = get_on_off("proxy.config.update.enabled");
+    my $retry_count = get_int("proxy.config.update.retry_count");
+    my $retry_interval = get_int("proxy.config.update.retry_interval");
+    my $concurrent_updates = get_int("proxy.config.update.concurrent_updates");
+    my $force = get_on_off("proxy.config.update.force");
+    
+    print <<__EOF
+Scheduled Update ------------- $enabled
+Update Error Retry Count ----- $retry_count
+Update Error Retry Interval -- $retry_interval s
+Maximum Concurrent Updates --- $concurrent_updates
+Force Immediate Update ------- $force
+__EOF
+  } elsif ($param eq "rules") {
+    print "update.config rules\n";
+    print "-------------------\n";
+    print_config("update.config");
+  } else {
+    param_die($param, "show:scheduled-update");
+  }
+}
+
+
+# Command: show:security
+#
+sub show_security {
+  print "Traffic Server Access\n";
+  print "-------------------\n";
+  print_config("ip_allow.config");
+}
+
+
+# Command: show:socks
+#
+sub show_socks {
+  my $param = shift || "";
+
+  if ($param eq "") {
+    my $socks_enabled = get_on_off("proxy.config.socks.socks_needed");
+    my $version = get_int("proxy.config.socks.socks_version");
+    my $default_servers = get_string("proxy.config.socks.default_servers");
+    my $accept_enabled = get_on_off("proxy.config.socks.accept_enabled");
+    my $accept_port = get_int("proxy.config.socks.accept_port");
+    
+    print <<__EOF
+SOCKS -------------------- $socks_enabled
+SOCKS Version ------------ $version
+SOCKS Default Servers ---- $default_servers
+SOCKS Accept Enabled ----- $accept_enabled
+SOCKS Accept Port -------- $accept_port
+__EOF
+  } elsif ($param eq "rules") {
+    print "socks.config rules\n";
+    print "------------------\n";
+    print_config("socks.config");
+  } else {
+    param_die($param, "show:socks");
+  }
+}
+
+
+# Command: show:ssl
+#
+sub show_ssl {
+  my $connect_ports = get_string("proxy.config.http.connect_ports");
+  print "Restrict CONNECT connections to Ports -- ", $connect_ports, "\n";
+}
+
+
+# Command: show:status
+#
+sub show_status {
+    print "Not implemented, use 'traffic_line --status' instead\n";
+}
+
+
+# Command: show:version
+#
+sub show_version {
+  my $ts_version = get_string("proxy.process.version.server.short");
+  my $tm_version = get_string("proxy.node.version.manager.short");
+
+  print <<__EOF
+traffic_server version --- $ts_version
+traffic_manager version -- $tm_version
+__EOF
+}
+
+
+# Command: show:virtual-ip
+#
+sub show_virtual_ip {
+  print <<__EOF
+Not supported
+__EOF
+}
+
+# Basic help function
+sub help {
+  print <<__EOF
+Usage: traffic_shell <command> [argument]
+
+   show:cache [rules | storage]
+   show:cache-stats
+   show:cluster
+   show:dns-resolver
+   show:dns-stats
+   show:hostdb
+   show:hostdb-stats
+   show:http
+   show:http-stats
+   show:http-trans-stats
+   show:icp [peers]
+   show:icp-stats
+   show:logging
+   show:logging-stats
+   show:parent [rules]
+   show:proxy
+   show:proxy-stats
+   show:remap
+   show:scheduled-update [rules]
+   show:security
+   show:socks [rules]
+   show:ssl
+   show:status
+   show:version
+   show:virtual-ip
+   help
+__EOF
+}
+
+
+#
+# Dispatcher  / command line
+#
+my %COMMANDS = ( "show:alarms", \&show_alarms,
+                 "show:cache", \&show_cache,
+                "show:cache-stats", \&show_cache_stats,
+                "show:cluster",  \&show_cluster,
+                "show:dns-resolver", \&show_dns_resolver,
+                "show:dns-stats", \&show_dns_stats,
+                "show:hostdb", \&show_hostdb,
+                "show:hostdb-stats", \&show_hostdb_stats,
+                "show:http", \&show_http,
+                "show:http-stats", \&show_http_stats,
+                "show:http-trans-stats", \&show_http_trans_stats,
+                "show:icp", \&show_icp,
+                "show:icp-stats", \&show_icp_stats,
+                "show:logging", \&show_logging,
+                "show:logging-stats", \&show_logging_stats,
+                "show:parent", \&show_parent,
+                "show:proxy", \&show_proxy,
+                "show:proxy-stats", \&show_proxy_stats,
+                "show:remap", \&show_remap,
+                "show:scheduled-update", \&show_scheduled_update,
+                "show:security", \&show_security,
+                "show:socks", \&show_socks,
+                "show:ssl", \&show_ssl,
+                "show:status", \&show_status,
+                "show:version", \&show_version,
+                "show:virtual-ip", \&show_virtual_ip,
+                "help", \&help,
+                "show", \&help);
+
+if ($#ARGV >= 0) {
+  my $cmd = shift;
+
+  die "Not valid command: $cmd" unless exists($COMMANDS{$cmd});
+  my $func = $COMMANDS{$cmd};
+
+  $func->(@ARGV);
+} else {
+  use Term::ReadLine;
+  my $term = Term::ReadLine->new('Apache Traffic Server');
+
+  my $prompt = "trafficserver> ";
+  my $OUT = $term->OUT || \*STDOUT;
+
+  while (defined ($_ = $term->readline($prompt))) {
+    chomp;
+    my ($cmd, @args) = split;
+
+    if (exists($COMMANDS{$cmd})) {
+      my $func = $COMMANDS{$cmd};
+      $func->(@args);
+      print "\n";
+    } else {
+      print "invalid command name \"$cmd\"\n";
+    }
+    $term->addhistory($_) if /\S/;
+  }
+}