Top | ![]() |
![]() |
![]() |
![]() |
#define | GEBR_PORT_PREFIX |
#define | GEBR_ADDR_PREFIX |
enum | GebrCommServerType |
enum | GebrCommServerLocation |
enum | GebrCommServerState |
struct | GebrCommServer |
struct | GebrCommServerClass |
GebrCommServerPriv |
GebrCommServer * gebr_comm_server_new (const gchar *_address
,const gchar *gebr_id
,const struct gebr_comm_server_ops *ops
);
const gchar *
gebr_comm_server_get_last_error (GebrCommServer *server
);
void gebr_comm_server_set_last_error (GebrCommServer *server
,enum gebr_comm_server_error error
,const gchar *message
,...
);
void gebr_comm_server_set_x11_cookie (GebrCommServer *server
,const gchar *cookie
);
void gebr_comm_server_connect (GebrCommServer *server
,gboolean maestro
,gboolean force_init
);
gboolean
gebr_comm_server_is_logged (GebrCommServer *gebr_comm_server
);
void gebr_comm_server_forward_x11 (GebrCommServer *gebr_comm_server
,const gchar *display_host
,guint display_port
);
Forward remote_display
to the local machine.
guint gebr_comm_server_get_display_port (GebrCommServer *server
,gchar **display_host
);
const gchar *
gebr_comm_server_state_to_string (GebrCommServerState state
);
GebrCommServerState
gebr_comm_server_state_from_string (const gchar *string
);
GebrCommServerState
gebr_comm_server_get_state (GebrCommServer *server
);
void gebr_comm_server_set_password (GebrCommServer *server
,const gchar *pass
);
Writes pass
into server
.
If server
is in interactive mode (see
gebr_comm_server_set_interactive()
) then pass
is written into server
only
if the signal “password-request” has been emitted.
Otherwise, if server
is in noninteractive mode, the password is cached for
the next connection, see gebr_comm_server_connect()
.
void
gebr_comm_server_invalid_password (GebrCommServer *server
);
Set password error for all pending connections, and clean list after that.
void gebr_comm_server_answer_question (GebrCommServer *server
,gboolean response
);
Writes a response into server
.
This method is similar to gebr_comm_server_set_password()
, but it can only
be called if a “question_request” signal was emitted. The
response
is the answer for a Yes or No question.
gboolean
gebr_comm_server_get_accepts_key (GebrCommServer *server
);
Return if the server accepts public key
void gebr_comm_server_append_key (GebrCommServer *server
,GCallback finished_callback
,gpointer user_data
);
Append key in the server
void gebr_comm_server_set_use_public_key (GebrCommServer *server
,gboolean use_key
);
gboolean
gebr_comm_server_get_use_public_key (GebrCommServer *server
);
void
gebr_comm_server_maestro_connect_on_daemons
(GebrCommServer *server
);
GebrCommPortProvider * gebr_comm_server_create_port_provider (GebrCommServer *server
,GebrCommPortType type
);
void gebr_comm_server_set_check_host (GebrCommServer *server
,gboolean check_host
);
void gebr_comm_server_set_cookie (GebrCommServer *server
,const gchar *gebr_cookie
);
struct GebrCommServer { GObject parent; GebrCommProtocolSocket *socket; GebrCommServerPriv *priv; /* server address/port */ GString *address; guint16 port; gboolean ac; /* ssh stuff */ gboolean use_public_key; gchar *password; gint16 tunnel_port; GebrCommTerminalProcess *x11_forward_process; GebrCommProcess *x11_forward_unix; gint ncores; gdouble clock_cpu; gchar *memory; gchar *model_name; GebrCommServerState state; enum gebr_comm_server_error { SERVER_ERROR_UNKNOWN, SERVER_ERROR_NONE, SERVER_ERROR_CONNECT, SERVER_ERROR_SERVER, SERVER_ERROR_SSH, SERVER_ERROR_PROTOCOL_VERSION, SERVER_ERROR_COOKIE, } error; GString *last_error; /* virtual methods */ const struct gebr_comm_server_ops { void (*log_message) (GebrCommServer *server, GebrLogMessageType type, const gchar *message, gpointer user_data); void (*state_changed) (GebrCommServer *server, gpointer user_data); void (*process_request) (GebrCommServer *server, GebrCommHttpMsg *request, gpointer user_data); void (*process_response) (GebrCommServer *server, GebrCommHttpMsg *request, GebrCommHttpMsg *response, gpointer user_data); void (*parse_messages) (GebrCommServer *server, gpointer user_data); } *ops; gpointer user_data; GebrCommTerminalProcess *process; };
struct GebrCommServerClass { GObjectClass parent_class; void (*server_password_request) (GebrCommServer *server, const gchar *title, const gchar *message); void (*question_request) (GebrCommServer *server, const gchar *title, const gchar *message); };