[zserv] Extend Zserv header with version information and marker field
2006-01-16 Paul Jakma <paul.jakma@sun.com>
* lib/zclient.h: Update the Zserv protocol header with a version
field. Define the old command field to be a 'marker', to
allow old Zserv and updated Zserv to be differentiated.
Future updates will bump the version field obviously. New
command field is made wider. Try to stop using the
'zebra_size_t' typedef in the callbacks.
* lib/zclient.c: Update to read/write new format header.
* zebra/zserv.c: Ditto
diff --git a/lib/zebra.h b/lib/zebra.h
index cf7998f..00f13f5 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -397,6 +397,12 @@
#define ZEBRA_ROUTER_ID_UPDATE 22
#define ZEBRA_MESSAGE_MAX 23
+/* Marker value used in new Zserv, in the byte location corresponding
+ * the command value in the old zserv header. To allow old and new
+ * Zserv headers to be distinguished from each other.
+ */
+#define ZEBRA_HEADER_MARKER 255
+
/* Zebra route's types. */
#define ZEBRA_ROUTE_SYSTEM 0
#define ZEBRA_ROUTE_KERNEL 1
@@ -493,9 +499,9 @@
typedef u_int16_t afi_t;
typedef u_int8_t safi_t;
-/* Zebra types. */
+/* Zebra types. Used in Zserv message header. */
typedef u_int16_t zebra_size_t;
-typedef u_int8_t zebra_command_t;
+typedef u_int16_t zebra_command_t;
/* FIFO -- first in first out structure and macros. */
struct fifo