Skip to Content.
Sympa Menu

ndt-dev - [ndt-dev] [ndt] r787 committed - Adding client identifier to metadata

Subject: NDT-DEV email list created

List archive

[ndt-dev] [ndt] r787 committed - Adding client identifier to metadata


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt-dev] [ndt] r787 committed - Adding client identifier to metadata
  • Date: Mon, 29 Oct 2012 17:56:58 +0000

Revision: 787
Author:

Date: Mon Oct 29 10:56:28 2012
Log: Adding client identifier to metadata
http://code.google.com/p/ndt/source/detail?r=787

Modified:
/trunk/Applet/NDTConstants.java
/trunk/Applet/Tcpbw100.java
/trunk/src/logging.c
/trunk/src/logging.h
/trunk/src/test_meta.h
/trunk/src/test_meta_clt.c
/trunk/src/test_meta_srv.c
/trunk/tcpbw100.template

=======================================
--- /trunk/Applet/NDTConstants.java Mon Aug 13 10:49:28 2012
+++ /trunk/Applet/NDTConstants.java Mon Oct 29 10:56:28 2012
@@ -18,6 +18,7 @@
public static final String META_BROWSER_OS = "client.browser.name";
public static final String META_CLIENT_KERNEL_VERSION = "client.kernel.version";
public static final String META_CLIENT_VERSION = "client.version";
+ public static final String META_CLIENT_APPLICATION = "client.application";

/*
* TODO for a later release: Version could be moved to some
"configurable"
@@ -108,12 +109,10 @@
public static final int TCP_MAX_RECV_WIN_SIZE = 65535;

// Section: Data units
- public static final int KILO = 1000; // Used in conversions from
-
// seconds->mS,
- public static final int KILO_BITS = 1024;// Used in kilobits->bits
-
// conversions
- public static final double EIGHT = 8.0; // Used in octal number, conversions from
-
// Bytes-> bits etc
+ public static final int KILO = 1000; // Used in conversions from seconds->mS,
+ public static final int KILO_BITS = 1024;// Used in kilobits->bits conversions
+ public static final double EIGHT = 8.0; // Used in octal number, conversions from Bytes-> bits etc
+ // EIGHT is a double to minimize overflow when converting.

// Section: Duplex mismatch conditions
public static final int DUPLEX_OK_INDICATOR = 0;
=======================================
--- /trunk/Applet/Tcpbw100.java Wed May 2 10:13:30 2012
+++ /trunk/Applet/Tcpbw100.java Mon Oct 29 10:56:28 2012
@@ -192,6 +192,7 @@
private ResourceBundle _resBundDisplayMsgs;
private String _sLang = "en";
private String _sCountry = "US";
+ private String _sClient = "applet";
// private static String lang="nb";
// private static String country="NO";
/***/
@@ -275,8 +276,8 @@
* */
public static void main(String[] args) {
JFrame frame = new JFrame("ANL/Internet2 NDT (applet)");
- if (args.length != 1) {
- System.out.println("Usage: java -jar Tcpbw100.jar " +
"HOST");
+ if (args.length < 1 || args.length > 2) {
+ System.out.println("Usage: java -jar Tcpbw100.jar <hostname> [client-id]");
System.exit(0);
}
final Tcpbw100 applet = new Tcpbw100();
@@ -288,6 +289,9 @@
});
applet._bIsApplication = true;
applet.sHostName = args[0];
+ if (args.length > 1) {
+ applet._sClient = args[1];
+ }
frame.getContentPane().add(applet);
frame.setSize(700, 320);
applet.init();
@@ -743,6 +747,9 @@
if (getParameter("language") != null) {
_sLang = getParameter("language");
}
+ if (getParameter("client") != null) {
+ _sClient = getParameter("client");
+ }

