You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2010/05/13 19:44:13 UTC

svn commit: r943951 [13/19] - in /trafficserver/traffic/tags/2.1.0: ./ ci/ example/add-header/ example/app-template/ example/append-transform/ example/basic-auth/ example/blacklist-0/ example/blacklist-1/ example/bnull-transform/ example/cache_scan/ ex...

Modified: trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/include/INKMgmtAPI.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/include/INKMgmtAPI.h?rev=943951&r1=943950&r2=943951&view=diff
==============================================================================
--- trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/include/INKMgmtAPI.h (original)
+++ trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/include/INKMgmtAPI.h Thu May 13 17:43:56 2010
@@ -27,7 +27,7 @@
  * order to eliminate the interdependencies of other library calls, new
  * types and structs will be defined and used in the wrapper function calls.
  *
- * 
+ *
  ***************************************************************************/
 
 #ifndef __INK_MGMT_API_H__
@@ -437,9 +437,9 @@ typedef enum
   } INKFileNameT;
 
 
-/* Each rule type within a file has its own enumeration. 
- * Need this enumeration because it's possible there are different Ele's used 
- * for rule types within the same file 
+/* Each rule type within a file has its own enumeration.
+ * Need this enumeration because it's possible there are different Ele's used
+ * for rule types within the same file
  */
   typedef enum
   {
@@ -574,7 +574,7 @@ typedef enum
   } INKDomain;
 
 /* there are a variety of secondary specifiers that can be used in a rule; more than
- * one secondary specifier can be used per rule, but a secondary specifier can only 
+ * one secondary specifier can be used per rule, but a secondary specifier can only
  * be used once per rule (eg. time, src_ip, prefix, suffix, port, method, scheme)
  */
   typedef struct
@@ -606,9 +606,9 @@ typedef enum
   } INKPdSsFormat;              /* PdSs = Primary Destination Secondary Specifier */
 
 
-/* Generic Ele struct which is used as first member in all other Ele structs. 
- * The INKCfgContext operations deal with INKCfgEle* type, so must typecast 
- * all Ele's to an INKCfgEle*  
+/* Generic Ele struct which is used as first member in all other Ele structs.
+ * The INKCfgContext operations deal with INKCfgEle* type, so must typecast
+ * all Ele's to an INKCfgEle*
  */
   typedef struct
   {
@@ -632,19 +632,19 @@ typedef enum
     INKConnectT type_con;       /* determines if ports will be opened for TCP or UDP */
     INKIpAddrEle *src_ip_addr;  /* arm-deny rule: the ip address or range of ip addresses that
                                    will be denied access to ports (can be NULL);
-                                   arm-allow rule: the ip address or range of ip addressess 
+                                   arm-allow rule: the ip address or range of ip addressess
                                    specifying the source of communication (can be NULL) */
     INKIpAddrEle *dest_ip_addr; /* destination ip address (can be NULL) */
     INKPortEle *open_ports;     /* open source ports (can be INVALID) */
     INKPortEle *src_ports;      /* source ports (can be INVALID) */
     /* arm-open rule: list of ports/port-ranges to open by default */
-    INKPortEle *dest_ports;     /* the destination port(s) that TCP traffic will be 
+    INKPortEle *dest_ports;     /* the destination port(s) that TCP traffic will be
                                    allowed/denied access to (can be INVALID)  */
     INKIntList src_port_list;   /* alternative for src_ports */
     INKIntList dest_port_list;  /* alternative for dest_ports */
-  } INKArmSecurityEle;          /* + at least of src_ip_addr, dest_ip_addr, dest_ports, 
-                                   src_ports is specified for arm allow rules; 
-                                   + at least of dest_ports or src_ip_addr is specified for arm 
+  } INKArmSecurityEle;          /* + at least of src_ip_addr, dest_ip_addr, dest_ports,
+                                   src_ports is specified for arm allow rules;
+                                   + at least of dest_ports or src_ip_addr is specified for arm
                                    deny rules */
 
 /* bypass.config */
@@ -722,9 +722,9 @@ typedef enum
     int peer_icp_port;          /* port number of the UDP port used by the ICP peer for ICP communication  */
     bool is_multicast;          /* false: multicast not enabled; true: multicast enabled */
     INKIpAddr mc_ip_addr;       /* multicast ip (can be 0 if is_multicast == false */
-    INKMcTtlT mc_ttl;           /* multicast time to live; either IP multicast datagrams will not 
+    INKMcTtlT mc_ttl;           /* multicast time to live; either IP multicast datagrams will not
                                    be forwarded beyond a single subnetwork, or allow delivery
-                                   of IP multicast datagrams to more than one subnet 
+                                   of IP multicast datagrams to more than one subnet
                                    (can be UNDEFINED if is_multicast == false */
   } INKIcpEle;
 
@@ -839,17 +839,17 @@ typedef enum
   } INKRemapEle;
 
 /* socks.config */
