KLone An SDK for Embedded Web Applications Steven Dorigotti - - PowerPoint PPT Presentation

klone an sdk for embedded web applications
SMART_READER_LITE
LIVE PREVIEW

KLone An SDK for Embedded Web Applications Steven Dorigotti - - PowerPoint PPT Presentation

KLone An SDK for Embedded Web Applications Steven Dorigotti KoanLogic (http://koanlogic.com) August 11, 2006 Outline KLone Development Applications Wrap-Up KLone What is it? Use Cases Features Libraries Workings Development


slide-1
SLIDE 1

KLone An SDK for Embedded Web Applications

Steven Dorigotti KoanLogic (http://koanlogic.com)

August 11, 2006

slide-2
SLIDE 2

Outline KLone Development Applications Wrap-Up

KLone What is it? Use Cases Features Libraries Workings Development Tutorial Fine-Tuning KLone-Devkit Applications Industry Open Source Wrap-Up

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-3
SLIDE 3

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

In Brief

◮ lightweight web server

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-4
SLIDE 4

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

In Brief

◮ lightweight web server ◮ C/C++ SDK

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-5
SLIDE 5

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

In Brief

◮ lightweight web server ◮ C/C++ SDK ◮ API (GET/POST, sessions, cookies, I/O, logging, upload, ...)

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-6
SLIDE 6

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

In Brief

◮ lightweight web server ◮ C/C++ SDK ◮ API (GET/POST, sessions, cookies, I/O, logging, upload, ...) ◮ framework (compilation & building).

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-7
SLIDE 7

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Generic

web app any C/C++ library host FS

KLone engine

embeddedFS HTTP library I/O library HTTP/S client

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-8
SLIDE 8

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Embedded System

web app any C/C++ library host FS

KLone engine

embeddedFS HTTP library I/O library HTTP/S client

generic WEB browser

  • r special purpose client

application interface to appliance resources (hardware or firmware) depends on type of appliance client interface to appliance configuration and monitoring

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-9
SLIDE 9

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Remote Procedure Calls

web app any C/C++ library host FS

KLone engine

embeddedFS HTTP library I/O library HTTP/S client

custom HTTP/S client application (e.g. TSP, DVCS, SCVP, LTAP-enabled) handles HTTP/S request/response possibly, crypto material needed to securely interface the backend application (may also be placed in the host FS if available) TSP, DVCS, SCVP, LTAP API to interface a backend application

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-10
SLIDE 10

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Content Management

web app any C/C++ library host FS

KLone engine

embeddedFS HTTP library I/O library HTTP/S client

client interface to document search and validation generic WEB browser launched on the same host as KLone document search and digital signature validation API a tamper proof digitally signed set of documents (PDF, MS Word ...) a set of trust anchors

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-11
SLIDE 11

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

General Features

Some standard features:

◮ HTTP 1.0 compliant ◮ TLS/SSL ◮ virtual hosting

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-12
SLIDE 12

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

General Features

Some standard features:

◮ HTTP 1.0 compliant ◮ TLS/SSL ◮ virtual hosting

...but also:

◮ optimised (∼ 140KB ROM, ∼ 70KB RAM)

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-13
SLIDE 13

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

General Features

Some standard features:

◮ HTTP 1.0 compliant ◮ TLS/SSL ◮ virtual hosting

...but also:

◮ optimised (∼ 140KB ROM, ∼ 70KB RAM) ◮ native compiled code

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-14
SLIDE 14

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

General Features

Some standard features:

◮ HTTP 1.0 compliant ◮ TLS/SSL ◮ virtual hosting

...but also:

◮ optimised (∼ 140KB ROM, ∼ 70KB RAM) ◮ native compiled code ◮ ROMable

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-15
SLIDE 15

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

General Features

Some standard features:

◮ HTTP 1.0 compliant ◮ TLS/SSL ◮ virtual hosting

...but also:

◮ optimised (∼ 140KB ROM, ∼ 70KB RAM) ◮ native compiled code ◮ ROMable ◮ Open Source (GPL/commercial).

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-16
SLIDE 16

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Embedded File System

◮ static/dynamic pages in kloned object

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-17
SLIDE 17

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Embedded File System

◮ static/dynamic pages in kloned object ◮ compression (zlib)

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-18
SLIDE 18

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Embedded File System

◮ static/dynamic pages in kloned object ◮ compression (zlib) ◮ encryption: 256-bit AES (OpenSSL).

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-19
SLIDE 19

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Client-Side Sessions

◮ standard session features

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-20
SLIDE 20

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Client-Side Sessions

◮ standard session features ◮ no storage required

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-21
SLIDE 21

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Client-Side Sessions

◮ standard session features ◮ no storage required ◮ cryptographically protected cookies.

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-22
SLIDE 22

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Client-Side Sessions

◮ standard session features ◮ no storage required ◮ cryptographically protected cookies.

The Internet Draft can be found at the following URL:

http://www.ietf.org/internet-drafts/draft-barbato-scs-00.txt Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-23
SLIDE 23

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Portability

◮ GNU/Linux (2.2, 2.4, 2.6 - GCC 2.95.x, 3.x, both glibc and

uClibc supported)

◮ x86, MIPS, ARM, Cris (Axis), PowerPC, SH4, m68k

◮ QNX 6

◮ x86, ARM, MIPS, PowerPC, SH

◮ VxWorks 6.x (DCC and GCC compilers)

◮ All supported CPUs

◮ FreeBSD 4.X, 5.X and 6.X ◮ NetBSD 2.0.X, 2.1 and 3.X ◮ OpenBSD 3.8 ◮ Darwin 7 / MacOSX 10.3 ◮ Microsoft Windows XP (MinGW framework with MSYS).

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-24
SLIDE 24

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Libraries

3rd party dependencies are minimised: zlib (compression), OpenSSL (encryption).

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-25
SLIDE 25

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Libraries

3rd party dependencies are minimised: zlib (compression), OpenSSL (encryption). Internally developed, BSD-licensed libraries:

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-26
SLIDE 26

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Libraries

3rd party dependencies are minimised: zlib (compression), OpenSSL (encryption). Internally developed, BSD-licensed libraries:

◮ LibU: utility library

◮ multi-platform ◮ net, string, memory, config, hmap, ... Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-27
SLIDE 27

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Libraries

3rd party dependencies are minimised: zlib (compression), OpenSSL (encryption). Internally developed, BSD-licensed libraries:

◮ LibU: utility library

◮ multi-platform ◮ net, string, memory, config, hmap, ...

◮ MaKL: build system

◮ Autotools replacement ◮ Bourne Shell & GNU Make ◮ toolchains Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-28
SLIDE 28

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Workings

Runtime Translation

<html> ... </html> <% /* C code block */ %>

$ klone -c import [-z] [-e]... translate_script_to_c()

static embpage_t e; static void exec_page (rq, rs, ss); static void module_init<md5> (void); static embfile_t e; static unsigned char data[] = { 0x ... }; static void module_init<md5> (void);

translate_opaque_to_c()

Compilation

  • bject files

static embpage_t e; static void exec_page (rq, rs, ss); static void module_init<md5> (void); static embfile_t e; static unsigned char data[] = { 0x ... }; static void module_init<md5> (void);

$ native_C_compiler $ native_linker

KLone HTTP/S server library KLone HTTP Helper library

kloned

kloned::server_loop() connect kloned::server_dispatch() kloned::server_be_serve() choose backend choose supplier choose page type sup_emb::serve_static() sup_emb::serve_dynamic()

exec_page()

https::https_serve() client response sup_fs::serve() script? developer $ cd site && make $ make

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-29
SLIDE 29

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Workings

Runtime Translation

<html> ... </html> <% /* C code block */ %>

$ klone -c import [-z] [-e]... translate_script_to_c()

static embpage_t e; static void exec_page (rq, rs, ss); static void module_init<md5> (void); static embfile_t e; static unsigned char data[] = { 0x ... }; static void module_init<md5> (void);

translate_opaque_to_c()

Compilation

  • bject files

static embpage_t e; static void exec_page (rq, rs, ss); static void module_init<md5> (void); static embfile_t e; static unsigned char data[] = { 0x ... }; static void module_init<md5> (void);

$ native_C_compiler $ native_linker

KLone HTTP/S server library KLone HTTP Helper library

kloned

kloned::server_loop() connect kloned::server_dispatch() kloned::server_be_serve() choose backend choose supplier choose page type sup_emb::serve_static() sup_emb::serve_dynamic()

exec_page()

https::https_serve() client response sup_fs::serve() script? developer $ cd site && make $ make

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-30
SLIDE 30

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Workings

Runtime Translation

<html> ... </html> <% /* C code block */ %>

$ klone -c import [-z] [-e]... translate_script_to_c()

static embpage_t e; static void exec_page (rq, rs, ss); static void module_init<md5> (void); static embfile_t e; static unsigned char data[] = { 0x ... }; static void module_init<md5> (void);

translate_opaque_to_c()

Compilation

  • bject files

static embpage_t e; static void exec_page (rq, rs, ss); static void module_init<md5> (void); static embfile_t e; static unsigned char data[] = { 0x ... }; static void module_init<md5> (void);

$ native_C_compiler $ native_linker

KLone HTTP/S server library KLone HTTP Helper library

kloned

kloned::server_loop() connect kloned::server_dispatch() kloned::server_be_serve() choose backend choose supplier choose page type sup_emb::serve_static() sup_emb::serve_dynamic()

exec_page()

https::https_serve() client response sup_fs::serve() script? developer $ cd site && make $ make

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-31
SLIDE 31

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Workings

Runtime Translation

<html> ... </html> <% /* C code block */ %>

$ klone -c import [-z] [-e]... translate_script_to_c()

static embpage_t e; static void exec_page (rq, rs, ss); static void module_init<md5> (void); static embfile_t e; static unsigned char data[] = { 0x ... }; static void module_init<md5> (void);

translate_opaque_to_c()

Compilation

  • bject files

static embpage_t e; static void exec_page (rq, rs, ss); static void module_init<md5> (void); static embfile_t e; static unsigned char data[] = { 0x ... }; static void module_init<md5> (void);

$ native_C_compiler $ native_linker

KLone HTTP/S server library KLone HTTP Helper library

kloned

kloned::server_loop() connect kloned::server_dispatch() kloned::server_be_serve() choose backend choose supplier choose page type sup_emb::serve_static() sup_emb::serve_dynamic()

exec_page()

https::https_serve() client response sup_fs::serve() script? developer $ cd site && make $ make

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-32
SLIDE 32

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Workings

Runtime

Translation

<html> ... </html> <% /* C code block */ %>

$ klone -c import [-z] [-e]...

translate_script_to_c()

static embpage_t e; static void exec_page (rq, rs, ss); static void module_init<md5> (void); static embfile_t e; static unsigned char data[] = { 0x ... }; static void module_init<md5> (void);

translate_opaque_to_c()

Compilation

  • bject fi

static embpage_t e; static void exec_page (rq, rs, ss); static void module_init<md5> (void); static embfile_t e; static unsigned char data[] = { 0x ... }; static void module_init<md5> (void);

$ native_C_compiler $ native_linker

KLone HTTP/S server library KLone HTTP Helper library

kloned

script?

developer

$ cd site && make $ make

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-33
SLIDE 33

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Workings

Runtime

Translation

/* C code block */

$ klone -c import [-z] [-e]...

translate_script_to_c()

(rq, rs, ss); module_init<md5> (void); static embfile_t e; static unsigned char data[] = { 0x ... }; static void module_init<md5> (void);

translate_opaque_to_c()

Compilation

  • bject files

static embpage_t e; static void exec_page (rq, rs, ss); static void module_init<md5> (void); static embfile_t e; static unsigned char data[] = { 0x ... }; static void module_init<md5> (void);

$ native_C_compiler $ native_linker

KLone HTTP/S server library KLone HTTP Helper library

kloned

script?

developer

$ cd site && make $ make

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-34
SLIDE 34

Outline KLone Development Applications Wrap-Up What is it? Use Cases Features Libraries Workings

Workings

Runtime

static void module_init<md5> (void);

kloned

kloned::server_loop()

connect

kloned::server_dispatch() kloned::server_be_serve() choose backend choose supplier choose page type sup_emb::serve_static() sup_emb::serve_dynamic()

exec_page()

https::https_serve()

client response

sup_fs::serve() Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-35
SLIDE 35

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Syntax

The syntax for dynamic .kl1 pages is very intuitive:

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-36
SLIDE 36

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Syntax

The syntax for dynamic .kl1 pages is very intuitive:

◮ standard HTML

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-37
SLIDE 37

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Syntax

The syntax for dynamic .kl1 pages is very intuitive:

◮ standard HTML ◮ code blocks:

<% /* C/C++ code */ %>

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-38
SLIDE 38

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Syntax

The syntax for dynamic .kl1 pages is very intuitive:

◮ standard HTML ◮ code blocks:

<% /* C/C++ code */ %>

◮ expression printing:

<%= /* char *expression */ %>

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-39
SLIDE 39

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Syntax

The syntax for dynamic .kl1 pages is very intuitive:

◮ standard HTML ◮ code blocks:

<% /* C/C++ code */ %>

◮ expression printing:

<%= /* char *expression */ %>

◮ declarations:

<%! /* C/C++ declarations */ %>

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-40
SLIDE 40

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Syntax

The syntax for dynamic .kl1 pages is very intuitive:

◮ standard HTML ◮ code blocks:

<% /* C/C++ code */ %>

◮ expression printing:

<%= /* char *expression */ %>

◮ declarations:

<%! /* C/C++ declarations */ %>

◮ preprocessor directives:

<%@ directive [param]... %>

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-41
SLIDE 41

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Example: Hello World

<!-- hello.kl1 --> <%@ include "header.kl1" %> <%! #include <time.h> %> <% time_t now; int i; now = time(NULL); io_printf(out, "today is %s <p>", ctime(&now)); for(i = 0; i < 10; ++i) { io_printf(out, "hello world! <p>"); } %> <%@ include "footer.kl1" %>

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-42
SLIDE 42

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Example: Hello World

<!-- hello.kl1 --> <%@ include "header.kl1" %> <%! #include <time.h> %> <% time_t now; int i; now = time(NULL); io_printf(out, "today is %s <p>", ctime(&now)); for(i = 0; i < 10; ++i) { io_printf(out, "hello world! <p>"); } %> <%@ include "footer.kl1" %>

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-43
SLIDE 43

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Example: Hello World

<!-- hello.kl1 --> <%@ include "header.kl1" %> <%! #include <time.h> %> <% time_t now; int i; now = time(NULL); io_printf(out, "today is %s <p>", ctime(&now)); for(i = 0; i < 10; ++i) { io_printf(out, "hello world! <p>"); } %> <%@ include "footer.kl1" %>

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-44
SLIDE 44

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Example: Hello World

<!-- hello.kl1 --> <%@ include "header.kl1" %> <%! #include <time.h> %> <% time_t now; int i; now = time(NULL); io_printf(out, "today is %s <p>", ctime(&now)); for(i = 0; i < 10; ++i) { io_printf(out, "hello world! <p>"); } %> <%@ include "footer.kl1" %>

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-45
SLIDE 45

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Example: Cookies

<!-- colour.kl1 --> <%! #include <string.h> %> <% vars_t *args = request_get_args(request); const char *colour = vars_get_value(args, "colour"); if (colour && strlen(colour)) response_set_cookie(response, "colour", colour, \ time(NULL), NULL, NULL, 0); %> <p>What is your favourite colour? <form action="colour.kl1" method="post"> colour: <input type="text" name="colour"><br> <input type="submit" value="submit"><br> </form> <p>You preference: <%= request_get_cookie(request, "colour") %>

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-46
SLIDE 46

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Example: Cookies

<!-- colour.kl1 --> <%! #include <string.h> %> <% vars_t *args = request_get_args(request); const char *colour = vars_get_value(args, "colour"); if (colour && strlen(colour)) response_set_cookie(response, "colour", colour, \ time(NULL), NULL, NULL, 0); %> <p>What is your favourite colour? <form action="colour.kl1" method="post"> colour: <input type="text" name="colour"><br> <input type="submit" value="submit"><br> </form> <p>You preference: <%= request_get_cookie(request, "colour") %>

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-47
SLIDE 47

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Example: Cookies

<!-- colour.kl1 --> <%! #include <string.h> %> <% vars_t *args = request_get_args(request); const char *colour = vars_get_value(args, "colour"); if (colour && strlen(colour)) response_set_cookie(response, "colour", colour, \ time(NULL), NULL, NULL, 0); %> <p>What is your favourite colour? <form action="colour.kl1" method="post"> colour: <input type="text" name="colour"><br> <input type="submit" value="submit"><br> </form> <p>You preference: <%= request_get_cookie(request, "colour") %>

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-48
SLIDE 48

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Example: Cookies

<!-- colour.kl1 --> <%! #include <string.h> %> <% vars_t *args = request_get_args(request); const char *colour = vars_get_value(args, "colour"); if (colour && strlen(colour)) response_set_cookie(response, "colour", colour, \ time(NULL), NULL, NULL, 0); %> <p>What is your favourite colour? <form action="colour.kl1" method="post"> colour: <input type="text" name="colour"><br> <input type="submit" value="submit"><br> </form> <p>You preference: <%= request_get_cookie(request, "colour") %>

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-49
SLIDE 49

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Example: Cookies

<!-- colour.kl1 --> <%! #include <string.h> %> <% vars_t *args = request_get_args(request); const char *colour = vars_get_value(args, "colour"); if (colour && strlen(colour)) response_set_cookie(response, "colour", colour, \ time(NULL), NULL, NULL, 0); %> <p>What is your favourite colour? <form action="colour.kl1" method="post"> colour: <input type="text" name="colour"><br> <input type="submit" value="submit"><br> </form> <p>You preference: <%= request_get_cookie(request, "colour") %>

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-50
SLIDE 50

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Fine-Tuning

KLone can be configured to suit the host environment in terms of:

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-51
SLIDE 51

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Fine-Tuning

KLone can be configured to suit the host environment in terms of:

◮ CPU, memory and filesystem utilisation:

◮ server model ◮ compression of content and/or sessions ◮ sessions: file, memory or client ◮ logging: file, syslog or memory Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-52
SLIDE 52

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Fine-Tuning

KLone can be configured to suit the host environment in terms of:

◮ CPU, memory and filesystem utilisation:

◮ server model ◮ compression of content and/or sessions ◮ sessions: file, memory or client ◮ logging: file, syslog or memory

◮ security requirements:

◮ uid/guid ◮ chroot ◮ file and/or session encryption. Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-53
SLIDE 53

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Zero Storage / In-memory Sessions / HTTP

server_list my_http log { type memory memory.limit 200 } my_http { type http addr.type IPv4 addr.port 8080 dir_root /www session { type memory compress yes memory.limit 8192 memory.max_count 2 } } Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-54
SLIDE 54

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Zero Storage / In-memory Sessions / HTTP

server_list my_http log { type memory memory.limit 200 } my_http { type http addr.type IPv4 addr.port 8080 dir_root /www session { type memory compress yes memory.limit 8192 memory.max_count 2 } } Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-55
SLIDE 55

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Zero Storage / In-memory Sessions / HTTP

server_list my_http log { type memory memory.limit 200 } my_http { type http addr.type IPv4 addr.port 8080 dir_root /www session { type memory compress yes memory.limit 8192 memory.max_count 2 } } Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-56
SLIDE 56

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Zero Storage / Client-side Sessions / HTTPS

server_list my_https log { type memory memory.limit 200 } my_https { type https compress yes addr.type IPv4 addr.port 443 dir_root /www session.type client cert_file /etc/kloned.pem } Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-57
SLIDE 57

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Zero Storage / Client-side Sessions / HTTPS

server_list my_https log { type memory memory.limit 200 } my_https { type https compress yes addr.type IPv4 addr.port 443 dir_root /www session.type client cert_file /etc/kloned.pem } Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-58
SLIDE 58

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Zero Storage / Client-side Sessions / HTTPS

server_list my_https log { type memory memory.limit 200 } my_https { type https compress yes addr.type IPv4 addr.port 443 dir_root /www session.type client cert_file /etc/kloned.pem } Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-59
SLIDE 59

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

KLone-Devkit

KLone-Devkit was developed with developers in mind:

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-60
SLIDE 60

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

KLone-Devkit

KLone-Devkit was developed with developers in mind:

◮ simplified learning curve

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-61
SLIDE 61

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

KLone-Devkit

KLone-Devkit was developed with developers in mind:

◮ simplified learning curve ◮ build environment

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-62
SLIDE 62

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

KLone-Devkit

KLone-Devkit was developed with developers in mind:

◮ simplified learning curve ◮ build environment ◮ provides working examples:

◮ Fox-Demo (basic and VHDL) ◮ PXAregs-GUI ◮ TSP-Proxy ◮ Doc-Search. Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-63
SLIDE 63

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

Klone-Devkit: FOX-Demo

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-64
SLIDE 64

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

KLone-Devkit: FOX-Demo

<html> <body> <%! #include <foxbone_userspace.h> %> <% unsigned int release, fd; fd = open("/dev/foxbone", O_RDONLY); release = ioctl(fd, IOCTL_FOXBONE_READ, \ FOXBONE_VER_REG); io_printf(out, "%x", release); close(fd); %> </body> </html>

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-65
SLIDE 65

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

KLone-Devkit: FOX-Demo

<html> <body> <%! #include <foxbone_userspace.h> %> <% unsigned int release, fd; fd = open("/dev/foxbone", O_RDONLY); release = ioctl(fd, IOCTL_FOXBONE_READ, \ FOXBONE_VER_REG); io_printf(out, "%x", release); close(fd); %> </body> </html>

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-66
SLIDE 66

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

KLone-Devkit: FOX-Demo

<html> <body> <%! #include <foxbone_userspace.h> %> <% unsigned int release, fd; fd = open("/dev/foxbone", O_RDONLY); release = ioctl(fd, IOCTL_FOXBONE_READ, \ FOXBONE_VER_REG); io_printf(out, "%x", release); close(fd); %> </body> </html>

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-67
SLIDE 67

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

KLone-Devkit: FOX-Demo

<html> <body> <%! #include <foxbone_userspace.h> %> <% unsigned int release, fd; fd = open("/dev/foxbone", O_RDONLY); release = ioctl(fd, IOCTL_FOXBONE_READ, \ FOXBONE_VER_REG); io_printf(out, "%x", release); close(fd); %> </body> </html>

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-68
SLIDE 68

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

KLone-Devkit: FOX-Demo

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-69
SLIDE 69

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

KLone-Devkit: FOX-VHDL

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-70
SLIDE 70

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

KLone-Devkit: PXAregs-GUI

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-71
SLIDE 71

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

KLone-Devkit: PXAregs-GUI

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-72
SLIDE 72

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

KLone-Devkit: TSP-Proxy

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-73
SLIDE 73

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

KLone-Devkit: Doc-Search

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-74
SLIDE 74

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

KLone-Devkit: Doc-Search

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-75
SLIDE 75

Outline KLone Development Applications Wrap-Up Tutorial Fine-Tuning KLone-Devkit

KLone-Devkit: Doc-Search

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-76
SLIDE 76

Outline KLone Development Applications Wrap-Up Industry Open Source

Industry

KLone is currently operational in several fields of the IT industry:

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-77
SLIDE 77

Outline KLone Development Applications Wrap-Up Industry Open Source

Industry

KLone is currently operational in several fields of the IT industry:

◮ FIAT: industrial control system

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-78
SLIDE 78

Outline KLone Development Applications Wrap-Up Industry Open Source

Industry

KLone is currently operational in several fields of the IT industry:

◮ FIAT: industrial control system ◮ RAI: network data analyser

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-79
SLIDE 79

Outline KLone Development Applications Wrap-Up Industry Open Source

Industry

KLone is currently operational in several fields of the IT industry:

◮ FIAT: industrial control system ◮ RAI: network data analyser ◮ T-Services:

◮ authentication system ◮ validation authority. Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-80
SLIDE 80

Outline KLone Development Applications Wrap-Up Industry Open Source

Open Source: Alp-MP3

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-81
SLIDE 81

Outline KLone Development Applications Wrap-Up Industry Open Source

Open Source: Alp-MP3

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-82
SLIDE 82

Outline KLone Development Applications Wrap-Up

Future Development

A preview:

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-83
SLIDE 83

Outline KLone Development Applications Wrap-Up

Future Development

A preview:

◮ HTTP 1.1 compliance

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-84
SLIDE 84

Outline KLone Development Applications Wrap-Up

Future Development

A preview:

◮ HTTP 1.1 compliance ◮ AJAX helpers

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-85
SLIDE 85

Outline KLone Development Applications Wrap-Up

Future Development

A preview:

◮ HTTP 1.1 compliance ◮ AJAX helpers ◮ performance & file size optimisation

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-86
SLIDE 86

Outline KLone Development Applications Wrap-Up

Future Development

A preview:

◮ HTTP 1.1 compliance ◮ AJAX helpers ◮ performance & file size optimisation ◮ more porting.

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-87
SLIDE 87

Outline KLone Development Applications Wrap-Up

Bookmarks

For more information:

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-88
SLIDE 88

Outline KLone Development Applications Wrap-Up

Bookmarks

For more information:

◮ Info, documentation and source code:

http://koanlogic.com Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-89
SLIDE 89

Outline KLone Development Applications Wrap-Up

Bookmarks

For more information:

◮ Info, documentation and source code:

http://koanlogic.com

◮ Mailing lists:

◮ klone-users@koanlogic.com ◮ klone-dev@koanlogic.com Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-90
SLIDE 90

Outline KLone Development Applications Wrap-Up

Bookmarks

For more information:

◮ Info, documentation and source code:

http://koanlogic.com

◮ Mailing lists:

◮ klone-users@koanlogic.com ◮ klone-dev@koanlogic.com

◮ Other information:

info@koanlogic.com Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-91
SLIDE 91

Outline KLone Development Applications Wrap-Up

Special Thanks

◮ Stefano Barbato ◮ Thomas Fossati

http://acmesystems.it http://phrozen.biz Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications

slide-92
SLIDE 92

Outline KLone Development Applications Wrap-Up

Questions

Steven Dorigotti KoanLogic (http://koanlogic.com) KLone An SDK for Embedded Web Applications