summaryrefslogtreecommitdiffstats
path: root/server/spice-experimental.h
blob: 0b732bc80829feaf23c5f5be984ff083f9f72d32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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);