You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2010/05/05 20:35:53 UTC
svn commit: r941419 [3/4] - in /trafficserver/traffic/trunk: proxy/logging/
proxy/mgmt2/ proxy/mgmt2/api2/ proxy/mgmt2/api2/include/
proxy/mgmt2/cluster/ proxy/mgmt2/tools/ proxy/mgmt2/utils/
proxy/mgmt2/web2/ test/SDKtest/synth_server/ test/plugin/INK...
Modified: trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpAuth.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpAuth.cc?rev=941419&r1=941418&r2=941419&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpAuth.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpAuth.cc Wed May 5 18:35:52 2010
@@ -45,9 +45,6 @@
#include "WebHttpMessage.h"
#include "WebMgmtUtils.h"
-#ifdef OEM
-#include "WebHttpSession.h"
-#endif //OEM
//-------------------------------------------------------------------------
// globals
@@ -107,13 +104,6 @@ WebHttpAuthenticate(WebHttpContext * whc
InkHashTableIteratorState htis;
WebHttpAuthUser *au;
-#ifdef OEM
-
- char *ctx_key = NULL;
- char namAttrib[256];
- time_t now;
-
-#endif //OEM
// check backdoor items first
file = (char *) (whc->request->getFile());
@@ -241,13 +231,6 @@ Lchallenge:
if (found && product_name) {
whc->response_hdr->setRealm(product_name);
xfree(product_name);
-#ifdef OEM
- ctx_key = WebHttpMakeSessionKey_Xmalloc();
- WebHttpCurrentSessionStore(ctx_key);
- time(&now);
- sprintf(namAttrib, "SessionID=%s:LastAccess=%d", ctx_key, now);
- whc->response_hdr->setCookie(namAttrib);
-#endif //OEM
} else {
whc->response_hdr->setRealm("Traffic_Server");
}
@@ -258,173 +241,3 @@ Lchallenge:
-#ifdef OEM
-
-
-//-------------------------------------------------------------------------
-// WebHttpAuthenticate
-//-------------------------------------------------------------------------
-
-int
-WebHttpAuthenticateWithoutNewSession(WebHttpContext * whc)
-{
-
- char *file;
- char *user = NULL;
- char *passwd = NULL;
- char *encrypt_passwd = NULL;
- char *uuencode_buf;
- char uudecode_buf[MAX_VAL_LENGTH];
- char *uudecode_buf_p = uudecode_buf;
- char **strtok_arg = &uudecode_buf_p;
- void *dummy;
-
- bool found;
- char *product_name;
-
- char empty_string[2];
- *empty_string = '\0';
-
- MgmtHashTable *ht = whc->other_users_ht;
- InkHashTableEntry *hte;
- InkHashTableIteratorState htis;
- WebHttpAuthUser *au;
-
-
- // check backdoor items first
- file = (char *) (whc->request->getFile());
- if (ink_hash_table_lookup(g_auth_bypass_ht, file, (void **) &dummy)) {
- goto Lauthenticate;
- }
- // get authentication header
- uuencode_buf = (char *) (whc->request->getAuthMessage());
- if (uuencode_buf == NULL) {
- goto Lchallenge;
- }
- // decode user and password
- ink_base64_decode(uuencode_buf, MAX_VAL_LENGTH, (unsigned char *) uudecode_buf);
- user = ink_strtok_r(uudecode_buf, ":", strtok_arg);
- passwd = ink_strtok_r(NULL, "", strtok_arg);
- Debug("web_auth", "[WebHttpAuthenticate] user (%s), passwd (%s)",
- user ? user : "user is NULL", passwd ? passwd : "passwd is NULL");
-
- //printf("Deepak:: WebHttpAuthenticate(): user (%s), passwd (%s)\n", user ? user : "user is NULL", passwd ? passwd : "passwd is NULL");
-
- // handle null users
- if (user == NULL) {
- strncpy(whc->current_user.user, "NULL", WEB_HTTP_AUTH_USER_MAX);
- whc->current_user.access = WEB_HTTP_AUTH_ACCESS_NONE;
- goto Laccess_defined;
- }
- // store the current-user
- strncpy(whc->current_user.user, user, WEB_HTTP_AUTH_USER_MAX);
-
- // handle null passwords
- if (passwd == NULL) {
- // special case for admin user (so can reset the admin password to nothing)
- if ((strncmp(user, whc->admin_user.user, WEB_HTTP_AUTH_USER_MAX) == 0) &&
- ((whc->admin_user.encrypt_passwd)[0] == '\0')) {
- whc->current_user.access = WEB_HTTP_AUTH_ACCESS_CONFIG_CHANGE;
- Debug("web_auth", "[WebHttpAuthenticate] "
- "adminContext.admin.passwd is NULL; allowing access (%d) to '%s'",
- whc->current_user.access, whc->admin_user.user);
- goto Laccess_defined;
- }
- // otherwise, null passwords are treated normally for everyone else
- passwd = empty_string;
- }
-
- INKEncryptPassword(passwd, &encrypt_passwd);
-
- Debug("web_auth", "[WebHttpAuthenticate] encrypt_passwd (%s), "
- "admin.encrypt_passwd (%s)\n", encrypt_passwd, whc->admin_user.encrypt_passwd);
-
- // check against admin user/password
- if ((strncmp(user, whc->admin_user.user, WEB_HTTP_AUTH_USER_MAX) == 0) &&
- (strncmp(encrypt_passwd, whc->admin_user.encrypt_passwd, WEB_HTTP_AUTH_ENCRYPT_PASSWD_LEN) == 0)) {
- whc->current_user.access = WEB_HTTP_AUTH_ACCESS_CONFIG_CHANGE;
- goto Laccess_defined;
- }
- // check against additional users
- for (hte = ht->mgmt_hash_table_iterator_first(&htis); hte != NULL; hte = ht->mgmt_hash_table_iterator_next(&htis)) {
- au = (WebHttpAuthUser *) ht->mgmt_hash_table_entry_value(hte);
- if (strcmp(user, au->user) == 0) {
- if (strncmp(encrypt_passwd, au->encrypt_passwd, WEB_HTTP_AUTH_ENCRYPT_PASSWD_LEN) == 0) {
- whc->current_user.access = au->access;
- goto Laccess_defined;
- }
- }
- }
-
- // Fix INKqa02963 - unescapify the username and passwd since it
- // could have been entered as part of a URL
- substituteUnsafeChars(user);
- substituteUnsafeChars(passwd);
-
- xfree(encrypt_passwd);
- INKEncryptPassword(passwd, &encrypt_passwd);
-
- // FIXME: Yucky cut-and-paste code below!!!
-
- // check against admin user/password
- if ((strncmp(user, whc->admin_user.user, WEB_HTTP_AUTH_USER_MAX) == 0) &&
- (strncmp(encrypt_passwd, whc->admin_user.encrypt_passwd, WEB_HTTP_AUTH_ENCRYPT_PASSWD_LEN) == 0)) {
- whc->current_user.access = WEB_HTTP_AUTH_ACCESS_CONFIG_CHANGE;
- goto Laccess_defined;
- }
- // check against additional users
- for (hte = ht->mgmt_hash_table_iterator_first(&htis); hte != NULL; hte = ht->mgmt_hash_table_iterator_next(&htis)) {
- au = (WebHttpAuthUser *) ht->mgmt_hash_table_entry_value(hte);
- if (strcmp(user, au->user) == 0) {
- if (strncmp(encrypt_passwd, au->encrypt_passwd, WEB_HTTP_AUTH_ENCRYPT_PASSWD_LEN) == 0) {
- whc->current_user.access = au->access;
- goto Laccess_defined;
- }
- }
- }
-
- // didn't find anyone
- whc->current_user.access = WEB_HTTP_AUTH_ACCESS_NONE;
-
-Laccess_defined:
- if (encrypt_passwd != NULL)
- xfree(encrypt_passwd);
- Debug("web_auth", "[WebHttpAuthenticate] access defined to be: %d\n", whc->current_user.access);
-
- if (whc->current_user.access == WEB_HTTP_AUTH_ACCESS_NONE)
- goto Lchallenge;
- if ((strncmp(file, "/configure/", strlen("/configure/")) == 0) &&
- (whc->current_user.access == WEB_HTTP_AUTH_ACCESS_MONITOR)) {
- goto Lchallenge;
- }
- //kwt
- if ((whc->request->getMethod() == METHOD_POST) && (whc->current_user.access != WEB_HTTP_AUTH_ACCESS_CONFIG_CHANGE)
- && (strncmp(file, "/charting/chart.cgi", strlen("/charting/chart.cgi")) != 0)) {
- goto Lchallenge;
- }
- //kwt
-
- goto Lauthenticate;
-
-Lauthenticate:
-
- return WEB_HTTP_ERR_OKAY;
-
-Lchallenge:
-
- found = false;
- found = (RecGetRecordString_Xmalloc("proxy.config.product_name", &product_name)
- == REC_ERR_OKAY);
- whc->response_hdr->setStatus(STATUS_UNAUTHORIZED);
- if (found && product_name) {
- whc->response_hdr->setRealm(product_name);
- xfree(product_name);
- } else {
- whc->response_hdr->setRealm("Traffic_Server");
- }
- WebHttpSetErrorResponse(whc, STATUS_UNAUTHORIZED);
- return WEB_HTTP_ERR_FAIL;
-
-}
-
-#endif
Modified: trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpAuth.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpAuth.h?rev=941419&r1=941418&r2=941419&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpAuth.h (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpAuth.h Wed May 5 18:35:52 2010
@@ -55,8 +55,5 @@ struct WebHttpContext;
void WebHttpAuthInit();
int WebHttpAuthenticate(WebHttpContext * whc);
-#ifdef OEM
-int WebHttpAuthenticateWithoutNewSession(WebHttpContext * whc);
-#endif
#endif // _WEB_HTTP_AUTH_H_
Modified: trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpMessage.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpMessage.cc?rev=941419&r1=941418&r2=941419&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpMessage.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpMessage.cc Wed May 5 18:35:52 2010
@@ -137,9 +137,6 @@ httpMessage::httpMessage()
modificationTime = -1;
modContentLength = -1;
client_request = NULL;
-#ifdef OEM
- cookie = NULL;
-#endif //OEM
}
void
@@ -261,16 +258,9 @@ httpMessage::addHeader(char *hdr)
if (strncasecmp("Content-length:", hdrName, 15) == 0) {
conLen = atoi(hdrArg1);
} else if (strncasecmp("Referer:", hdrName, 8) == 0) {
-#ifdef OEM
- referer = NULL;
- if (hdrArg1 != NULL) {
-#endif //OEM
unsigned int amtToAllocate = strlen(hdrArg1);
referer = new char[amtToAllocate + 1];
ink_strncpy(referer, hdrArg1, amtToAllocate);
-#ifdef OEM
- }
-#endif //OEM
} else if (strncasecmp("Content-type:", hdrName, 13) == 0) {
unsigned int amtToAllocate = strlen(hdrArg1);
conType_str = new char[amtToAllocate + 1];
@@ -286,26 +276,8 @@ httpMessage::addHeader(char *hdr)
} else if (strncasecmp("If-Modified-Since:", hdrName, 18) == 0) {
// Disabled due to thread safety issues
getModDate();
-#ifdef OEM
- } else if (strncasecmp("Cookie:", hdrName, 7) == 0) {
- int index = 1;
- char cookieString[1024];
- while ((hdrName = (*parser)[index++])) {
- if (strncasecmp("SessionID=", hdrName, 10) == 0) {
- sessionID = strdup((strchr(hdrName, '=') + (sizeof(char))));
-#endif //OEM
}
-#ifdef OEM
- strcat(cookieString, hdrName);
-#endif //OEM
- }
-#ifdef OEM
- if (cookieString != NULL) {
- cookie = xstrdup(cookieString);
}
- }
-}
-#endif //OEM
// httpMessage::getModDate()
@@ -461,13 +433,7 @@ httpResponse::httpResponse()
authRealm = NULL;
dateResponse = NULL;
status = STATUS_INTERNAL_SERVER_ERROR;
-#ifdef OEM
- cookie = NULL;
-#endif //OEM
locationURL = NULL;
-#ifdef OEM
- contentLocationURL = NULL;
-#endif //OEM
cachable = 1;
}
@@ -488,12 +454,6 @@ httpResponse::~httpResponse()
if (locationURL != NULL) {
xfree(locationURL);
}
-#ifdef OEM
-
- if (contentLocationURL != NULL) {
- xfree(contentLocationURL);
- }
-#endif //OEM
xfree(dateResponse);
}
@@ -513,10 +473,6 @@ httpResponse::writeHdr(SocketInfo socket
const char lastModStr[] = "Last-modified: ";
const char expiresStr[] = "Expires: ";
const char locationStr[] = "Location: ";
-#ifdef OEM
- const char contentLocationStr[] = "Content-Location: ";
- const char setCookieStr[] = "Set-Cookie: ";
-#endif //OEM
const char refreshURLStr[] = "; URL=";
time_t currentTime;
const int bufSize = 512;
@@ -550,20 +506,6 @@ httpResponse::writeHdr(SocketInfo socket
}
hdr.copyFrom("\r\n", 2);
}
-#ifdef OEM
- if (cookie != NULL) {
- SimpleTokenizer cookiesTokens(cookie, ':');
- int cookiesCount = cookiesTokens.getNumTokensRemaining();
- for (int index = 0; index < cookiesCount; index++) {
- char *nextCookie = cookiesTokens.getNext();
- hdr.copyFrom(setCookieStr, strlen(setCookieStr));
- hdr.copyFrom(nextCookie, strlen(nextCookie));
- hdr.copyFrom(";path=/;", strlen(";path=/;"));
- //hdr.copyFrom(";expires=Wednesday, 10-Oct-2001 23:12:40 GMT", strlen(";expires=Wednesday, 10-Oct-2001 23:12:40 GMT"));
- hdr.copyFrom("\r\n", 2);
- }
- }
-#endif //OEM
// Location Header
if (locationURL != NULL) {
@@ -571,15 +513,6 @@ httpResponse::writeHdr(SocketInfo socket
hdr.copyFrom(locationURL, strlen(locationURL));
hdr.copyFrom("\r\n", 2);
}
-#ifdef OEM
-
- // Location Header
- if (contentLocationURL != NULL) {
- hdr.copyFrom(contentLocationStr, strlen(contentLocationStr));
- hdr.copyFrom(contentLocationURL, strlen(contentLocationURL));
- hdr.copyFrom("\r\n", 2);
- }
-#endif //OEM
// Always send the current time
currentTime = time(NULL);
@@ -665,15 +598,6 @@ httpResponse::setLocationURL(const char
}
}
-#ifdef OEM
-void
-httpResponse::setContentLocationURL(const char *url)
-{
- if (url != NULL) {
- contentLocationURL = xstrdup(url);
- }
-}
-#endif //OEM
void
httpResponse::getLogInfo(const char **date, HttpStatus_t * statusIn, int *length)
Modified: trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpMessage.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpMessage.h?rev=941419&r1=941418&r2=941419&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpMessage.h (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpMessage.h Wed May 5 18:35:52 2010
@@ -130,26 +130,6 @@ public:
{
return file;
};
-#ifdef OEM
- const char *getCookie()
- {
- if (cookie != NULL) {
- return cookie;
- }
- return NULL;
- };
- const char *getSessionID()
- {
- if (sessionID != NULL) {
- return sessionID;
- }
- return NULL;
- };
- void setAuthMessage()
- {
- authMessage = NULL;
- };
-#endif //OEM
const char *getQuery()
{
return query;
@@ -201,10 +181,6 @@ private:
void getModDate();
Method_t method;
char *file;
-#ifdef OEM
- char *cookie;
- char *sessionID;
-#endif //OEM
//char* referer;
char *query;
Scheme_t scheme;
@@ -252,18 +228,6 @@ public:
return status;
};
-#ifdef OEM
- void setCookie(char *s)
- {
- cookie = xstrdup(s);
- };
- const char *getContentLocationURL()
- {
- return contentLocationURL;
- };
- void setContentLocationURL(const char *url);
-
-#endif //OEM
void setRefresh(int i)
{
@@ -309,10 +273,6 @@ public:
private:
httpResponse(const httpResponse &);
HttpStatus_t status;
-#ifdef OEM
- char *cookie;
- char *contentLocationURL;
-#endif //OEM
int refresh;
int conLen;
Content_t conType;
Modified: trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpRender.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpRender.cc?rev=941419&r1=941418&r2=941419&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpRender.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpRender.cc Wed May 5 18:35:52 2010
@@ -56,10 +56,6 @@
#include "MultiFile.h"
#include "../tools/ConfigAPI.h"
-#if defined(OEM)
-#include "CfgContextManager.h"
-#include "CoreAPI.h"
-#endif
//-------------------------------------------------------------------------
// defines
@@ -1192,19 +1188,6 @@ handle_ftp_select(WebHttpContext * whc)
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
-#ifdef OEM
- HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, "2", 0);
- output->
- copyFrom
- (" <input type=\"checkbox\" name=\"Restore Network Snapshot\" value=\"Restore NW Snapshot\">",
- strlen
- (" <input type=\"checkbox\" name=\"Restore Network Snapshot\" value=\"Restore NW Snapshot\">"));
- output->copyFrom(" Restore Network Snapshot", strlen(" Restore Network Snapshot"));
-
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-#endif //OEM
HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, "2", 2);
@@ -1247,19 +1230,6 @@ handle_ftp_select(WebHttpContext * whc)
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
-#ifdef OEM
- HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, "2", 0);
- output->
- copyFrom
- (" <input type=\"checkbox\" name=\"NWSnapshot\" value=\"Network Settings Snapshot\">",
- strlen
- (" <input type=\"checkbox\" name=\"NWSnapshot\" value=\"Network Settings Snapshot\">"));
- output->copyFrom(" Save Network Snapshot", strlen(" Save Network Snapshot"));
-
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-#endif //OEM
}
}
@@ -1385,19 +1355,6 @@ handle_floppy_select(WebHttpContext * wh
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
-#if defined(OEM)
- HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, "2", 0);
- output->
- copyFrom
- (" <input type=\"checkbox\" name=\"Restore Network Snapshot\" value=\"Restore NW Snapshot\">",
- strlen
- (" <input type=\"checkbox\" name=\"Restore Network Snapshot\" value=\"Restore NW Snapshot\">"));
- output->copyFrom(" Restore Network Snapshot", strlen(" Restore Network Snapshot"));
-
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-#endif //OEM
HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, "2", 2);
@@ -1433,19 +1390,6 @@ handle_floppy_select(WebHttpContext * wh
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
-#if defined(OEM)
- HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, "2", 0);
- output->
- copyFrom
- (" <input type=\"checkbox\" name=\"NWSnapshot\" value=\"Network Settings Snapshot\">",
- strlen
- (" <input type=\"checkbox\" name=\"NWSnapshot\" value=\"Network Settings Snapshot\">"));
- output->copyFrom(" Save Network Snapshot", strlen(" Save Network Snapshot"));
-
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-#endif //OEM
}
}
@@ -1495,23 +1439,6 @@ handle_password_object(WebHttpContext *
return WEB_HTTP_ERR_OKAY;
}
-#ifdef OEM
-//-------------------------------------------------------------------------
-// handle_sessionid
-//-------------------------------------------------------------------------
-static int
-handle_sessionid(WebHttpContext * whc, char *tag, char *arg)
-{
- textBuffer *output = whc->response_bdy;
- char *session_key_str = (char *) xmalloc(10);
- long session_key = WebRand();
- // note: ink_snprintf takes the buffer length, not the string
- // length? Add 2 to xmalloc above to be safe. ^_^
- ink_snprintf(session_key_str, 9, "%x", session_key);
- output->copyFrom(session_key_str, strlen(session_key_str));
- return WEB_HTTP_ERR_OKAY;
-}
-#endif //OEM
//-------------------------------------------------------------------------
// handle_select_*_logs
@@ -2461,179 +2388,6 @@ handle_time(WebHttpContext * whc, char *
return WEB_HTTP_ERR_OKAY;
}
-#ifdef OEM
-//------------------------------------------------------------------------
-// handle_date
-//------------------------------------------------------------------------
-
-extern int find_value(char *pathname, char *key, char *value, char *delim, int no);
-static int
-handle_date(WebHttpContext * whc, char *tag, char *arg)
-{
- textBuffer *output = whc->response_bdy;
- char value[256], hour[10], minute[10], second[10], month[10], day[10], year[10];
- char *dummy, *old_value, *value_safe;
-
-//conside different render method for timezone
- if (ink_hash_table_lookup(whc->submit_warn_ht, arg, (void **) &dummy) && strcmp(arg, "timezone_select") != 0) {
- if (ink_hash_table_lookup(whc->post_data_ht, arg, (void **) &old_value) && old_value != NULL) {
- value_safe = substituteForHTMLChars(old_value);
- whc->response_bdy->copyFrom(value_safe, strlen(value_safe));
- }
- goto Ldone;
- }
-
- ink_strncpy(value, "", sizeof(value));
-
- if (strcmp(arg, "hour") == 0) {
- Config_GetTime(value, minute, second);
- } else if (strcmp(arg, "minute") == 0) {
- Config_GetTime(hour, value, second);
- } else if (strcmp(arg, "second") == 0) {
- Config_GetTime(hour, minute, value);
- } else if (strcmp(arg, "month") == 0) {
- Config_GetDate(value, day, year);
- } else if (strcmp(arg, "day") == 0) {
- Config_GetDate(month, value, year);
- } else if (strcmp(arg, "year") == 0) {
- Config_GetDate(month, day, value);
- } else if (strcmp(arg, "timezone") == 0) {
- FILE *fp;
- char buffer[1024];
- char old_zone[1024];
- char *zone;
-
- Config_GetTimezone(old_zone, sizeof(old_zone));
- Config_SortTimezone();
-
- fp = fopen("/tmp/zonetab", "r");
- fgets(buffer, 1024, fp);
- while (!feof(fp)) {
- zone = buffer;
- if (zone[strlen(zone) - 1] == '\n') {
- zone[strlen(zone) - 1] = '\0';
- }
- if (strcmp(zone, old_zone) == 0) {
- HtmlRndrOptionOpen(output, zone, true);
- } else {
- HtmlRndrOptionOpen(output, zone, false);
- }
- output->copyFrom(zone, strlen(zone));
- HtmlRndrOptionClose(output);
- fgets(buffer, 1024, fp);
- }
- fclose(fp);
- remove("/tmp/zonetab");
- } else if (strstr(arg, "ntp_server") != NULL) {
- if (strstr(arg, "1") != NULL) {
- Config_GetNTP_Server(value, sizeof(value), 0);
- } else if (strstr(arg, "2") != NULL) {
- Config_GetNTP_Server(value, sizeof(value), 1);
- } else if (strstr(arg, "3") != NULL) {
- Config_GetNTP_Server(value, sizeof(value), 2);
- }
- } else if (strcmp(arg, "ntp_enable") == 0) {
- char status[10];
- Config_GetNTP_Status(status, sizeof(status));
- if (strcmp(status, "on") == 0) {
- ink_strncpy(value, "checked", sizeof(value));
- } else {
- ink_strncpy(value, "", sizeof(value));
- }
- } else if (strcmp(arg, "ntp_disable") == 0) {
- char status[10];
- Config_GetNTP_Status(status, sizeof(status));
- if (strcmp(status, "off") == 0) {
- ink_strncpy(value, "checked", sizeof(value));
- } else {
- ink_strncpy(value, "", sizeof(value));
- }
- }
-
- if (strlen(value) != 0) {
- value_safe = substituteForHTMLChars(value);
- whc->response_bdy->copyFrom(value_safe, strlen(value_safe));
- }
-
-Ldone:
- return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// handle_ftp_logging
-//-------------------------------------------------------------------------
-static int
-handle_ftp_logging(WebHttpContext * whc, char *tag, char *arg)
-{
- int err = WEB_HTTP_ERR_OKAY;
- char buffer[1024], value[1024];
- char *value_safe, *old_value, *dummy;
- int i;
- FILE *f;
-
- if (ink_hash_table_lookup(whc->submit_warn_ht, arg, (void **) &dummy)) {
- if (ink_hash_table_lookup(whc->post_data_ht, arg, (void **) &old_value) && old_value != NULL) {
- value_safe = substituteForHTMLChars(old_value);
- whc->response_bdy->copyFrom(value_safe, strlen(value_safe));
- }
- goto Ldone;
- }
-
- if (strcmp(arg, "ftp_logging_enable") == 0) {
- if (access("etc/trafficserver/internal/ftp_logging.config", F_OK) == 0) {
- ink_strncpy(value, "checked", sizeof(value));
- } else {
- ink_strncpy(value, "", sizeof(value));
- }
- } else if (strcmp(arg, "ftp_logging_disable") == 0) {
- if (access("etc/trafficserver/internal/ftp_logging.config", F_OK) != 0) {
- ink_strncpy(value, "checked", sizeof(value));
- } else {
- ink_strncpy(value, "", sizeof(value));
- }
- } else if (strcmp(arg, "FTPServerName") == 0) {
- f = fopen("etc/trafficserver/internal/ftp_logging.config", "r");
- if (f != NULL) {
- fgets(buffer, 1024, f);
- sscanf(buffer, "%s\n", value);
- fclose(f);
- } else {
- ink_strncpy(value, "", sizeof(value));
- }
- } else if (strcmp(arg, "FTPUserName") == 0) {
- f = fopen("etc/trafficserver/internal/ftp_logging.config", "r");
- if (f != NULL) {
- fgets(buffer, 1024, f);
- fgets(buffer, 1024, f);
- sscanf(buffer, "%s\n", value);
- fclose(f);
- } else {
- ink_strncpy(value, "", sizeof(value));
- }
- } else if (strcmp(arg, "FTPRemoteDir") == 0) {
- f = fopen("etc/trafficserver/internal/ftp_logging.config", "r");
- if (f != NULL) {
- fgets(buffer, 1024, f);
- fgets(buffer, 1024, f);
- fgets(buffer, 1024, f);
- fgets(buffer, 1024, f);
- sscanf(buffer, "%s\n", value);
- fclose(f);
- } else {
- ink_strncpy(value, "", sizeof(value));
- }
- }
-
- if (strlen(value) != 0) {
- value_safe = substituteForHTMLChars(value);
- whc->response_bdy->copyFrom(value_safe, strlen(value_safe));
- }
-
-Ldone:
- return WEB_HTTP_ERR_OKAY;
-}
-
-#endif
//-------------------------------------------------------------------------
// handle_user
//-------------------------------------------------------------------------
@@ -2685,11 +2439,7 @@ handle_plugin_object(WebHttpContext * wh
HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, NULL, 3);
HtmlRndrSpace(output, 2);
-#ifdef OEM
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_OEM_NO_PLUGINS);
-#else
HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_NO_PLUGINS);
-#endif
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
}
@@ -2698,723 +2448,6 @@ handle_plugin_object(WebHttpContext * wh
}
-#if defined(OEM)
-//-------------------------------------------------------------------------
-// int GetPluginEnableStatus ()
-// Find if plugin line is commented in the plugin.config file
-// return 0 if it is off
-// return 1 if it is on
-// return -1 if plugin does not exist
-// return -2 if any error happens
-//-------------------------------------------------------------------------
-
-static int
-GetPlugInEnableStatus(WebHttpContext * whc, Plugin_t which_plugin)
-{
- textBuffer *output = whc->response_bdy;
- char *p1;
- Rollback *file_rb;
- textBuffer *file_content = NULL;
- version_t ver;
- int return_code;
- char *plugin_lib = NULL;
-
- if (!(configFiles->getRollbackObj("plugin.config", &file_rb))) {
- mgmt_log(stderr, "[handleWebsenseFile] ERROR getting rollback object\n");
- return_code = -2;
- goto done;
- }
- ver = file_rb->getCurrentVersion();
- file_rb->getVersion(ver, &file_content);
-
- switch (which_plugin) {
- case PLUGIN_WEBSENSE:
- plugin_lib = "WebsenseEnterprise/websense.so";
- break;
- case PLUGIN_VSCAN:
- plugin_lib = "vscan.so";
- break;
- default:
- return_code = -2;
- goto done;
- }
-
- if ((p1 = strstr(file_content->bufPtr(), plugin_lib)) == NULL) {
- return_code = -1;
- goto done;
- }
-
- do {
- p1--;
- } while (*p1 == ' ');
-
- if ((char) *p1 == '#') {
- return_code = 0;
- goto done;
- } else {
- return_code = 1;
- goto done;
- }
-
-done:
- if (file_content) {
- delete file_content;
- }
- return return_code;
-}
-
-//-------------------------------------------------------------------------
-// handle_websense_status
-//-------------------------------------------------------------------------
-
-static int
-handle_websense_status(WebHttpContext * whc, char *tag, char *arg)
-{
-
- textBuffer *output = whc->response_bdy;
- char websense_status[256];
- int OnOff = GetPlugInEnableStatus(whc, PLUGIN_WEBSENSE);
-
- if (OnOff == -1)
- goto done;
-
- HtmlRndrTableOpen(output, "100%", 0, 0, 10, NULL);
-
- HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, "2", 2);
- handle_submit_error_flg(whc, "submit_error_flg", "plugin.required.restart");
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_WEBSENSE);
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-
- HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- switch (OnOff) {
- case 0:
- ink_snprintf(websense_status, sizeof(websense_status), "%s\n%s",
- "<input type=\"radio\" name=\"proxy.config.plugin.websense.enabled\" value=\"1\"> Enabled <br>",
- "<input type=\"radio\" name=\"proxy.config.plugin.websense.enabled\" value=\"0\" checked> Disabled");
- break;
- case 1:
- ink_snprintf(websense_status, sizeof(websense_status), "%s\n%s",
- "<input type=\"radio\" name=\"proxy.config.plugin.websense.enabled\" value=\"1\" checked> Enabled <br>",
- "<input type=\"radio\" name=\"proxy.config.plugin.websense.enabled\" value=\"0\"> Disabled");
- break;
- case -2:
- ink_snprintf(websense_status, sizeof(websense_status), "%s\n", "Configuration not available <br>");
- break;
- }
- output->copyFrom(websense_status, strlen(websense_status));
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrUlOpen(output);
- HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_WEBSENSE_HELP);
- HtmlRndrUlClose(output);
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
- HtmlRndrTableClose(output);
-
-done:
- return WEB_HTTP_ERR_OKAY;
-
-}
-
-//-------------------------------------------------------------------------
-// getMaximumClientConnections
-// From the real proxy proxy.lic file
-//-------------------------------------------------------------------------
-int
-getMaximumClientConnections()
-{
- int Mcc;
- char *path;
- char *end_of_path1;
- char license_path[1024];
- char *fileBuff;
- char *ptr, *end_ptr;
- FILE *fp;
- long fsize;
-
- path = GetRmCfgPath();
- if (!path) {
- fprintf(stderr, "Error:rmserver.cfg path not found!\n");
- goto Lerror;
- }
- if ((end_of_path1 = strstr(path, "/rmserver.cfg")) != NULL) {
- memset(license_path, 0, 1024);
- strncpy(license_path, path, (size_t) (end_of_path1 - path));
- strncat(license_path, "/License/proxy.lic", sizeof(license_path) - strlen(license_path) - 1);
- }
- if (path) {
- xfree(path);
- }
- if ((fp = fopen(license_path, "r")) == NULL) {
- mgmt_log(stderr, "Error: unable to open %s\n", license_path);
- goto Lerror;
- }
- /* Get the file size to alloc an text buffer */
- if (fseek(fp, 0, SEEK_END) < 0) {
- goto Lerror;
- } else {
- fsize = ftell(fp);
- rewind(fp);
- fileBuff = new char[fsize + 1];
- memset(fileBuff, 0, fsize + 1);
- if (fread(fileBuff, sizeof(char), fsize, fp) == (size_t) fsize) {
- fclose(fp);
- } else {
- fclose(fp);
- delete[]fileBuff;
- goto Lerror;
- }
- }
- if ((ptr = strstr(fileBuff, "\"ClientConnections\"")) != NULL) {
- if ((ptr = strstr(ptr + strlen("\"ClientConnections\""), "\"")) != NULL) {
- sscanf(ptr + 1, "%d", &Mcc);
- } else {
- delete[]fileBuff;
- goto Lerror;
- }
- } else {
- delete[]fileBuff;
- goto Lerror;
- }
- goto done;
-
-Lerror:
- Mcc = -1;
- return Mcc;
-
-done:
- delete[]fileBuff;
- Debug("web2", "getMaximumClientConnection =%d\n", Mcc);
- return Mcc;
-}
-
-
-static int
-handle_license_check(WebHttpContext * whc, char *tag, char *arg)
-{
- textBuffer *output = whc->response_bdy;
- int MCC = getMaximumClientConnections();
- if (MCC == -1) {
- output->copyFrom("disabled", strlen("disabled"));
- }
-done:
- return WEB_HTTP_ERR_OKAY;
-
-}
-static int
-handle_mcc(WebHttpContext * whc, char *tag, char *arg)
-{
- textBuffer *output = whc->response_bdy;
- int MCC = getMaximumClientConnections();
- if (MCC == -1) {
- output->copyFrom("Not Available", strlen("Not Available"));
- } else {
- char tmpbuff[100];
- memset(tmpbuff, 0, 100);
- ink_snprintf(tmpbuff, sizeof(tmpbuff), "%d", MCC);
- output->copyFrom(tmpbuff, strlen(tmpbuff));
- }
-done:
- return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// int GetArmOnOff ()
-// Find if Arm is enabled
-// return 0 if it is off
-// return 1 if it is on
-// return -1 if any error happens
-//-------------------------------------------------------------------------
-int
-GetArmOnOff()
-{
- return 0;
-}
-
-//-------------------------------------------------------------------------
-// getPort
-// get PNA port if arm is not enabled
-// get PNA Redirect port if arm is enabled.
-//-------------------------------------------------------------------------
-int
-getPort(int enabled)
-{
- INKCfgContext ctx;
- INKRmServerEle *ele;
- int port;
-
- ctx = INKCfgContextCreate(INK_FNAME_RMSERVER);
- if (!ctx) {
- Debug("config", "[getport] can't allocate ctx memory");
- goto Lerror;
- }
- if (INKCfgContextGet(ctx) != INK_ERR_OKAY) {
- Debug("config", "[Rmserver getPort ] Failed to Get and Clear CfgContext");
- goto Lerror;
- }
- // Debug("web", "INKCfgContextGet in WebHttpRender and arm is %d\n", enabled);
- switch (enabled) {
- case 0:
- ele = (INKRmServerEle *) CfgContextGetEleAt(ctx, (int) INK_RM_RULE_PNA_PORT);
- break;
- case 1:
- ele = (INKRmServerEle *) CfgContextGetEleAt(ctx, (int) INK_RM_RULE_PNA_RDT_PORT);
- break;
- case -1:
- goto Lerror;
- }
- port = ele->int_val;
- goto done;
-
-Lerror:
- port = -1;
-
-done:
- INKCfgContextDestroy(ctx);
- return port;
-
-}
-
-//-------------------------------------------------------------------------
-// handle_rm_pna_port
-//-------------------------------------------------------------------------
-
-static int
-handle_rm_pna_port(WebHttpContext * whc, char *tag, char *arg)
-{
- textBuffer *output = whc->response_bdy;
- char port_str[20], arm_str[10];
- int port;
- int OnOff = GetArmOnOff();
- char *warning_str;
-
- ink_snprintf(arm_str, sizeof(arm_str), "%d", OnOff);
- memset(port_str, 0, 20);
- if (ink_hash_table_lookup(whc->submit_warn_ht, "rmserver_rule_1", (void **) &warning_str)) {
- ink_snprintf(port_str, sizeof(port_str), "%s", warning_str);
- } else {
- port = getPort(OnOff);
- if (port == -1) {
- goto done;
- }
- ink_snprintf(port_str, sizeof(port_str), "%d", port);
- }
- HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, "2", 2);
- handle_submit_error_flg(whc, "submit_error_flg", "rmserver_rule_1");
- switch (OnOff) {
- case 0:
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_RM_PNA_PORT);
- break;
- case 1:
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_RM_PNA_RDT_PORT);
- break;
- }
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-
- HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- HtmlRndrInput(output, HTML_CSS_NONE, HTML_TYPE_TEXT, "rmserver_rule_1", port_str, NULL, NULL, "5");
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrUlOpen(output);
- HtmlRndrLi(output);
- switch (OnOff) {
- case 0:
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_RM_PNA_PORT_HELP);
- break;
- case 1:
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_RM_PNA_RDT_PORT_HELP);
- break;
- }
- HtmlRndrUlClose(output);
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-
-done:
- return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// handle_rm_rule
-//-------------------------------------------------------------------------
-
-static int
-handle_rm_rule(WebHttpContext * whc, char *tag, char *arg)
-{
- char rule_value[MAX_VAL_LENGTH];
- INKCfgContext ctx;
- INKRmServerEle *ele;
- int rule_no;
- char *warning_str;
-
- if (arg != NULL) {
- if (ink_hash_table_lookup(whc->submit_warn_ht, arg, (void **) &warning_str)) {
- ink_snprintf(rule_value, sizeof(rule_value), "%s", warning_str);
- } else {
- ctx = INKCfgContextCreate(INK_FNAME_RMSERVER);
- if (!ctx) {
- Debug("config", "[handle_rm_rule] can't allocate ctx memory");
- goto Lerror;
- }
- if (INKCfgContextGet(ctx) != INK_ERR_OKAY) {
- Debug("config", "[handle_rm_rule] Failed to Get and Clear CfgContext");
- goto Lerror;
- }
- sscanf(arg, "rmserver_rule_%d", &rule_no);
- switch (rule_no) {
- case 0:{
- ele = (INKRmServerEle *) CfgContextGetEleAt(ctx, (int) INK_RM_RULE_ADMIN_PORT);
- break;
- }
- case 2:{
- ele = (INKRmServerEle *) CfgContextGetEleAt(ctx, (int) INK_RM_RULE_MAX_PROXY_CONN);
- break;
- }
- case 3:{
- ele = (INKRmServerEle *) CfgContextGetEleAt(ctx, (int) INK_RM_RULE_MAX_GWBW);
- break;
- }
- case 4:{
- ele = (INKRmServerEle *) CfgContextGetEleAt(ctx, (int) INK_RM_RULE_MAX_PXBW);
- break;
- }
- default:
- goto Lerror;
- }
- ink_snprintf(rule_value, sizeof(rule_value), "%d", ele->int_val);
- INKCfgContextDestroy(ctx);
- }
- } else {
- mgmt_log(stderr, "[handle_rm_rule] no argument passed to <@%s ...>", tag);
- }
- goto done;
-
-Lerror:
- ink_snprintf(rule_value, sizeof(rule_value), "%s", "not found");
-
-done:
- whc->response_bdy->copyFrom(rule_value, strlen(rule_value));
- return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// handle_vscan_plugin_status
-//-------------------------------------------------------------------------
-
-static int
-handle_vscan_plugin_status(WebHttpContext * whc, char *tag, char *arg)
-{
-
- char *old_value, *dummy;
- textBuffer *output;
- char vscan_plugin_status[256];
- int OnOff;
-
- output = whc->response_bdy;
-
- if (whc->post_data_ht && // render old values if any
- ink_hash_table_lookup(whc->post_data_ht, "proxy.config.plugin.vscan.enabled", (void **) &old_value)) {
- OnOff = atoi(old_value);
- } else
- OnOff = GetPlugInEnableStatus(whc, PLUGIN_VSCAN);
-
- HtmlRndrTableOpen(output, "100%", 0, 0, 10, NULL);
-
- HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, "2", 2);
- handle_submit_error_flg(whc, "submit_error_flg", "plugin.required.restart");
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_VIRUS_SCAN);
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-
- HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
-
- switch (OnOff) {
- case 0:
- ink_snprintf(vscan_plugin_status, sizeof(vscan_plugin_status), "%s\n%s",
- "<input type=\"radio\" name=\"proxy.config.plugin.vscan.enabled\" value=\"1\"> Enabled <br>",
- "<input type=\"radio\" name=\"proxy.config.plugin.vscan.enabled\" value=\"0\" checked> Disabled");
- break;
- case 1:
- ink_snprintf(vscan_plugin_status, sizeof(vscan_plugin_status), "%s\n%s",
- "<input type=\"radio\" name=\"proxy.config.plugin.vscan.enabled\" value=\"1\" checked> Enabled <br>",
- "<input type=\"radio\" name=\"proxy.config.plugin.vscan.enabled\" value=\"0\"> Disabled");
- break;
- case -1:
- ink_snprintf(vscan_plugin_status, sizeof(vscan_plugin_status), "%s\n",
- "Plugin is not installed or hasn't been installed properly <br>");
- break;
- case -2:
- ink_snprintf(vscan_plugin_status, sizeof(vscan_plugin_status), "%s\n", "Configuration not available <br>");
- break;
- }
-
- output->copyFrom(vscan_plugin_status, strlen(vscan_plugin_status));
- HtmlRndrTdClose(output);
- if (OnOff == 0 || OnOff == 1) { // only display help when plugin is properly installed
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrUlOpen(output);
- HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_VIRUS_SCAN_HELP);
- HtmlRndrUlClose(output);
- HtmlRndrTdClose(output);
- }
- HtmlRndrTrClose(output);
- HtmlRndrTableClose(output);
-
-Ldone:
- return WEB_HTTP_ERR_OKAY;
-}
-
-/*
- handle_vscan_plugin_config_object
- This handle determines whether to render the dispaly of plugin configuration.
- If the plugin is not installed properly, then no plugin configuration dispaly
- will be rendered
- */
-static int
-handle_vscan_plugin_config_object(WebHttpContext * whc, char *tag, char *arg)
-{
-
- if (GetPlugInEnableStatus(whc, PLUGIN_VSCAN) >= 0)
- WebHttpRender(whc, "/configure/c_plugin_vscan_confobj.ink");
- return WEB_HTTP_ERR_OKAY;
-}
-
-/*
- server.address has the format of Server:ip:port;;;Server:ip:port;;;ip:port
- */
-
-int
-parseVscanServerAddr(char *str, VscanObj_t type, int index, char *&rule_value)
-{
-
- char *ip_port_pair = NULL;
- bool found = false;
- int count = 0;
- char *retval = NULL;
-
- if (strlen(str) <= 0) { // empty string
- return WEB_HTTP_ERR_FAIL;
- }
-
- if (strstr(str, ";;;") != NULL) { // has more than one server
- ip_port_pair = strtok(str, ";;;");
- while (ip_port_pair) {
- index--;
- if (index == 0) {
- found = true;
- break;
- }
- ip_port_pair = strtok(NULL, ";;;");
- }
- } else {
- if (index == 1) {
- found = true;
- ip_port_pair = str;
- }
- }
-
- if (found) { //found Server:ip:port pair
- strtok(ip_port_pair, ":"); // skip Server
- if (type == VSCAN_PORT) {
- strtok(NULL, ":");
- }
- retval = strtok(NULL, ":");
- strcpy(rule_value, retval);
- // get rid of ;;;
- retval = strstr(rule_value, ";");
- if (retval)
- *retval = '\0';
- } else
- return WEB_HTTP_ERR_FAIL;
-
- return WEB_HTTP_ERR_OKAY;
-}
-
-/*
- handle_vscan_rule
- parse vscan.config file
- return server name, server port
- */
-static int
-handle_vscan_rule(WebHttpContext * whc, char *tag, char *arg)
-{
-
- char rule_value[MAX_VAL_LENGTH] = { 0 };
- INKCfgContext ctx;
- INKCfgIterState ctx_state;
- INKVscanEle *ele;
- char *warning_str;
- VscanObj_t query_type;
- int query_index;
- char *value_safe = NULL, *old_value = NULL, *dummy = NULL;
- // render old values
-
- if (arg == NULL) {
- mgmt_log(stderr, "[handle_vscan_rule] no argument passed to <@%s ...>", tag);
- goto done;
- }
-
- if (whc->post_data_ht && ink_hash_table_lookup(whc->post_data_ht, arg, (void **) &old_value)) {
- if (old_value && strlen(old_value) != 0) {
- ink_strncpy(rule_value, old_value, sizeof(rule_value));
- } // else, could be empty value
- goto done;
- }
-
- if (ink_hash_table_lookup(whc->submit_warn_ht, arg, (void **) &warning_str)) {
- ink_snprintf(rule_value, sizeof(rule_value), "%s", warning_str);
- } else {
- // first, parse SERVER/PORT and server_no
- if (strstr(arg, "vscan_rule_server") != NULL) { // server
- query_type = VSCAN_SERVER;
- sscanf(arg, "vscan_rule_server_%d", &query_index);
- } else if (strstr(arg, "vscan_rule_port") != NULL) { // port
- query_type = VSCAN_PORT;
- sscanf(arg, "vscan_rule_port_%d", &query_index);
- } else {
- goto Lerror;
- }
-
- ctx = INKCfgContextCreate(INK_FNAME_VSCAN);
- if (!ctx) {
- Debug("config", "[handle_vscan_rule] can't allocate ctx memory");
- goto Lerror;
- }
- if (INKCfgContextGet(ctx) != INK_ERR_OKAY) {
- Debug("config", "[handle_vscan_rule] Failed to Get and Clear CfgContext");
- goto Lerror;
- }
- // currently, only server.address attribute is pull from the file
- // need to fix the code below if more fields are needed
- ele = (INKVscanEle *) INKCfgContextGetFirst(ctx, &ctx_state);
- while (ele) {
- if (strcmp(ele->attr_name, "server.address") == 0) {
- if (parseVscanServerAddr(xstrdup(ele->attr_val), query_type, query_index, rule_value) != WEB_HTTP_ERR_OKAY)
- goto Lerror;
- break;
- }
- ele = (INKVscanEle *) INKCfgContextGetNext(ctx, &ctx_state);
- }
- }
- goto done;
-
-Lerror:
- ink_snprintf(rule_value, sizeof(rule_value), "%s", "\0");
-
-done:
- whc->response_bdy->copyFrom(rule_value, strlen(rule_value));
- return WEB_HTTP_ERR_OKAY;
-
-}
-
-//-------------------------------------------------------------------------
-// handle_vscan_trusted_hosts_list
-//-------------------------------------------------------------------------
-
-static int
-handle_vscan_trusted_hosts_list(WebHttpContext * whc, char *tag, char *arg)
-{
-
- int host_count = 0;
- INKCfgContext ctx;
- INKCfgIterState ctx_state;
- INKVsTrustedHostEle *ele;
- textBuffer *output = whc->response_bdy;
- char *old_value = NULL;
- char tmp[32];
-
- if (arg && strcmp(arg, "new_trusted_host") == 0) {
- if (whc->post_data_ht)
- ink_hash_table_lookup(whc->post_data_ht, arg, (void **) &old_value);
- // no old value foun
- if (old_value)
- whc->response_bdy->copyFrom(old_value, strlen(old_value));
- return WEB_HTTP_ERR_OKAY;
- }
-
- ctx = INKCfgContextCreate(INK_FNAME_VS_TRUSTED_HOST);
- INKCfgContextGet(ctx);
- ele = (INKVsTrustedHostEle *) INKCfgContextGetFirst(ctx, &ctx_state);
- while (ele) {
- HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
- ink_snprintf(tmp, sizeof(tmp), "host:%d", host_count);
- HtmlRndrInput(output, HTML_CSS_NONE, HTML_TYPE_HIDDEN, tmp, ele->hostname, NULL, NULL);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_NONE, HTML_VALIGN_NONE, "99%", NULL, 0);
- output->copyFrom(ele->hostname, strlen(ele->hostname));
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
- ink_snprintf(tmp, sizeof(tmp), "delete:%d", host_count);
- HtmlRndrInput(output, HTML_CSS_NONE, HTML_TYPE_CHECKBOX, tmp, ele->hostname, NULL, NULL);
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
- // move on
- ele = (INKVsTrustedHostEle *) INKCfgContextGetNext(ctx, &ctx_state);
- host_count++;
- }
- if (host_count == 0) {
- HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, NULL, 4);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_VSCAN_NO_TRUSTED_HOSTS);
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
- }
- // add hidden form tags
- ink_snprintf(tmp, sizeof(tmp), "%d", host_count);
- HtmlRndrInput(output, HTML_CSS_NONE, HTML_TYPE_HIDDEN, "host_count", tmp, NULL, NULL);
- return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// handle_vscan_extensions_list
-//-------------------------------------------------------------------------
-
-static int
-handle_vscan_extensions_list(WebHttpContext * whc, char *tag, char *arg)
-{
-
- int ext_count = 0;
- INKCfgContext ctx;
- INKCfgIterState ctx_state;
- INKVsExtensionEle *ele;
- textBuffer *output = whc->response_bdy;
- char *old_value = NULL;
- char tmp[32];
-
- if (arg && strcmp(arg, "new_file_extension") == 0) {
- if (whc->post_data_ht)
- ink_hash_table_lookup(whc->post_data_ht, arg, (void **) &old_value);
- // no old value found
- if (old_value)
- whc->response_bdy->copyFrom(old_value, strlen(old_value));
- return WEB_HTTP_ERR_OKAY;
- }
-
- ctx = INKCfgContextCreate(INK_FNAME_VS_EXTENSION);
- INKCfgContextGet(ctx);
- ele = (INKVsExtensionEle *) INKCfgContextGetFirst(ctx, &ctx_state);
- while (ele) {
- HtmlRndrOptionOpen(output, ele->file_ext, false);
- output->copyFrom(ele->file_ext, strlen(ele->file_ext));
- HtmlRndrOptionClose(output);
- ele = (INKVsExtensionEle *) INKCfgContextGetNext(ctx, &ctx_state);
- ext_count++;
- }
- // add hidden form tags
- ink_snprintf(tmp, sizeof(tmp), "%d", ext_count);
- HtmlRndrInput(output, HTML_CSS_NONE, HTML_TYPE_HIDDEN, "ext_count", tmp, NULL, NULL);
- return WEB_HTTP_ERR_OKAY;
-}
-
-#endif
//-------------------------------------------------------------------------
// handle_ssl_redirect_url
@@ -3681,159 +2714,10 @@ handle_network_object(WebHttpContext * w
return WEB_HTTP_ERR_OKAY;
}
-#ifdef OEM
-//-------------------------------------------------------------------------
-// handle_driver_object
-//-------------------------------------------------------------------------
-static int
-handle_driver_object(WebHttpContext * whc, char *tag, char *arg)
-{
- char *driver_ink_path, *template_ink_path;
- FILE *net_device;
- char buffer[200], command[200], tmpname[80];
- int i, space_len;
- char *pos, *interface;
-
- net_device = fopen("/proc/net/dev", "r");
- for (i = 0; i < 3; i++) {
- fgets(buffer, 200, net_device);
- }
- template_ink_path = WebHttpAddDocRoot_Xmalloc(whc, "/configure/c_net_devdri.ink");
- fgets(buffer, 200, net_device);
- while (!feof(net_device)) {
- pos = strchr(buffer, ':');
- *pos = '\0';
- space_len = strspn(buffer, " ");
- interface = buffer + space_len;
- ink_strncpy(tmpname, "/configure/driver_", sizeof(tmpname));
- strncat(tmpname, interface, sizeof(tmpname) - strlen(tmpname) - 1);
- strncat(tmpname, ".ink", sizeof(tmpname) - strlen(tmpname) - 1);
-
- driver_ink_path = WebHttpAddDocRoot_Xmalloc(whc, tmpname);
- remove(driver_ink_path);
- ink_strncpy(command, "cat ", sizeof(command));
- strncat(command, template_ink_path, sizeof(command) - strlen(command) - 1);
- strncat(command, "| sed 's/netdev/", sizeof(command) - strlen(command) - 1);
- strncat(command, interface, sizeof(command) - strlen(command) - 1);
- strncat(command, "/g' >", sizeof(command) - strlen(command) - 1);
- strncat(command, driver_ink_path, sizeof(command) - strlen(command) - 1);
- strncat(command, " 2>/dev/null", sizeof(command) - strlen(command) - 1);
- system(command);
- WebHttpRender(whc, tmpname);
- remove(driver_ink_path);
- fgets(buffer, 200, net_device);
- }
-
- return WEB_HTTP_ERR_OKAY;
-}
-#endif
-
-
-#ifdef OEM
-#if (HOST_OS == linux)
-char *
-removequotes(char *find)
-{
- char *newword = new char[1024];
- int i = 0;
- while (*find) {
- if (*find != '\"') {
- newword[i] = *find;
- i++;
- }
- find++;
- }
- newword[i] = '\0';
- return newword;
-}
-#endif
-#endif
//handle_snmp
-#ifdef OEM
-#if (HOST_OS == linux)
-static int
-handle_snmp(WebHttpContext * whc, char *tag, char *arg)
-{
- int err = WEB_HTTP_ERR_OKAY;
- char buffer[1024], value[1024], command[256];
- char *value_safe, *old_value, *dummy;
- char *pos, *open_quot, *close_quot;
- char *interface;
- char *newvalue;
- char sys_name[1024], sys_loc[1024], sys_contact[1024], auth_trap[1024], trap_commun[1024], trap_host[1024];
-
-#if (HOST_OS == linux)
- Config_SNMPGetInfo(sys_loc, sizeof(sys_loc), sys_contact, sizeof(sys_contact), sys_name, sizeof(sys_name), auth_trap,
- sizeof(auth_trap), trap_commun, sizeof(trap_commun), trap_host, sizeof(trap_host));
- value[0] = '\0';
- if (strcmp(arg, "SNMP_SYSTEM_NAME") == 0)
- strncpy(value, sys_name, 1024);
- value[1023] = '\0';
- newvalue = removequotes(value);
- ink_strncpy(value, newvalue, sizeof(value));
- delete[]newvalue;
- if (strcmp(arg, "SNMP_TRAP_IP") == 0)
- strncpy(value, trap_host, 1022);
- value[1023] = '\0';
-
- if (strcmp(arg, "AUTH_TRAP_ENABLE") == 0) {
- strncpy(value, auth_trap, 1022);
- value[1023] = '\0';
- if (strcmp(value, "1") == 0)
- ink_strncpy(value, "Enabled", sizeof(value));
- else if (strcmp(value, "2") == 0)
- ink_strncpy(value, "Disabled", sizeof(value));
- else
- ink_strncpy(value, "Blank", sizeof(value));
-
- }
-
- if (strcmp(arg, "SYS_LOCATION") == 0)
- strncpy(value, sys_loc, 1022);
- value[1023] = '\0';
- newvalue = removequotes(value);
- ink_strncpy(value, newvalue, sizeof(value));
- delete[]newvalue;
- if (strcmp(arg, "SYS_CONTACT") == 0)
- strncpy(value, sys_contact, 1022);
- value[1023] = '\0';
- newvalue = removequotes(value);
- ink_strncpy(value, newvalue, sizeof(value));
- delete[]newvalue;
- if (strcmp(arg, "COMMUNITY_NAME") == 0)
- strncpy(value, trap_commun, 1022);
- value[1023] = '\0';
-
- if (strcmp(arg, "auth_trap_enable") == 0) {
- strncpy(value, auth_trap, 1022);
- value[1023] = '\0';
- if (strcmp(value, "1") == 0)
- ink_strncpy(value, "checked", sizeof(value));
- else
- ink_strncpy(value, "", sizeof(value));
- }
- if (strcmp(arg, "auth_trap_disable") == 0) {
- strncpy(value, auth_trap, 1022);
- value[1023] = '\0';
- if (strcmp(value, "2") == 0)
- ink_strncpy(value, "checked", sizeof(value));
- else
- ink_strncpy(value, "", sizeof(value));
- }
-
- value_safe = substituteForHTMLChars(value);
- whc->response_bdy->copyFrom(value_safe, strlen(value_safe));
-Ldone:
- return err;
-#else
- return err;
-#endif
-}
-#endif
-#endif
//-------------------------------------------------------------------------
@@ -3867,9 +2751,6 @@ WebHttpRenderInit()
ink_hash_table_insert(g_display_bindings_ht, "action_checked", (void *) handle_action_checked);
ink_hash_table_insert(g_display_bindings_ht, "select", (void *) handle_select);
ink_hash_table_insert(g_display_bindings_ht, "password_object", (void *) handle_password_object);
-#ifdef OEM
- ink_hash_table_insert(g_display_bindings_ht, "sessionid", (void *) handle_sessionid);
-#endif //OEM
ink_hash_table_insert(g_display_bindings_ht, "select_system_logs", (void *) handle_select_system_logs);
ink_hash_table_insert(g_display_bindings_ht, "select_access_logs", (void *) handle_select_access_logs);
ink_hash_table_insert(g_display_bindings_ht, "select_debug_logs", (void *) handle_select_debug_logs);
@@ -3887,20 +2768,6 @@ WebHttpRenderInit()
ink_hash_table_insert(g_display_bindings_ht, "time", (void *) handle_time);
ink_hash_table_insert(g_display_bindings_ht, "user", (void *) handle_user);
ink_hash_table_insert(g_display_bindings_ht, "plugin_object", (void *) handle_plugin_object);
-#if defined(OEM)
- ink_hash_table_insert(g_display_bindings_ht, "snmp", (void *) handle_snmp);
- ink_hash_table_insert(g_display_bindings_ht, "websense_status", (void *) handle_websense_status);
- ink_hash_table_insert(g_display_bindings_ht, "rm_rule", (void *) handle_rm_rule);
- ink_hash_table_insert(g_display_bindings_ht, "rm_pna_port", (void *) handle_rm_pna_port);
- ink_hash_table_insert(g_display_bindings_ht, "license_check", (void *) handle_license_check);
- ink_hash_table_insert(g_display_bindings_ht, "mcc", (void *) handle_mcc);
- ink_hash_table_insert(g_display_bindings_ht, "vscan_plugin_status", (void *) handle_vscan_plugin_status);
- ink_hash_table_insert(g_display_bindings_ht, "vscan_plugin_config_object",
- (void *) handle_vscan_plugin_config_object);
- ink_hash_table_insert(g_display_bindings_ht, "vscan_rule", (void *) handle_vscan_rule);
- ink_hash_table_insert(g_display_bindings_ht, "vscan_trusted_hosts_list", (void *) handle_vscan_trusted_hosts_list);
- ink_hash_table_insert(g_display_bindings_ht, "vscan_extensions_list", (void *) handle_vscan_extensions_list);
-#endif
ink_hash_table_insert(g_display_bindings_ht, "ssl_redirect_url", (void *) handle_ssl_redirect_url);
ink_hash_table_insert(g_display_bindings_ht, "host_redirect_url", (void *) handle_host_redirect_url);
ink_hash_table_insert(g_display_bindings_ht, "help_link", (void *) handle_help_link);
@@ -3912,11 +2779,6 @@ WebHttpRenderInit()
ink_hash_table_insert(g_display_bindings_ht, "config_table_object", (void *) handle_config_table_object);
ink_hash_table_insert(g_display_bindings_ht, "network", (void *) handle_network);
ink_hash_table_insert(g_display_bindings_ht, "network_object", (void *) handle_network_object);
-#ifdef OEM
- ink_hash_table_insert(g_display_bindings_ht, "date", (void *) handle_date);
- ink_hash_table_insert(g_display_bindings_ht, "driver_object", (void *) handle_driver_object);
- ink_hash_table_insert(g_display_bindings_ht, "ftp_logging", (void *) handle_ftp_logging);
-#endif
ink_hash_table_insert(g_display_bindings_ht, "clear_cluster_stats", (void *) handle_clear_cluster_stats);
return;
}
@@ -4473,45 +3335,6 @@ HtmlRndrUlClose(textBuffer * html)
//-------------------------------------------------------------------------
// HtmlRndrInput
//-------------------------------------------------------------------------
-#ifdef OEM
-int
-HtmlRndrInput(textBuffer * html,
- HtmlCss css, HtmlType type, char *name, char *value, char *target, char *onclick, char *size = NULL)
-{
- char tmp[MAX_TMP_BUF_LEN + 1];
- html->copyFrom("<input", 6);
- if (css) {
- ink_snprintf(tmp, MAX_TMP_BUF_LEN, " class=\"%s\"", css);
- html->copyFrom(tmp, strlen(tmp));
- }
- if (type) {
- ink_snprintf(tmp, MAX_TMP_BUF_LEN, " type=\"%s\"", type);
- html->copyFrom(tmp, strlen(tmp));
- }
- if (size) {
- ink_snprintf(tmp, MAX_TMP_BUF_LEN, " size=\"%s\"", size);
- html->copyFrom(tmp, strlen(tmp));
- }
- if (name) {
- ink_snprintf(tmp, MAX_TMP_BUF_LEN, " name=\"%s\"", name);
- html->copyFrom(tmp, strlen(tmp));
- }
- if (value) {
- ink_snprintf(tmp, MAX_TMP_BUF_LEN, " value=\"%s\"", value);
- html->copyFrom(tmp, strlen(tmp));
- }
- if (target) {
- ink_snprintf(tmp, MAX_TMP_BUF_LEN, " target=\"%s\"", target);
- html->copyFrom(tmp, strlen(tmp));
- }
- if (onclick) {
- ink_snprintf(tmp, MAX_TMP_BUF_LEN, " onclick=\"%s\"", onclick);
- html->copyFrom(tmp, strlen(tmp));
- }
- html->copyFrom(">\n", 2);
- return WEB_HTTP_ERR_OKAY;
-}
-#else
int
HtmlRndrInput(textBuffer * html, const HtmlCss css, const HtmlType type, const char *name, const char *value, const char *target, const char *onclick)
{
@@ -4544,7 +3367,6 @@ HtmlRndrInput(textBuffer * html, const H
html->copyFrom(">\n", 2);
return WEB_HTTP_ERR_OKAY;
}
-#endif
//-------------------------------------------------------------------------
// HtmlRndrInput
Modified: trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpRender.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpRender.h?rev=941419&r1=941418&r2=941419&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpRender.h (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpRender.h Wed May 5 18:35:52 2010
@@ -88,9 +88,6 @@
#define HTML_ID_AUTH_MONITOR_CHANGE "s_text_035"
#define HTML_ID_USER "s_text_036"
#define HTML_ID_NO_PLUGINS "s_text_037"
-#ifdef OEM
-#define HTML_ID_OEM_NO_PLUGINS "s_text_038"
-#endif
#define HTML_ID_NO_STATS "s_text_039"
#define HTML_ID_SUBMIT_WARN_FLG "s_text_100"
@@ -115,10 +112,6 @@
#define HTML_ID_SUBMIT_NOTE_FLG "s_text_150"
#define HTML_ID_RESTART_REQUIRED "s_text_151"
#define HTML_ID_NEW_ADMIN_PASSWD_SET "s_text_152"
-#ifdef OEM
-#define HTML_ID_RM_RESTART_REQUIRED "s_text_153"
-#define HTML_ID_IPNAT_CHANGE_REQUIRED "s_text_154"
-#endif
#define HTML_ID_RESTART_REQUIRED_FILE "s_text_155"
#define HTML_ID_INSPECTOR_REGEX_MISSED "s_text_300"
@@ -373,39 +366,10 @@
#define HTML_ID_CFG_COMMIT_ERROR "s_text_905"
#define HTML_ID_CFG_INVALID_RULE "s_text_906"
-#ifdef OEM
-#define HTML_ID_CFG_WEBSENSE "s_text_2000"
-#define HTML_ID_CFG_WEBSENSE_HELP "s_text_2001"
-
-#define HTML_ID_CFG_RM_PNA_PORT "s_text_2010"
-#define HTML_ID_CFG_RM_PNA_RDT_PORT "s_text_2011"
-#define HTML_ID_CFG_RM_PNA_PORT_HELP "s_text_2012"
-#define HTML_ID_CFG_RM_PNA_RDT_PORT_HELP "s_text_2013"
-#endif
#define HTML_ID_CLEAR_CLUSTER_STAT "s_text_2020"
#define HTML_ID_CLEAR_CLUSTER_STAT_HELP "s_text_2021"
-#ifdef OEM
-/* vscan.config */
-#define HTML_ID_CFG_VIRUS_SCAN "s_text_2030"
-#define HTML_ID_CFG_VIRUS_SCAN_HELP "s_text_2031"
-#define HTML_ID_CFG_VSCAN_IP_FORMAT_ERROR "s_text_2032"
-#define HTML_ID_CFG_VSCAN_PORT_FORMAT_ERROR "s_text_2033"
-#define HTML_ID_CFG_VSCAN_SERVER_FORMAT_ERROR "s_text_2034"
-#define HTML_ID_CFG_VSCAN_PRIMARY_SERVER_ERROR "s_text_2035"
-#define HTML_ID_REBOOT_REQUIRED "s_text_2036"
-/* trusted-host.config */
-#define HTML_ID_CFG_VSCAN_NO_TRUSTED_HOSTS "s_text_2040"
-#define HTML_ID_CFG_VSCAN_HOST_URL_ERROR "s_text_2041"
-#define HTML_ID_CFG_VSCAN_HOST_IP_ERROR "s_text_2042"
-#define HTML_ID_CFG_VSCAN_HOST_NAME_ERROR "s_text_2043"
-#define HTML_ID_CFG_VSCAN_HOST_DUPLICATE_ERROR "s_text_2044"
-/* extensions.config */
-#define HTML_ID_CFG_VSCAN_EXT_ERROR "s_text_2050"
-#define HTML_ID_CFG_VSCAN_EXT_DUPLICATE_ERROR "s_text_2051"
-#define HTML_ID_CFG_VSCAN_EXTFR_FILE_MISSING "s_text_2052"
-#endif
/*********************/
@@ -451,9 +415,6 @@
#define HTML_TYPE_SUBMIT "submit"
#define HTML_TYPE_CHECKBOX "checkbox"
#define HTML_TYPE_BUTTON "button"
-#ifdef OEM
-#define HTML_TYPE_TEXT "text"
-#endif
#define HTML_WRAP_OFF "off"
@@ -470,9 +431,6 @@
#define HTML_OTW_UPGRADE_CGI_FILE "/configure/helper/traffic_shell.cgi"
#define HTML_FEATURE_ON_OFF_FILE "/configure/c_basic.ink"
#define HTML_DEFAULT_HELP_FILE "/help/ts.ink"
-#ifdef OEM
-#define HTML_DEFAULT_RM_FILE "/configure/c_realnetworks_realproxy.ink"
-#endif
#define HTML_CHART_FILE "/charting/chart.cgi"
#define HTML_SUBMIT_ALARM_FILE "/submit_alarm.cgi"
@@ -490,15 +448,6 @@
#define HTML_SUBMIT_CONFIG_DISPLAY "/configure/submit_config_display.cgi"
#define HTML_SUBMIT_NET_CONFIG "/submit_net_config.cgi"
#define HTML_SUBMIT_OTW_UPGRADE_FILE "/submit_otw_upgrade.cgi"
-#ifdef OEM
-#define HTML_SUBMIT_SNMP_CONFIG "/submit_snmp_config.cgi"
-#define HTML_SUBMIT_SESSION "/submit_session.cgi"
-#define HTML_SUBMIT_RELOGIN "/submit_relogin.cgi"
-#define HTML_SUBMIT_PLUGIN_WEBSENSE "/submit_plugin_websense.cgi"
-#define HTML_SUBMIT_RMSERVER "/submit_rmserver.cgi"
-#define RMSERVER_WEB_ENTRY 5
-#define HTML_SUBMIT_PLUGIN_VSCAN "/submit_plugin_vscan.cgi"
-#endif
#define HTML_BACKDOOR_STATS "/monitor/m_records.cgi"
#define HTML_BACKDOOR_CONFIGS "/configure/c_records.cgi"
#define HTML_BACKDOOR_STATS_REC "/monitor/m_records_rec.cgi"
@@ -586,12 +535,7 @@ int HtmlRndrOptionClose(textBuffer * htm
int HtmlRndrPreClose(textBuffer * html);
int HtmlRndrUlClose(textBuffer * html);
-#ifdef OEM
-int HtmlRndrInput(textBuffer * html, HtmlCss css, HtmlType type, char *name, char *value, char *target, char *onclick,
- char *size = NULL);
-#else
int HtmlRndrInput(textBuffer * html, const HtmlCss css, const HtmlType type, const char *name, const char *value, const char *target, const char *onclick);
-#endif
int HtmlRndrInput(textBuffer * html, MgmtHashTable * dict_ht, HtmlCss css, HtmlType type, char *name, HtmlId value_id);
int HtmlRndrBr(textBuffer * html);
@@ -604,20 +548,4 @@ int HtmlRndrImg(textBuffer * html, const
int HtmlRndrDotClear(textBuffer * html, int width, int height);
int HtmlRndrSelectList(textBuffer * html, const char *listName, const char *options[], int numOpts);
-#ifdef OEM
-int getMaximumClientConnections();
-enum Plugin_t
-{
- PLUGIN_NONE = 0,
- PLUGIN_WEBSENSE,
- PLUGIN_VSCAN,
-};
-enum VscanObj_t
-{
- VSCAN_SERVER = 0,
- VSCAN_PORT,
-};
-
-const static int NUM_VSERVERS = 3;
-#endif
#endif // _WEB_HTTP_RENDER_H_
Modified: trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpSession.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpSession.cc?rev=941419&r1=941418&r2=941419&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpSession.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpSession.cc Wed May 5 18:35:52 2010
@@ -219,159 +219,3 @@ WebHttpMakeSessionKey_Xmalloc()
-#ifdef OEM
-
-static InkHashTable *current_session_ht = 0;
-//static ink_mutex current_session_mutex;
-
-//struct current_session_ele {
- //time_t created;
- //time_t last_access;
-//};
-
-
-
-//-------------------------------------------------------------------------
-// current_deleter_main
-//-------------------------------------------------------------------------
-
-static void *
-current_deleter_main(void *unused)
-{
- time_t now;
- InkHashTableIteratorState htis;
- InkHashTableEntry *hte;
- char *key;
- current_session_ele *session;
- int session_count;
- MgmtInt sessionTimeout = 0;
- bool found;
-
- while (1) {
- sessionTimeout = REC_readInteger("proxy.config.admin.session.timeout", &found);
- time(&now);
- ink_mutex_acquire(&wGlobals.submitLock);
- // mutex_try_acquire to avoid potential deadlocking; not so
- // critical that we don't delete these objects right now.
- session_count = 0;
- if (ink_mutex_try_acquire(¤t_session_mutex)) {
- for (hte = ink_hash_table_iterator_first(current_session_ht, &htis);
- hte != NULL; hte = ink_hash_table_iterator_next(current_session_ht, &htis)) {
- key = (char *) ink_hash_table_entry_key(current_session_ht, hte);
- session = (current_session_ele *) ink_hash_table_entry_value(current_session_ht, hte);
- if (session->last_access != 0) {
- if (now - session->last_access > sessionTimeout) {
- ink_hash_table_delete(current_session_ht, key);
- //session->deleter_func(session->data);
- xfree(session);
- //session->session_status = false;
- } else {
- session_count++;
- }
- }
- }
- ink_mutex_release(¤t_session_mutex);
- }
- ink_mutex_release(&wGlobals.submitLock);
- // random arbitrary heuristic
- mgmt_sleep_sec(CURRENT_SESSION_EXPIRES / 10);
- }
- return NULL;
-}
-
-//-------------------------------------------------------------------------
-// WebHttpCurrentSessionInit
-//-------------------------------------------------------------------------
-
-void
-WebHttpCurrentSessionInit()
-{
- time_t now;
- time(&now);
- WebSeedRand((long) now);
- current_session_ht = ink_hash_table_create(InkHashTableKeyType_String);
- ink_mutex_init(¤t_session_mutex, "current_session_mutex");
- ink_thread_create(current_deleter_main, NULL);
-}
-
-
-//-------------------------------------------------------------------------
-// WebHttpSessionStore
-//-------------------------------------------------------------------------
-
-int
-WebHttpCurrentSessionStore(char *key)
-{
- int err = WEB_HTTP_ERR_OKAY;
- current_session_ele *session;
- void *dummy;
- time_t now;
-
- if (!key) {
- return WEB_HTTP_ERR_FAIL;
- }
- ink_mutex_acquire(¤t_session_mutex);
- time(&now);
- session = (current_session_ele *) xmalloc(sizeof(current_session_ele));
- session->created = now;
- session->last_access = now;
- session->session_status = true;
- ink_hash_table_insert(current_session_ht, key, (void *) session);
-
-Ldone:
- ink_mutex_release(¤t_session_mutex);
- return err;
-}
-
-
-//-------------------------------------------------------------------------
-// WebHttpCurrentSessionRetrieve
-//-------------------------------------------------------------------------
-
-int
-WebHttpCurrentSessionRetrieve(char *key, current_session_ele ** data)
-{
- int err;
- current_session_ele *session;
- if (!key) {
- return WEB_HTTP_ERR_FAIL;
- }
- ink_mutex_acquire(¤t_session_mutex);
- if (!ink_hash_table_lookup(current_session_ht, key, (void **) &session)) {
- *data = NULL;
- err = WEB_HTTP_ERR_FAIL;
- } else {
- *data = session;
- err = WEB_HTTP_ERR_OKAY;
- }
- ink_mutex_release(¤t_session_mutex);
- return err;
-}
-
-
-//-------------------------------------------------------------------------
-// WebHttpCurrentSessionDelete
-//-------------------------------------------------------------------------
-
-int
-WebHttpCurrentSessionDelete(char *key)
-{
- int err = WEB_HTTP_ERR_OKAY;
- current_session_ele *session;
- if (!key) {
- return WEB_HTTP_ERR_FAIL;
- }
- ink_mutex_acquire(¤t_session_mutex);
- if (!ink_hash_table_lookup(current_session_ht, key, (void **) &session)) {
- err = WEB_HTTP_ERR_FAIL;
- goto Ldone;
- }
- ink_hash_table_delete(current_session_ht, key);
- //session->deleter_func(session->data);
- xfree(session);
-Ldone:
- ink_mutex_release(¤t_session_mutex);
- return err;
-}
-
-#endif //OEM
Modified: trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpSession.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpSession.h?rev=941419&r1=941418&r2=941419&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpSession.h (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpSession.h Wed May 5 18:35:52 2010
@@ -43,21 +43,4 @@ int WebHttpSessionDelete(char *key);
char *WebHttpMakeSessionKey_Xmalloc();
-#ifdef OEM
-struct current_session_ele
-{
- char *session_id;
- time_t created;
- time_t last_access;
- char *last_state;
- bool session_status;
-};
-
-static ink_mutex current_session_mutex;
-
-void WebHttpCurrentSessionInit();
-int WebHttpCurrentSessionStore(char *key);
-int WebHttpCurrentSessionRetrieve(char *key, current_session_ele ** data);
-int WebHttpCurrentSessionDelete(char *key);
-#endif // OEM
#endif // _WEB_HTTP_SESSION_