libvirt/src/virnetprotocol-structs
Daniel P. Berrange b0f996a6b1 Extend RPC protocol to allow FD passing
Define two new RPC message types VIR_NET_CALL_WITH_FDS and
VIR_NET_REPLY_WITH_FDS. These message types are equivalent
to VIR_NET_CALL and VIR_NET_REPLY, except that between the
message header, and payload there is a 32-bit integer field
specifying how many file descriptors have been passed.

The actual file descriptors are sent/recv'd out of band.

* src/rpc/virnetmessage.c, src/rpc/virnetmessage.h,
  src/libvirt_private.syms: Add support for handling
  passed file descriptors
* src/rpc/virnetprotocol.x: Extend protocol for FD
  passing
2011-10-28 10:27:15 +01:00

45 lines
1.4 KiB
C

/* -*- c -*- */
enum virNetMessageType {
VIR_NET_CALL = 0,
VIR_NET_REPLY = 1,
VIR_NET_MESSAGE = 2,
VIR_NET_STREAM = 3,
VIR_NET_CALL_WITH_FDS = 4,
VIR_NET_REPLY_WITH_FDS = 5,
};
enum virNetMessageStatus {
VIR_NET_OK = 0,
VIR_NET_ERROR = 1,
VIR_NET_CONTINUE = 2,
};
struct virNetMessageHeader {
u_int prog;
u_int vers;
int proc;
virNetMessageType type;
u_int serial;
virNetMessageStatus status;
};
struct virNetMessageNonnullDomain {
virNetMessageNonnullString name;
virNetMessageUUID uuid;
int id;
};
struct virNetMessageNonnullNetwork {
virNetMessageNonnullString name;
virNetMessageUUID uuid;
};
struct virNetMessageError {
int code;
int domain;
virNetMessageString message;
int level;
virNetMessageDomain dom;
virNetMessageString str1;
virNetMessageString str2;
virNetMessageString str3;
int int1;
int int2;
virNetMessageNetwork net;
};