-/* INKqa10915: supports two rules types - the first rule type specifies the 
-   IP addresses of origin servers that TS should bypass SOCKS and access 
+/* INKqa10915: supports two rules types - the first rule type specifies the
+   IP addresses of origin servers that TS should bypass SOCKS and access
    directly (this is when ip_addrs is used); the second rule
-   type specifies which SOCKS servers to use for the addresses specified 
-   in dest_ip_addr; so this means that either ip_addrs is specified OR 
+   type specifies which SOCKS servers to use for the addresses specified
+   in dest_ip_addr; so this means that either ip_addrs is specified OR
    dest_ip_addr/socks_servers/rr are */
   typedef struct
   {
     INKCfgEle cfg_ele;
     INKIpAddrList ip_addrs;     /* list of ip addresses to bypass SOCKS server (INK_SOCKS_BYPASS) */
-    INKIpAddrEle *dest_ip_addr; /* ip address(es) that will use the socks server 
+    INKIpAddrEle *dest_ip_addr; /* ip address(es) that will use the socks server
                                    specified in parent_list (INK_SOCKS_MULTIPLE rule) */
     INKDomainList socks_servers;        /* ordered list of SOCKS servers (INK_SOCKS_MULTIPLE rule) */
     INKRrT rr;                  /* possible values are INK_RRT_TRUE (go through proxy
@@ -1013,21 +1013,21 @@ typedef enum
 /*--- allocate/deallocate operations -------------------------------------*/
 /* NOTE:
  * 1) Default values for INKxxEleCreate functions:
- *    - for all lists, default value is INK_INVALID_LIST. NO memory is 
- *      allocated for an Ele's  list type member. The user must 
- *      explicity call the INKxxListCreate() function to initialize it. 
- *    - for char*'s and INKIpAddr the default is NULL (or INK_INVALID_IP_ADDR 
- *      for INKIpAddr's); user must assign allocated memory to initialize any 
+ *    - for all lists, default value is INK_INVALID_LIST. NO memory is
+ *      allocated for an Ele's  list type member. The user must
+ *      explicity call the INKxxListCreate() function to initialize it.
+ *    - for char*'s and INKIpAddr the default is NULL (or INK_INVALID_IP_ADDR
+ *      for INKIpAddr's); user must assign allocated memory to initialize any
  *      string or INKIpAddr members of an INKxxxEle
- * 
- * 2) An Ele corresponds to a rule type in a file; this is why each Ele has an 
- * INKRuleType to identify which type of rule it corresponds to. 
- * For config files which only have one rule type, we can easily set the 
+ *
+ * 2) An Ele corresponds to a rule type in a file; this is why each Ele has an
+ * INKRuleType to identify which type of rule it corresponds to.
+ * For config files which only have one rule type, we can easily set the
  * rule type of the Ele in the EleCreate function since there's only one possible
  * option. However, note that for those config files with more than one rule
  * type, we cannot set the rule type in the EleCreate function since
- * we don't know which rule type the Ele corresponds to yet. Thus, the user must 
- * specify the INKRuleTypeT when he/she creates the Ele. 
+ * we don't know which rule type the Ele corresponds to yet. Thus, the user must
+ * specify the INKRuleTypeT when he/she creates the Ele.
  */
 
   inkapi INKEvent *INKEventCreate();
@@ -1095,7 +1095,7 @@ typedef enum
 
 /* INKIsValid: checks if the fields in the ele are all valid
  * Input:  ele - the ele to check (typecast any of the INKxxxEle's to an INKCfgEle)
- * Output: true if ele has valid fields for its rule type, false otherwise 
+ * Output: true if ele has valid fields for its rule type, false otherwise
  */
   bool INKIsValid(INKCfgEle * ele);
 
@@ -1108,7 +1108,7 @@ typedef enum
  * Input: socket_path - not applicable for local clients
  *                      for remote users, the path to the config directory
  *         (eg. run from bin, socket_path = "../etc/trafficserver")
- * Output: INK_ERR_xx 
+ * Output: INK_ERR_xx
  * Note: If remote client successfully connects, returns INK_ERR_OKAY; but
  *       even if not successful connection (eg. client program is started
  *       before TM) then can still make API calls and will try connecting then
@@ -1127,15 +1127,15 @@ typedef enum
  *         argv - argument array
  * Output: <none>
  * Note: To implement a program as a plugin, need to implement the INKPluginInit
- *       function and then add the plugin's name (eg. test-plugin.so) and argument 
- *       list (if any) to the list in the plugin_mgmt.config file. The location of the 
- *       mgmt plugins should be specified in the records.config variable 
+ *       function and then add the plugin's name (eg. test-plugin.so) and argument
+ *       list (if any) to the list in the plugin_mgmt.config file. The location of the
+ *       mgmt plugins should be specified in the records.config variable
  *       "proxy.config.plugin.plugin_mgmt_dir" (if this directory is a relative
  *       pathname then, it is assumed that it is relative to the root directory
  *       stored in DEFAULT_TS_DIRECTORY_FILE). The default value is "etc/trafficserver/plugins_mgmt",
  *       which tells Traffic Manager to use the directory plugins_mgmt located in the
  *       same directory as records.config. You should place your shared library (*.so)
- *       into the directory you have specified. 
+ *       into the directory you have specified.
  */
   inkexp extern void INKPluginInit(int argc, const char *argv[]);
 
@@ -1156,7 +1156,7 @@ typedef enum
 
 /* INKProxyStateSet: set the proxy state (on/off)
  * Input:  proxy_state - set to on/off
- *         clear - specifies if want to start TS with clear_cache or 
+ *         clear - specifies if want to start TS with clear_cache or
  *                 clear_cache_hostdb option, or just run TS with no options;
  *                  only applies when turning proxy on
  * Output: INKError
@@ -1210,12 +1210,12 @@ typedef enum
  */
   inkapi INKError INKEncryptPassword(char *passwd, char **e_passwd);
 
-/* INKEncryptToFile: Given the plain text password, this function will 
- *                   encrypt the password and stores it to the specified file 
+/* INKEncryptToFile: Given the plain text password, this function will
+ *                   encrypt the password and stores it to the specified file
  * Input: passwd - the plain text password
  *        filepath - the file location to store the encyrpted password
- * Output: INKError  
- * Note: Uses certificate in ACL module for encryption. 
+ * Output: INKError
+ * Note: Uses certificate in ACL module for encryption.
  */
   inkapi INKError INKEncryptToFile(const char *passwd, const char *filepath);
 
@@ -1232,8 +1232,8 @@ typedef enum
  * Input:  file - the config file to write
  *         text - text buffer to write
  *         size - the size of the buffer to write
- *         version - the current version level; new file will have the 
- *                  version number above this one  (if version < 0, then 
+ *         version - the current version level; new file will have the
+ *                  version number above this one  (if version < 0, then
  *                  just uses the next version number in the sequence)
  * Output: INKError
  */
@@ -1322,7 +1322,7 @@ typedef enum
 /* INKRecordGet: gets a record
  * Input:  rec_name - the name of the record (proxy.config.record_name)
  *         rec_val  - allocated INKRecordEle structure, value stored inside
- * Output: INKError (if the rec_name does not exist, returns INK_ERR_FAIL) 
+ * Output: INKError (if the rec_name does not exist, returns INK_ERR_FAIL)
  */
   inkapi INKError INKRecordGet(char *rec_name, INKRecordEle * rec_val);
 
@@ -1330,7 +1330,7 @@ typedef enum
  * Input:  rec_name - the name of the record (proxy.config.record_name)
  *         *_val    - allocated INKRecordEle structure, value stored inside
  * Output: INKError
- * Note: For INKRecordGetString, the function will allocate memory for the 
+ * Note: For INKRecordGetString, the function will allocate memory for the
  *       *string_val, so the caller must free (*string_val);
  */
   inkapi INKError INKRecordGetInt(const char *rec_name, INKInt * int_val);
@@ -1339,7 +1339,7 @@ typedef enum
   inkapi INKError INKRecordGetString(const char *rec_name, INKString * string_val);
 
 /* INKRecordGetMlt: gets a set of records
- * Input:  rec_list - list of record names the user wants to retrieve; 
+ * Input:  rec_list - list of record names the user wants to retrieve;
  *                    resulting gets will be stored in the same list;
  *                    if one get fails, transaction will be aborted
  * Output: INKError
@@ -1360,7 +1360,7 @@ typedef enum
   inkapi INKError INKRecordSetString(const char *rec_name, const char *string_val, INKActionNeedT * action_need);
 
 /* INKRecordSetMlt: sets a set of records
- * Input:  rec_list     - list of record names the user wants to set; 
+ * Input:  rec_list     - list of record names the user wants to set;
  *                        if one set fails, transaction will be aborted
  *         *action_need - indicates which operation required by user for changes to take effect
  * Output: INKError
@@ -1377,7 +1377,7 @@ typedef enum
 /* UNIMPLEMENTED - wait for new alarm processor */
 /* INKEventSignal: enables the user to trigger an event
  * Input:  event_name - "MGMT_ALARM_ADD_ALARM"
- *         ...        - variable argument list of parameters that go 
+ *         ...        - variable argument list of parameters that go
  *                       go into event description when it is signalled
  * Output: INKError
  */
@@ -1391,9 +1391,9 @@ typedef enum
   inkapi INKError INKEventResolve(char *event_name);
 
 /* INKActiveEventGetMlt: query for a list of all the currently active events
- * Input:  active_events - an empty INKList; if function call is successful, 
+ * Input:  active_events - an empty INKList; if function call is successful,
  *                         active_events will contain names of the currently
- *                         active events 
+ *                         active events
  * Output: INKError
  */
   inkapi INKError INKActiveEventGetMlt(INKList active_events);
@@ -1420,7 +1420,7 @@ typedef enum
 /* INKEventSignalCbUnregister: unregister a callback for a specific event
  *                             or for any event
  * Input: event_name - the name of event to unregister callback for;
- *                     if NULL, the callback is unregistered for all events 
+ *                     if NULL, the callback is unregistered for all events
  *         func       - callback function
  * Output: INKError
  */
@@ -1429,9 +1429,9 @@ typedef enum
 
 /*--- abstracted file operations ------------------------------------------*/
 /* INKCfgContextCreate: allocates memory for an empty INKCfgContext for the specified file
- * Input:  file - the file 
+ * Input:  file - the file
  * Output: INKCfgContext
- * Note: This function does not read the current rules in the file into 
+ * Note: This function does not read the current rules in the file into
  * the INKCfgContext (must call INKCfgContextGet to do this). If you
  * do not call INKCfgContextGet before calling INKCfgContextCommit, then
  * you will overwite all the old rules in the config file!
@@ -1454,54 +1454,54 @@ typedef enum
   inkapi INKError INKCfgContextCommit(INKCfgContext ctx, INKActionNeedT * action_need, INKIntList errRules);
 
 
-/* INKCfgContextGet: retrieves all the Ele's for the file specified in the ctx and 
- *                puts them into ctx; note that the ele's in the INKCfgContext don't 
- *                all have to be of the same ele type 
+/* INKCfgContextGet: retrieves all the Ele's for the file specified in the ctx and
+ *                puts them into ctx; note that the ele's in the INKCfgContext don't
+ *                all have to be of the same ele type
  * Input: ctx - where all the most currfile's eles are stored
  * Output: INKError
- * 
+ *
  */
   inkapi INKError INKCfgContextGet(INKCfgContext ctx);
 
 
 /*--- INKCfgContext Operations --------------------------------------------*/
-/* 
- * These operations are used to manipulate the opaque INKCfgContext type, 
+/*
+ * These operations are used to manipulate the opaque INKCfgContext type,
  * eg. when want to modify a file
  */
 
-/* INKCfgContextGetCount: returns number of Ele's in the INKCfgContext 
+/* INKCfgContextGetCount: returns number of Ele's in the INKCfgContext
  * Input:  ctx - the INKCfgContext to count the number of ele's in
- * Output: the number of Ele's 
+ * Output: the number of Ele's
  */
   int INKCfgContextGetCount(INKCfgContext ctx);
 
-/* INKCfgContextGetEleAt: retrieves the Ele at the specified index; user must 
- *                        typecast the INKCfgEle to appropriate INKEle before using 
+/* INKCfgContextGetEleAt: retrieves the Ele at the specified index; user must
+ *                        typecast the INKCfgEle to appropriate INKEle before using
  * Input:  ctx   - the INKCfgContext to retrieve the ele from
  *         index - the Ele position desired; first Ele located at index 0
- * Output: the Ele (typecasted as an INKCfgEle) 
+ * Output: the Ele (typecasted as an INKCfgEle)
  */
   INKCfgEle *INKCfgContextGetEleAt(INKCfgContext ctx, int index);
 
-/* INKCfgContextGetFirst: retrieves the first Ele in the INKCfgContext  
- * Input:  ctx   - the INKCfgContext 
- *         state - the current position in the Ele that the iterator is at 
+/* INKCfgContextGetFirst: retrieves the first Ele in the INKCfgContext
+ * Input:  ctx   - the INKCfgContext
+ *         state - the current position in the Ele that the iterator is at
  * Output: returns first Ele in the ctx (typecasted as an INKCfgEle)
  */
   INKCfgEle *INKCfgContextGetFirst(INKCfgContext ctx, INKCfgIterState * state);
 
 /* INKCfgContextGetNext: retrieves the next ele in the ctx that's located after
  *                       the one pointed to by the INKCfgIterState
- * Input:  ctx   - the INKCfgContext 
- *         state - the current position in the Ele that the iterator is at 
+ * Input:  ctx   - the INKCfgContext
+ *         state - the current position in the Ele that the iterator is at
  * Output: returns the next Ele in the ctx (typecasted as an INKCfgEle)
  */
   INKCfgEle *INKCfgContextGetNext(INKCfgContext ctx, INKCfgIterState * state);
 
 /* INKCfgContextMoveEleUp: shifts the Ele at the specified index one position up;
  *                         does nothing if Ele is at first position in the INKCfgContext
- * Input:  ctx   - the INKCfgContext 
+ * Input:  ctx   - the INKCfgContext
  *         index - the position of the Ele that needs to be shifted up
  * Output: INKError
  */
@@ -1509,44 +1509,44 @@ typedef enum
 
 /* INKCfgContextMoveEleDown: shifts the Ele at the specified index one position down;
  *                           does nothing if Ele is last in the INKCfgContext
- * Input:  ctx   - the INKCfgContext 
+ * Input:  ctx   - the INKCfgContext
  *         index - the position of the Ele that needs to be shifted down
  * Output: INKError
  */
   INKError INKCfgContextMoveEleDown(INKCfgContext ctx, int index);
 
 /* INKCfgContextAppendEle: apppends the ele to the end of the INKCfgContext
- * Input:  ctx   - the INKCfgContext 
+ * Input:  ctx   - the INKCfgContext
  *         ele - the Ele (typecasted as an INKCfgEle) to append to ctx
  * Output: INKError
- * Note: When appending the ele to the INKCfgContext, this function does NOT 
+ * Note: When appending the ele to the INKCfgContext, this function does NOT
  *       make a copy of the ele passed in; it uses the same memory! So you probably
- *       do not want to append the ele and then free the memory for the ele 
+ *       do not want to append the ele and then free the memory for the ele
  *       without first removing the ele from the INKCfgContext
  */
   INKError INKCfgContextAppendEle(INKCfgContext ctx, INKCfgEle * ele);
 
 /* INKCfgContextInsertEleAt: inserts the ele at the specified index
- * Input:  ctx   - the INKCfgContext 
+ * Input:  ctx   - the INKCfgContext
  *         ele   - the Ele (typecasted as an INKCfgEle) to insert into ctx
  *         index - the position in ctx to insert the Ele
  * Output: INKError
- * Note: When inserting the ele into the INKCfgContext, this function does NOT 
+ * Note: When inserting the ele into the INKCfgContext, this function does NOT
  *       make a copy of the ele passed in; it uses the same memory! So you probably
- *       do not want to insert the ele and then free the memory for the ele 
- *       without first removing the ele from the INKCfgContext 
+ *       do not want to insert the ele and then free the memory for the ele
+ *       without first removing the ele from the INKCfgContext
  */
   INKError INKCfgContextInsertEleAt(INKCfgContext ctx, INKCfgEle * ele, int index);
 
 /* INKCfgContextRemoveEleAt: removes the Ele at the specified index from the INKCfgContext
- * Input:  ctx   - the INKCfgContext 
+ * Input:  ctx   - the INKCfgContext
  *         index - the position of the Ele in the ctx to remove
  * Output: INKError
  */
   INKError INKCfgContextRemoveEleAt(INKCfgContext ctx, int index);
 
   /* INKCfgContextRemoveAll: removes all Eles from the INKCfgContext
-   * Input:  ctx   - the INKCfgContext 
+   * Input:  ctx   - the INKCfgContext
    * Output: INKError
    */
   INKError INKCfgContextRemoveAll(INKCfgContext ctx);
@@ -1554,7 +1554,7 @@ typedef enum
 /*--- INK Cache Inspector Operations --------------------------------------------*/
 
 /* INKLookupFromCacheUrl
- *   Function takes an url and an 'info' buffer as input, 
+ *   Function takes an url and an 'info' buffer as input,
  *   lookups cache information of the url and saves the
  *   cache info to the info buffer
  */
@@ -1589,9 +1589,9 @@ typedef enum
 
   inkapi INKError INKInvalidateFromCacheUrlRegex(INKString url_regex, INKString * list);
 
-/* These functions support the network configuration functionality 
+/* These functions support the network configuration functionality
  * For each change of hostname, gateway, dns servers, and nick configurations
- * we should use these APIs to accomodate for it in TS, TM 
+ * we should use these APIs to accomodate for it in TS, TM
  ******************************************************************/
   /* rmserver.cfg */
 

Modified: trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/APITestCliRemote.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/APITestCliRemote.cc?rev=943951&r1=943950&r2=943951&view=diff
==============================================================================
--- trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/APITestCliRemote.cc (original)
+++ trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/APITestCliRemote.cc Thu May 13 17:43:56 2010
@@ -24,8 +24,8 @@
 /*****************************************************************************
  * Filename: APITestCliRemote.cc
  * Purpose: An interactive cli to test remote mgmt API; UNIT TEST for mgmtAPI
- * Created: lant 
- * 
+ * Created: lant
+ *
  ***************************************************************************/
 
 /***************************************************************************
@@ -34,7 +34,7 @@
  * Control Operations:
  * -------------------
  * state:   returns ON (proxy is on) or OFF (proxy is off)
- * start:<tsArgs>  -   turns Proxy on, the tsArgs is optional; 
+ * start:<tsArgs>  -   turns Proxy on, the tsArgs is optional;
  *                     it can either be  "hostdb" or "all",
  *                 eg. start, start:hostdb, start:all
  * stop:    turns Proxy off
@@ -46,7 +46,7 @@
  * read_file:  reads filter.config file
  * write_file: write some made-up text to filter.config file
  * proxy.config.xxx (a records.config variable): returns value of that record
- * records: tests get/set/get a record of each different type 
+ * records: tests get/set/get a record of each different type
  *          (int, float, counter, string)
  * err_recs: stress test record get/set functions by purposely entering
  *              invalid record names and/or values
@@ -54,24 +54,24 @@
  * set_mlt: tests INKRecordSetMlt
  *
  * read_url: tests INKReadFromUrl works by retrieving two valid urls
- * test_url: tests robustness of INKReadFromUrl using invalid urls 
+ * test_url: tests robustness of INKReadFromUrl using invalid urls
  *
  * CfgContext operations:
  * ---------------------
  * cfg_get:<config-filename>: prints out the rules in confg-filename
- * cfg:<config-filename>: switches the position of first and last rule of 
+ * cfg:<config-filename>: switches the position of first and last rule of
  *                        <config-filename>
  * cfg_context: calls all the INKCfgCOntext helper function calls using
  *              vaddrs.config
  * cfg_socks: does some basic testing of socks.config (reads in file,
  *            modifies it, eg. add new rules, then commits changes)
- * 
+ *
  * Event Operations:
- * ---------------- 
+ * ----------------
  * active_events: lists the names of all currently active events
- * MGMT_ALARM_xxx (event_name specified in CoreAPIShared.h or Alarms.h): 
+ * MGMT_ALARM_xxx (event_name specified in CoreAPIShared.h or Alarms.h):
  *                 resolves the specified event
- * register: registers a generic callback (=eventCallbackFn) which 
+ * register: registers a generic callback (=eventCallbackFn) which
  *           prints out the event name whenever an event is signalled
  * unregister: unregisters the generic callback function eventCallbackFn
  *
@@ -124,7 +124,7 @@
 /* ------------------------------------------------------------------------
  * print_err
  * ------------------------------------------------------------------------
- * used to print the error description associated with the INKError err 
+ * used to print the error description associated with the INKError err
  */
 void
 print_err(const char *module, INKError err)
@@ -388,7 +388,7 @@ print_pd_sspec(INKPdSsFormat info)
 
 //
 // Ele printing functions
-// 
+//
 
 void
 print_admin_access_ele(INKAdminAccessEle * ele)
@@ -532,7 +532,7 @@ print_cache_ele(INKCacheEle * ele)
 
   /*
      print_pd_sspec(ele->cache_info);
-     printf("Time: %d day, %d hr, %d min, %d sec\n", ele->time_period.d, ele->time_period.h, 
+     printf("Time: %d day, %d hr, %d min, %d sec\n", ele->time_period.d, ele->time_period.h,
      ele->time_period.m, ele->time_period.s);
    */
   return;
@@ -960,11 +960,11 @@ print_vaddrs_ele(INKVirtIpAddrEle * ele)
   printf("ip=%s, intr=%s, sub_intr=%d\n", ele->ip_addr, ele->intr, ele->sub_intr);
 }
 
-// 
+//
 // print_ele_list
 //
 // prints a list of Ele's
-// 
+//
 
 void
 print_ele_list(INKFileNameT file, INKCfgContext ctx)
@@ -1222,7 +1222,7 @@ test_error_records()
  * test_records
  * ------------------------------------------------------------------------
  * stress test record functionality by getting and setting different
- * records types; use the #defines defined above to determine which 
+ * records types; use the #defines defined above to determine which
  * type of tests you'd like turned on/off
  */
 void
@@ -1275,7 +1275,7 @@ test_records()
 #endif
 
 #if TEST_STRING
-  // retrieve an string value record using GetString  
+  // retrieve an string value record using GetString
   err = INKRecordGetString("proxy.config.proxy_name", &rec_value);
   if (err != INK_ERR_OKAY)
     print_err("INKRecordGetString", err);
@@ -1291,7 +1291,7 @@ test_records()
     printf("[INKRecordSetString] proxy.config.proxy_name=%s\n", new_str);
 
 
-  // get 
+  // get
   err = INKRecordGetString("proxy.config.proxy_name", &rec_value);
   if (err != INK_ERR_OKAY)
     print_err("INKRecordGetString", err);
@@ -1423,7 +1423,7 @@ test_rec_get(char *rec_name)
 /* ------------------------------------------------------------------------
  * test_record_get_mlt
  * ------------------------------------------------------------------------
- * Creates a list of record names to retrieve, and then batch request to 
+ * Creates a list of record names to retrieve, and then batch request to
  * get list of records
  */
 void
@@ -1512,7 +1512,7 @@ test_record_get_mlt(void)
     INKRecordEleDestroy(rec_ele);
   }
 
