From patchwork Tue Apr 5 01:32:04 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: 606225 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 3qfBFC1rPlz9s5M for ; Tue, 5 Apr 2016 11:33:02 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=skyportsystems.com header.i=@skyportsystems.com header.b=hC/SUNf5; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 2BD3A102D5; Mon, 4 Apr 2016 18:32:34 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id C5AE4102C0 for ; Mon, 4 Apr 2016 18:32:30 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id 572E0420390 for ; Mon, 4 Apr 2016 19:32:30 -0600 (MDT) X-ASG-Debug-ID: 1459819949-09eadd287d591cb0001-byXFYA Received: from mx3-pf1.cudamail.com ([192.168.14.2]) by bar5.cudamail.com with ESMTP id gTItMbHvT7ch9Jmn (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 04 Apr 2016 19:32:29 -0600 (MDT) X-Barracuda-Envelope-From: ben@skyportsystems.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.2 Received: from unknown (HELO mail-pa0-f50.google.com) (209.85.220.50) by mx3-pf1.cudamail.com with ESMTPS (RC4-SHA encrypted); 5 Apr 2016 01:32:29 -0000 Received-SPF: pass (mx3-pf1.cudamail.com: SPF record at _netblocks.google.com designates 209.85.220.50 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.85.220.50 X-Barracuda-RBL-IP: 209.85.220.50 Received: by mail-pa0-f50.google.com with SMTP id fe3so155707476pab.1 for ; Mon, 04 Apr 2016 18:32:29 -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=DxMeyo9pDYkiX99OCmAmDtxp6K9ct223PdIPS6cmub0=; b=hC/SUNf5KhBwo6noK93d0cvliX7DqPLcTEsLet44HIENtxgmmC8vikxAtAxs24cIt5 Vwb0fFASmpSwuDNMLi9nH+ykmE8toT23sjekjMQsYiRa6rxD+2C/YOQkvtmyyjdCKpfQ rEaXpAN7XEnTXBzVzwwm1NwBbWgi+xsvvA2zQ= 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=DxMeyo9pDYkiX99OCmAmDtxp6K9ct223PdIPS6cmub0=; b=kSY0LvKzAD+qRcDNFTwEAomfiuoxvfQyKWLIWQha9iuCTZVUg9L4EL/7rq1Z9fVz49 r5b4Rx1TMzG38PkDMhFG1eNJ3krncevreBoNdNguMYOF67/9XoB/dUrYowMa9u04OafX kOa3YHqMenxXrwGtgN5MwJA9d6p80ThQqqAZT4TVjeTXyEibsDlRxCWCRIaL3Rw3iE37 4xiFv0xd9hP05ll2GgD9Z9pXvf1grQfTcURLkWSCJYPJNMzJ+NN1BlSpCo5uvpXqD4gT MD/yP4nfXGrHZtJFj/GaPYw/evWixboxzHw+GoeswqWQ8TdeX2DE/4B0gcUSfhDP2hLk fwig== X-Gm-Message-State: AD7BkJKne4j5vSzK5nXgnuR+gLci5h2yxfV4R81oe5hAqCZrIPh0SA9M06t0jJ7671vS7d6+ X-Received: by 10.66.237.33 with SMTP id uz1mr25891049pac.5.1459819948941; Mon, 04 Apr 2016 18:32:28 -0700 (PDT) Received: from Arrow.local.com (gateway.skyportsystems.com. [74.93.0.69]) by smtp.gmail.com with ESMTPSA id 85sm42259177pfq.6.2016.04.04.18.32.27 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 04 Apr 2016 18:32:28 -0700 (PDT) X-CudaMail-Envelope-Sender: ben@skyportsystems.com From: ben@skyportsystems.com To: dev@openvswitch.org X-CudaMail-MID: CM-V1-403062234 X-CudaMail-DTE: 040416 X-CudaMail-Originating-IP: 209.85.220.50 Date: Mon, 4 Apr 2016 21:32:04 -0400 X-ASG-Orig-Subj: [##CM-V1-403062234##][PATCH v6 04/13] Break uuid.h into private and public parts Message-Id: <29928c7970ad482a01e66bca9d8c609906998c87.1459819171.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.220.50, Ugly c=0.374854 p=-0.315789 Source Normal X-MessageSniffer-Rules: 0-0-0-11330-c X-Barracuda-Connect: UNKNOWN[192.168.14.2] X-Barracuda-Start-Time: 1459819949 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.28462 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 v6 04/13] 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 184dd89..4339ff7 100644 --- a/include/openvswitch/automake.mk +++ b/include/openvswitch/automake.mk @@ -14,6 +14,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 69050cf..148edf2 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 53baaf8..923a429 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"