Re: [systemd-devel] [RFC 3/6] proxy-discoveryd: Add PAC support through duktape js engine

2015-04-13 Thread Zbigniew Jędrzejewski-Szmek
On Mon, Apr 13, 2015 at 09:51:05AM -0700, Marcel Holtmann wrote: Hi Zbyszek, --- a/Makefile.am +++ b/Makefile.am @@ -5895,12 +5895,19 @@ rootlibexec_PROGRAMS += \ systemd-proxy-discoveryd systemd_proxy_discoveryd_SOURCES = \ + src/proxy-discovery/duktape.h \ +

Re: [systemd-devel] [RFC 3/6] proxy-discoveryd: Add PAC support through duktape js engine

2015-04-13 Thread Tomasz Bursztyka
Le 10/04/2015 18:49, Lennart Poettering a écrit : On Fri, 10.04.15 15:17, Tomasz Bursztyka (tomasz.burszt...@linux.intel.com) wrote: +struct PAC { +duk_context *ctx; +}; + +static int get_addresses_from_interface(int ifindex, union in_addr_union *address) { +struct ifreq ifr

Re: [systemd-devel] [RFC 3/6] proxy-discoveryd: Add PAC support through duktape js engine

2015-04-13 Thread Tomasz Bursztyka
Hi Tom, --- a/Makefile.am +++ b/Makefile.am @@ -5895,12 +5895,19 @@ rootlibexec_PROGRAMS += \ systemd-proxy-discoveryd systemd_proxy_discoveryd_SOURCES = \ + src/proxy-discovery/duktape.h \ + src/proxy-discovery/duktape.c \ These files are not included in the patch, how

Re: [systemd-devel] [RFC 3/6] proxy-discoveryd: Add PAC support through duktape js engine

2015-04-13 Thread Zbigniew Jędrzejewski-Szmek
On Mon, Apr 13, 2015 at 01:24:57PM +0300, Tomasz Bursztyka wrote: Hi Tom, --- a/Makefile.am +++ b/Makefile.am @@ -5895,12 +5895,19 @@ rootlibexec_PROGRAMS += \ systemd-proxy-discoveryd systemd_proxy_discoveryd_SOURCES = \ + src/proxy-discovery/duktape.h \ +

Re: [systemd-devel] [RFC 3/6] proxy-discoveryd: Add PAC support through duktape js engine

2015-04-13 Thread Zbigniew Jędrzejewski-Szmek
On Mon, Apr 13, 2015 at 08:43:32AM -0700, Marcel Holtmann wrote: Hi Zbyszek, --- a/Makefile.am +++ b/Makefile.am @@ -5895,12 +5895,19 @@ rootlibexec_PROGRAMS += \ systemd-proxy-discoveryd systemd_proxy_discoveryd_SOURCES = \ + src/proxy-discovery/duktape.h \ +

Re: [systemd-devel] [RFC 3/6] proxy-discoveryd: Add PAC support through duktape js engine

2015-04-13 Thread Marcel Holtmann
Hi Zbyszek, --- a/Makefile.am +++ b/Makefile.am @@ -5895,12 +5895,19 @@ rootlibexec_PROGRAMS += \ systemd-proxy-discoveryd systemd_proxy_discoveryd_SOURCES = \ + src/proxy-discovery/duktape.h \ + src/proxy-discovery/duktape.c \ These files are not included in the

Re: [systemd-devel] [RFC 3/6] proxy-discoveryd: Add PAC support through duktape js engine

2015-04-13 Thread Marcel Holtmann
Hi Zbyszek, --- a/Makefile.am +++ b/Makefile.am @@ -5895,12 +5895,19 @@ rootlibexec_PROGRAMS += \ systemd-proxy-discoveryd systemd_proxy_discoveryd_SOURCES = \ + src/proxy-discovery/duktape.h \ + src/proxy-discovery/duktape.c \ These files are not included in the

Re: [systemd-devel] [RFC 3/6] proxy-discoveryd: Add PAC support through duktape js engine

2015-04-12 Thread Lennart Poettering
On Fri, 10.04.15 15:26, Marcel Holtmann (mar...@holtmann.org) wrote: +static int pac_dns_resolve(duk_context *ctx) { +_cleanup_free_ char *address = NULL; +struct addrinfo hints = {}; +struct addrinfo *res, *addr; +const char *hostname; +int r;

Re: [systemd-devel] [RFC 3/6] proxy-discoveryd: Add PAC support through duktape js engine

2015-04-10 Thread Marcel Holtmann
Hi Lennart, +struct PAC { +duk_context *ctx; +}; + +static int get_addresses_from_interface(int ifindex, union in_addr_union *address) { +struct ifreq ifr = {}; +int sk; + +sk = socket(AF_INET, SOCK_DGRAM, 0); +if (sk 0) +