-  INKListDestroy(rec_list);     // must dequeue and free each string individually  
+  INKListDestroy(rec_list);     // must dequeue and free each string individually
 
   return;
 }
@@ -1521,7 +1521,7 @@ test_record_get_mlt(void)
  * test_record_set_mlt
  * ------------------------------------------------------------------------
  * Creates a list of INKRecordEle's, and then batch request to set records
- * Also checks to make sure correct action_need type is set. 
+ * Also checks to make sure correct action_need type is set.
  */
 void
 test_record_set_mlt(void)
@@ -1692,7 +1692,7 @@ test_read_file()
 /* ------------------------------------------------------------------------
  * test_write_file
  * ------------------------------------------------------------------------
- * writes filter.config with some garbage text then reads the file and 
+ * writes filter.config with some garbage text then reads the file and
  * prints the new file to stdout
  */
 void
@@ -1796,7 +1796,7 @@ test_cfg_context_get(char *args)
   return;
 }
 
-// 
+//
 // tests the INKCfgContextMoveEleUp/Down functions (which end up calling
 // the new "copy" utility functions in CfgContextUtils.cc
 // depending on the file specified, this will move the top rule to the bottom,
@@ -1875,7 +1875,7 @@ test_cfg_context_move(char *args)
     }
   }
 
