From patchwork Fri Apr 1 10:46:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bligh X-Patchwork-Id: 8722301 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C96979F7C9 for ; Fri, 1 Apr 2016 10:46:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 239A7203B1 for ; Fri, 1 Apr 2016 10:46:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E2AEB203AE for ; Fri, 1 Apr 2016 10:46:49 +0000 (UTC) Received: from localhost ([::1]:43320 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alwbJ-0007Sz-BI for patchwork-qemu-devel@patchwork.kernel.org; Fri, 01 Apr 2016 06:46:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alwb6-0007Pw-0d for qemu-devel@nongnu.org; Fri, 01 Apr 2016 06:46:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alwb5-0002Z1-6s for qemu-devel@nongnu.org; Fri, 01 Apr 2016 06:46:35 -0400 Received: from mail.avalus.com ([2001:41c8:10:1dd::10]:53213) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alwb5-0002Yt-0J for qemu-devel@nongnu.org; Fri, 01 Apr 2016 06:46:35 -0400 Received: by mail.avalus.com (Postfix) with ESMTPSA id A59A0C5607B; Fri, 1 Apr 2016 11:46:33 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alex.org.uk; s=mail; t=1459507593; bh=cxgx6AaZdrJcM2yLOGDvQuW8jAbwpYRTtaREDGmaAF0=; h=From:To:Cc:Subject:Date; b=J0IV8NgtvcZ7Pan8TGRcGktHyiXgz1iqjiQycs/SV/P2qZeGMUc5JL6uiU16STvdj ZhGvgrCERBl07wrUobpr6P4uMEB24b9McVuDyuB5D6VkIxBMk3ipd0NjG2BcTIzkeN iQ5BPKEzX34H/LR5ypUuaz8cepmCdPNpwE2LT/5Q= From: Alex Bligh To: Eric Blake , Wouter Verhelst Date: Fri, 1 Apr 2016 11:46:29 +0100 Message-Id: <1459507590-1191-1-git-send-email-alex@alex.org.uk> X-Mailer: git-send-email 1.9.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2001:41c8:10:1dd::10 Cc: "nbd-general@lists.sourceforge.net" , "qemu-devel@nongnu.org" , Alex Bligh Subject: [Qemu-devel] [PATCHv2 1/2] proto.md: Clearly set out NBDMAGIC is the actual value X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Clearly set out NBDMAGIC, not the name of a constant equal to some value. Set out the value in hex as well. Document the newstyle magic number is "IHAVEOPT". Signed-off-by: Alex Bligh Reviewed-by: Eric Blake --- doc/proto.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/proto.md b/doc/proto.md index 03dfe2b..8376021 100644 --- a/doc/proto.md +++ b/doc/proto.md @@ -67,7 +67,8 @@ newstyle negotiation. #### Oldstyle negotiation -S: 64 bits, `NBDMAGIC` (also known as the `INIT_PASSWD`) +S: 64 bits, `0x4e42444d41474943` (ASCII '`NBDMAGIC`') (also known as + the `INIT_PASSWD`) S: 64 bits, `0x00420281861253` (`cliserv_magic`, a magic number) S: 64 bits, size of the export in bytes (unsigned) S: 32 bits, flags @@ -96,8 +97,10 @@ production purposes. The initial few exchanges in newstyle negotiation look as follows: -S: 64 bits, `NBDMAGIC` (as in the old style handshake) -S: 64 bits, `0x49484156454F5054` (note different magic number) +S: 64 bits, `0x4e42444d41474943` (ASCII '`NBDMAGIC`') (as in the old + style handshake) +S: 64 bits, `0x49484156454F5054` (ASCII '`IHAVEOPT`') (note different + magic number) S: 16 bits, handshake flags C: 32 bits, flags @@ -113,7 +116,8 @@ At this point, we move on to option haggling, during which point the client can send one or (in fixed newstyle) more options to the server. The generic format of setting an option is as follows: -C: 64 bits, `0x49484156454F5054` (note same newstyle handshake's magic number) +C: 64 bits, `0x49484156454F5054` (ASCII '`IHAVEOPT`') (note same + newstyle handshake's magic number) C: 32 bits, option C: 32 bits, length of option data (unsigned) C: any data needed for the chosen option, of length as specified above.