summaryrefslogtreecommitdiff
path: root/lib/zclient.h
diff options
context:
space:
mode:
authorpaul <paul>2006-01-16 01:54:02 +0000
committerpaul <paul>2006-01-16 01:54:02 +0000
commitc1b9800a60f073c7d57f6232f9af7ae39bc3353a (patch)
tree94fc0006fcf73d4ab4733bef23689cb8f36772ee /lib/zclient.h
parentc77d4546619f9d3e0ccfac5acbc0ebb42658a61f (diff)
[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
Diffstat (limited to 'lib/zclient.h')
-rw-r--r--lib/zclient.h36
1 files changed, 24 insertions, 12 deletions
diff --git a/lib/zclient.h b/lib/zclient.h
index 910db0dc..bd33295a 100644
--- a/lib/zclient.h
+++ b/lib/zclient.h
@@ -29,7 +29,7 @@
#define ZEBRA_MAX_PACKET_SIZ 4096
/* Zebra header size. */
-#define ZEBRA_HEADER_SIZE 3
+#define ZEBRA_HEADER_SIZE 6
/* Structure for the zebra client. */
struct zclient
@@ -68,17 +68,17 @@ struct zclient
u_char default_information;
/* Pointer to the callback functions. */
- int (*router_id_update) (int, struct zclient *, zebra_size_t);
- int (*interface_add) (int, struct zclient *, zebra_size_t);
- int (*interface_delete) (int, struct zclient *, zebra_size_t);
- int (*interface_up) (int, struct zclient *, zebra_size_t);
- int (*interface_down) (int, struct zclient *, zebra_size_t);
- int (*interface_address_add) (int, struct zclient *, zebra_size_t);
- int (*interface_address_delete) (int, struct zclient *, zebra_size_t);
- int (*ipv4_route_add) (int, struct zclient *, zebra_size_t);
- int (*ipv4_route_delete) (int, struct zclient *, zebra_size_t);
- int (*ipv6_route_add) (int, struct zclient *, zebra_size_t);
- int (*ipv6_route_delete) (int, struct zclient *, zebra_size_t);
+ int (*router_id_update) (int, struct zclient *, uint16_t);
+ int (*interface_add) (int, struct zclient *, uint16_t);
+ int (*interface_delete) (int, struct zclient *, uint16_t);
+ int (*interface_up) (int, struct zclient *, uint16_t);
+ int (*interface_down) (int, struct zclient *, uint16_t);
+ int (*interface_address_add) (int, struct zclient *, uint16_t);
+ int (*interface_address_delete) (int, struct zclient *, uint16_t);
+ int (*ipv4_route_add) (int, struct zclient *, uint16_t);
+ int (*ipv4_route_delete) (int, struct zclient *, uint16_t);
+ int (*ipv6_route_add) (int, struct zclient *, uint16_t);
+ int (*ipv6_route_delete) (int, struct zclient *, uint16_t);
};
/* Zebra API message flag. */
@@ -87,6 +87,18 @@ struct zclient
#define ZAPI_MESSAGE_DISTANCE 0x04
#define ZAPI_MESSAGE_METRIC 0x08
+/* Zserv protocol message header */
+struct zserv_header
+{
+ uint16_t length;
+ uint8_t marker; /* corresponds to command field in old zserv
+ * always set to 255 in new zserv.
+ */
+ uint8_t version;
+#define ZSERV_VERSION 1
+ uint16_t command;
+};
+
/* Zebra IPv4 route message API. */
struct zapi_ipv4
{