| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a string parser, serializer and asynchronous resolver.
It's purpose is to convert to and from the strings we use in our
dialers and servers, such as "127.0.0.1:1234" or "[::1]:1234",
properties allow to check the family, port, address bytes (slice) and
even get a struct sockaddr pointer to use with bind()/connect() in
outside code.
It will also offer some utilities present in netinet/in.h in an easy
to use way, after all IN6_IS_ADDR_LOOPBACK() works one way, while
there is no IN_LOOPBACK and comparing with INADDR_LOOPBACK will lead
to errors since it's in network order.
Last but not least, it will do asynchronous resolve of host and port
names using an internal thread and getaddrinfo(). The results are
delivered using a Future with an array of objects.
|
|
|
|
|
| |
This error is shared by Dialer and Server, will also be used by IP
resolution.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a major work and unfortunately couldn't be split into smaller
pieces as old code was highly coupled.
Ecore_Con_Server is now a wrapper around Efl_Net_Dialer_Simple
(ecore_con_server_connect()) and Efl_Net_Server_Simple
(ecore_con_server_add()), doing all that the original version did with
some fixes so ecore_con_ssl_server_upgrade() and
ecore_con_ssl_client_upgrade() are more usable -- see the examples and
-t/--type=tcp+ssl.
I tried to be bug-compatible, with code annotations where things
doesn't make sense. This was based on ecore_con_suite tests and some
manual experimenting with the examples, these can be helpful if you
find regressions (report/assign to me).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rewrite Ecore_Con_Url as a non-Eo (since it's just legacy) that is
built on top of Efl_Net_Dialer_Http.
Since there are some legacy behavior we do not want to expose in the
new classes, hack around and manipulate the curl_easy_setopt()
directly in those cases.
This includes the cookies: there is no reason why we should expose
independent files for read (COOKIEFILE) and write (COOKIEJAR), real
world applications can manipulate the files directly, like copying
from a template to a RDWR before using, etc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The low level I/O primitives are powerful but adds some complexity to
use, for bi-directional streaming communication one ends creating two
Efl.Io.Queue and two Efl.Io.Copier to pipe data to socket when it can
operate.
Then encapsulate the socket using the new Efl.Io.Buffered_Stream, this
will allow the socket, be a dialer or a server client, to be operated
as a single handle that internally carries about the buffering for
you.
As one can see in the examples, compared to their "manual"
alternatives they are very easy to use, ressembling
Ecore_Con_Server/Ecore_Con_Client, but also offers line-based
delimiters and the possibility to let the socket to handle queueing
for you in case you received partial messages (just do not
read/clear/discard the received data).
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since connman is specific to linux, on other platforms just compile a
dummy "none" backend that will always report online and no other
details. This will be used in Windows, MacOS and other platforms that
still lack a proper backend.
The compile-time infrastructure also allows for networkmanager to be
added with ease, simply copy "efl_net*-none.c" or "efl_net*-connman.c"
to be a starting point and then add its specifics, adapting
configure.ac and Makefile_Ecore_Con.am
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are objects to allow control of networking devices
(efl_net_control) as well as an application to request for
connectivity (efl_net_session).
They are loosely based on ConnMan.org, which we already use in
Enlightenment Window Manager via DBus access with Eldbus. However they
do not map 1:1 as the goal was to expose a viable subset of controls
but in a simple and general way, thus nome strings were converted to
enums, some arrays of strings were converted to bitwise flags, some
names were made more general, such as "service" was turned into
"access point" so it doesn't generate confusion with other "network
services" (ie: http server), or "favorite" that was renamed to
"remembered". Some behavior are slightly different (yet able to be
implemented on top), such as "Service.MoveBefore" and "MoveAfter" were
converted to a numeric "priority", calculated from service's list
index, changing the priority will reoder the list and thus generate
the MoveBefore and MoveAfter DBus commands.
ConnMan was chosen not only because we already use it, but because its
DBus API is sane and simple, with the server doing almost all that we
need. This is visible in the efl_net_session, which is completely done
in the server and do not require any extra work on our side -- aside
from talking DBus and converting to Eo, which is a major work :-D
NOTE: ConnMan doesn't use FreeDesktop.Org DBus interfaces such as
Properties and ObjectManager, thus we cannot use
eldbus_model_object.
There are two examples added:
- efl_net_session_example: monitors the connection available for an
application and try to connect. You need a connman compiled with
session_policy_local and a configuration file explained in
https://github.com/aldebaran/connman/blob/master/doc/session-policy-format.txt
to get a connection if nothing is connected. Otherwise it will just
monitor the connectivity state.
- efl_net_control_example: monitors, plays the agent and configure
the network details. It can enable/disable technologies, connect to
access points (services) and configure them. It's quite extensive
as allows testing all of ConnMan's DBus API except P2P (Peers).
|
|
|
|
|
|
|
|
|
| |
in the previous commit we're manually upgrading an existing TCP socket
to SSL. It is desired since some protocols need to negotiate, like
STARTTLS and the likes
Now we offer 2 classes that does autostart SSL once the socket is
ready.
|
|
|
|
|
| |
This is the first step towards SSL connections on top of sockets, with
an example on how to upgrade a dialer and a server client using TCP.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This introduces AF_UNIX server and dialer, these are not available on
Windows as in that platform we'll create a custom class for native
'local' communication.
In the future we can add a wrapper class Efl.Net.Local that will use
the class for each platform, but won't expose its details.
For instance, if we ever expose 'credentials' (which I didn't because
they are not portable), then it doesn't make sense to try to match
that on Windows. The 'Efl.Net.Local' would just stick to the basics:
Reader, Writer and Closer APIs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the initial UDP server that works similarly to the TCP one,
however under the hood it's widely different since the socket is
reused for all "clients", thus needs a new Efl.Net.Server.Udp.Client
(Efl.Net.Socket) as Efl.Net.Socket.Udp exposes the fd and options such
as 'cork', which would interfere in other clients.
The main socket will read the packets and find an existing client to
feed it. If no client exists, then it will create one if not overr
limit. Since there is no kernel-queuing as done by listen()/accept(),
the 'no reject' case will just accept the client anyway.
Next commits will improve UDP server handling with some advanced
features:
- join multicast groups
- bind to a specific interface (SO_BINDTODEVICE)
- block packets going out of local network (SO_DONTROUTE)
- specify priorities (SO_PRIORITY)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Like existing ecore_con code, this does not use SOCKSv5 UDP
proxy. It's kinda cumbersome to add since requires a keep alive TCP
connection to the server, a second UDP channel and framing around the
original UDP frame.
Added UDP_CORK (if present) to match TCP_UDP present in TCP sockets,
this allows one to execute multiple write() calls that will result in
a single datagram, generated when CORK becomes FALSE again.
The efl_io_copier_example.c now accepts this as output. There is no
input UDP as there is no way to notify the server of a connection
(since such thing doesn't exit), usually servers react after a
datagram is received, replying to the source.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Efl.Net.Dialer.Websocket is just like other Efl.Net.Dialers: you
can dial, you can close, monitor connected/address resolved and so
on. And you can use WebSocket primitives and events such as
text_send(), binary_send(), ping() and close_request() (since
WebSockets use a close process where you should state a close
reason). See efl_net_dialer_websocket_example.c
Even if WebSocket is a message-based protocol (like "packets" from
UDP), you can use efl_net_dialer_websocket_streaming_mode_set() to
tell it to handle text or binary messages as a stream. Then all the
Efl.Io.Reader and Efl.Io.Writer APIs work as expected, see
efl_io_copier_example.c updates.
|
|
|
|
|
|
|
|
| |
This class implements the Efl.Net.Dialer interface using libcurl to
perform HTTP requests. That means it's an Efl.Net.Dialer,
Efl.Net.Socket, Efl.Io.Reader, Efl.Io.Writer and Efl.Io.Closer, thus
being usable with Efl.Io.Copier as demonstrated in the
efl_io_copier_example.c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Efl.Net.Server defines how to accept new connections, doing the
bind(), listen() and accept() for protocols such as TCP.
Efl.Net.Dialer defines to to reach a server.
Both are based on Efl.Net.Socket as communication interface that is
based on Efl.Io.Reader, Efl.Io.Writer and Efl.Io.Closer, thus being
usable with code such as Efl.Io.Copier.
The Server will emit an event "client,add" with the established
Socket, which is a child and can be closed by both the server or the
user.
The Dialer extends the Socket and allows for creating one given an
address, that will be resolved and connected.
TCP is the initial implementation so we an validate the
interfaces. UDP, Unix-Local and SSL will come later as derivate
classes.
The examples are documented and should cover the basic principles:
- efl_io_copier_example can accept "tcp://IP:PORT" and will work as a
"netcat", can send data from socket, file or stdin to a socket,
file, stdout or stderr.
- efl_net_server_example listens for connections and can either reply
"Hello World!" and take some data or work as an echo-server,
looping back all received data to the user.
More complex interactions that require a "chat" between client and
server will be covered with new classes later, such as a queue that
empties itself once data is read.
|
|
|
|
|
|
|
|
| |
CLEANFILES
We hit another argument too long error with CLEANFILES. Moving the generated
files for js and lua into separated variables and cleaning them manually fixes
the issue.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is again to avoid the "Argument list too long" error we are hitting more and
more now. Given we just merged elementary, emotion generic players, evas generic
loaders and elm_code it is not surprising we are hitting it again.
This time the number of files being hold in DISTFILES has just grown to big so a
make dist was no longer possible. If one looks at what the DISTFILES variable
from automake holds you can image it grows a lot with all the source files plus
generated files we have in tree now.
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
To cut off a big chunk but still keep all the other automagic in place for
SOURCE files I went and renamed the EXTRA_DIST in src/ to EXTRA_DIST2 and handle
the files in a dist-hook now.
Another thing to note here is that this also only happens as we have the one big
Makefile with includes. If we go back to per directory Makefiles this problem
should vanish as well. In any case we need a solution for 1.18 now and this is
what I have to offer. If you have a cleaner solution in mind feel welcome to
test it out and if everything we need keeps working (make, make examples,
make check, make benchmark, make dist and make distcheck) go ahead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
this removes the cares/ares based resolver and the compiled-in dns.c
resolver, modified the getaddrinfo based resolver to use threads not
forking (almost halving its size) and now makes that the only resolver
we have. getaddrinfo handles ipv6 and ipv4 (according to docs). this
simplifies code paths, drops code size of the efl tree by about 11k
lines of code, makes it easier to test and more robust to future
changes with ip resolving as it now just relies on libc. we won't have
coverity complaints on dns.c imported code anymore to fix and don't
have tokeep up with bugfixes/security from the upstream imported code.
this means we use a single resolver on all platforms (windows, mac,
linux) as opposed to before where cares was used for windows, and
dns.c on linux/mac. oh and the forking original was broken since our
move to eo too. so it couldnt even compile if enabled, letalone work.
so fix bug with missing /etc/resolv.conf that dns.c couldn't cope
with, fix testability, fix maintainability and reduce efl codebase size.
this fixes T3668
@fix
@improve
Subscribers: cedric, seoz, jpeg
Maniphest Tasks: T3668
Differential Revision: https://phab.enlightenment.org/D3971
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have been putting the generated eo files and BUILT_SOURCES into CLEANFILES
several times. So far this have not been a real problem but with the elm merge
and more and more eo files showing up this did explode recently.
During make distcheck a lot of files kept being around and make complained about
them. It took some digging to find the arguments list to long error. If you want
details on this great limitation have a look here:
http://www.linuxjournal.com/article/6060
In our case we have been lucky enough that we just appened many files over and
over again. Not doing that solves the issue for now. My testing showed no
problems but if I missed something let me know.
Fixes T3386
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric
Subscribers: jpeg
Differential Revision: https://phab.enlightenment.org/D3696
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric
Subscribers: jpeg
Differential Revision: https://phab.enlightenment.org/D3663
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric
Subscribers: jpeg
Differential Revision: https://phab.enlightenment.org/D3549
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Changed ecore_con_connector.eo to efl_network_connector.eo as part of
migrating to efl_network.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3427
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To configure efl sources with bindings to use in nodejs add ––with-js=nodejs in configure flags to generate node files
$ configure --with-js=nodejs
and compile normally with:
$ make
$ make install
To use, you have to require efl:
efl = require('efl')
The bindings is divided in two parts: generated and manually
written. The generation uses the Eolian library for parsing Eo files
and generate C++ code that is compiled against V8 interpreter library
to create a efl.node file that can be required in a node.js instance.
@feature
|
|
|
|
|
|
|
| |
This time the move of dns to static_libs in
4f24deac448c648d0b514acefd8bbb8721c9fe04 broke distcheck as the header file was
never shipped with the tarball. I would really appreciate if author and reviewer
would pay more attention.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Took the license file from https://github.com/wahern/dns
The dns.c and dns.h are taken from here.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric
Differential Revision: https://phab.enlightenment.org/D3314
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This lib would be used in efl_network_websocket.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric
Reviewed By: cedric
Differential Revision: https://phab.enlightenment.org/D3244
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
|
|
|
|
|
|
| |
this splits out out "manual" dlopen (eina_module_load) of curl into
its own .c file and special header out of ecore_con_url.c to tidy up
that code a bit and isolate our curl magic loading/handling
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This is still work in progress. I've added new file for temporary
purpose. Idea is to first eoify everything then change its namespace properly.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2602
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
|
|
|
|
| |
tarball
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This is just the beginning. I tried for one class to check.
Tell me if this is fine, I'll change in other classes also. The goal
is to simplify and make our API clearer to understand to new comers.
Reviewers: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2468
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
|
|
|
|
|
|
|
| |
This reverts commit 35119e7bfdc7c13c2041293f3d0b2ebe1fb7c313.
Reverted to bring make check back in a working state. Also the way we
want to handle a more modular testing needs discussion.
|
|
|
|
|
|
|
|
| |
Currently make check runs tests of whole EFL.Enabled running
of tests of individual modules by make check-<modulename>
Signed-off-by: kabeer khan <kabeer.khan@samsung.com>
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Added test case for ecore_con_eet.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2347
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
|
|
|
|
|
| |
Pull them out of the if EFL_ENABLE_TESTS test as we need them to be put into
the tarball in all cases.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Have created ecore_con test suite.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric, Sergeant_Whitespace, stefan_schmidt
Subscribers: stefan_schmidt, Sergeant_Whitespace, cedric
Maniphest Tasks: T2235
Differential Revision: https://phab.enlightenment.org/D2269
|
|
|
|
|
| |
Also change the generator a bit so that it doesn't rely on lib name information
and fix the runtime to properly source lua files within tree.
|
|
|
|
|
|
| |
This cleans up a lot of the build system. This makes everything
consistent, clean, less redundant and also fixes the issue of make clean
not cleaning up generated files.
|
|
|
|
|
| |
This change also consists of cleaning up the server class and adding a
constructor and a finalizer to it.
|
| |
|
|
|
|
|
|
| |
please test things before committing.
reverts all changes since and including f6156c9a6234237757b61960c690e8d55779e764
|
|
|
|
|
| |
This change also consists of cleaning up the server class and adding a
constructor and a finalizer to it.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
|