From bf014a4c57083088fe4bbb4c85a8836f9815c2be Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 23 Aug 2018 14:02:36 -0700 Subject: [PATCH] scoutfs-utils: update format network requests We updated the format header when relaxing the restrictions on duplicate request message processing. Signed-off-by: Zach Brown --- utils/src/format.h | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/utils/src/format.h b/utils/src/format.h index 95f732c9..195bc3c7 100644 --- a/utils/src/format.h +++ b/utils/src/format.h @@ -520,36 +520,22 @@ struct scoutfs_net_greeting { /* * This header precedes and describes all network messages sent over - * sockets. The id is set by the request and sent in the reply. The - * type is strictly redundant in the reply because the id will find the - * send but we include it in both packets to make it easier to observe - * replies without having the id from their previous request. + * sockets. The id is set by the request and sent in the response. * - * Error is only set to a translated errno on response messages and - * data_len will be 0. + * Error is only set to a translated errno and will only be found in + * response messages. */ struct scoutfs_net_header { __le64 id; __le16 data_len; - __u8 msg; __u8 cmd; + __u8 flags; __u8 error; __u8 data[0]; } __packed; -/* - * Greetings are the first messages sent down every newly established - * socket on the connection. Every other message gets a unique - * increasing id over the life time of the connection. - */ -#define SCOUTFS_NET_ID_GREETING 1 - -enum { - SCOUTFS_NET_MSG_REQUEST = 0, - SCOUTFS_NET_MSG_RESPONSE, - SCOUTFS_NET_MSG_ACK, - SCOUTFS_NET_MSG_UNKNOWN, -}; +#define SCOUTFS_NET_FLAG_RESPONSE (1 << 0) +#define SCOUTFS_NET_FLAGS_UNKNOWN (U8_MAX << 1) enum { SCOUTFS_NET_CMD_GREETING = 0,