get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1238,
    "url": "http://patchwork.ozlabs.org/api/patches/1238/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20080924052305.GC4944@gerrit.erg.abdn.ac.uk/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20080924052305.GC4944@gerrit.erg.abdn.ac.uk>",
    "list_archive_url": null,
    "date": "2008-09-24T05:23:05",
    "name": "v2 [PATCH 1/5] dccp: Basic data structure for feature negotiation",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": true,
    "hash": "67d2702677cf50390ba9c042661f8b6aeb5da7a0",
    "submitter": {
        "id": 386,
        "url": "http://patchwork.ozlabs.org/api/people/386/?format=api",
        "name": "Gerrit Renker",
        "email": "gerrit@erg.abdn.ac.uk"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20080924052305.GC4944@gerrit.erg.abdn.ac.uk/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/1238/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1238/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.176.167])\n\tby ozlabs.org (Postfix) with ESMTP id BA211DDE0E\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 24 Sep 2008 15:23:33 +1000 (EST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751608AbYIXFX2 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 24 Sep 2008 01:23:28 -0400",
            "(majordomo@vger.kernel.org) by vger.kernel.org id S1751909AbYIXFX1\n\t(ORCPT <rfc822; netdev-outgoing>); Wed, 24 Sep 2008 01:23:27 -0400",
            "from dee.erg.abdn.ac.uk ([139.133.204.82]:39211 \"EHLO\n\terg.abdn.ac.uk\"\n\trhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP\n\tid S1751280AbYIXFX0 (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tWed, 24 Sep 2008 01:23:26 -0400",
            "from laptev.erg.abdn.ac.uk (Debian-exim@ra-gerrit.erg.abdn.ac.uk\n\t[139.133.204.38])\n\tby erg.abdn.ac.uk (8.13.4/8.13.4) with ESMTP id m8O5N6HJ015318\n\t(version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT);\n\tWed, 24 Sep 2008 06:23:06 +0100 (BST)",
            "from gerrit by laptev.erg.abdn.ac.uk with local (Exim 4.69)\n\t(envelope-from <gerrit@laptev.erg.abdn.ac.uk>)\n\tid 1KiMq9-0001x4-GO; Wed, 24 Sep 2008 07:23:05 +0200"
        ],
        "Date": "Wed, 24 Sep 2008 07:23:05 +0200",
        "From": "Gerrit Renker <gerrit@erg.abdn.ac.uk>",
        "To": "David Miller <davem@davemloft.net>, acme@redhat.com,\n\tdccp@vger.kernel.org, netdev@vger.kernel.org",
        "Subject": "v2 [PATCH 1/5] dccp: Basic data structure for feature negotiation",
        "Message-ID": "<20080924052305.GC4944@gerrit.erg.abdn.ac.uk>",
        "Mail-Followup-To": "Gerrit Renker <gerrit@erg.abdn.ac.uk>,\n\tDavid Miller <davem@davemloft.net>, acme@redhat.com,\n\tdccp@vger.kernel.org, netdev@vger.kernel.org",
        "References": "<1222068117-13401-3-git-send-email-gerrit@erg.abdn.ac.uk>\n\t<20080922142105.GB16625@ghostprotocols.net>\n\t<20080922154554.GA3521@gerrit.erg.abdn.ac.uk>\n\t<20080922.202056.218746153.davem@davemloft.net>\n\t<20080924051823.GB4944@gerrit.erg.abdn.ac.uk>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=us-ascii",
        "Content-Disposition": "inline",
        "In-Reply-To": "<20080924051823.GB4944@gerrit.erg.abdn.ac.uk>",
        "User-Agent": "Mutt/1.5.18 (2008-05-17)",
        "X-ERG-MailScanner": "Found to be clean",
        "X-ERG-MailScanner-From": "gerrit@erg.abdn.ac.uk",
        "X-Spam-Status": "No",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "This is the second/other revised patch for this set [v2 of 1/5].\n\nChanges relative to v1: copied Arnaldos suggested layout and updated the\nstruct documentation accordingly. Compile-tested the result.\n\n>>>>>>>>>>>>>>>>>>>>>>>>> Patch v2 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\ndccp: Basic data structure for feature negotiation\n\nThis patch prepares for the new and extended feature-negotiation routines.\n\nThe following feature-negotiation data structures are provided:\n\t* a container for the various (SP or NN) values,\n\t* symbolic state names to track feature states,\n\t* an entry struct which holds all current information together,\n\t* elementary functions to fill in and process these structures.\n\nEntry structs are arranged as FIFO for the following reason: RFC 4340 specifies\nthat if multiple options of the same type are present, they are processed in the\norder of their appearance in the packet; which means that this order needs to be\npreserved in the local data structure (the later insertion code also respects\nthis order).\n\nThe struct list_head has been chosen for the following reasons: the most \nfrequent operations are\n * add new entry at tail (when receiving Change or setting socket options);\n * delete entry (when Confirm has been received);\n * deep copy of entire list (cloning from listening socket onto request socket).\n\nThe NN value has been set to 64 bit, which is a currently sufficient upper limit\n(Sequence Window feature has 48 bit).\n\nThanks to Arnaldo who streamlined the field layout of the entry struct.\n\nSigned-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>\n---\n net/dccp/feat.c |   14 ++++++++++++\n net/dccp/feat.h |   61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 75 insertions(+)\n\n--\nTo unsubscribe from this list: send the line \"unsubscribe netdev\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html",
    "diff": "--- a/net/dccp/feat.h\n+++ b/net/dccp/feat.h\n@@ -14,6 +14,67 @@\n #include <linux/types.h>\n #include \"dccp.h\"\n \n+enum dccp_feat_type {\n+\tFEAT_AT_RX   = 1,\t/* located at RX side of half-connection  */\n+\tFEAT_AT_TX   = 2,\t/* located at TX side of half-connection  */\n+\tFEAT_SP      = 4,\t/* server-priority reconciliation (6.3.1) */\n+\tFEAT_NN\t     = 8,\t/* non-negotiable reconciliation (6.3.2)  */\n+\tFEAT_UNKNOWN = 0xFF\t/* not understood or invalid feature\t  */\n+};\n+\n+enum dccp_feat_state {\n+\tFEAT_DEFAULT = 0,\t/* using default values from 6.4 */\n+\tFEAT_INITIALISING,\t/* feature is being initialised  */\n+\tFEAT_CHANGING,\t\t/* Change sent but not confirmed yet */\n+\tFEAT_UNSTABLE,\t\t/* local modification in state CHANGING */\n+\tFEAT_STABLE\t\t/* both ends (think they) agree */\n+};\n+\n+/**\n+ * dccp_feat_val  -  Container for SP or NN feature values\n+ * @nn:     single NN value\n+ * @sp.vec: single SP value plus optional preference list\n+ * @sp.len: length of @sp.vec in bytes\n+ */\n+typedef union {\n+\tu64 nn;\n+\tstruct {\n+\t\tu8\t*vec;\n+\t\tu8\tlen;\n+\t}   sp;\n+} dccp_feat_val;\n+\n+/**\n+ * struct feat_entry  -  Data structure to perform feature negotiation\n+ * @val: feature's current value (SP features may have preference list)\n+ * @state: feature's current state\n+ * @feat_num: one of %dccp_feature_numbers\n+ * @needs_mandatory: whether Mandatory options should be sent\n+ * @needs_confirm: whether to send a Confirm instead of a Change\n+ * @empty_confirm: whether to send an empty Confirm (depends on @needs_confirm)\n+ * @is_local: feature location (1) or feature-remote (0)\n+ * @node: list pointers, entries arranged in FIFO order\n+ */\n+struct dccp_feat_entry {\n+\tdccp_feat_val           val;\n+\tenum dccp_feat_state    state:8;\n+\tu8                      feat_num;\n+\n+\tbool\t\t\tneeds_mandatory,\n+\t\t\t\tneeds_confirm,\n+\t\t\t\tempty_confirm,\n+\t\t\t\tis_local;\n+\n+\tstruct list_head\tnode;\n+};\n+\n+static inline u8 dccp_feat_genopt(struct dccp_feat_entry *entry)\n+{\n+\tif (entry->needs_confirm)\n+\t\treturn entry->is_local ? DCCPO_CONFIRM_L : DCCPO_CONFIRM_R;\n+\treturn entry->is_local ? DCCPO_CHANGE_L : DCCPO_CHANGE_R;\n+}\n+\n #ifdef CONFIG_IP_DCCP_DEBUG\n extern const char *dccp_feat_typename(const u8 type);\n extern const char *dccp_feat_name(const u8 feat);\n--- a/net/dccp/feat.c\n+++ b/net/dccp/feat.c\n@@ -23,6 +23,20 @@\n \n #define DCCP_FEAT_SP_NOAGREE (-123)\n \n+/* copy constructor, fval must not already contain allocated memory */\n+static int dccp_feat_clone_sp_val(dccp_feat_val *fval, u8 const *val, u8 len)\n+{\n+\tfval->sp.len = len;\n+\tif (fval->sp.len > 0) {\n+\t\tfval->sp.vec = kmemdup(val, len, gfp_any());\n+\t\tif (fval->sp.vec == NULL) {\n+\t\t\tfval->sp.len = 0;\n+\t\t\treturn -ENOBUFS;\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n int dccp_feat_change(struct dccp_minisock *dmsk, u8 type, u8 feature,\n \t\t     u8 *val, u8 len, gfp_t gfp)\n {\n",
    "prefixes": []
}