From patchwork Tue Mar 22 23:17:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ben@skyportsystems.com X-Patchwork-Id: 601069 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3qV7wF1Clfz9sCy for ; Wed, 23 Mar 2016 10:20:29 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=skyportsystems.com header.i=@skyportsystems.com header.b=MHIwDmiF; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 54E5810558; Tue, 22 Mar 2016 16:20:28 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id C88DA1039D for ; Tue, 22 Mar 2016 16:20:26 -0700 (PDT) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 4D88C1E01B8 for ; Tue, 22 Mar 2016 17:20:26 -0600 (MDT) X-ASG-Debug-ID: 1458688691-09eadd116503f60001-byXFYA Received: from mx3-pf1.cudamail.com ([192.168.14.2]) by bar5.cudamail.com with ESMTP id MGLZKMnlAx7LPrLy (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 22 Mar 2016 17:18:11 -0600 (MDT) X-Barracuda-Envelope-From: ben@skyportsystems.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.2 Received: from unknown (HELO mail-pf0-f174.google.com) (209.85.192.174) by mx3-pf1.cudamail.com with ESMTPS (RC4-SHA encrypted); 22 Mar 2016 23:18:11 -0000 Received-SPF: pass (mx3-pf1.cudamail.com: SPF record at _netblocks.google.com designates 209.85.192.174 as permitted sender) X-Barracuda-RBL-Trusted-Forwarder: 209.85.192.174 Received: by mail-pf0-f174.google.com with SMTP id u190so331344843pfb.3 for ; Tue, 22 Mar 2016 16:18:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skyportsystems.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=zVf0Dq/K1ZzrjDBerPYb5smiroIsOi1wnDKw3m5IoxY=; b=MHIwDmiFnvDTuxL1DzxhTQFIaPtXjCdlZhkvd/m5H+rv161f5fP76kFBZiTEZy4jFd ADLrVnTAVXfInlXCg1rRYlA0yAQDPbumDZlAM9gLPhRnFviG3j7WM976bkqiACu88pNf IU/FZbr9bGDIXLJ7M8rvgx2kiozu97nZtAwz4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=zVf0Dq/K1ZzrjDBerPYb5smiroIsOi1wnDKw3m5IoxY=; b=gmghPBU9HmX1HXhqzYLP12NtlqITniYXBNEWUEE2JF/USKPoRprAYEJFcnPC64IAUQ HcRJPvH+qyy0nsMfbpP0O92sJz0ibaeCD/GNQrJ/nxTDxUyP8AAZGS2DyFYS6tVeAREc vbcCHkMqTg/9RG89qNFoeu/I9mK76kDf2Go6WqsCdRR5e7Arn/NwNR6HCuUUGpspNqUB kP9JCOY5gOFR1ZQUfftwhsc2URm6SxrKASWPOMYnCFjfexr4yd5nWBHl9irVXLknf4aw rTgFZl6Ou2xKbPm5SITmkTOnIjQq5lOWrns3DIXnEfUD8ikDRjOxfOCLfRkimePvoZrb oq5w== X-Gm-Message-State: AD7BkJINh4MEKuzdafCqiYJqnMA0/ZDY6XMo6zBF1BmHpN+Fg9pW7osB3cIYAFP121Fl4Dm+ X-Received: by 10.98.89.7 with SMTP id n7mr56554012pfb.81.1458688690994; Tue, 22 Mar 2016 16:18:10 -0700 (PDT) Received: from Arrow.corp.skyportsystems.com (67-207-112-138.static.wiline.com. [67.207.112.138]) by smtp.gmail.com with ESMTPSA id 9sm50729385pft.44.2016.03.22.16.18.10 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 22 Mar 2016 16:18:10 -0700 (PDT) X-CudaMail-Envelope-Sender: ben@skyportsystems.com X-Barracuda-Apparent-Source-IP: 67.207.112.138 From: ben@skyportsystems.com To: dev@openvswitch.org X-CudaMail-MID: CM-V1-321069965 X-CudaMail-DTE: 032216 X-CudaMail-Originating-IP: 209.85.192.174 Date: Tue, 22 Mar 2016 16:17:46 -0700 X-ASG-Orig-Subj: [##CM-V1-321069965##][PATCH v4 15/22] Break uuid.h into private and public parts Message-Id: <8aaff020cc448284cdabf8b71007af4cf5397d2b.1458688105.git.ben@skyportsystems.com> X-Mailer: git-send-email 2.5.4 (Apple Git-61) In-Reply-To: References: In-Reply-To: References: X-GBUdb-Analysis: 0, 209.85.192.174, Ugly c=0.436326 p=-0.362319 Source Normal X-MessageSniffer-Rules: 0-0-0-11360-c X-Barracuda-Connect: UNKNOWN[192.168.14.2] X-Barracuda-Start-Time: 1458688691 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using per-user scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, DKIM_SIGNED, NO_REAL_NAME, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.28069 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 NO_REAL_NAME From: does not include a real name 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Cc: Ben Warren Subject: [ovs-dev] [PATCH v4 15/22] Break uuid.h into private and public parts X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" From: Ben Warren Public (struct definitions and some prototypes) go in include/openvswitch Signed-off-by: Ben Warren --- include/openvswitch/automake.mk | 1 + include/openvswitch/uuid.h | 35 +++++++++++++++++++++++++++++++++++ lib/ofp-print.c | 1 + lib/ofp-util.c | 1 + lib/uuid.h | 19 +------------------ tests/test-uuid.c | 1 + 6 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 include/openvswitch/uuid.h diff --git a/include/openvswitch/automake.mk b/include/openvswitch/automake.mk index 9990053..a2bc749 100644 --- a/include/openvswitch/automake.mk +++ b/include/openvswitch/automake.mk @@ -16,6 +16,7 @@ openvswitchinclude_HEADERS = \ include/openvswitch/tun-metadata.h \ include/openvswitch/types.h \ include/openvswitch/util.h \ + include/openvswitch/uuid.h \ include/openvswitch/version.h \ include/openvswitch/vconn.h \ include/openvswitch/vlog.h diff --git a/include/openvswitch/uuid.h b/include/openvswitch/uuid.h new file mode 100644 index 0000000..383a408 --- /dev/null +++ b/include/openvswitch/uuid.h @@ -0,0 +1,35 @@ +/* Copyright (c) 2008, 2009, 2010 Nicira, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OPENVSWITCH_UUID_H +#define OPENVSWITCH_UUID_H 1 + +#include "openvswitch/util.h" + +#define UUID_BIT 128 /* Number of bits in a UUID. */ +#define UUID_OCTET (UUID_BIT / 8) /* Number of bytes in a UUID. */ + +/* A Universally Unique IDentifier (UUID) compliant with RFC 4122. + * + * Each of the parts is stored in host byte order, but the parts themselves are + * ordered from left to right. That is, (parts[0] >> 24) is the first 8 bits + * of the UUID when output in the standard form, and (parts[3] & 0xff) is the + * final 8 bits. */ +struct uuid { + uint32_t parts[4]; +}; +BUILD_ASSERT_DECL(sizeof(struct uuid) == UUID_OCTET); + +#endif /* uuid.h */ diff --git a/lib/ofp-print.c b/lib/ofp-print.c index cd91f6b..9cf6cda 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -50,6 +50,7 @@ #include "unaligned.h" #include "odp-util.h" #include "util.h" +#include "uuid.h" static void ofp_print_queue_name(struct ds *string, uint32_t port); static void ofp_print_error(struct ds *, enum ofperr); diff --git a/lib/ofp-util.c b/lib/ofp-util.c index fcf6bf9..314c8c1 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -48,6 +48,7 @@ #include "openvswitch/ofp-errors.h" #include "openvswitch/vlog.h" #include "bitmap.h" +#include "uuid.h" VLOG_DEFINE_THIS_MODULE(ofp_util); diff --git a/lib/uuid.h b/lib/uuid.h index 8c6f2f1..a5792b0 100644 --- a/lib/uuid.h +++ b/lib/uuid.h @@ -16,24 +16,7 @@ #ifndef UUID_H #define UUID_H 1 -#include -#include -#include -#include "util.h" - -#define UUID_BIT 128 /* Number of bits in a UUID. */ -#define UUID_OCTET (UUID_BIT / 8) /* Number of bytes in a UUID. */ - -/* A Universally Unique IDentifier (UUID) compliant with RFC 4122. - * - * Each of the parts is stored in host byte order, but the parts themselves are - * ordered from left to right. That is, (parts[0] >> 24) is the first 8 bits - * of the UUID when output in the standard form, and (parts[3] & 0xff) is the - * final 8 bits. */ -struct uuid { - uint32_t parts[4]; -}; -BUILD_ASSERT_DECL(sizeof(struct uuid) == UUID_OCTET); +#include "openvswitch/uuid.h" /* Formats a UUID as a string, in the conventional format. * diff --git a/tests/test-uuid.c b/tests/test-uuid.c index 65878ea..3b47ab6 100644 --- a/tests/test-uuid.c +++ b/tests/test-uuid.c @@ -16,6 +16,7 @@ #include #undef NDEBUG +#include "util.h" #include "uuid.h" #include #include "ovstest.h"