-  // shift all the ele's down so that the next to bottom ele is now top ele 
+  // shift all the ele's down so that the next to bottom ele is now top ele
   // move all ele's above the last ele down; bottom ele becomes top ele
   printf("\nShift all Ele's above second to last ele down; bottom ele becomes top ele\n");
   for (i = count - 3; i >= 0; i--) {
@@ -1919,7 +1919,7 @@ test_cfg_context_ops()
   printf("# ele's = %d\n", count);
 
   printf("\nShifted all Ele's < %d up\n", rm_index);
-  // move all ele's below rm_index up one; this shifts the rm_index ele to 
+  // move all ele's below rm_index up one; this shifts the rm_index ele to
   // bottom of INKCfgContext
   for (i = (rm_index + 1); i < count; i++) {
     err = INKCfgContextMoveEleUp(ctx, i);
@@ -1945,7 +1945,7 @@ test_cfg_context_ops()
     goto END;
   }
 
-  // append a new ele 
+  // append a new ele
   printf("\nappend new ele\n");
   ele = INKVirtIpAddrEleCreate();
   if (ele) {
@@ -1968,7 +1968,7 @@ test_cfg_context_ops()
   //print_VirtIpAddr_ele_list(ctx);
 
   insert_at = 1;
-  // insert a new ele in insert_at index 
+  // insert a new ele in insert_at index
   printf("\nINSERT NEW ELE at %d index\n", insert_at);
   ele = INKVirtIpAddrEleCreate();
   if (ele) {
@@ -2213,13 +2213,13 @@ check_active(char *event_name)
 /* ------------------------------------------------------------------------
  * try_resolve
  * ------------------------------------------------------------------------
- * checks if the event_name is still unresolved; if it is, it then 
+ * checks if the event_name is still unresolved; if it is, it then
  * resolves it, and checks the status of the event again to make sure
  * the event was actually resolved
- * 
+ *
  * NOTE: all the special string manipulation is needed because the CLI
  * appends extra newline character to end of the user input; normally
- * do not have to do all this special string manipulation 
+ * do not have to do all this special string manipulation
  */
 void
 try_resolve(char *event_name)
@@ -2274,7 +2274,7 @@ register_event_callback(void)
  * unregister_event_callback
  * ------------------------------------------------------------------------
  * unregisters the eventCallbackFn above for all events; this just means
- * that it will remove this eventCallbackFn entirely so that for any 
+ * that it will remove this eventCallbackFn entirely so that for any
  * event called, the eventCallbackFn will NOT be called
  */
 void
@@ -2395,7 +2395,7 @@ test_diags()
  * Statistics
  ***************************************************************************/
 
-// generate dummy values for statistics 
+// generate dummy values for statistics
 void
 set_stats()
 {
@@ -2686,7 +2686,7 @@ runInteractive()
 /* ------------------------------------------------------------------------
  * main
  * ------------------------------------------------------------------------
- * Main entry point which connects the client to the API, does any 
+ * Main entry point which connects the client to the API, does any
  * clean up on exit, and gets the interactive command-line running
  */
 int
@@ -2694,7 +2694,7 @@ main(int argc, char **argv)
 {
   INKError ret;
 
-  // initialize 
+  // initialize
 #if INSTALL_TEST
   if ((ret = INKInit("../etc/trafficserver/")) != INK_ERR_OKAY)
 #else
@@ -2708,7 +2708,7 @@ main(int argc, char **argv)
   // Interactive mode
   runInteractive();
 
-  // clean-up 
+  // clean-up
   INKTerminate();               //ERROR:Causes infinite!!
   printf("END REMOTE API TEST\n");
 

Modified: trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/CoreAPIRemote.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/CoreAPIRemote.cc?rev=943951&r1=943950&r2=943951&view=diff
==============================================================================
--- trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/CoreAPIRemote.cc (original)
+++ trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/CoreAPIRemote.cc Thu May 13 17:43:56 2010
@@ -25,15 +25,15 @@
  * Filename: CoreAPIRemote.cc
  * Purpose: Implementation of CoreAPI.h interface but from remote client
  *          perspective, so must also add networking calls. Basically, any
- *          INKMgmtAPI calls which are "special" for remote clients 
+ *          INKMgmtAPI calls which are "special" for remote clients
  *          need to be implemented here.
  * Note: For remote implementation of this interface, most functions will:
  *  1) marshal: create the message to send across network
  *  2) connect and send request
- *  3) unmarshal: parse the reply (checking for INKError) 
+ *  3) unmarshal: parse the reply (checking for INKError)
+ *
+ * Created: lant
  *
- * Created: lant 
- * 
  ***************************************************************************/
 
 #include "ink_config.h"
@@ -55,7 +55,7 @@
 #define DEFAULT_LOG_DIRECTORY             "var/log/trafficserver"
 #define DEFAULT_TS_DIRECTORY_FILE         PREFIX "/etc/traffic_server"
 
-// extern variables 
+// extern variables
 extern CallbackTable *remote_event_callbacks;   // from EventRegistration
 extern int main_socket_fd;      // from NetworkUtils
 extern int event_socket_fd;
@@ -69,7 +69,7 @@ bool start_binary(const char *abs_bin_pa
 char *get_root_dir();
 
 // global variables
-// need to store the thread id associated with socket_test_thread 
+// need to store the thread id associated with socket_test_thread
 // in case we want to  explicitly stop/cancel the testing thread
 ink_thread ink_test_thread;
 
@@ -80,7 +80,7 @@ ink_thread ink_test_thread;
  * send_and_parse_basic (helper function)
  *-------------------------------------------------------------------------
  * helper function used by operations which only require sending a simple
- * operation type and parsing a simple error return value 
+ * operation type and parsing a simple error return value
  */
 INKError
 send_and_parse_basic(OpType op)
@@ -100,7 +100,7 @@ send_and_parse_basic(OpType op)
  * send_and_parse_list (helper function)
  *-------------------------------------------------------------------------
  * helper function used by operations which only require sending a simple
- * operation type and parsing a string delimited list 
+ * operation type and parsing a string delimited list
  * (delimited with REMOTE_DELIM_STR) and storing the tokens in the list
  * parameter
  */
@@ -121,7 +121,7 @@ send_and_parse_list(OpType op, LLQ * lis
   if (ret != INK_ERR_OKAY)
     return ret;
 
-  // parse the reply = delimited list of ids of active event names 
+  // parse the reply = delimited list of ids of active event names
   ret = parse_reply_list(main_socket_fd, &list_str);
   if (ret != INK_ERR_OKAY)
     return ret;
@@ -148,7 +148,7 @@ send_and_parse_list(OpType op, LLQ * lis
  *-------------------------------------------------------------------------
  * helper function used by operations which only require sending a simple
  * operation type with one string name argument and then parsing a simple
- * INKError reply 
+ * INKError reply
  * NOTE: name can be a NULL parameter!
  */
 INKError
@@ -161,7 +161,7 @@ send_and_parse_name(OpType op, char *nam
   if (ret != INK_ERR_OKAY)
     return ret;
 
-  // parse the reply 
+  // parse the reply
   ret = parse_reply(main_socket_fd);
 
   return ret;
@@ -172,11 +172,11 @@ send_and_parse_name(OpType op, char *nam
  * mgmt_record_set (helper function)
  *-------------------------------------------------------------------------
  * Helper function for all Set functions:
- * NOTE: regardless of the type of the record being set, 
- * it is converted to a string. Then on the local side, the 
- * CoreAPI::MgmtRecordSet function will do the appropriate type 
+ * NOTE: regardless of the type of the record being set,
+ * it is converted to a string. Then on the local side, the
+ * CoreAPI::MgmtRecordSet function will do the appropriate type
  * converstion from the string to the record's type (eg. MgmtInt, MgmtString..)
- * Hence, on the local side, don't have to worry about typecasting a  
+ * Hence, on the local side, don't have to worry about typecasting a
  * void*. Just read out the string from socket and pass it MgmtRecordSet.
  */
 INKError
@@ -210,7 +210,7 @@ bool
 start_binary(const char *abs_bin_path)
 {
   INKDiags(INK_DIAG_NOTE, "[start_binary] abs_bin_path = %s", abs_bin_path);
-  // before doing anything, check for existence of binary and its execute 
+  // before doing anything, check for existence of binary and its execute
   // permissions
   if (access(abs_bin_path, F_OK) < 0) {
     // ERROR: can't find binary
@@ -236,8 +236,8 @@ start_binary(const char *abs_bin_path)
  * get_root_dir
  *-------------------------------------------------------------------------
  * This function retrieves the root directory path from DEFAULT_TS_DIRECTORY_FILE
- * file. If there is no DEFAULT_TS_DIRECTORY_FILE file to be found, returns NULL 
- * (copied from TrafficCop.cc). The string returned is NOT ALLOCATED. 
+ * file. If there is no DEFAULT_TS_DIRECTORY_FILE file to be found, returns NULL
+ * (copied from TrafficCop.cc). The string returned is NOT ALLOCATED.
  * Used by HardRestart to determine full path of start/stop_traffic_server scripts.
  */
 #ifndef _WIN32
@@ -267,7 +267,7 @@ get_root_dir()
     }
     root_dir[i] = '\0';
   } else {
-    ink_strncpy(root_dir, "/usr/local", sizeof(root_dir));
+    ink_strncpy(root_dir, PREFIX, sizeof(root_dir));
   }
 
   if (root_dir[0] == '\0')
@@ -307,7 +307,7 @@ Init(const char *socket_path)
 
   // need to ignore SIGPIPE signal; in the case that TM is restarted
   signal(SIGPIPE, SIG_IGN);
-  signal(SIGUSR1, terminate_signal);    // for cancelling socket_test_thread 
+  signal(SIGUSR1, terminate_signal);    // for cancelling socket_test_thread
 
   // EVENT setup - initialize callback queue
   remote_event_callbacks = create_callback_table("remote_callbacks");
@@ -315,8 +315,8 @@ Init(const char *socket_path)
     return INK_ERR_SYS_CALL;
 
   // try to connect to traffic manager
-  // do this last so that everything else on client side is set up even if 
-  // connection fails; this might happen if client is set up and running 
+  // do this last so that everything else on client side is set up even if
+  // connection fails; this might happen if client is set up and running
   // before TM
   err = ts_connect();
   if (err != INK_ERR_OKAY)
@@ -327,14 +327,14 @@ Init(const char *socket_path)
 
 END:
 
-  // create thread that periodically checks the socket connection 
+  // create thread that periodically checks the socket connection
   // with TM alive - reconnects if not alive
   ink_test_thread = ink_thread_create(socket_test_thread, NULL);
   return err;
 
 }
 
-// does clean up for remote API client; destroy structures and disconnects 
+// does clean up for remote API client; destroy structures and disconnects
 INKError
 Terminate()
 {
@@ -348,10 +348,10 @@ Terminate()
     return err;
 
   // cancel the listening socket thread
-  // it's important to call this before setting paths to NULL because the 
+  // it's important to call this before setting paths to NULL because the
   // socket_test_thread actually will try to reconnect() and this funntion
   // will seg fault if the socket paths are NULL while it is connecting;
-  // the thread will be cancelled at a cancellation point in the 
+  // the thread will be cancelled at a cancellation point in the
   // socket_test_thread, eg. sleep
   ink_thread_cancel(ink_test_thread);
 
@@ -360,7 +360,7 @@ Terminate()
   return INK_ERR_OKAY;
 }
 
-// ONLY have very basic diag functionality for remote cliets. 
+// ONLY have very basic diag functionality for remote cliets.
 // When a remote client tries to use diags (wants to output runtime
 // diagnostics, the diagnostics will be outputted to the machine
 // the remote client is logged into (the one TM is running on)
@@ -619,10 +619,10 @@ MgmtRecordSetString(const char *rec_name
  * Input:   file - the config file to read
  *          text - a buffer is allocated on the text char* pointer
  *          size - the size of the buffer is returned
- * Output:  
- *  
+ * Output:
+ *
  * Marshals a read file request that can be sent over the unix domain socket.
- * Connects to the socket and sends request over. Parses the response from 
+ * Connects to the socket and sends request over. Parses the response from
  * Traffic Manager.
  */
 INKError
@@ -645,15 +645,15 @@ ReadFile(INKFileNameT file, char **text,
 /*-------------------------------------------------------------------------
  * WriteFile
  *-------------------------------------------------------------------------
- * Purpose: replaces the current file with the file passed in; 
+ * Purpose: replaces the current file with the file passed in;
  *  does forceUpdate for Rollback and FileManager so correct file
  *  versioning is maintained
  * Input: file - the config file to write
  *        text - text buffer to write
- *        size - the size of the buffer to write 
+ *        size - the size of the buffer to write
  *
  * Marshals a write file request that can be sent over the unix domain socket.
- * Connects to the socket and sends request over. Parses the response from 
+ * Connects to the socket and sends request over. Parses the response from
  * Traffic Manager.
  */
 INKError
@@ -745,11 +745,11 @@ EventIsActive(char *event_name, bool * i
 /*-------------------------------------------------------------------------
  * EventSignalCbRegister
  *-------------------------------------------------------------------------
- * Adds the callback function in appropriate places in the remote side 
+ * Adds the callback function in appropriate places in the remote side
  * callback table.
  * If this is the first callback to be registered for a certain event type,
  * then sends a callback registration notification to TM so that TM will know
- * which events have remote callbacks registered on it. 
+ * which events have remote callbacks registered on it.
  */
 INKError
 EventSignalCbRegister(char *event_name, INKEventSignalFunc func, void *data)
@@ -777,15 +777,15 @@ EventSignalCbRegister(char *event_name, 
 /*-------------------------------------------------------------------------
  * EventSignalCbUnregister
  *-------------------------------------------------------------------------
- * Removes the callback function from the remote side callback table. 
+ * Removes the callback function from the remote side callback table.
  * After removing the callback function, needs to check which events now
  * no longer have any callbacks registered at all; sends an unregister callback
- * notification to TM so that TM knows that that event doesn't have any 
- * remote callbacks registered for it 
- * Input: event_name - the event to unregister the callback from; if NULL, 
+ * notification to TM so that TM knows that that event doesn't have any
+ * remote callbacks registered for it
+ * Input: event_name - the event to unregister the callback from; if NULL,
  *                     unregisters the specified func from all events
- *        func       - the callback function to unregister; if NULL, then 
- *                     unregisters all callback functions for the event_name 
+ *        func       - the callback function to unregister; if NULL, then
+ *                     unregisters all callback functions for the event_name
  *                     specified
  */
 INKError
@@ -853,7 +853,7 @@ StatsReset()
  * EncryptToFile
  *-------------------------------------------------------------------------
  * Encrypts the password and stores the encrypted password in the
- * location specified by "filepath"  
+ * location specified by "filepath"
  */
 INKError
 EncryptToFile(const char *passwd, const char *filepath)

Modified: trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/EventRegistration.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/EventRegistration.cc?rev=943951&r1=943950&r2=943951&view=diff
==============================================================================
--- trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/EventRegistration.cc (original)
+++ trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/EventRegistration.cc Thu May 13 17:43:56 2010
@@ -23,12 +23,12 @@
 
 /*****************************************************************************
  * Filename: EventRegistration.cc
- * Purpose: This file contains functions and structures used in event 
- *          notification and callbacks for remote clients; also has the 
+ * Purpose: This file contains functions and structures used in event
+ *          notification and callbacks for remote clients; also has the
  *          thread that services event notification.
  * Created: 2/15/01
- * 
- * 
+ *
+ *
  ***************************************************************************/
 
 #include "inktomi++.h"
@@ -54,21 +54,21 @@ CallbackTable *remote_event_callbacks;
 
 /**********************************************************************
  * event_poll_thread_main
- * 
- * purpose: thread listens on the client's event socket connection; 
- *          only reads from the event_socket connection and  
- *          processes EVENT_NOTIFY messages; each time client 
+ *
+ * purpose: thread listens on the client's event socket connection;
+ *          only reads from the event_socket connection and
+ *          processes EVENT_NOTIFY messages; each time client
  *          makes new event-socket connection to TM, must launch
- *          a new event_poll_thread_main thread 
+ *          a new event_poll_thread_main thread
  * input:   arg - contains the socket_fd to listen on
  * output:  NULL - if error
  * notes:   each time the client's socket connection to TM is reset
- *          a new thread will be launched as old one dies; there are 
+ *          a new thread will be launched as old one dies; there are
  *          only two places where a new thread is created:
  *          1) when client first connects (INKInit call)
  *          2) client reconnects() due to a TM restart
  * Uses blocking socket; so blocks until receives an event notification.
- * Shouldn't need to use select since only waiting for a notification 
+ * Shouldn't need to use select since only waiting for a notification
  * message from event_callback_main thread!
  **********************************************************************/
 void *
@@ -165,7 +165,7 @@ event_callback_thread(void *arg)
     (*cb) (event_notice->name, event_notice->description, event_notice->priority, NULL);
   }
 
-  // clean up event notice 
+  // clean up event notice
   INKEventDestroy(event_notice);
   delete_queue(func_q);
 

Modified: trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/EventRegistration.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/EventRegistration.h?rev=943951&r1=943950&r2=943951&view=diff
==============================================================================
--- trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/EventRegistration.h (original)
+++ trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/EventRegistration.h Thu May 13 17:43:56 2010
@@ -26,7 +26,7 @@
  * Purpose: This file contains sturctures intended for event notification
  * Created: 8/8/00
  * Created by: Stephanie Song
- * 
+ *
  ***************************************************************************/
 
 #ifndef _EVENT_REGISTRATION_H

Modified: trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/NetworkUtilsRemote.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/NetworkUtilsRemote.cc?rev=943951&r1=943950&r2=943951&view=diff
==============================================================================
--- trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/NetworkUtilsRemote.cc (original)
+++ trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/NetworkUtilsRemote.cc Thu May 13 17:43:56 2010
@@ -23,13 +23,13 @@
 
 /*****************************************************************************
  * Filename: NetworkUtilsRemote.cc
- * Purpose: This file contains functions used by remote api client to 
+ * Purpose: This file contains functions used by remote api client to
  *          marshal requests to TM and unmarshal replies from TM.
  *          Also stores the information about the client's current
  *          socket connection to Traffic Manager
  * Created: 8/9/00
- * 
- * 
+ *
+ *
  ***************************************************************************/
 
 #include "ink_config.h"
@@ -47,8 +47,8 @@ int main_socket_fd = -1;
 int event_socket_fd = -1;
 
 // need to store for reconnecting scenario
-char *main_socket_path = NULL;  // "<path>/mgmtapisocket" 
-char *event_socket_path = NULL; // "<path>/eventapisocket" 
+char *main_socket_path = NULL;  // "<path>/mgmtapisocket"
+char *event_socket_path = NULL; // "<path>/eventapisocket"
 
 /**********************************************************************
  * Socket Helper Functions
@@ -158,7 +158,7 @@ ts_connect()
     //fprintf(stderr, "[connect] ERROR: can't open socket\n");
     goto ERROR;                 // ERROR - can't open socket
   }
-  // setup Unix domain socket 
+  // setup Unix domain socket
   memset(&client_sock, 0, sizeof(sockaddr_un));
   client_sock.sun_family = AF_UNIX;
   ink_strncpy(client_sock.sun_path, main_socket_path, sizeof(client_sock.sun_path));
@@ -260,7 +260,7 @@ reconnect()
     return err;
 
   // use the socket_path that was called by remote client on first init
-  // use connect instead of INKInit() b/c if TM restarted, client-side tables 
+  // use connect instead of INKInit() b/c if TM restarted, client-side tables
   // would be recreated; just want to reconnect to same socket_path
   err = ts_connect();
   if (err != INK_ERR_OKAY)      // problem establishing connection
@@ -280,12 +280,12 @@ reconnect()
 /***************************************************************************
  * reconnect_loop
  *
- * purpose: attempts to reconnect to TM (eg. when TM restarts) for the 
+ * purpose: attempts to reconnect to TM (eg. when TM restarts) for the
  *          specified number of times
  * input:  num_attempts - number of reconnection attempts to try before quit
  * output: INK_ERR_OKAY - if succesfully reconnected within num_attempts
  *         INK_ERR_xx - the reason the reconnection failed
- * notes: 
+ * notes:
  ***************************************************************************/
 INKError
 reconnect_loop(int num_attempts)
@@ -300,7 +300,7 @@ reconnect_loop(int num_attempts)
       //fprintf(stderr, "[reconnect_loop] Successful reconnction; Leave loop\n");
       return INK_ERR_OKAY;      // successful connection
     }
-    sleep(1);                   // to make it slower  
+    sleep(1);                   // to make it slower
   }
 
   //fprintf(stderr, "[reconnect_loop] FAIL TO CONNECT after %d tries\n", num_attempts);
@@ -310,18 +310,18 @@ reconnect_loop(int num_attempts)
 /*************************************************************************
  * connect_and_send
  *
- * purpose: 
- * When sending a request, it's possible that the user had restarted 
- * Traffic Manager. This means that the connection between TM and 
+ * purpose:
+ * When sending a request, it's possible that the user had restarted
+ * Traffic Manager. This means that the connection between TM and
  * the remote client has been broken, so the client needs to re-"connect"
- * to Traffic Manager. So, after "writing" to the socket in each 
- * "send_xx_request" function, need to check if the TM socket has 
+ * to Traffic Manager. So, after "writing" to the socket in each
+ * "send_xx_request" function, need to check if the TM socket has
  * been closed or not; the "write" function's errno will indicate if
  * the other end of the socket has been closed or not. If it is closed,
- * then need to try to re"connect", then resend the message request if 
- * the "connect" was successful. 
- * 1) try connect() 
- * 2) if connect() success, then resend the request. 
+ * then need to try to re"connect", then resend the message request if
+ * the "connect" was successful.
+ * 1) try connect()
+ * 2) if connect() success, then resend the request.
  * output: INK_ERR_NET_xx - connection problem or INK_ERR_OKAY
  * notes:
  * This function is basically called by the special "socket_write_conn" fn
@@ -380,16 +380,16 @@ connect_and_send(const char *msg, int ms
 
 /**************************************************************************
  * socket_write_conn
- * 
- * purpose: guarantees writing of n bytes; if connection error, tries 
+ *
+ * purpose: guarantees writing of n bytes; if connection error, tries
  *          reconnecting to TM again (in case TM was restarted)
  * input:   fd to write to, buffer to write from & number of bytes to write
  * output:  INK_ERR_xx
- * note:   EPIPE - this happens if client makes a call after stopping then 
- *         starting TM again. 
- *         ENOTCONN - this happens if the client tries to make a call after 
+ * note:   EPIPE - this happens if client makes a call after stopping then
+ *         starting TM again.
+ *         ENOTCONN - this happens if the client tries to make a call after
  *         stopping TM, but before starting it; then restarts TM and makes a
- *          new call 
+ *          new call
  * In the send_xx_request function, use a special socket writing function
  * which calls connect_and_send() instead of just the basic connect():
  * 1) if the write returns EPIPE error, then call connect_and_send()
@@ -422,7 +422,7 @@ socket_write_conn(int fd, const char *ms
       } else
         return INK_ERR_NET_WRITE;
     }
-    // we are all good here   
+    // we are all good here
     byte_wrote += ret;
   }
 
@@ -432,22 +432,22 @@ socket_write_conn(int fd, const char *ms
 /**********************************************************************
  * socket_test_thread
  *
- * purpose: continually polls to check if local end of socket connection 
- *          is still open; this thread is created when the client calls 
+ * purpose: continually polls to check if local end of socket connection
+ *          is still open; this thread is created when the client calls
  *          Init() to initialize the API; and will not
  *          die until the client process dies
- * input: none 
- * output: if other end is closed, it reconnects to TM 
- * notes: uses the current main_socket_fd because the main_socket_fd could be 
+ * input: none
+ * output: if other end is closed, it reconnects to TM
+ * notes: uses the current main_socket_fd because the main_socket_fd could be
  *        in flux; basically it is possible that the client will reconnect
  *        from some other call, thus making the main_socket_fd actually
  *        valid when socket_test is called
- * reason: decided to create this "watcher" thread for the socket 
+ * reason: decided to create this "watcher" thread for the socket
  *         connection because if TM is restarted or the client process
- *         is started before the TM process, then the client will not 
+ *         is started before the TM process, then the client will not
  *         be able to receive any event notifications until a "request"
  *         is issued. In order to prevent losing an event notifications
- *         that are called in between the time TM is restarted and 
+ *         that are called in between the time TM is restarted and
  *         client issues a first request, we just run this thread which
  *         will try to reconnect to TM if it is not already connected
  **********************************************************************/
@@ -459,10 +459,10 @@ socket_test_thread(void *arg)
     if (socket_test(main_socket_fd) <= 0) {
       // ASSUMES that in between the time the socket_test is made
       // and this reconnect call is made, the main_socket_fd remains
-      // the same (eg. no one else called reconnect to TM successfully!! 
+      // the same (eg. no one else called reconnect to TM successfully!!
       // WHAT IF in between this time, the client had issued a request
       // calling socket_write_conn which then calls reconnect(); then
-      // reconnect will return an "ALREADY CONNECTED" error when it 
+      // reconnect will return an "ALREADY CONNECTED" error when it
       // tries to connect, and on the next loop iteration, the socket_test
       // will actually pass because main_socket_fd is valid!!
       if (reconnect() == INK_ERR_OKAY) {
@@ -484,11 +484,11 @@ socket_test_thread(void *arg)
  * send_request
  *
  * purpose: sends file read request to Traffic Manager
- * input:   fd - file descriptor to use to send to 
+ * input:   fd - file descriptor to use to send to
  *          op - the type of OpType request sending
  * output:  INK_ERR_xx
  * notes:  used by operations which don't need to send any additional
- *         parameters 
+ *         parameters
  * format: <OpType> <msg_len=0>
  **********************************************************************/
 INKError
@@ -553,7 +553,7 @@ send_request_name(int fd, OpType op, cha
     memcpy(msg_buf + SIZE_OP_T + SIZE_LEN, name, msg_len);
 
 
-  // send message  
+  // send message
   err = socket_write_conn(fd, msg_buf, total_len);
   if (msg_buf)
     xfree(msg_buf);
@@ -624,8 +624,8 @@ send_request_name_value(int fd, OpType o
  * send_file_read_request
  *
  * purpose: sends file read request to Traffic Manager
- * input:   fd - file descriptor to use to send to 
- *          file - file to read 
+ * input:   fd - file descriptor to use to send to
+ *          file - file to read
  * output:  INK_ERR_xx
  * notes:   first must create the message and then send it across network
  *          msg format = <OpType> <msg_len> <INKFileNameT>
@@ -669,7 +669,7 @@ send_file_read_request(int fd, INKFileNa
  *
  * purpose: sends file write request to Traffic Manager
  * input: fd - file descriptor to use
- *        file - file to read 
+ *        file - file to read
  *        text - new text to write to specified file
  *        size - length of the text
  *        ver  - version of the file to be written
@@ -767,7 +767,7 @@ send_record_get_request(int fd, char *re
   // fill in record name
   memcpy(msg_buf + msg_pos, rec_name, strlen(rec_name));
 
-  // send message  
+  // send message
   err = socket_write_conn(fd, msg_buf, total_len);
   xfree(msg_buf);
   return err;
@@ -832,7 +832,7 @@ send_proxy_state_set_request(int fd, INK
   cache_t = (ink16) clear;
   memcpy(msg_buf + SIZE_OP_T + SIZE_LEN + SIZE_PROXY_T, (void *) &cache_t, SIZE_TS_ARG_T);
 
-  // send message  
+  // send message
   err = socket_write_conn(fd, msg_buf, total_len);
   xfree(msg_buf);
   return err;
@@ -878,7 +878,7 @@ send_restart_request(int fd, bool cluste
   memcpy(msg_buf + SIZE_OP_T + SIZE_LEN, (void *) &clust_t, SIZE_BOOL);
 
 
-  // send message  
+  // send message
   err = socket_write_conn(fd, msg_buf, total_len);
   xfree(msg_buf);
   return err;
@@ -895,8 +895,8 @@ send_restart_request(int fd, bool cluste
  *          registered for each event
  * input: None
  * output: return INK_ERR_OKAY only if ALL events sent okay
- * notes: could create a function which just sends a list of all the events to 
- * reregister; but actually just reuse the function 
+ * notes: could create a function which just sends a list of all the events to
+ * reregister; but actually just reuse the function
  * send_request_name(EVENT_REG_CALLBACK) and call it for each event
  * 1) get list of all events with callbacks
  * 2) for each event, call send_request_name
@@ -951,8 +951,8 @@ send_register_all_callbacks(int fd, Call
  *          callbacks registered for that event
  * input: None
  * output: INK_ERR_OKAY only if all send requests are okay
- * notes: could create a function which just sends a list of all the events to 
- * unregister; but actually just reuse the function 
+ * notes: could create a function which just sends a list of all the events to
+ * unregister; but actually just reuse the function
  * send_request_name(EVENT_UNREG_CALLBACK) and call it for each event
  **********************************************************************/
 INKError
@@ -995,7 +995,7 @@ send_unregister_all_callbacks(int fd, Ca
       }
       // REMEMBER: WON"T GET A REPLY!
       // only the event_poll_thread_main does any reading of the event_socket;
-      // so DO NOT parse reply b/c a reply won't be sent            
+      // so DO NOT parse reply b/c a reply won't be sent
     }
   }
 
@@ -1050,7 +1050,7 @@ send_diags_msg(int fd, INKDiagsT mode, c
   // fill in diags msg
   memcpy(msg_buf + SIZE_OP_T + SIZE_LEN + SIZE_DIAGS_T + SIZE_LEN, diag_msg, diag_msg_len);
 
-  // send message  
+  // send message
   err = socket_write_conn(fd, msg_buf, total_len);
   if (msg_buf)
     xfree(msg_buf);
@@ -1062,17 +1062,17 @@ send_diags_msg(int fd, INKDiagsT mode, c
  * UNMARSHAL REPLIES
  **********************************************************************/
 
-/* Error handling implementation: 
+/* Error handling implementation:
  * All the parsing functions which parse the reply returned from local side
- * also must read the INKERror return value sent from local side; this return 
+ * also must read the INKERror return value sent from local side; this return
  * value is the same value that will be returned by the parsing function.
  * ALL PARSING FUNCTIONS MUST FIRST CHECK that the retval is INK_ERR_OKAY;
  * if it is not, then DON"T PARSE THE REST OF THE REPLY!!
  */
 
 /* Reading replies:
- * The reading is done in while loop in the parse_xx_reply functions; 
- * need to add a timeout so that the function is not left looping and 
+ * The reading is done in while loop in the parse_xx_reply functions;
+ * need to add a timeout so that the function is not left looping and
  * waiting if a msg isn't sent to the socket from local side (eg. TM died)
  */
 
@@ -1080,10 +1080,10 @@ send_diags_msg(int fd, INKDiagsT mode, c
  * parse_reply
  *
  * purpose: parses a reply from traffic manager. return that error
- * input: fd 
- * output: errors on error or fill up class with response & 
+ * input: fd
+ * output: errors on error or fill up class with response &
  *         return INK_ERR_xx
- * notes: only returns an INKError 
+ * notes: only returns an INKError
  **********************************************************************/
 INKError
 parse_reply(int fd)
@@ -1222,12 +1222,12 @@ parse_reply_list(int fd, char **list)
 /**********************************************************************
  * parse_file_read_reply
  *
- * purpose: parses a file read reply from traffic manager. 
- * input: fd 
+ * purpose: parses a file read reply from traffic manager.
+ * input: fd
  *        ver -
  *        size - size of text
- *        text - 
- * output: errors on error or fill up class with response & 
+ *        text -
+ * output: errors on error or fill up class with response &
  *         return INK_ERR_xx
  * notes: reply format = <INKError> <file_version> <file_size> <text>
  **********************************************************************/
@@ -1246,7 +1246,7 @@ parse_file_read_reply(int fd, int *ver, 
   if (socket_read_timeout(fd, MAX_TIME_WAIT, 0) <= 0) { // time expires before ready to read
     return INK_ERR_NET_TIMEOUT;
   }
-  // get the error return value 
+  // get the error return value
   while (amount_read < SIZE_ERR_T) {
     ret = read(fd, (void *) &ret_val, SIZE_ERR_T - amount_read);
 
@@ -1350,16 +1350,16 @@ parse_file_read_reply(int fd, int *ver, 
 /**********************************************************************
  * parse_record_get_reply
  *
- * purpose: parses a record_get reply from traffic manager. 
- * input: fd 
+ * purpose: parses a record_get reply from traffic manager.
+ * input: fd
  *        retval   -
  *        rec_type - the type of the record
- *        rec_value - the value of the record in string format 
- * output: errors on error or fill up class with response & 
+ *        rec_value - the value of the record in string format
+ * output: errors on error or fill up class with response &
  *         return SUCC
- * notes: reply format = <INKError> <val_size> <rec_type> <record_value> 
- * It's the responsibility of the calling function to conver the rec_value 
- * based on the rec_type!! 
+ * notes: reply format = <INKError> <val_size> <rec_type> <record_value>
+ * It's the responsibility of the calling function to conver the rec_value
+ * based on the rec_type!!
  **********************************************************************/
 INKError
 parse_record_get_reply(int fd, INKRecordT * rec_type, void **rec_val)
@@ -1372,7 +1372,7 @@ parse_record_get_reply(int fd, INKRecord
   if (!rec_type || !rec_val)
     return INK_ERR_PARAMS;
 
-  // check to see if anything to read; wait for specified time 
+  // check to see if anything to read; wait for specified time
   if (socket_read_timeout(fd, MAX_TIME_WAIT, 0) <= 0) { //time expired before ready to read
     return INK_ERR_NET_TIMEOUT;
   }
@@ -1481,13 +1481,13 @@ parse_record_get_reply(int fd, INKRecord
 /**********************************************************************
  * parse_record_set_reply
  *
- * purpose: parses a record_set reply from traffic manager. 
- * input: fd 
+ * purpose: parses a record_set reply from traffic manager.
+ * input: fd
  *        action_need - will contain the type of action needed from the set
  * output: INK_ERR_xx
- * notes: reply format = <INKError> <val_size> <rec_type> <record_value> 
- * It's the responsibility of the calling function to conver the rec_value 
- * based on the rec_type!! 
+ * notes: reply format = <INKError> <val_size> <rec_type> <record_value>
+ * It's the responsibility of the calling function to conver the rec_value
+ * based on the rec_type!!
  **********************************************************************/
 INKError
 parse_record_set_reply(int fd, INKActionNeedT * action_need)
@@ -1499,7 +1499,7 @@ parse_record_set_reply(int fd, INKAction
   if (!action_need)
     return INK_ERR_PARAMS;
 
-  // check to see if anything to read; wait for specified time 
+  // check to see if anything to read; wait for specified time
   if (socket_read_timeout(fd, MAX_TIME_WAIT, 0) <= 0) {
     return INK_ERR_NET_TIMEOUT;
   }
@@ -1555,11 +1555,11 @@ parse_record_set_reply(int fd, INKAction
  * parse_proxy_state_get_reply
  *
  * purpose: parses a TM reply to a PROXY_STATE_GET request
- * input: fd 
+ * input: fd
  *        state - will contain the state of the proxy
  * output: INK_ERR_xx
  * notes: function is DIFFERENT becuase it has NO INKError at head of msg
- * format: <INKProxyStateT> 
+ * format: <INKProxyStateT>
  **********************************************************************/
 INKError
 parse_proxy_state_get_reply(int fd, INKProxyStateT * state)
@@ -1570,7 +1570,7 @@ parse_proxy_state_get_reply(int fd, INKP
   if (!state)
     return INK_ERR_PARAMS;
 
-  // check to see if anything to read; wait for specified time 
+  // check to see if anything to read; wait for specified time
   if (socket_read_timeout(fd, MAX_TIME_WAIT, 0) <= 0) { // time expires before ready to read
     return INK_ERR_NET_TIMEOUT;
   }
@@ -1620,7 +1620,7 @@ parse_event_active_reply(int fd, bool * 
   if (!is_active)
     return INK_ERR_PARAMS;
 
-  // check to see if anything to read; wait for specified time 
+  // check to see if anything to read; wait for specified time
   if (socket_read_timeout(fd, MAX_TIME_WAIT, 0) <= 0) {
     return INK_ERR_NET_TIMEOUT;
   }
@@ -1699,11 +1699,11 @@ parse_event_notification(int fd, INKEven
   while (amount_read < SIZE_OP_T) {
     ret = read(fd, (void *) &type_op, SIZE_OP_T - amount_read);
 
-    // the thread can receive a bad file descriptor error(EBADF) 
-    // if the current socket_fd being used by this thread is invalid; 
+    // the thread can receive a bad file descriptor error(EBADF)
+    // if the current socket_fd being used by this thread is invalid;
     // this occurs when TM restarts and the client has to reconnect and
-    // get a new socket_fd; in this case, this thread will return null 
-    // and die; and the client will launch a new event_poll_thread_main 
+    // get a new socket_fd; in this case, this thread will return null
+    // and die; and the client will launch a new event_poll_thread_main
     // when it reconnects to TM
 
     // connection broken or error

Modified: trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/NetworkUtilsRemote.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/NetworkUtilsRemote.h?rev=943951&r1=943950&r2=943951&view=diff
==============================================================================
--- trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/NetworkUtilsRemote.h (original)
+++ trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/NetworkUtilsRemote.h Thu May 13 17:43:56 2010
@@ -23,13 +23,13 @@
 
 /*****************************************************************************
  * Filename: NetworkUtilsRemote.h
- * Purpose: This file contains functions used by remote api client to 
- *          marshal requests to TM and unmarshal replies from TM. 
- *          Also contains functions used to store information specific 
- *          to a remote client connection. 
+ * Purpose: This file contains functions used by remote api client to
+ *          marshal requests to TM and unmarshal replies from TM.
+ *          Also contains functions used to store information specific
+ *          to a remote client connection.
  * Created: 8/9/00
  * Created by: lant
- * 
+ *
  ***************************************************************************/
 
 #ifndef _NETWORK_UTILS_H_
@@ -54,8 +54,8 @@ void set_socket_paths(const char *path);
 int socket_test(int fd);
 
 /* The following functions are specific for a client connection; uses
- * the client connection information stored in the variables in 
- * NetworkUtilsRemote.cc 
+ * the client connection information stored in the variables in
+ * NetworkUtilsRemote.cc
  */
 INKError ts_connect(); /* TODO: update documenation, Renamed due to conflict with connect() in <sys/socket.h> on some platforms*/
 INKError disconnect();
@@ -66,7 +66,7 @@ INKError socket_write_conn(int fd, const
 void *socket_test_thread(void *arg);
 
 /*****************************************************************************
- * Marshalling (create requests) 
+ * Marshalling (create requests)
  *****************************************************************************/
 INKError send_request(int fd, OpType op);
 INKError send_request_name(int fd, OpType op, char *name);
@@ -85,7 +85,7 @@ INKError send_unregister_all_callbacks(i
 INKError send_diags_msg(int fd, INKDiagsT mode, const char *diag_msg);
 
 /*****************************************************************************
- * Un-marshalling (parse responses) 
+ * Un-marshalling (parse responses)
  *****************************************************************************/
 INKError parse_reply(int fd);
 INKError parse_reply_list(int fd, char **list);

Modified: trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/RemoteTestOem.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/RemoteTestOem.cc?rev=943951&r1=943950&r2=943951&view=diff
==============================================================================
--- trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/RemoteTestOem.cc (original)
+++ trafficserver/traffic/tags/2.1.0/proxy/mgmt2/api2/remote/RemoteTestOem.cc Thu May 13 17:43:56 2010
@@ -147,7 +147,7 @@ main(int argc, char *argv[])
 
   printf("START REMOTE API TEST\n");
 
-  // initialize 
+  // initialize
   if (INKInit("../../../../etc/trafficserver/mgmtapisocket") != INK_ERR_OKAY) {
     printf("INKInit failed!\n");
     return -1;
@@ -191,7 +191,7 @@ main(int argc, char *argv[])
 #endif
 
 #if TEST_STRING
-  // retrieve an string value record using GetString  
+  // retrieve an string value record using GetString
   if (INKRecordGetString("proxy.config.proxy_name", &rec_value) != INK_ERR_OKAY)
     printf("INKRecordGetString FAILED!\n");
   else
@@ -203,7 +203,7 @@ main(int argc, char *argv[])
   else
     printf("[INKRecordSetString] proxy.config.proxy_name=%s\n", new_str);
 
-  // get 
+  // get
   if (INKRecordGetString("proxy.config.proxy_name", &rec_value) != INK_ERR_OKAY)
     printf("INKRecordGetString FAILED!\n");
   else
@@ -318,7 +318,7 @@ main(int argc, char *argv[])
   printf("\n\n");
 
   /********************* END TEST SECTION *********************/
-  INKTerminate();               //ERROR:Causes infinite!! 
+  INKTerminate();               //ERROR:Causes infinite!!
 
   printf("END REMOTE API TEST\n");
 }

Modified: trafficserver/traffic/tags/2.1.0/proxy/mgmt2/cli/AbsEventHandler.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/tags/2.1.0/proxy/mgmt2/cli/AbsEventHandler.h?rev=943951&r1=943950&r2=943951&view=diff
==============================================================================
--- trafficserver/traffic/tags/2.1.0/proxy/mgmt2/cli/AbsEventHandler.h (original)
+++ trafficserver/traffic/tags/2.1.0/proxy/mgmt2/cli/AbsEventHandler.h Thu May 13 17:43:56 2010
@@ -24,9 +24,9 @@
 /***************************************/
 /****************************************************************************
  *
- *  Module: Abstract class for event handling 
+ *  Module: Abstract class for event handling
  *  Source: CUJ
- * 
+ *
  ****************************************************************************/
 
 #ifndef _ABS_EVENTHANDLER_H
@@ -77,7 +77,7 @@ protected:
   virtual void FillHandlersArray(void) = 0;
 
 private:
-  /* copy constructor and assignment operator are private 
+  /* copy constructor and assignment operator are private
    *  to prevent their use */
   AbsEventHandler(const AbsEventHandler & rhs);
   AbsEventHandler & operator=(const AbsEventHandler & rhs);