summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-04-26 16:25:31 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-04-26 17:20:23 +0200
commit1649ad765cde363a675a92dda86629b3a3a08438 (patch)
treea872a170490df29915dd25236817ccafdad348be
parenta0111289ba0b4cf61b474b31c0a4ac1c73020a8b (diff)
ecore_con: first initial addition of Ecore_Con_Ssh object.devs/cedric/ecore_con_ssh
-rw-r--r--src/Makefile_Ecore_Con.am11
-rw-r--r--src/lib/ecore_con/Ecore_Con_Ssh.h65
-rw-r--r--src/lib/ecore_con/ecore_con_ssh.c139
-rw-r--r--src/lib/ecore_con/efl_network_ssh_channel_base.eo40
-rw-r--r--src/lib/ecore_con/efl_network_ssh_channel_interactive_session.eo33
-rw-r--r--src/lib/ecore_con/efl_network_ssh_client.eo64
6 files changed, 349 insertions, 3 deletions
diff --git a/src/Makefile_Ecore_Con.am b/src/Makefile_Ecore_Con.am
index a443e671bb..e9aef332fb 100644
--- a/src/Makefile_Ecore_Con.am
+++ b/src/Makefile_Ecore_Con.am
@@ -6,7 +6,10 @@ ecore_con_eolian_files = \
6 lib/ecore_con/ecore_con_client.eo \ 6 lib/ecore_con/ecore_con_client.eo \
7 lib/ecore_con/ecore_con_server.eo \ 7 lib/ecore_con/ecore_con_server.eo \
8 lib/ecore_con/ecore_con_connector.eo \ 8 lib/ecore_con/ecore_con_connector.eo \
9 lib/ecore_con/ecore_con_url.eo 9 lib/ecore_con/ecore_con_url.eo \
10 lib/ecore_con/efl_network_ssh_client.eo \
11 lib/ecore_con/efl_network_ssh_channel_base.eo \
12 lib/ecore_con/efl_network_ssh_channel_interactive_session.eo
10 13
11ecore_con_eolian_c = $(ecore_con_eolian_files:%.eo=%.eo.c) 14ecore_con_eolian_c = $(ecore_con_eolian_files:%.eo=%.eo.c)
12ecore_con_eolian_h = $(ecore_con_eolian_files:%.eo=%.eo.h) \ 15ecore_con_eolian_h = $(ecore_con_eolian_files:%.eo=%.eo.h) \
@@ -34,7 +37,8 @@ dist_installed_ecoreconmainheaders_DATA = \
34lib/ecore_con/Ecore_Con.h \ 37lib/ecore_con/Ecore_Con.h \
35lib/ecore_con/Ecore_Con_Legacy.h \ 38lib/ecore_con/Ecore_Con_Legacy.h \
36lib/ecore_con/Ecore_Con_Eo.h \ 39lib/ecore_con/Ecore_Con_Eo.h \
37lib/ecore_con/Ecore_Con_Eet.h 40lib/ecore_con/Ecore_Con_Eet.h \
41lib/ecore_con/Ecore_Con_Ssh.h
38 42
39nodist_installed_ecoreconmainheaders_DATA = \ 43nodist_installed_ecoreconmainheaders_DATA = \
40 $(ecore_con_eolian_h) 44 $(ecore_con_eolian_h)
@@ -46,7 +50,8 @@ lib/ecore_con/ecore_con_eet.c \
46lib/ecore_con/ecore_con_socks.c \ 50lib/ecore_con/ecore_con_socks.c \
47lib/ecore_con/ecore_con_ssl.c \ 51lib/ecore_con/ecore_con_ssl.c \
48lib/ecore_con/ecore_con_url.c \ 52lib/ecore_con/ecore_con_url.c \
49lib/ecore_con/ecore_con_private.h 53lib/ecore_con/ecore_con_private.h \
54lib/ecore_con/ecore_con_ssh.c
50 55
51if HAVE_WINDOWS 56if HAVE_WINDOWS
52lib_ecore_con_libecore_con_la_SOURCES += lib/ecore_con/ecore_con_local_win32.c 57lib_ecore_con_libecore_con_la_SOURCES += lib/ecore_con/ecore_con_local_win32.c
diff --git a/src/lib/ecore_con/Ecore_Con_Ssh.h b/src/lib/ecore_con/Ecore_Con_Ssh.h
new file mode 100644
index 0000000000..31a7139c96
--- /dev/null
+++ b/src/lib/ecore_con/Ecore_Con_Ssh.h
@@ -0,0 +1,65 @@
1#ifndef _ECORE_CON_SSH_H
2#define _ECORE_CON_SSH_H
3
4#include <time.h>
5#include <libgen.h>
6#ifdef _WIN32
7# include <ws2tcpip.h>
8#else
9# include <netdb.h>
10#endif
11#include <Eina.h>
12#include <Eo.h>
13
14#ifdef EAPI
15# undef EAPI
16#endif
17
18#ifdef _WIN32
19# ifdef EFL_ECORE_CON_BUILD
20# ifdef DLL_EXPORT
21# define EAPI __declspec(dllexport)
22# else
23# define EAPI
24# endif
25# else
26# define EAPI __declspec(dllimport)
27# endif
28#else
29# ifdef __GNUC__
30# if __GNUC__ >= 4
31# define EAPI __attribute__ ((visibility("default")))
32# else
33# define EAPI
34# endif
35# else
36# define EAPI
37# endif
38#endif
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44typedef struct _Efl_Network_Ssh_Request Efl_Network_Ssh_Request;
45typedef Eo Efl_Network_Ssh_Channel_Interactive_Session;
46
47#ifndef EFL_NOLEGACY_API_SUPPORT
48# include "efl_network_ssh_client.eo.legacy.h"
49# include "efl_network_ssh_channel_base.eo.legacy.h"
50# include "efl_network_ssh_channel_interactive_session.eo.legacy.h"
51#endif
52#ifdef EFL_EO_API_SUPPORT
53# include "efl_network_ssh_client.eo.h"
54# include "efl_network_ssh_channel_base.eo.h"
55# include "efl_network_ssh_channel_interactive_session.eo.h"
56#endif
57
58#ifdef __cplusplus
59}
60#endif
61
62#undef EAPI
63#define EAPI
64
65#endif
diff --git a/src/lib/ecore_con/ecore_con_ssh.c b/src/lib/ecore_con/ecore_con_ssh.c
new file mode 100644
index 0000000000..6e5d5c3587
--- /dev/null
+++ b/src/lib/ecore_con/ecore_con_ssh.c
@@ -0,0 +1,139 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <Eina.h>
6#include <Eo.h>
7#include <Ecore_Con.h>
8#include <Ecore_Con_Ssh.h>
9
10typedef struct _Efl_Network_Ssh_Client_Data Efl_Network_Ssh_Client_Data;
11struct _Efl_Network_Ssh_Client_Data
12{
13};
14
15typedef struct _Efl_Network_Ssh_Channel_Base_Data Efl_Network_Ssh_Channel_Base_Data;
16struct _Efl_Network_Ssh_Channel_Base_Data
17{
18};
19
20typedef struct _Efl_Network_Ssh_Channel_Interactive_Session_Data Efl_Network_Ssh_Channel_Interactive_Session_Data;
21struct _Efl_Network_Ssh_Channel_Interactive_Session_Data
22{
23};
24
25
26
27static void
28_efl_network_ssh_client_user_set(Eo *obj, Efl_Network_Ssh_Client_Data *pd, const char *user)
29{
30}
31
32static const char *
33_efl_network_ssh_client_user_get(Eo *obj, Efl_Network_Ssh_Client_Data *pd)
34{
35}
36
37static void
38_efl_network_ssh_client_passwd_set(Eo *obj, Efl_Network_Ssh_Client_Data *pd, const char *passwd)
39{
40}
41
42static const char *
43_efl_network_ssh_client_passwd_get(Eo *obj, Efl_Network_Ssh_Client_Data *pd)
44{
45}
46
47static Eina_Iterator *
48_efl_network_ssh_client_keys_list(Eo *obj, Efl_Network_Ssh_Client_Data *pd)
49{
50}
51
52static Eina_Bool
53_efl_network_ssh_client_key_add(Eo *obj, Efl_Network_Ssh_Client_Data *pd, const char *path)
54{
55}
56
57static Eina_Bool
58_efl_network_ssh_client_key_del(Eo *obj, Efl_Network_Ssh_Client_Data *pd, const char *path)
59{
60}
61
62static Eina_Bool
63_efl_network_ssh_client_hostkey(Eo *obj, Efl_Network_Ssh_Client_Data *pd, Eina_Bool validate)
64{
65}
66
67static Efl_Network_Ssh_Channel_Interactive_Session *
68_efl_network_ssh_client_interactive_session_new(Eo *obj, Efl_Network_Ssh_Client_Data *pd)
69{
70}
71
72static void
73_efl_network_ssh_client_eo_base_constructor(Eo *obj, Efl_Network_Ssh_Client_Data *pd)
74{
75}
76
77static Eo *
78_efl_network_ssh_client_eo_base_finalize(Eo *obj, Efl_Network_Ssh_Client_Data *pd)
79{
80}
81
82static void
83_efl_network_ssh_client_eo_base_destructor(Eo *obj, Efl_Network_Ssh_Client_Data *pd)
84{
85}
86
87static int
88_efl_network_ssh_client_ecore_con_base_send(Eo *obj, Efl_Network_Ssh_Client_Data *pd, const void *data, int size)
89{
90}
91
92static void
93_efl_network_ssh_client_ecore_con_base_flush(Eo *obj, Efl_Network_Ssh_Client_Data *pd)
94{
95}
96
97static Eina_Bool
98_efl_network_ssh_channel_base_data_send(Eo *obj, Efl_Network_Ssh_Channel_Base_Data *pd, const void *data, size_t size)
99{
100}
101
102static Eina_Bool
103_efl_network_ssh_channel_base_binbuf_send(Eo *obj, Efl_Network_Ssh_Channel_Base_Data *pd, const Eina_Binbuf *data)
104{
105}
106
107static Eina_Bool
108_efl_network_ssh_channel_base_data_ext_send(Eo *obj, Efl_Network_Ssh_Channel_Base_Data *pd, unsigned int type, const void *data, size_t size)
109{
110}
111
112static Eina_Bool
113_efl_network_ssh_channel_base_binbuf_ext_send(Eo *obj, Efl_Network_Ssh_Channel_Base_Data *pd, unsigned int type, const Eina_Binbuf *data)
114{
115}
116
117static Efl_Network_Ssh_Request *
118_efl_network_ssh_channel_interactive_session_pty_req(Eo *obj, Efl_Network_Ssh_Channel_Interactive_Session_Data *pd, const char *term, const char *modes, unsigned int columns, unsigned int rows, unsigned int width, unsigned int height)
119{
120}
121
122static void
123_efl_network_ssh_channel_interactive_session_env_req(Eo *obj, Efl_Network_Ssh_Channel_Interactive_Session_Data *pd, const char *name, const char *value)
124{
125}
126
127static Efl_Network_Ssh_Request *
128_efl_network_ssh_channel_interactive_session_shell_req(Eo *obj, Efl_Network_Ssh_Channel_Interactive_Session_Data *pd)
129{
130}
131
132static Efl_Network_Ssh_Request *
133_efl_network_ssh_channel_interactive_session_exec_req(Eo *obj, Efl_Network_Ssh_Channel_Interactive_Session_Data *pd, const char *command)
134{
135}
136
137#include "efl_network_ssh_client.eo.c"
138#include "efl_network_ssh_channel_base.eo.c"
139#include "efl_network_ssh_channel_interactive_session.eo.c"
diff --git a/src/lib/ecore_con/efl_network_ssh_channel_base.eo b/src/lib/ecore_con/efl_network_ssh_channel_base.eo
new file mode 100644
index 0000000000..089ba0fde6
--- /dev/null
+++ b/src/lib/ecore_con/efl_network_ssh_channel_base.eo
@@ -0,0 +1,40 @@
1class Efl.Network.Ssh.Channel.Base
2{
3 eo_prefix: efl_network_ssh_channel;
4 legacy_prefix: ecore_con_ssh_channel;
5 methods {
6 data_send {
7 params {
8 const(void)* data;
9 size_t size;
10 }
11 return: bool;
12 }
13 binbuf_send {
14 params {
15 const(Eina_Binbuf)* data;
16 }
17 return: bool;
18 }
19 data_ext_send {
20 params {
21 uint type;
22 const(void)* data;
23 size_t size;
24 }
25 return: bool;
26 }
27 binbuf_ext_send {
28 params {
29 uint type;
30 const(Eina_Binbuf)* data;
31 }
32 return: bool;
33 }
34 }
35 events {
36 data,received;
37 data,error;
38 request,reply;
39 }
40}
diff --git a/src/lib/ecore_con/efl_network_ssh_channel_interactive_session.eo b/src/lib/ecore_con/efl_network_ssh_channel_interactive_session.eo
new file mode 100644
index 0000000000..3467e6eda7
--- /dev/null
+++ b/src/lib/ecore_con/efl_network_ssh_channel_interactive_session.eo
@@ -0,0 +1,33 @@
1class Efl.Network.Ssh.Channel.Interactive_Session (Efl.Network.Ssh.Channel.Base)
2{
3 eo_prefix: efl_network_ssh_channel_interactive_session;
4 legacy_prefix: ecore_con_ssh_channel_interactive_session;
5 methods {
6 pty_req {
7 params {
8 const(char)* term;
9 const(char)* modes;
10 uint columns;
11 uint rows;
12 uint width;
13 uint height;
14 }
15 return: Efl_Network_Ssh_Request *;
16 }
17 env_req {
18 params {
19 const(char)* name;
20 const(char)* value;
21 }
22 }
23 shell_req {
24 return: Efl_Network_Ssh_Request *;
25 }
26 exec_req {
27 params {
28 const(char)* command;
29 }
30 return: Efl_Network_Ssh_Request *;
31 }
32 }
33}
diff --git a/src/lib/ecore_con/efl_network_ssh_client.eo b/src/lib/ecore_con/efl_network_ssh_client.eo
new file mode 100644
index 0000000000..6be12ec36f
--- /dev/null
+++ b/src/lib/ecore_con/efl_network_ssh_client.eo
@@ -0,0 +1,64 @@
1class Efl.Network.Ssh.Client (Ecore.Con.Connector)
2{
3 eo_prefix: efl_network_ssh_client;
4 legacy_prefix: ecore_con_ssh_client;
5 properties {
6 user {
7 set {
8 }
9 get {
10 }
11 values {
12 const(char)* user;
13 }
14 }
15 passwd {
16 set {
17 }
18 get {
19 }
20 values {
21 const(char)* passwd;
22 }
23 }
24 }
25 methods {
26 keys_list {
27 return: free(own(iterator<const(char)*> *), eina_iterator_free);
28 }
29 key_add {
30 params {
31 const(char)* path @nonull;
32 }
33 return: bool;
34 }
35 key_del {
36 params {
37 const(char)* path @nonull;
38 }
39 return: bool;
40 }
41 hostkey {
42 params {
43 bool validate;
44 }
45 return: bool;
46 }
47 interactive_session_new {
48 return: Efl_Network_Ssh_Channel_Interactive_Session *;
49 }
50 }
51 implements {
52 Eo.Base.constructor;
53 Eo.Base.finalize;
54 Eo.Base.destructor;
55 Ecore.Con.Base.send;
56 Ecore.Con.Base.flush;
57 }
58 events {
59 hostkey,known;
60 hostkey,unknown;
61 auth,passwd;
62 auth,keys;
63 }
64}