+/** Defines routing information for a command, containing a destination
+ * server id (if applicable) and a routing type from the enum above.
+ */
+struct RouteDescriptor
+{
+ /** Routing type from the enum above
+ */
+ const RouteType type;
+ /** For unicast, the destination server's name
+ */
+ const std::string serverdest;
+
+ /** Create a RouteDescriptor
+ */
+ RouteDescriptor(RouteType t, const std::string &d)
+ : type(t), serverdest(d) { }
+};
+
+/** Do not route this command */
+#define ROUTE_LOCALONLY (RouteDescriptor(ROUTE_TYPE_LOCALONLY, ""))
+/** Route this command to all servers, fail if not understood */
+#define ROUTE_BROADCAST (RouteDescriptor(ROUTE_TYPE_BROADCAST, ""))
+/** Route this command to a single server (do nothing if own server name specified) */
+#define ROUTE_UNICAST(x) (RouteDescriptor(ROUTE_TYPE_UNICAST, x))
+/** Route this command to all servers wrapped via ENCAP, so ignored if not understood */
+#define ROUTE_OPT_BCAST (RouteDescriptor(ROUTE_TYPE_OPT_BCAST, ""))
+/** Route this command to a single server wrapped via ENCAP, so ignored if not understood */
+#define ROUTE_OPT_UCAST(x) (RouteDescriptor(ROUTE_TYPE_OPT_UCAST, x))