try {
_localeObj = new Locale(_sLang, _sCountry);
@@ -2142,7 +2149,7 @@
* @see Protocol#send_msg(byte bParamType, byte[] baParamTab) These methods
* indicate more information about IOException
* */
- public boolean test_meta(Protocol paramProtoObj) throws IOException {
+ public boolean test_meta(Protocol paramProtoObj, String application) throws IOException {
Message msg = new Message();
// Start META tests
if ((_yTests & NDTConstants.TEST_META) ==
NDTConstants.TEST_META) {
@@ -2220,11 +2227,10 @@
paramProtoObj.send_msg(MessageType.TEST_MSG,
(NDTConstants.META_CLIENT_KERNEL_VERSION +
":" + System

.getProperty("os.version")).getBytes());
- paramProtoObj
- .send_msg(
- MessageType.TEST_MSG,
-
(NDTConstants.META_CLIENT_VERSION + ":" + NDTConstants.VERSION)
-
.getBytes());
+ paramProtoObj.send_msg(MessageType.TEST_MSG,
+ (NDTConstants.META_CLIENT_VERSION + ":" + NDTConstants.VERSION).getBytes());
+ paramProtoObj.send_msg(MessageType.TEST_MSG,
+ (NDTConstants.META_CLIENT_APPLICATION + ":" + application) .getBytes());

// Client can send any number of such meta data in a
TEST_MSG
// format, and signal
@@ -2592,7 +2598,7 @@
break;
case NDTConstants.TEST_META:

sPanel.setText(_resBundDisplayMsgs.getString("meta"));
- if (test_meta(protocolObj)) {
+ if (test_meta(protocolObj, _sClient)) {
_resultsTxtPane.append(_sErrMsg);

_resultsTxtPane.append(_resBundDisplayMsgs
.getString("metaFailed") +
"\n");
@@ -3861,4 +3867,3 @@
}

} // class: Tcpbw100
-
=======================================
--- /trunk/src/logging.c Tue Oct 16 08:22:53 2012
+++ /trunk/src/logging.c Mon Oct 29 10:56:28 2012
@@ -1064,6 +1064,7 @@
fprintf(fp, "client hostname: %s\n", meta.client_name);
fprintf(fp, "client OS name: %s\n", meta.client_os);
fprintf(fp, "client_browser name: %s\n", meta.client_browser);
+ fprintf(fp, "client_application name: %s\n", meta.client_application);
fprintf(fp, "Summary data: %s\n", meta.summary);
if (meta.additional) {
fprintf(fp, " * Additional data:\n");
=======================================
--- /trunk/src/logging.h Mon Aug 13 10:49:28 2012
+++ /trunk/src/logging.h Mon Oct 29 10:56:28 2012
@@ -73,6 +73,7 @@
char client_name[64]; // client's host-name
char client_os[32]; // client OS name
char client_browser[32]; // client's browser name
+ char client_application[32]; // client application name
int ctl_port; // ctl port
char server_ip[64]; // server IP address
char server_name[64]; // server's host-name
=======================================
--- /trunk/src/test_meta.h Mon Apr 30 13:46:39 2012
+++ /trunk/src/test_meta.h Mon Oct 29 10:56:28 2012
@@ -12,6 +12,7 @@
#define META_BROWSER_OS "client.browser.name"
#define META_CLIENT_KERNEL_VERSION "client.kernel.version"
#define META_CLIENT_VERSION "client.version"
+#define META_CLIENT_APPLICATION "client.application"

#define META_TEST_LOG "META test"

=======================================
--- /trunk/src/test_meta_clt.c Mon Apr 30 13:46:39 2012
+++ /trunk/src/test_meta_clt.c Mon Oct 29 10:56:28 2012
@@ -82,6 +82,8 @@
printf("sending meta information to server . . . . . ");
fflush(stdout);

+ sprintf(buff, "%s:%s", META_CLIENT_APPLICATION, "cli");
+ send_msg(ctlSocket, TEST_MSG, buff, strlen(buff));
// send client os name details
if ((fp = fopen("/proc/sys/kernel/ostype", "r")) == NULL) {
log_println(0, "Unable to determine client os type.");
=======================================
--- /trunk/src/test_meta_srv.c Fri Aug 31 12:28:29 2012
+++ /trunk/src/test_meta_srv.c Mon Oct 29 10:56:28 2012
@@ -119,6 +119,11 @@
snprintf(meta.client_os, sizeof(meta.client_os),
"%s", value);
/*continue;*/
}
+
+ if (strcmp(META_CLIENT_APPLICATION, buff) == 0) {
+ snprintf(meta.client_application, sizeof(meta.client_application), "%s", value);
+ /*continue;*/
+ }

if (strcmp(META_BROWSER_OS, buff) == 0) {
snprintf(meta.client_browser,
sizeof(meta.client_browser), "%s",
=======================================
--- /trunk/tcpbw100.template Tue May 10 04:16:40 2011
+++ /trunk/tcpbw100.template Mon Oct 29 10:56:28 2012
@@ -72,6 +72,7 @@

<PARAM NAME="language" VALUE="en">
<PARAM NAME="country" VALUE="US">
+ <PARAM NAME="client" VALUE="applet">

</applet>
</td></tr></table>


  • [ndt-dev] [ndt] r787 committed - Adding client identifier to metadata, ndt, 10/29/2012

Archive powered by MHonArc 2.6.16.

Top of Page