get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/132975/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 132975,
    "url": "https://patches.dpdk.org/api/patches/132975/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20231019105000.520914-4-skori@marvell.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20231019105000.520914-4-skori@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231019105000.520914-4-skori@marvell.com",
    "date": "2023-10-19T10:49:51",
    "name": "[v10,03/12] app/graph: support parser utility APIs",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "cb8688e68a3cde2913cdf2e12c03d0fb70b70bb7",
    "submitter": {
        "id": 1318,
        "url": "https://patches.dpdk.org/api/people/1318/?format=api",
        "name": "Sunil Kumar Kori",
        "email": "skori@marvell.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20231019105000.520914-4-skori@marvell.com/mbox/",
    "series": [
        {
            "id": 29919,
            "url": "https://patches.dpdk.org/api/series/29919/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=29919",
            "date": "2023-10-19T10:49:48",
            "name": "add CLI based graph application",
            "version": 10,
            "mbox": "https://patches.dpdk.org/series/29919/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/132975/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/132975/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 20CCD431A9;\n\tThu, 19 Oct 2023 12:50:35 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D948D41149;\n\tThu, 19 Oct 2023 12:50:15 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 0759D410F2\n for <dev@dpdk.org>; Thu, 19 Oct 2023 12:50:14 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 39J8fCku027267 for <dev@dpdk.org>; Thu, 19 Oct 2023 03:50:14 -0700",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3tstb41v4s-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Thu, 19 Oct 2023 03:50:13 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Thu, 19 Oct 2023 03:50:11 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend\n Transport; Thu, 19 Oct 2023 03:50:11 -0700",
            "from localhost.localdomain (unknown [10.28.34.25])\n by maili.marvell.com (Postfix) with ESMTP id 3A7365B6958;\n Thu, 19 Oct 2023 03:50:09 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=6c8nVKcgZl6lzsuZah0UNd/X6+dqQwLnE1YwXGSQUT8=;\n b=Idxtzl8RWMlrsVr/FrJywQGDv0HFxtaSfiG8IBYEmAVc9GIs55FQq2gEEtW07m8KJE5P\n KmJAewrg/oXUEgZ0GdPfB4VC0prFYly4GeSzJch1fQdSOGcc/XCddqUkGh2XTrbp+7tl\n 0v8lXA/dWlisS1ouyioSDqEKFIVZ8A44myZy5Q6iseVyfDCL/cvc0HFp6aA2PojCtloi\n 0IK3p8brquAvFtFtaUaLMfrcAnQJ2Li0J8/9xSZYZZSO25dtxWGmNdHcnE5G0DunQaqx\n uvzCL4vle/JsKTfK9+DcWyOM2leVUoriyZtT9C8viol6CGxDvGbtYwKIBYQ6yZcpXB01 IA==",
        "From": "<skori@marvell.com>",
        "To": "Sunil Kumar Kori <skori@marvell.com>, Rakesh Kudurumalla\n <rkudurumalla@marvell.com>",
        "CC": "<dev@dpdk.org>, Jerin Jacob <jerinj@marvell.com>",
        "Subject": "[PATCH v10 03/12] app/graph: support parser utility APIs",
        "Date": "Thu, 19 Oct 2023 16:19:51 +0530",
        "Message-ID": "<20231019105000.520914-4-skori@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20231019105000.520914-1-skori@marvell.com>",
        "References": "<20231018063347.68081-13-skori@marvell.com>\n <20231019105000.520914-1-skori@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "7m0dfmcrSxMANZmssL1HNc6WllAWZ32T",
        "X-Proofpoint-GUID": "7m0dfmcrSxMANZmssL1HNc6WllAWZ32T",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26\n definitions=2023-10-19_08,2023-10-19_01,2023-05-22_02",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "From: Sunil Kumar Kori <skori@marvell.com>\n\nAdds some helper functions to parse IPv4, IPv6 and MAC addresses\nstring into respective datatype.\n\nSigned-off-by: Sunil Kumar Kori <skori@marvell.com>\nSigned-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>\nAcked-by: Jerin Jacob <jerinj@marvell.com>\n---\n app/graph/meson.build  |   1 +\n app/graph/module_api.h |   1 +\n app/graph/utils.c      | 156 +++++++++++++++++++++++++++++++++++++++++\n app/graph/utils.h      |  14 ++++\n 4 files changed, 172 insertions(+)\n create mode 100644 app/graph/utils.c\n create mode 100644 app/graph/utils.h",
    "diff": "diff --git a/app/graph/meson.build b/app/graph/meson.build\nindex c8d2b41b69..fd71036a95 100644\n--- a/app/graph/meson.build\n+++ b/app/graph/meson.build\n@@ -13,4 +13,5 @@ sources = files(\n         'cli.c',\n         'conn.c',\n         'main.c',\n+        'utils.c',\n )\ndiff --git a/app/graph/module_api.h b/app/graph/module_api.h\nindex 9826303f0c..ad4fb50989 100644\n--- a/app/graph/module_api.h\n+++ b/app/graph/module_api.h\n@@ -10,6 +10,7 @@\n \n #include \"cli.h\"\n #include \"conn.h\"\n+#include \"utils.h\"\n /*\n  * Externs\n  */\ndiff --git a/app/graph/utils.c b/app/graph/utils.c\nnew file mode 100644\nindex 0000000000..c7b6ae83cf\n--- /dev/null\n+++ b/app/graph/utils.c\n@@ -0,0 +1,156 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2023 Marvell.\n+ */\n+\n+#include <ctype.h>\n+#include <errno.h>\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+\n+#include <rte_common.h>\n+\n+#include \"module_api.h\"\n+\n+#define white_spaces_skip(pos)\t\t\t\\\n+({\t\t\t\t\t\t\\\n+\t__typeof__(pos) _p = (pos);\t\t\\\n+\tfor ( ; isspace(*_p); _p++)\t\t\\\n+\t\t;\t\t\t\t\\\n+\t_p;\t\t\t\t\t\\\n+})\n+\n+static void\n+hex_string_to_uint64(uint64_t *dst, const char *hexs)\n+{\n+\tchar buf[2] = {0};\n+\tuint8_t shift = 4;\n+\tint iter = 0;\n+\tchar c;\n+\n+\twhile ((c = *hexs++)) {\n+\t\tbuf[0] = c;\n+\t\t*dst |= (strtol(buf, NULL, 16) << shift);\n+\t\tshift -= 4;\n+\t\titer++;\n+\t\tif (iter == 2) {\n+\t\t\titer = 0;\n+\t\t\tshift = 4;\n+\t\t\tdst++;\n+\t\t}\n+\t}\n+}\n+\n+int\n+parser_uint64_read(uint64_t *value, const char *p)\n+{\n+\tchar *next;\n+\tuint64_t val;\n+\n+\tp = white_spaces_skip(p);\n+\tif (!isdigit(*p))\n+\t\treturn -EINVAL;\n+\n+\tval = strtoul(p, &next, 0);\n+\tif (p == next)\n+\t\treturn -EINVAL;\n+\n+\tp = next;\n+\tswitch (*p) {\n+\tcase 'T':\n+\t\tval *= 1024ULL;\n+\t\t/* fall through */\n+\tcase 'G':\n+\t\tval *= 1024ULL;\n+\t\t/* fall through */\n+\tcase 'M':\n+\t\tval *= 1024ULL;\n+\t\t/* fall through */\n+\tcase 'k':\n+\tcase 'K':\n+\t\tval *= 1024ULL;\n+\t\tp++;\n+\t\tbreak;\n+\t}\n+\n+\tp = white_spaces_skip(p);\n+\tif (*p != '\\0')\n+\t\treturn -EINVAL;\n+\n+\t*value = val;\n+\treturn 0;\n+}\n+\n+int\n+parser_uint32_read(uint32_t *value, const char *p)\n+{\n+\tuint64_t val = 0;\n+\tint rc = parser_uint64_read(&val, p);\n+\n+\tif (rc < 0)\n+\t\treturn rc;\n+\n+\tif (val > UINT32_MAX)\n+\t\treturn -ERANGE;\n+\n+\t*value = val;\n+\treturn 0;\n+}\n+\n+int\n+parser_ip4_read(uint32_t *value, char *p)\n+{\n+\tuint8_t shift = 24;\n+\tuint32_t ip = 0;\n+\tchar *token;\n+\n+\ttoken = strtok(p, \".\");\n+\twhile (token != NULL) {\n+\t\tip |= (((uint32_t)strtoul(token, NULL, 10)) << shift);\n+\t\ttoken = strtok(NULL, \".\");\n+\t\tshift -= 8;\n+\t}\n+\n+\t*value = ip;\n+\n+\treturn 0;\n+}\n+\n+int\n+parser_ip6_read(uint8_t *value, char *p)\n+{\n+\tuint64_t val = 0;\n+\tchar *token;\n+\n+\ttoken = strtok(p, \":\");\n+\twhile (token != NULL) {\n+\t\thex_string_to_uint64(&val, token);\n+\t\t*value = val;\n+\t\ttoken = strtok(NULL, \":\");\n+\t\tvalue++;\n+\t\tval = 0;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int\n+parser_mac_read(uint64_t *value, char *p)\n+{\n+\tuint64_t mac = 0, val = 0;\n+\tuint8_t shift = 40;\n+\tchar *token;\n+\n+\ttoken = strtok(p, \":\");\n+\twhile (token != NULL) {\n+\t\thex_string_to_uint64(&val, token);\n+\t\tmac |= val << shift;\n+\t\ttoken = strtok(NULL, \":\");\n+\t\tshift -= 8;\n+\t\tval = 0;\n+\t}\n+\n+\t*value = mac;\n+\n+\treturn 0;\n+}\ndiff --git a/app/graph/utils.h b/app/graph/utils.h\nnew file mode 100644\nindex 0000000000..0ebb5de55a\n--- /dev/null\n+++ b/app/graph/utils.h\n@@ -0,0 +1,14 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2023 Marvell.\n+ */\n+\n+#ifndef APP_GRAPH_UTILS_H\n+#define APP_GRAPH_UTILS_H\n+\n+int parser_uint64_read(uint64_t *value, const char *p);\n+int parser_uint32_read(uint32_t *value, const char *p);\n+int parser_ip4_read(uint32_t *value, char *p);\n+int parser_ip6_read(uint8_t *value, char *p);\n+int parser_mac_read(uint64_t *value, char *p);\n+\n+#endif\n",
    "prefixes": [
        "v10",
        "03/12"
    ]
}