diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2010-05-18 15:32:35 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2010-05-19 11:22:08 +0200 |
commit | 9204a5903ab7a2cc39f1c078ce503d337a815be0 (patch) | |
tree | 5204865baefd62bdfd03a6e9f459db9b437ac849 | |
parent | 981abd3fee93efb4578e1ae6442ea4b320a710a9 (diff) | |
download | spice-9204a5903ab7a2cc39f1c078ce503d337a815be0.tar.gz spice-9204a5903ab7a2cc39f1c078ce503d337a815be0.tar.xz spice-9204a5903ab7a2cc39f1c078ce503d337a815be0.zip |
add spice-experimental.h
Supposed to be used for work-in-progress bits,
where interfaces are not finalized yet.
Moved over vdi port interface, tunnel interface
and spice client migration functions.
-rw-r--r-- | server/Makefile.am | 2 | ||||
-rwxr-xr-x | server/red_tunnel_worker.h | 2 | ||||
-rw-r--r-- | server/reds.c | 1 | ||||
-rw-r--r-- | server/spice-experimental.h | 63 | ||||
-rw-r--r-- | server/spice.h | 63 |
5 files changed, 66 insertions, 65 deletions
diff --git a/server/Makefile.am b/server/Makefile.am index cf504a79..efda9023 100644 --- a/server/Makefile.am +++ b/server/Makefile.am @@ -86,6 +86,7 @@ libspice_server_la_SOURCES = \ red_channel.h \ red_channel.c \ spice.h \ + spice-experimental.h \ $(TUNNEL_SRCS) \ $(COMMON_SRCS) \ $(NULL) @@ -93,6 +94,7 @@ libspice_server_la_SOURCES = \ libspice_serverincludedir = $(includedir)/spice-server libspice_serverinclude_HEADERS = spice.h \ + spice-experimental.h \ $(NULL) EXTRA_DIST = \ diff --git a/server/red_tunnel_worker.h b/server/red_tunnel_worker.h index 42d23d1b..3df4aea4 100755 --- a/server/red_tunnel_worker.h +++ b/server/red_tunnel_worker.h @@ -22,8 +22,6 @@ #ifndef _H_RED_TUNNEL_WORKER #define _H_RED_TUNNEL_WORKER -#include "spice.h" - void *red_tunnel_attach(SpiceCoreInterface *core_interface, SpiceNetWireInstance *sin); #endif diff --git a/server/reds.c b/server/reds.c index e9bf7164..45946f0c 100644 --- a/server/reds.c +++ b/server/reds.c @@ -39,6 +39,7 @@ #include <openssl/err.h> #include "spice.h" +#include "spice-experimental.h" #include "reds.h" #include <spice/protocol.h> #include <spice/vd_agent.h> diff --git a/server/spice-experimental.h b/server/spice-experimental.h new file mode 100644 index 00000000..0b732bc8 --- /dev/null +++ b/server/spice-experimental.h @@ -0,0 +1,63 @@ +/* vdi port interface */ + +#define SPICE_INTERFACE_VDI_PORT "vdi_port" +#define SPICE_INTERFACE_VDI_PORT_MAJOR 1 +#define SPICE_INTERFACE_VDI_PORT_MINOR 1 +typedef struct SpiceVDIPortInterface SpiceVDIPortInterface; +typedef struct SpiceVDIPortInstance SpiceVDIPortInstance; +typedef struct SpiceVDIPortState SpiceVDIPortState; + +struct SpiceVDIPortInterface { + SpiceBaseInterface base; + + void (*state)(SpiceVDIPortInstance *sin, int connected); + int (*write)(SpiceVDIPortInstance *sin, const uint8_t *buf, int len); + int (*read)(SpiceVDIPortInstance *sin, uint8_t *buf, int len); +}; + +struct SpiceVDIPortInstance { + SpiceBaseInstance base; + SpiceVDIPortState *st; +}; + +void spice_server_vdi_port_wakeup(SpiceVDIPortInstance *sin); + +/* tunnel interface */ + +#define SPICE_INTERFACE_NET_WIRE "net_wire" +#define SPICE_INTERFACE_NET_WIRE_MAJOR 1 +#define SPICE_INTERFACE_NET_WIRE_MINOR 1 +typedef struct SpiceNetWireInterface SpiceNetWireInterface; +typedef struct SpiceNetWireInstance SpiceNetWireInstance; +typedef struct SpiceNetWireState SpiceNetWireState; + +struct NetWireInterface { + SpiceBaseInterface base; + + struct in_addr (*get_ip)(SpiceNetWireInterface *sin); + int (*can_send_packet)(SpiceNetWireInterface *sin); + void (*send_packet)(SpiceNetWireInterface *sin, const uint8_t *pkt, int len); +}; + +struct SpiceNetWireInstance { + SpiceBaseInstance base; + SpiceNetWireState *st; +}; + +void spice_server_net_wire_recv_packet(SpiceNetWireInstance *sin, + const uint8_t *pkt, int len); + +/* spice client migration */ + +enum { + SPICE_MIGRATE_CLIENT_NONE = 1, + SPICE_MIGRATE_CLIENT_WAITING, + SPICE_MIGRATE_CLIENT_READY, +}; + +int spice_server_migrate_info(SpiceServer *s, const char* dest, int port, int secure_port, + const char* cert_subject); +int spice_server_migrate_start(SpiceServer *s); +int spice_server_migrate_client_state(SpiceServer *s); +int spice_server_migrate_end(SpiceServer *s, int completed); + diff --git a/server/spice.h b/server/spice.h index ccbae92d..6c5853dc 100644 --- a/server/spice.h +++ b/server/spice.h @@ -310,55 +310,6 @@ void spice_server_record_stop(SpiceRecordInstance *sin); uint32_t spice_server_record_get_samples(SpiceRecordInstance *sin, uint32_t *samples, uint32_t bufsize); -/* vdi port interface */ - -#define SPICE_INTERFACE_VDI_PORT "vdi_port" -#define SPICE_INTERFACE_VDI_PORT_MAJOR 1 -#define SPICE_INTERFACE_VDI_PORT_MINOR 1 -typedef struct SpiceVDIPortInterface SpiceVDIPortInterface; -typedef struct SpiceVDIPortInstance SpiceVDIPortInstance; -typedef struct SpiceVDIPortState SpiceVDIPortState; - -struct SpiceVDIPortInterface { - SpiceBaseInterface base; - - void (*state)(SpiceVDIPortInstance *sin, int connected); - int (*write)(SpiceVDIPortInstance *sin, const uint8_t *buf, int len); - int (*read)(SpiceVDIPortInstance *sin, uint8_t *buf, int len); -}; - -struct SpiceVDIPortInstance { - SpiceBaseInstance base; - SpiceVDIPortState *st; -}; - -void spice_server_vdi_port_wakeup(SpiceVDIPortInstance *sin); - -/* tunnel interface */ - -#define SPICE_INTERFACE_NET_WIRE "net_wire" -#define SPICE_INTERFACE_NET_WIRE_MAJOR 1 -#define SPICE_INTERFACE_NET_WIRE_MINOR 1 -typedef struct SpiceNetWireInterface SpiceNetWireInterface; -typedef struct SpiceNetWireInstance SpiceNetWireInstance; -typedef struct SpiceNetWireState SpiceNetWireState; - -struct NetWireInterface { - SpiceBaseInterface base; - - struct in_addr (*get_ip)(SpiceNetWireInterface *sin); - int (*can_send_packet)(SpiceNetWireInterface *sin); - void (*send_packet)(SpiceNetWireInterface *sin, const uint8_t *pkt, int len); -}; - -struct SpiceNetWireInstance { - SpiceBaseInstance base; - SpiceNetWireState *st; -}; - -void spice_server_net_wire_recv_packet(SpiceNetWireInstance *sin, - const uint8_t *pkt, int len); - /* spice server setup */ typedef struct RedsState SpiceServer; @@ -407,18 +358,4 @@ int spice_server_add_renderer(SpiceServer *s, const char *name); int spice_server_get_sock_info(SpiceServer *s, struct sockaddr *sa, socklen_t *salen); int spice_server_get_peer_info(SpiceServer *s, struct sockaddr *sa, socklen_t *salen); -/* spice client migration */ - -enum { - SPICE_MIGRATE_CLIENT_NONE = 1, - SPICE_MIGRATE_CLIENT_WAITING, - SPICE_MIGRATE_CLIENT_READY, -}; - -int spice_server_migrate_info(SpiceServer *s, const char* dest, int port, int secure_port, - const char* cert_subject); -int spice_server_migrate_start(SpiceServer *s); -int spice_server_migrate_client_state(SpiceServer *s); -int spice_server_migrate_end(SpiceServer *s, int completed); - #endif |