[Anima-signaling] GRASP API issue 2: Passing the (CBOR) value of an objective

Brian E Carpenter <brian.e.carpenter@gmail.com> Sun, 08 January 2017 01:16 UTC

Return-Path: <brian.e.carpenter@gmail.com>
X-Original-To: anima-signaling@ietfa.amsl.com
Delivered-To: anima-signaling@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id F23631296B8; Sat, 7 Jan 2017 17:16:38 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0r9XwvuPuewq; Sat, 7 Jan 2017 17:16:37 -0800 (PST)
Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id BC63812968E; Sat, 7 Jan 2017 17:16:37 -0800 (PST)
Received: by mail-pg0-x243.google.com with SMTP id 75so9657147pgf.3; Sat, 07 Jan 2017 17:16:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:organization:cc:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=zXl6tgb2D23sl46PX0CpUQz408DnXiMZWWaM0lhb1NU=; b=B3LLs8IIIkD38ELo43+RKtBG8xnsnqzTkHFoYNJYSgEWYgWKM6oA3QufMOhfk+VLYA +5PIFzjMZvPV5oTgA3avuEhaaN7UYkasNZOuqPVpLDwSj4t29fTK7U8yNjYcavSpPOwN RH62FiNMW1tnRvo552oJYaTPp2woCpZqlS4hhkDo80HTiAna3AdxtZoiBQmRcZflRiXZ U/Fvha1pn96kauVluw0h3bJoPTKCHswJkDSSLxxvjEdYBUDhXEcBsV4rmoNkFLoC+R8y F5pKFz9o9aKtu9f29qtSjd+3CLkpIl7h1bTJbq0OloKxClDRURvK0zj5XwvyfESZNsN6 TKvA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:organization:cc:message-id:date :user-agent:mime-version:content-transfer-encoding; bh=zXl6tgb2D23sl46PX0CpUQz408DnXiMZWWaM0lhb1NU=; b=Lts3SUWE8kMGssQFyOaTl+rLPh5cYsD4cLc6kf2vIRJ27IxspAgglg1xCD0AzmvAxo nyQjS4nfhQlH2iGLNeuD0TQBpWtz+XdzuR1pt7Xci0mFl9oh0xnKk9vjcs//seotgsyE ZwbUD5hmxYt0j+JROhGDy4l3tDEpQSIwhLvhw2dk26ihTiPid2sk1bS7Hj88AdobN90i 4iOb6K/Bnn8SFlujhK6t26IeGfUzV5PZFqHJlEMiSRhzAwwlqjdqw8rfTsKPz/0MRJL0 nrsn2P1dqj3EcRK90ApJhiQMYUrp2dcyecEpaqZ3lg3RgS1tXhn6ZtYr+UiQF7uxEHHt 2Gyg==
X-Gm-Message-State: AIkVDXLTHhbN9SuY+kSbwH9c/ghHMqZFBBNtHOYhGsEJFEDx9aJ4sR1CqJf3t2D8xxvudA==
X-Received: by 10.84.209.172 with SMTP id y41mr171828864plh.96.1483838197183; Sat, 07 Jan 2017 17:16:37 -0800 (PST)
Received: from [192.168.178.21] ([118.149.104.180]) by smtp.gmail.com with ESMTPSA id y62sm104588953pfk.52.2017.01.07.17.16.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Jan 2017 17:16:36 -0800 (PST)
To: Anima signaling DT <anima-signaling@ietf.org>
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
Organization: University of Auckland
Message-ID: <93f5edf8-c9e2-3319-eeba-aebc513992d2@gmail.com>
Date: Sun, 08 Jan 2017 14:16:32 +1300
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/anima-signaling/wzh0ECXPtfVRlcSGB4NPLclm_uc>
Cc: draft-liu-anima-grasp-api@ietf.org
Subject: [Anima-signaling] GRASP API issue 2: Passing the (CBOR) value of an objective
X-BeenThere: anima-signaling@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Mailing list for the signaling design team of the ANIMA WG <anima-signaling.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/anima-signaling>, <mailto:anima-signaling-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/anima-signaling/>
List-Post: <mailto:anima-signaling@ietf.org>
List-Help: <mailto:anima-signaling-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/anima-signaling>, <mailto:anima-signaling-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Jan 2017 01:16:39 -0000

How should the API represent the 'value' part of a GRASP Objective
in a non-OO language?

In an OO language there will be a natural way to represent the value
of an objective: for example, in Python, any valid Python object
that the CBOR library can handle.

In a traditional language such as C, it's not so clear. For example, this doesn't
quite work:

typedef struct {
    gstring name;
    bool neg;
    bool dry;
    bool synch;
    int loop_count;
    void * value;    // user has to cast this pointer appropriately and do own malloc()
    } objective;

This doesn't work because the GRASP implementation won't know how
to CBORise whatever ends up in the 'value' parameter.

Is this already a solved problem in CBORland? For example, should we expect
the ASA to pass an already CBORised byte string?

Regards
   Brian