From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1E64FA0093; Thu, 23 Jun 2022 20:39:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 00B704067B; Thu, 23 Jun 2022 20:39:38 +0200 (CEST) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by mails.dpdk.org (Postfix) with ESMTP id 1B37940146 for ; Thu, 23 Jun 2022 20:39:37 +0200 (CEST) Received: by mail-pg1-f178.google.com with SMTP id h192so254368pgc.4 for ; Thu, 23 Jun 2022 11:39:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U+i0uMsN8W2HACfLQ2liwrKHJmMNhu16goT55ENbtUc=; b=oMz17hbVFn7r0m+CoeJtdSwd2G/fEwKfwzCq2cLG2xGdc2In54npJdyTdG0M2nRR4m VSp4KCBTi8gAWmn6nUQgyjIM0M6y9ccpqT0Avnt49C34bZJshAQBW1RAp70Fkzaczh5k 1/VrhrXGfsXZtqoefHXD8E6ZNJRjZQk3MaLi3xxll5O+B3u0vDBycc1Pthk0XDVcO4f0 cynm9wt7ez43U+7ZaIjnFsAIVr9DMwz3BqnR+H94Nc1ZuRNwz9zpy9aCT0TkJpfXh3O5 LZ3ycpi0E8txPpPiVVv9ZBkOvMYcG4qL6C60o2PQMe23xxyksk5Y9a1RIKMfiDd7pTyS SbUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U+i0uMsN8W2HACfLQ2liwrKHJmMNhu16goT55ENbtUc=; b=swD91W9oXHpbhcR1k83nCACTDxZvwZT11WqDqwpxox6V0HnfxoOFiA/u7HGZccj4YB ybihj3ojeDymNkTpneCOPz8Sw3BtfpvLlggr50X6kjuU0wvk5+Kv4Rf0FUZdFBToWWRE UWBlPto+FddlHjb4Xj2Uk5Admqr+98GwiJtyLx9Kn898j4Ezht7Yv3slxdT9qrsh0pxD q0gdKsb/EiR4siRGhIRNOOmLoWggTeJRWJyy8bskcw8ovoTrveqC+ewKe7OC4ku8wXYU +JYmf8WRQEw6ZiRP4YRnclhPqVOVNks9Xi+Oz5EJy8XqHsgpcwoN+pKsWsEn3qVTPJnK PXig== X-Gm-Message-State: AJIora+XwurEOaJqxHealXVrosdl4vzxZWt1UrIZmhpXqWW+LvKbfR0I WXHyJtqBd41XeEKoayN3x30klA== X-Google-Smtp-Source: AGRyM1umnBD2MTW0mwl/6lHZgty++lERrvu+zsM7e4PTqNqqyBM03EFNAlg7w9PzOwJdoGqh2WsQxQ== X-Received: by 2002:a05:6a00:1821:b0:525:6ed7:cdcc with SMTP id y33-20020a056a00182100b005256ed7cdccmr1039173pfa.70.1656009577121; Thu, 23 Jun 2022 11:39:37 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id t6-20020a170902b20600b0016a1e2d148csm140084plr.32.2022.06.23.11.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jun 2022 11:39:36 -0700 (PDT) Date: Thu, 23 Jun 2022 11:39:34 -0700 From: Stephen Hemminger To: Morten =?UTF-8?B?QnLDuHJ1cA==?= Cc: "Bruce Richardson" , , , Subject: Re: [RFC PATCH 2/6] telemetry: fix escaping of invalid json characters Message-ID: <20220623113934.372b059e@hermes.local> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D8716B@smartserver.smartshare.dk> References: <20220623164245.561371-1-bruce.richardson@intel.com> <20220623164245.561371-3-bruce.richardson@intel.com> <98CBD80474FA8B44BF855DF32C47DC35D8716B@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, 23 Jun 2022 20:34:07 +0200 Morten Br=C3=B8rup wrote: > > From: Bruce Richardson [mailto:bruce.richardson@intel.com] > > Sent: Thursday, 23 June 2022 18.43 > >=20 > > For string values returned from telemetry, escape any values that > > cannot > > normally appear in a json string. According to the json spec[1], the > > characters than need to be handled are control chars (char value < > > 0x20) > > and '"' and '\' characters. =20 >=20 > Correct. Other chars are optional to escape. For json_writer (which I wrote for iproute2 and could have been used here). The switch handles: \t \n \r \f \b \\ " ' as special cases.