{"action":"created","comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments/46929016","id":46929016,"diff_hunk":"@@ -379,17 +466,86 @@ size_t gnrc_sixlowpan_iphc_decode(gnrc_pktsnip_t *ipv6, gnrc_pktsnip_t *pkt, siz\n         ipv6_hdr->len = byteorder_htons((uint16_t)(datagram_size - sizeof(ipv6_hdr_t)));\n     }\n \n+#ifdef MODULE_GNRC_SIXLOWPAN_IPHC_NHC\n+    if (iphc_hdr[IPHC1_IDX] & SIXLOWPAN_IPHC1_NH) {\n+        switch (iphc_hdr[payload_offset] & NHC_ID_MASK) {\n+#ifdef MODULE_GNRC_UDP\n+            case NHC_UDP_ID:\n+                payload_offset = iphc_nhc_udp_decode(pkt, ipv6, payload_offset);\n+                break;\n+#endif\n+\n+            default:\n+                break;\n+        }\n+    }\n+#endif\n \n     return payload_offset;\n }\n \n+#ifdef MODULE_GNRC_UDP\n+inline static size_t iphc_nhc_udp_encode(gnrc_pktsnip_t *udp, ipv6_hdr_t *ipv6_hdr)\n+{\n+    udp_hdr_t *udp_hdr = udp->data;\n+    network_uint16_t *src_port = &(udp_hdr->src_port);\n+    network_uint16_t *dst_port = &(udp_hdr->dst_port);\n+    uint8_t *udp_data = udp->data;\n+    size_t nhc_len = 0;\n+\n+    /* TODO: Add support for elided checksum when it is available in the linux kernel. */\n+\n+    /* Compressing UDP ports, follow the same sequence as the linux kernel (nhc_udp module). */","path":"sys/net/gnrc/network_layer/sixlowpan/iphc/gnrc_sixlowpan_iphc.c","position":159,"original_position":159,"commit_id":"9c1b48aa84f937a861036489a5e343a97ad35c65","original_commit_id":"989acbd2003710e4a90c0e766d9c0de37ad8033e","user":{"login":"jfischer-phytec-iot","id":9864546,"avatar_url":"https://avatars.githubusercontent.com/u/9864546?v=3","gravatar_id":"","url":"https://api.github.com/users/jfischer-phytec-iot","html_url":"https://github.com/jfischer-phytec-iot","followers_url":"https://api.github.com/users/jfischer-phytec-iot/followers","following_url":"https://api.github.com/users/jfischer-phytec-iot/following{/other_user}","gists_url":"https://api.github.com/users/jfischer-phytec-iot/gists{/gist_id}","starred_url":"https://api.github.com/users/jfischer-phytec-iot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfischer-phytec-iot/subscriptions","organizations_url":"https://api.github.com/users/jfischer-phytec-iot/orgs","repos_url":"https://api.github.com/users/jfischer-phytec-iot/repos","events_url":"https://api.github.com/users/jfischer-phytec-iot/events{/privacy}","received_events_url":"https://api.github.com/users/jfischer-phytec-iot/received_events","type":"User","site_admin":false},"body":"no, I mean: ```if first 8 bits of Destination Port are 0xf0 and first 8 bits of Source Port are 0xf0``` there are IMHO two capabilities (RFC leaves free to choose):\r\n- dst will be elided\r\n- src will be elided\r\n\r\n\r\nNothing special, the comment is just confusing.","created_at":"2015-12-08T09:06:43Z","updated_at":"2015-12-08T09:06:43Z","html_url":"https://github.com/RIOT-OS/RIOT/pull/4189#discussion_r46929016","pull_request_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/4189","_links":{"self":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments/46929016"},"html":{"href":"https://github.com/RIOT-OS/RIOT/pull/4189#discussion_r46929016"},"pull_request":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/4189"}}},"pull_request":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/4189","id":49171541,"html_url":"https://github.com/RIOT-OS/RIOT/pull/4189","diff_url":"https://github.com/RIOT-OS/RIOT/pull/4189.diff","patch_url":"https://github.com/RIOT-OS/RIOT/pull/4189.patch","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4189","number":4189,"state":"open","locked":false,"title":"gnrc_sixlowpan_iphc.c: add nhc udp encoding and decoding","user":{"login":"jfischer-phytec-iot","id":9864546,"avatar_url":"https://avatars.githubusercontent.com/u/9864546?v=3","gravatar_id":"","url":"https://api.github.com/users/jfischer-phytec-iot","html_url":"https://github.com/jfischer-phytec-iot","followers_url":"https://api.github.com/users/jfischer-phytec-iot/followers","following_url":"https://api.github.com/users/jfischer-phytec-iot/following{/other_user}","gists_url":"https://api.github.com/users/jfischer-phytec-iot/gists{/gist_id}","starred_url":"https://api.github.com/users/jfischer-phytec-iot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfischer-phytec-iot/subscriptions","organizations_url":"https://api.github.com/users/jfischer-phytec-iot/orgs","repos_url":"https://api.github.com/users/jfischer-phytec-iot/repos","events_url":"https://api.github.com/users/jfischer-phytec-iot/events{/privacy}","received_events_url":"https://api.github.com/users/jfischer-phytec-iot/received_events","type":"User","site_admin":false},"body":"This PR adds NHC UDP decoding and encoding.\r\n\r\n@cgundogan @authmillenon @OlegHahm ~~~I need your support to get it pretty.\r\nFor first, my mayor problem is that gnrc_pktbuf_realloc_data fails after a few calls.\r\nWhat would be the alternative?~~~\r\n\r\nReferences:\r\nhttps://tools.ietf.org/html/rfc6282#section-4.3\r\nhttps://github.com/torvalds/linux/blob/master/net/6lowpan/nhc_udp.c","created_at":"2015-10-29T17:19:39Z","updated_at":"2015-12-08T09:06:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6e07e90a1de1708719f553595978292e5652e36b","assignee":{"login":"authmillenon","id":675644,"avatar_url":"https://avatars.githubusercontent.com/u/675644?v=3","gravatar_id":"","url":"https://api.github.com/users/authmillenon","html_url":"https://github.com/authmillenon","followers_url":"https://api.github.com/users/authmillenon/followers","following_url":"https://api.github.com/users/authmillenon/following{/other_user}","gists_url":"https://api.github.com/users/authmillenon/gists{/gist_id}","starred_url":"https://api.github.com/users/authmillenon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/authmillenon/subscriptions","organizations_url":"https://api.github.com/users/authmillenon/orgs","repos_url":"https://api.github.com/users/authmillenon/repos","events_url":"https://api.github.com/users/authmillenon/events{/privacy}","received_events_url":"https://api.github.com/users/authmillenon/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones/10","html_url":"https://github.com/RIOT-OS/RIOT/milestones/Release%202015.12","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones/10/labels","id":871004,"number":10,"title":"Release 2015.12","description":"This is the next major milestone.","creator":{"login":"OlegHahm","id":1590423,"avatar_url":"https://avatars.githubusercontent.com/u/1590423?v=3","gravatar_id":"","url":"https://api.github.com/users/OlegHahm","html_url":"https://github.com/OlegHahm","followers_url":"https://api.github.com/users/OlegHahm/followers","following_url":"https://api.github.com/users/OlegHahm/following{/other_user}","gists_url":"https://api.github.com/users/OlegHahm/gists{/gist_id}","starred_url":"https://api.github.com/users/OlegHahm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlegHahm/subscriptions","organizations_url":"https://api.github.com/users/OlegHahm/orgs","repos_url":"https://api.github.com/users/OlegHahm/repos","events_url":"https://api.github.com/users/OlegHahm/events{/privacy}","received_events_url":"https://api.github.com/users/OlegHahm/received_events","type":"User","site_admin":false},"open_issues":54,"closed_issues":240,"state":"open","created_at":"2014-11-18T10:51:58Z","updated_at":"2015-12-08T09:06:21Z","due_on":"2015-12-07T00:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/4189/commits","review_comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/4189/comments","review_comment_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4189/comments","statuses_url":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/9c1b48aa84f937a861036489a5e343a97ad35c65","head":{"label":"jfischer-phytec-iot:wip@nhc-udp","ref":"wip@nhc-udp","sha":"9c1b48aa84f937a861036489a5e343a97ad35c65","user":{"login":"jfischer-phytec-iot","id":9864546,"avatar_url":"https://avatars.githubusercontent.com/u/9864546?v=3","gravatar_id":"","url":"https://api.github.com/users/jfischer-phytec-iot","html_url":"https://github.com/jfischer-phytec-iot","followers_url":"https://api.github.com/users/jfischer-phytec-iot/followers","following_url":"https://api.github.com/users/jfischer-phytec-iot/following{/other_user}","gists_url":"https://api.github.com/users/jfischer-phytec-iot/gists{/gist_id}","starred_url":"https://api.github.com/users/jfischer-phytec-iot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfischer-phytec-iot/subscriptions","organizations_url":"https://api.github.com/users/jfischer-phytec-iot/orgs","repos_url":"https://api.github.com/users/jfischer-phytec-iot/repos","events_url":"https://api.github.com/users/jfischer-phytec-iot/events{/privacy}","received_events_url":"https://api.github.com/users/jfischer-phytec-iot/received_events","type":"User","site_admin":false},"repo":{"id":26913807,"name":"RIOT","full_name":"jfischer-phytec-iot/RIOT","owner":{"login":"jfischer-phytec-iot","id":9864546,"avatar_url":"https://avatars.githubusercontent.com/u/9864546?v=3","gravatar_id":"","url":"https://api.github.com/users/jfischer-phytec-iot","html_url":"https://github.com/jfischer-phytec-iot","followers_url":"https://api.github.com/users/jfischer-phytec-iot/followers","following_url":"https://api.github.com/users/jfischer-phytec-iot/following{/other_user}","gists_url":"https://api.github.com/users/jfischer-phytec-iot/gists{/gist_id}","starred_url":"https://api.github.com/users/jfischer-phytec-iot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfischer-phytec-iot/subscriptions","organizations_url":"https://api.github.com/users/jfischer-phytec-iot/orgs","repos_url":"https://api.github.com/users/jfischer-phytec-iot/repos","events_url":"https://api.github.com/users/jfischer-phytec-iot/events{/privacy}","received_events_url":"https://api.github.com/users/jfischer-phytec-iot/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jfischer-phytec-iot/RIOT","description":"RIOT -  The friendly OS for IoT","fork":true,"url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT","forks_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/forks","keys_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/teams","hooks_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/hooks","issue_events_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/issues/events{/number}","events_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/events","assignees_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/assignees{/user}","branches_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/branches{/branch}","tags_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/tags","blobs_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/git/refs{/sha}","trees_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/statuses/{sha}","languages_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/languages","stargazers_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/stargazers","contributors_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/contributors","subscribers_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/subscribers","subscription_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/subscription","commits_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/commits{/sha}","git_commits_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/git/commits{/sha}","comments_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/comments{/number}","issue_comment_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/issues/comments{/number}","contents_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/contents/{+path}","compare_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/merges","archive_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/downloads","issues_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/issues{/number}","pulls_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/pulls{/number}","milestones_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/milestones{/number}","notifications_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/labels{/name}","releases_url":"https://api.github.com/repos/jfischer-phytec-iot/RIOT/releases{/id}","created_at":"2014-11-20T13:37:08Z","updated_at":"2015-03-31T07:26:54Z","pushed_at":"2015-12-08T00:13:12Z","git_url":"git://github.com/jfischer-phytec-iot/RIOT.git","ssh_url":"git@github.com:jfischer-phytec-iot/RIOT.git","clone_url":"https://github.com/jfischer-phytec-iot/RIOT.git","svn_url":"https://github.com/jfischer-phytec-iot/RIOT","homepage":"https://github.com/RIOT-OS/RIOT/wiki","size":23427,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"RIOT-OS:master","ref":"master","sha":"810c623092e048be768289bc1831c672a7159a85","user":{"login":"RIOT-OS","id":3079480,"avatar_url":"https://avatars.githubusercontent.com/u/3079480?v=3","gravatar_id":"","url":"https://api.github.com/users/RIOT-OS","html_url":"https://github.com/RIOT-OS","followers_url":"https://api.github.com/users/RIOT-OS/followers","following_url":"https://api.github.com/users/RIOT-OS/following{/other_user}","gists_url":"https://api.github.com/users/RIOT-OS/gists{/gist_id}","starred_url":"https://api.github.com/users/RIOT-OS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RIOT-OS/subscriptions","organizations_url":"https://api.github.com/users/RIOT-OS/orgs","repos_url":"https://api.github.com/users/RIOT-OS/repos","events_url":"https://api.github.com/users/RIOT-OS/events{/privacy}","received_events_url":"https://api.github.com/users/RIOT-OS/received_events","type":"Organization","site_admin":false},"repo":{"id":7370241,"name":"RIOT","full_name":"RIOT-OS/RIOT","owner":{"login":"RIOT-OS","id":3079480,"avatar_url":"https://avatars.githubusercontent.com/u/3079480?v=3","gravatar_id":"","url":"https://api.github.com/users/RIOT-OS","html_url":"https://github.com/RIOT-OS","followers_url":"https://api.github.com/users/RIOT-OS/followers","following_url":"https://api.github.com/users/RIOT-OS/following{/other_user}","gists_url":"https://api.github.com/users/RIOT-OS/gists{/gist_id}","starred_url":"https://api.github.com/users/RIOT-OS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RIOT-OS/subscriptions","organizations_url":"https://api.github.com/users/RIOT-OS/orgs","repos_url":"https://api.github.com/users/RIOT-OS/repos","events_url":"https://api.github.com/users/RIOT-OS/events{/privacy}","received_events_url":"https://api.github.com/users/RIOT-OS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RIOT-OS/RIOT","description":"RIOT -  The friendly OS for IoT","fork":false,"url":"https://api.github.com/repos/RIOT-OS/RIOT","forks_url":"https://api.github.com/repos/RIOT-OS/RIOT/forks","keys_url":"https://api.github.com/repos/RIOT-OS/RIOT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RIOT-OS/RIOT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RIOT-OS/RIOT/teams","hooks_url":"https://api.github.com/repos/RIOT-OS/RIOT/hooks","issue_events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/events{/number}","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/events","assignees_url":"https://api.github.com/repos/RIOT-OS/RIOT/assignees{/user}","branches_url":"https://api.github.com/repos/RIOT-OS/RIOT/branches{/branch}","tags_url":"https://api.github.com/repos/RIOT-OS/RIOT/tags","blobs_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/refs{/sha}","trees_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/{sha}","languages_url":"https://api.github.com/repos/RIOT-OS/RIOT/languages","stargazers_url":"https://api.github.com/repos/RIOT-OS/RIOT/stargazers","contributors_url":"https://api.github.com/repos/RIOT-OS/RIOT/contributors","subscribers_url":"https://api.github.com/repos/RIOT-OS/RIOT/subscribers","subscription_url":"https://api.github.com/repos/RIOT-OS/RIOT/subscription","commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/commits{/sha}","git_commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/commits{/sha}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/comments{/number}","issue_comment_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments{/number}","contents_url":"https://api.github.com/repos/RIOT-OS/RIOT/contents/{+path}","compare_url":"https://api.github.com/repos/RIOT-OS/RIOT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RIOT-OS/RIOT/merges","archive_url":"https://api.github.com/repos/RIOT-OS/RIOT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RIOT-OS/RIOT/downloads","issues_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues{/number}","pulls_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls{/number}","milestones_url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones{/number}","notifications_url":"https://api.github.com/repos/RIOT-OS/RIOT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/labels{/name}","releases_url":"https://api.github.com/repos/RIOT-OS/RIOT/releases{/id}","created_at":"2012-12-29T20:38:40Z","updated_at":"2015-12-08T05:27:40Z","pushed_at":"2015-12-08T09:05:55Z","git_url":"git://github.com/RIOT-OS/RIOT.git","ssh_url":"git@github.com:RIOT-OS/RIOT.git","clone_url":"https://github.com/RIOT-OS/RIOT.git","svn_url":"https://github.com/RIOT-OS/RIOT","homepage":"https://github.com/RIOT-OS/RIOT/wiki","size":90983,"stargazers_count":572,"watchers_count":572,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":445,"mirror_url":null,"open_issues_count":408,"forks":445,"open_issues":408,"watchers":572,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/4189"},"html":{"href":"https://github.com/RIOT-OS/RIOT/pull/4189"},"issue":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4189"},"comments":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4189/comments"},"review_comments":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/4189/comments"},"review_comment":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/4189/commits"},"statuses":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/9c1b48aa84f937a861036489a5e343a97ad35c65"}}}}