[PATCH 1/9] Define keepalive protocol

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The keepalive program has three procedures: ADVERTISE, PING, and PONG.
All are used only in asynchronous messages and the sender doesn't wait
for any reply. However, the party which receives PING messages is
supposed to react by sending PONG message the other party, but no
explicit binding between PING and PONG messages is made. ADVERTISE is
sent by a client to indicate it supports keepalive protocol. Server is
not allowed to send any keepalive message until it sees ADVERTISE.
---
 .gitignore                     |    1 +
 src/Makefile.am                |   12 +++++++++---
 src/rpc/virkeepaliveprotocol.x |    8 ++++++++
 3 files changed, 18 insertions(+), 3 deletions(-)
 create mode 100644 src/rpc/virkeepaliveprotocol.x

diff --git a/.gitignore b/.gitignore
index 41fa50f..3859fab 100644
--- a/.gitignore
+++ b/.gitignore
@@ -65,6 +65,7 @@
 /src/locking/qemu-sanlock.conf
 /src/remote/*_client_bodies.h
 /src/remote/*_protocol.[ch]
+/src/rpc/virkeepaliveprotocol.[ch]
 /src/rpc/virnetprotocol.[ch]
 /src/util/virkeymaps.h
 /tests/*.log
diff --git a/src/Makefile.am b/src/Makefile.am
index 738ee91..ff890e1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -266,7 +266,8 @@ PDWTAGS = \
 PROTOCOL_STRUCTS = \
 	$(srcdir)/remote_protocol-structs \
 	$(srcdir)/qemu_protocol-structs \
-	$(srcdir)/virnetprotocol-structs
+	$(srcdir)/virnetprotocol-structs \
+	$(srcdir)/virkeepaliveprotocol-structs
 if WITH_REMOTE
 # The .o file that pdwtags parses is created as a side effect of running
 # libtool; but from make's perspective we depend on the .lo file.
@@ -274,6 +275,7 @@ $(srcdir)/%_protocol-structs: libvirt_driver_remote_la-%_protocol.lo
 	$(PDWTAGS)
 $(srcdir)/virnetprotocol-structs: libvirt_net_rpc_la-virnetprotocol.lo
 	$(PDWTAGS)
+$(srcdir)/virkeepaliveprotocol-structs: libvirt_net_rpc_la-virkeepaliveprotocol.lo
 else !WITH_REMOTE
 # These generated files must live in git, because they cannot be re-generated
 # when configured --without-remote.
@@ -1307,12 +1309,15 @@ noinst_LTLIBRARIES += \
 
 EXTRA_DIST += \
        rpc/virnetprotocol.x \
+       rpc/virkeepaliveprotocol.x \
        rpc/gendispatch.pl \
        rpc/genprotocol.pl
 
 VIR_NET_RPC_GENERATED = \
 	$(srcdir)/rpc/virnetprotocol.h \
-	$(srcdir)/rpc/virnetprotocol.c
+	$(srcdir)/rpc/virnetprotocol.c \
+	$(srcdir)/rpc/virkeepaliveprotocol.h \
+	$(srcdir)/rpc/virkeepaliveprotocol.c
 
 BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
 
@@ -1320,7 +1325,8 @@ libvirt_net_rpc_la_SOURCES = \
 	rpc/virnetmessage.h rpc/virnetmessage.c \
 	rpc/virnetprotocol.h rpc/virnetprotocol.c \
 	rpc/virnetsocket.h rpc/virnetsocket.c \
-	rpc/virnettlscontext.h rpc/virnettlscontext.c
+	rpc/virnettlscontext.h rpc/virnettlscontext.c \
+	rpc/virkeepaliveprotocol.h rpc/virkeepaliveprotocol.c
 if HAVE_SASL
 libvirt_net_rpc_la_SOURCES += \
 	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
diff --git a/src/rpc/virkeepaliveprotocol.x b/src/rpc/virkeepaliveprotocol.x
new file mode 100644
index 0000000..326ea78
--- /dev/null
+++ b/src/rpc/virkeepaliveprotocol.x
@@ -0,0 +1,8 @@
+const KEEPALIVE_PROGRAM = 0x6b656570;
+const KEEPALIVE_VERSION = 1;
+
+enum keepalive_procedure {
+    KEEPALIVE_PROC_ADVERTISE = 1,
+    KEEPALIVE_PROC_PING = 2,
+    KEEPALIVE_PROC_PONG = 3
+};
-- 
1.7.6.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]