diff --git a/client/src/core/host.cc b/client/src/core/host.cc
index 5dc5684..6748a61 100644
--- a/client/src/core/host.cc
+++ b/client/src/core/host.cc
@@ -110,7 +110,7 @@
}
bool Host::isReady() const {
- this->session->waitForReady(this->timeout);
+// this->session->waitForReady(this->timeout);
return getProgramMessage() == MESSAGE_NONE;
}
diff --git a/client/src/include/ipc-client-internals.h b/client/src/include/ipc-client-internals.h
index 182f0f1..f96c2d7 100644
--- a/client/src/include/ipc-client-internals.h
+++ b/client/src/include/ipc-client-internals.h
@@ -192,6 +192,7 @@
std::string getRevision() const override;
std::string getLUName() const override;
std::string getHostURL() const override;
+ SSLState getSSLState() const override;
unsigned short getScreenWidth() const override;
unsigned short getScreenHeight() const override;
@@ -373,6 +374,7 @@
std::string getRevision() const override;
std::string getLUName() const override;
std::string getHostURL() const override;
+ SSLState getSSLState() const override;
unsigned short getScreenWidth() const override;
unsigned short getScreenHeight() const override;
diff --git a/client/src/session/local/session.cc b/client/src/session/local/session.cc
index 99d7e2a..17d6522 100644
--- a/client/src/session/local/session.cc
+++ b/client/src/session/local/session.cc
@@ -695,6 +695,10 @@
return (unsigned short) lib3270_get_length(hSession);
}
+ TN3270::SSLState Local::Session::getSSLState() const override {
+ return lib3270_get_secure(hSession);
+ }
+
}
diff --git a/client/src/session/remote/session.cc b/client/src/session/remote/session.cc
index 05a2a79..fad6a5e 100644
--- a/client/src/session/remote/session.cc
+++ b/client/src/session/remote/session.cc
@@ -447,6 +447,15 @@
int value;
getProperty("length",value);
return (unsigned short) value;
+
+ }
+
+ TN3270::SSLState Local::Session::getSSLState() const override {
+
+ int value;
+ getProperty("sslstate",value);
+ return (TN3270::SSLState) value;
+
}
}
diff --git a/common/src/include/lib3270/ipc-glib.h b/common/src/include/lib3270/ipc-glib.h
index 05881e7..7412103 100644
--- a/common/src/include/lib3270/ipc-glib.h
+++ b/common/src/include/lib3270/ipc-glib.h
@@ -61,6 +61,25 @@
G_BEGIN_DECLS
+ #define GLIB_TYPE_IPC3270_RESPONSE (ipc3270Response_get_type ())
+ #define IPC3270_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLIB_TYPE_IPC3270_RESPONSE, ipc3270Response))
+ #define IPC3270_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLIB_TYPE_IPC3270_RESPONSE, ipc3270ResponseClass))
+ #define IS_IPC3270_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLIB_TYPE_IPC3270_RESPONSE))
+ #define IS_IPC3270_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLIB_TYPE_IPC3270_RESPONSE))
+ #define IPC3270_RESPONSE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS ((obj), GLIB_TYPE_IPC3270_RESPONSE, ipc3270ResponseClass))
+
+ typedef struct _ipc3270Response ipc3270Response;
+ typedef struct _ipc3270ResponseClass ipc3270ResponseClass;
+
+ GObject * ipc3270_response_new();
+
+ void ipc3270_response_append_int32(GObject *object, gint32 value);
+ void ipc3270_response_append_uint32(GObject *object, guint32 value);
+ void ipc3270_response_append_3270_string(GObject *object, const char *text, GError **error);
+ gboolean ipc3270_response_has_values(GObject *object);
+ GVariant * ipc3270_response_steal_value(GObject *object);
+
+
#define GLIB_TYPE_IPC3270 (ipc3270_get_type ())
#define IPC3270(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLIB_TYPE_IPC3270, ipc3270))
#define IPC3270_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLIB_TYPE_IPC3270, ipc3270Class))
@@ -121,7 +140,7 @@
void ipc3270_set_error(GObject *object, int errcode, GError **error);
- GVariant * ipc3270_method_call(GObject *object, const gchar *method_name, GVariant *parameters, GError **error);
+ void ipc3270_method_call(GObject *object, const gchar *method_name, GVariant *request, GObject *response, GError **error);
gboolean ipc3270_set_property(GObject *object, const gchar *property_name, GVariant *value, GError **error);
GVariant * ipc3270_get_property(GObject *object, const gchar *property_name, GError **error);
diff --git a/common/src/include/lib3270/ipc.h b/common/src/include/lib3270/ipc.h
index 0e5f8c4..faac8ac 100644
--- a/common/src/include/lib3270/ipc.h
+++ b/common/src/include/lib3270/ipc.h
@@ -141,6 +141,14 @@
CONNECTED_TN3270E = LIB3270_CONNECTED_TN3270E, ///< @brief connected in TN3270E mode, 3270 mode
};
+ enum SSLState : uint8_t {
+ SSL_UNSECURE = LIB3270_SSL_UNSECURE, ///< @brief No secure connection
+ SSL_SECURE = LIB3270_SSL_SECURE, ///< @brief Connection secure with CA check
+ SSL_NEGOTIATED = LIB3270_SSL_NEGOTIATED, ///< @brief Connection secure, no CA, self-signed or expired CRL
+ SSL_NEGOTIATING = LIB3270_SSL_NEGOTIATING, ///< @brief Negotiating SSL
+ SSL_UNDEFINED = LIB3270_SSL_UNDEFINED ///< @brief Undefined
+ };
+
/// @brief PF Keys
enum PFKey : uint8_t {
PF_1,
@@ -270,10 +278,20 @@
return getConnectionState();
}
- inline bool operator==(ConnectionState state) const noexcept {
+ inline bool operator==(ConnectionState state) const {
return this->getConnectionState() == state;
}
+ virtual SSLState getSSLState() const = 0;
+
+ inline operator SSLState() const {
+ return getSSLState();
+ }
+
+ inline bool operator==(SSLState state) const {
+ return this->getSSLState() == state;
+ }
+
// Set properties.
virtual void setUnlockDelay(unsigned short delay = 350) = 0;
void setCharSet(const char *charset);
@@ -335,6 +353,19 @@
/// @brief Wait for update.
virtual Session & wait_for_update(unsigned short seconds) = 0;
+ /// @brief Wait for string.
+ ///
+ /// @return 0 if the string was found, error code if not.
+ int wait(int row, int col, const char *key, unsigned short seconds);
+ int wait(int baddr, const char *key, unsigned short seconds);
+
+ /// @brief Search
+ size_t find(const char * str, size_t pos = 0) const;
+
+ /// @brief Compare contents.
+ int compare(size_t baddr, const char* s, size_t len) const;
+ int compare(int row, int col, const char* s, size_t len) const;
+
};
/// @brief TN3270 Host
diff --git a/server/Makefile.in b/server/Makefile.in
index 4acf718..e89ae31 100644
--- a/server/Makefile.in
+++ b/server/Makefile.in
@@ -32,6 +32,7 @@ PACKAGE_NAME=@PACKAGE_NAME@
CORE_SOURCES= \
$(wildcard src/core/*.c) \
+ $(wildcard src/core/methods/*.c) \
$(wildcard src/core/@OSNAME@/*.c)
PLUGIN_SOURCES= \
diff --git a/server/pw3270-plugin-ipc.cbp b/server/pw3270-plugin-ipc.cbp
index f3de793..7b92da2 100644
--- a/server/pw3270-plugin-ipc.cbp
+++ b/server/pw3270-plugin-ipc.cbp
@@ -73,13 +73,16 @@
+
+
+
-
+
diff --git a/server/src/core/linux/gobject.c b/server/src/core/linux/gobject.c
index a4f5cdf..3f08a64 100644
--- a/server/src/core/linux/gobject.c
+++ b/server/src/core/linux/gobject.c
@@ -133,7 +133,7 @@ void ipc3270_add_terminal_introspection(GString *introspection) {
" " \
" " \
" " \
- " " \
+ " " \
" " \
" " \
" " \
@@ -143,22 +143,14 @@ void ipc3270_add_terminal_introspection(GString *introspection) {
" " \
" " \
" " \
- " " \
- " " \
- " " \
- " " \
- " " \
- " " \
- " " \
- " " \
- " " \
- " " \
- " " \
- " " \
" " \
" " \
" " \
" " \
+ " " \
+ " " \
+ " " \
+ " " \
" " \
" " \
" " \
@@ -168,6 +160,15 @@ void ipc3270_add_terminal_introspection(GString *introspection) {
" " \
" " \
" " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
+ " " \
" " \
" "
);
diff --git a/server/src/core/linux/start.c b/server/src/core/linux/start.c
index e8b2ba4..1d4c410 100644
--- a/server/src/core/linux/start.c
+++ b/server/src/core/linux/start.c
@@ -50,28 +50,25 @@ static void
GDBusMethodInvocation *invocation,
gpointer user_data) {
- g_autoptr (GError) error = NULL;
- GVariant * rc;
+ g_autoptr(GError) error = NULL;
+ g_autoptr(GObject) response = ipc3270_response_new();
debug("%s(%s,%s)",__FUNCTION__,interface_name,object_path);
- rc = ipc3270_method_call(G_OBJECT(user_data), method_name, parameters, &error);
+ ipc3270_method_call(G_OBJECT(user_data), method_name, parameters, response, &error);
if(error) {
- if(rc) {
- g_variant_unref(rc);
- }
-
g_dbus_method_invocation_return_gerror(invocation, error);
- } else if(rc) {
+ } else if(ipc3270_response_has_values(response)) {
// Convert rc to tuple.
// It is an error if parameters is not of the right format: it must be a tuple containing the out-parameters of the D-Bus method.
// Even if the method has a single out-parameter, it must be contained in a tuple.
- g_dbus_method_invocation_return_value(invocation, g_variant_new_tuple(&rc,1));
+ GVariant *values[] = { ipc3270_response_steal_value(response) };
+ g_dbus_method_invocation_return_value(invocation, g_variant_new_tuple(values,1));
} else {
diff --git a/server/src/core/methods.c b/server/src/core/methods.c
deleted file mode 100644
index 2513173..0000000
--- a/server/src/core/methods.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
- * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
- * aplicativos mainframe. Registro no INPI sob o nome G3270.
- *
- * Copyright (C) <2008>
- *
- * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
- * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
- * Free Software Foundation.
- *
- * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
- * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
- * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
- * obter mais detalhes.
- *
- * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
- * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
- * St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Este programa está nomeado como - e possui - linhas de código.
- *
- * Referências:
- *
- * https://github.com/joprietoe/gdbus/blob/master/gdbus-example-server.c
- * https://github.com/bratsche/glib/blob/master/gio/tests/gdbus-example-export.c
- *
- * Contatos:
- *
- * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
- * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
- *
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-// #include
-// #include
-
-GVariant * ipc3270_method_call(GObject *object, const gchar *method_name, GVariant *parameters, GError **error)
-{
-
- size_t ix;
- H3270 * hSession = ipc3270_get_session(object);
-
- lib3270_trace_event(hSession,"Method %s called on session %c\n",method_name,lib3270_get_session_id(hSession));
-
- debug("%s(%s)",__FUNCTION__,method_name);
-
- if(!g_ascii_strcasecmp(method_name,"getString"))
- {
- return ipc3270_GVariant_from_input_string(object, lib3270_get_string_at_address(hSession,0,-1,'\n'), error);
- }
- else if(!g_ascii_strcasecmp(method_name,"setString"))
- {
- gchar *text = NULL;
- g_variant_get(parameters, "(&s)", &text);
-
- g_autofree gchar * converted = ipc3270_convert_output_string(object, text, error);
- if(lib3270_input_string(hSession,(const unsigned char *) converted, -1))
- {
- // Failed!
- debug("%s failed: %s",method_name,strerror(errno));
- ipc3270_set_error(object,errno,error);
- return NULL;
- }
-
- // Suceeded
- debug("%s Suceeds",method_name);
- return g_variant_new_int32(0);
-
- }
- else if(!g_ascii_strcasecmp(method_name,"setStringAt"))
- {
- guint row,col;
- gchar *text = NULL;
- g_variant_get(parameters, "(ii&s)", &row, &col, &text);
-
- g_autofree gchar * converted = ipc3270_convert_output_string(object, text, error);
- if(lib3270_set_string_at(hSession,row,col,(const unsigned char *) converted) < 0)
- {
- // Failed!
- ipc3270_set_error(object,errno,error);
- return NULL;
- }
-
- // Suceeded
- return g_variant_new_int32(0);
-
- }
- else if(!g_ascii_strcasecmp(method_name,"getStringAt"))
- {
- guint row,col,len;
- guchar lf;
- g_variant_get(parameters, "(uuuy)", &row, &col, &len,&lf);
-
- return ipc3270_GVariant_from_input_string(object,lib3270_get_string_at(hSession, row, col, len, lf),error);
-
- }
- else if(!g_ascii_strcasecmp(method_name,"setStringAtAddress"))
- {
- guint addr;
- gchar *text = NULL;
- g_variant_get(parameters, "(i&s)", &addr, &text);
-
- g_autofree gchar * converted = ipc3270_convert_output_string(object, text, error);
- if(lib3270_set_string_at_address(hSession,addr,(unsigned char *) converted, -1) < 0)
- {
- // Failed!
- ipc3270_set_error(object,errno,error);
- return NULL;
- }
-
- // Suceeded
- return g_variant_new_int32(0);
-
- }
- else if(!g_ascii_strcasecmp(method_name,"getStringAtAddress"))
- {
- guint addr,len;
- guchar lf;
- g_variant_get(parameters, "(uuy)", &addr, &len, &lf);
-
- debug("lf=%02x",(int) lf);
-
- return ipc3270_GVariant_from_input_string(object,lib3270_get_string_at_address(hSession, addr, len, lf),error);
-
- }
- else if(!g_ascii_strcasecmp(method_name,"waitforready"))
- {
- guint timeout = 1;
- if(parameters) {
- g_variant_get(parameters, "(u)", &timeout);
- }
- return g_variant_new_int32((gint) lib3270_wait_for_ready(hSession,timeout));
- }
- else if(!g_ascii_strcasecmp(method_name,"connect"))
- {
- gchar *text = NULL;
- g_variant_get(parameters, "(&s)", &text);
-
- g_autofree gchar * converted = ipc3270_convert_output_string(object, text, error);
- if(lib3270_connect_url(hSession,converted,0))
- {
- // Failed!
- ipc3270_set_error(object,errno,error);
- return NULL;
- }
-
- // Suceeded
- return g_variant_new_int32(0);
-
- }
- else if(!g_ascii_strcasecmp(method_name,"disconnect"))
- {
- if(lib3270_disconnect(hSession))
- {
- // Failed!
- ipc3270_set_error(object,errno,error);
- return NULL;
- }
-
- // Suceeded
- return g_variant_new_int32(0);
- }
-
-
-
- // Check action table.
- const LIB3270_ACTION_ENTRY * actions = lib3270_get_action_table();
- for(ix = 0; actions[ix].name; ix++)
- {
- if(!g_ascii_strcasecmp(actions[ix].name,method_name)) {
-
- int rc = actions[ix].call(hSession);
- if(rc)
- {
- // Failed
- ipc3270_set_error(object,errno,error);
- return NULL;
- }
-
- // Suceeded
- return g_variant_new_int32(0);
-
- }
- }
-
- // Check int methods
- const IPC_METHOD_INT_ARG * int_methods = ipc3270_get_int_arg_methods();
-
- for(ix = 0; int_methods[ix].name; ix++)
- {
- if(!g_ascii_strcasecmp(int_methods[ix].name,method_name)) {
-
- gint value;
- g_variant_get(parameters, "(i)", &value);
-
- int rc = int_methods[ix].call(hSession, value);
- if(rc)
- {
- // Failed
- ipc3270_set_error(object,errno,error);
- return NULL;
- }
-
- // Suceeded
- return g_variant_new_int32(0);
-
- }
-
- }
-
- g_message("Unknown method \"%s\"",method_name);
-
- return NULL;
-
-}
diff --git a/server/src/core/methods/methods.c b/server/src/core/methods/methods.c
new file mode 100644
index 0000000..870b64b
--- /dev/null
+++ b/server/src/core/methods/methods.c
@@ -0,0 +1,258 @@
+/*
+ * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
+ * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
+ * aplicativos mainframe. Registro no INPI sob o nome G3270.
+ *
+ * Copyright (C) <2008>
+ *
+ * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
+ * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
+ * Free Software Foundation.
+ *
+ * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
+ * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
+ * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
+ * obter mais detalhes.
+ *
+ * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
+ * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
+ * St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Este programa está nomeado como - e possui - linhas de código.
+ *
+ * Referências:
+ *
+ * https://github.com/joprietoe/gdbus/blob/master/gdbus-example-server.c
+ * https://github.com/bratsche/glib/blob/master/gio/tests/gdbus-example-export.c
+ *
+ * Contatos:
+ *
+ * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
+ * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+void ipc3270_method_call(GObject *object, const gchar *method_name, GVariant *request, GObject *response, GError **error) {
+
+ size_t ix;
+ H3270 * hSession = ipc3270_get_session(object);
+
+ lib3270_trace_event(hSession,"Method %s called on session %c\n",method_name,lib3270_get_session_id(hSession));
+
+ debug("%s(%s)",__FUNCTION__,method_name);
+
+ if(!g_ascii_strcasecmp(method_name,"getString"))
+ {
+ lib3270_autoptr(char) str = lib3270_get_string_at_address(hSession,0,-1,'\n');
+ ipc3270_response_append_3270_string(response,str,error);
+ return;
+ }
+ else if(!g_ascii_strcasecmp(method_name,"setString"))
+ {
+ gchar *text = NULL;
+ g_variant_get(request, "(&s)", &text);
+
+ g_autofree gchar * converted = ipc3270_convert_output_string(object, text, error);
+ if(lib3270_input_string(hSession,(const unsigned char *) converted, -1))
+ {
+ // Failed!
+ debug("%s failed: %s",method_name,strerror(errno));
+ ipc3270_set_error(object,errno,error);
+ return;
+ }
+
+ // Suceeded
+ debug("%s Suceeds",method_name);
+ ipc3270_response_append_int32(response, 0);
+ return;
+
+ }
+ else if(!g_ascii_strcasecmp(method_name,"setStringAt"))
+ {
+ guint row,col;
+ gchar *text = NULL;
+ g_variant_get(request, "(ii&s)", &row, &col, &text);
+
+ g_autofree gchar * converted = ipc3270_convert_output_string(object, text, error);
+ if(lib3270_set_string_at(hSession,row,col,(const unsigned char *) converted) < 0)
+ {
+ // Failed!
+ ipc3270_set_error(object,errno,error);
+ return;
+ }
+
+ // Suceeded
+ ipc3270_response_append_int32(response, 0);
+ return;
+
+ }
+ else if(!g_ascii_strcasecmp(method_name,"getStringAt"))
+ {
+ guint row,col,len;
+ guchar lf;
+ g_variant_get(request, "(uuuy)", &row, &col, &len,&lf);
+
+ lib3270_autoptr(char) str = lib3270_get_string_at(hSession, row, col, len, lf);
+ ipc3270_response_append_3270_string(response,str,error);
+ return;
+
+ }
+ else if(!g_ascii_strcasecmp(method_name,"setStringAtAddress"))
+ {
+ gint addr;
+ gchar *text = NULL;
+ g_variant_get(request, "(i&s)", &addr, &text);
+
+ g_autofree gchar * converted = ipc3270_convert_output_string(object, text, error);
+ if(lib3270_set_string_at_address(hSession,addr,(unsigned char *) converted, -1) < 0)
+ {
+ // Failed!
+ ipc3270_set_error(object,errno,error);
+ return;
+ }
+
+ // Suceeded
+ ipc3270_response_append_int32(response, 0);
+ return;
+
+ }
+ else if(!g_ascii_strcasecmp(method_name,"getStringAtAddress"))
+ {
+ gint addr;
+ guint len;
+ guchar lf;
+ g_variant_get(request, "(iuy)", &addr, &len, &lf);
+
+ debug("lf=%02x",(int) lf);
+
+ lib3270_autoptr(char) str = lib3270_get_string_at_address(hSession, addr, len, lf);
+ ipc3270_response_append_3270_string(response,str,error);
+ return;
+
+ }
+ else if(!g_ascii_strcasecmp(method_name,"waitforready"))
+ {
+ guint timeout = 1;
+ if(request) {
+ g_variant_get(request, "(u)", &timeout);
+ }
+ ipc3270_response_append_int32(response, lib3270_wait_for_ready(hSession,timeout));
+ return;
+
+ }
+ else if(!g_ascii_strcasecmp(method_name,"connect"))
+ {
+ gchar *text = NULL;
+ g_variant_get(request, "(&s)", &text);
+
+ g_autofree gchar * converted = ipc3270_convert_output_string(object, text, error);
+ if(lib3270_connect_url(hSession,converted,0))
+ {
+ // Failed!
+ ipc3270_set_error(object,errno,error);
+ return NULL;
+ }
+
+ // Suceeded
+ ipc3270_response_append_int32(response, 0);
+ return;
+
+ }
+ else if(!g_ascii_strcasecmp(method_name,"disconnect"))
+ {
+ if(lib3270_disconnect(hSession))
+ {
+ // Failed!
+ ipc3270_set_error(object,errno,error);
+ return;
+ }
+
+ // Suceeded
+ ipc3270_response_append_int32(response, 0);
+ return;
+
+ }
+ else if(!g_ascii_strcasecmp(method_name,"getFieldAttributeAt"))
+ {
+ guint row,col;
+ g_variant_get(request, "(uu)", &row, &col);
+ ipc3270_response_append_int32(response, lib3270_get_field_attribute(hSession,lib3270_translate_to_address(hSession,row,col)));
+ return;
+ }
+ else if(!g_ascii_strcasecmp(method_name,"getFieldAttributeAtAddress"))
+ {
+ gint addr;
+ g_variant_get(request, "(i)", &addr);
+
+ ipc3270_response_append_int32(response, lib3270_get_field_attribute(hSession,addr));
+ return;
+ }
+ else if(!g_ascii_strcasecmp(method_name,"waitForUpdate"))
+ {
+ guint timeout = 1;
+ if(request) {
+ g_variant_get(request, "(u)", &timeout);
+ }
+
+ ipc3270_response_append_int32(response, lib3270_wait_for_update(hSession,timeout));
+ return;
+ }
+
+ // Check action table.
+ const LIB3270_ACTION_ENTRY * actions = lib3270_get_action_table();
+ for(ix = 0; actions[ix].name; ix++)
+ {
+ if(!g_ascii_strcasecmp(actions[ix].name,method_name)) {
+
+ int rc = actions[ix].call(hSession);
+ if(rc)
+ {
+ // Failed
+ ipc3270_set_error(object,errno,error);
+ return;
+ }
+
+ // Suceeded
+ ipc3270_response_append_int32(response, 0);
+ return;
+
+ }
+ }
+
+ // Check int methods
+ const IPC_METHOD_INT_ARG * int_methods = ipc3270_get_int_arg_methods();
+
+ for(ix = 0; int_methods[ix].name; ix++)
+ {
+ if(!g_ascii_strcasecmp(int_methods[ix].name,method_name)) {
+
+ gint value;
+ g_variant_get(request, "(i)", &value);
+
+ int rc = int_methods[ix].call(hSession, value);
+ if(rc)
+ {
+ // Failed
+ ipc3270_set_error(object,errno,error);
+ return;
+ }
+
+ // Suceeded
+ ipc3270_response_append_int32(response, 0);
+ return;
+
+ }
+
+ }
+
+ g_message("Unknown method \"%s\"",method_name);
+ ipc3270_set_error(object,ENOENT,error);
+
+}
diff --git a/server/src/testprogram/testprogram.c b/server/src/testprogram/testprogram.c
index 35deddc..a49134f 100644
--- a/server/src/testprogram/testprogram.c
+++ b/server/src/testprogram/testprogram.c
@@ -127,6 +127,7 @@
GModule * module = NULL;
gtk_widget_set_name(window,session_name);
+ v3270_set_session_name(terminal,session_name);
#ifdef _WIN32
{
diff --git a/server/testscripts/introspect-plugin.sh b/server/testscripts/introspect-plugin.sh
deleted file mode 100755
index da4d062..0000000
--- a/server/testscripts/introspect-plugin.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-gdbus \
- introspect \
- --session \
- --dest=br.com.bb.pw3270.a \
- --object-path=/br/com/bb/tn3270/session
-
diff --git a/server/testscripts/introspect.sh b/server/testscripts/introspect.sh
new file mode 100755
index 0000000..da4d062
--- /dev/null
+++ b/server/testscripts/introspect.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+gdbus \
+ introspect \
+ --session \
+ --dest=br.com.bb.pw3270.a \
+ --object-path=/br/com/bb/tn3270/session
+
--
libgit2 0.21.2