{"action":"created","comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments/28286472","id":28286472,"diff_hunk":"@@ -0,0 +1,110 @@\n+/*\n+ * Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>\n+ *\n+ * This file is subject to the terms and conditions of the GNU Lesser\n+ * General Public License v2.1. See the file LICENSE in the top level\n+ * directory for more details.\n+ */\n+\n+/**\n+ * @defgroup    net_ng_sixlowpan_ctx    Contexts for 6LoWPAN address compression\n+ * @ingroup     net_ng_sixlowpan\n+ * @brief       Context buffer for stateful 6LoWPAN address compression\n+ * @see         <a href=\"https://tools.ietf.org/html/rfc6282#section-3.1.2\">\n+ *                  RFC 6282, section 3.1.2\n+ *              </a>\n+ * @see         <a href=\"http://tools.ietf.org/html/rfc6775#section-4.2\">\n+ *                  RFC 6775, section 4.2\n+ *              </a>\n+ * @{\n+ *\n+ * @file\n+ * @brief   Context buffer definitions\n+ *\n+ * @author  Martine Lenders <mlenders@inf.fu-berlin.de>\n+ */\n+#ifndef NG_SIXLOWPAN_CTX_H_\n+#define NG_SIXLOWPAN_CTX_H_\n+\n+#include <inttypes.h>\n+\n+#include \"net/ng_ipv6/addr.h\"\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#define NG_SIXLOWPAN_CTX_SIZE   (16)    /**< maximum number of entries in\n+                                         *   context buffer */\n+\n+typedef struct {\n+    ng_ipv6_addr_t prefix;  /**< The prefix associated to this context. */\n+    uint8_t prefix_len;     /**< Length of ng_sixlowpan_ctx_t::prefix in bit. */\n+    /**\n+     * @brief   4-bit Context ID.\n+     *\n+     * @note    This needs to be here to easily translate prefixes to\n+     *          ID.\n+     */\n+    uint8_t id;\n+    /**\n+     * @brief   Lifetime in minutes this context is valid.\n+     *\n+     * @see     <a href=\"http://tools.ietf.org/html/rfc6775#section-4.2\">\n+     *              6LoWPAN Context Option\n+     *          </a>\n+     */\n+    uint16_t ltime;\n+} ng_sixlowpan_ctx_t;\n+\n+/**\n+ * @brief   Gets a context matching the given IPv6 address best with its prefix.\n+ *\n+ * @param[in] addr  An IPv6 address.\n+ *\n+ * @return  The context associated with the best prefix for @p addr.\n+ * @return  NULL if there is no such context.\n+ */\n+ng_sixlowpan_ctx_t *ng_sixlowpan_ctx_lookup_addr(const ng_ipv6_addr_t *addr);\n+\n+/**\n+ * @brief   Gets context by ID.\n+ *\n+ * @param[in] id    A context ID.\n+ *\n+ * @return  The context associated with @p id.\n+ * @return  NULL if there is no such context.\n+ */\n+ng_sixlowpan_ctx_t *ng_sixlowpan_ctx_lookup_id(uint8_t id);\n+\n+/**\n+ * @brief   Updates (or adds if currently not registered) a context\n+ *\n+ * @param[in] id            The ID for the context.\n+ *                          Must be < @ref NG_SIXLOWPAN_CTX_SIZE.\n+ * @param[in] prefix        The prefix for the context.\n+ * @param[in] prefix_len    Length of @p prefix in bits. Must be > 0, when\n+ *                          @p ltime > 0.\n+ * @param[in] ltime         New lifetime of the context. The context will\n+ *                          be removed if 0.\n+ *\n+ * @return  The new conext on success.\n+ * @return  NULL, on error.","path":"sys/include/net/ng_sixlowpan/ctx.h","position":null,"original_position":92,"commit_id":"b0c89431dc627177936b74b69f049f1843757a78","original_commit_id":"68134a13cd7a0392d8884acaa161f922efe89694","user":{"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},"body":"Fixed","created_at":"2015-04-13T22:42:00Z","updated_at":"2015-04-13T22:42:00Z","html_url":"https://github.com/RIOT-OS/RIOT/pull/2785#discussion_r28286472","pull_request_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2785","_links":{"self":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments/28286472"},"html":{"href":"https://github.com/RIOT-OS/RIOT/pull/2785#discussion_r28286472"},"pull_request":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2785"}}},"pull_request":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2785","id":33033517,"html_url":"https://github.com/RIOT-OS/RIOT/pull/2785","diff_url":"https://github.com/RIOT-OS/RIOT/pull/2785.diff","patch_url":"https://github.com/RIOT-OS/RIOT/pull/2785.patch","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/2785","number":2785,"state":"open","locked":false,"title":"ng_sixlowpan: initial import of a context buffer","user":{"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},"body":"Just a simple datastructure to handle contexts for stateful 6LoWPAN address compression.\r\n\r\nTests will follow.","created_at":"2015-04-10T10:05:00Z","updated_at":"2015-04-13T22:42:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00310cf8b18dbcb6d29c19bdb3e0f43dfaea6293","assignee":{"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},"milestone":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones/11","html_url":"https://github.com/RIOT-OS/RIOT/milestones/Network%20Stack%20Task%20Force","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones/11/labels","id":968921,"number":11,"title":"Network Stack Task Force","description":"The goal of this milestone is to implement the redesign of the network stack.\r\n\r\nTodo list at #2278.","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":21,"closed_issues":61,"state":"open","created_at":"2015-02-06T16:04:53Z","updated_at":"2015-04-13T22:25:11Z","due_on":"2015-04-29T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2785/commits","review_comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2785/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/2785/comments","statuses_url":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/b0c89431dc627177936b74b69f049f1843757a78","head":{"label":"authmillenon:ng_sixlowpan_ctx/feat/initial","ref":"ng_sixlowpan_ctx/feat/initial","sha":"b0c89431dc627177936b74b69f049f1843757a78","user":{"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},"repo":{"id":7667624,"name":"RIOT","full_name":"authmillenon/RIOT","owner":{"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},"private":false,"html_url":"https://github.com/authmillenon/RIOT","description":"RIOT OS -  The revolutionary IoT OS","fork":true,"url":"https://api.github.com/repos/authmillenon/RIOT","forks_url":"https://api.github.com/repos/authmillenon/RIOT/forks","keys_url":"https://api.github.com/repos/authmillenon/RIOT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/authmillenon/RIOT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/authmillenon/RIOT/teams","hooks_url":"https://api.github.com/repos/authmillenon/RIOT/hooks","issue_events_url":"https://api.github.com/repos/authmillenon/RIOT/issues/events{/number}","events_url":"https://api.github.com/repos/authmillenon/RIOT/events","assignees_url":"https://api.github.com/repos/authmillenon/RIOT/assignees{/user}","branches_url":"https://api.github.com/repos/authmillenon/RIOT/branches{/branch}","tags_url":"https://api.github.com/repos/authmillenon/RIOT/tags","blobs_url":"https://api.github.com/repos/authmillenon/RIOT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/authmillenon/RIOT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/authmillenon/RIOT/git/refs{/sha}","trees_url":"https://api.github.com/repos/authmillenon/RIOT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/authmillenon/RIOT/statuses/{sha}","languages_url":"https://api.github.com/repos/authmillenon/RIOT/languages","stargazers_url":"https://api.github.com/repos/authmillenon/RIOT/stargazers","contributors_url":"https://api.github.com/repos/authmillenon/RIOT/contributors","subscribers_url":"https://api.github.com/repos/authmillenon/RIOT/subscribers","subscription_url":"https://api.github.com/repos/authmillenon/RIOT/subscription","commits_url":"https://api.github.com/repos/authmillenon/RIOT/commits{/sha}","git_commits_url":"https://api.github.com/repos/authmillenon/RIOT/git/commits{/sha}","comments_url":"https://api.github.com/repos/authmillenon/RIOT/comments{/number}","issue_comment_url":"https://api.github.com/repos/authmillenon/RIOT/issues/comments{/number}","contents_url":"https://api.github.com/repos/authmillenon/RIOT/contents/{+path}","compare_url":"https://api.github.com/repos/authmillenon/RIOT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/authmillenon/RIOT/merges","archive_url":"https://api.github.com/repos/authmillenon/RIOT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/authmillenon/RIOT/downloads","issues_url":"https://api.github.com/repos/authmillenon/RIOT/issues{/number}","pulls_url":"https://api.github.com/repos/authmillenon/RIOT/pulls{/number}","milestones_url":"https://api.github.com/repos/authmillenon/RIOT/milestones{/number}","notifications_url":"https://api.github.com/repos/authmillenon/RIOT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/authmillenon/RIOT/labels{/name}","releases_url":"https://api.github.com/repos/authmillenon/RIOT/releases{/id}","created_at":"2013-01-17T14:31:57Z","updated_at":"2015-04-13T14:46:17Z","pushed_at":"2015-04-13T22:41:48Z","git_url":"git://github.com/authmillenon/RIOT.git","ssh_url":"git@github.com:authmillenon/RIOT.git","clone_url":"https://github.com/authmillenon/RIOT.git","svn_url":"https://github.com/authmillenon/RIOT","homepage":null,"size":33585,"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":"fce1d4538ee6604423b6f927e20c84c84c343731","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-04-13T14:32:04Z","pushed_at":"2015-04-13T22:41:49Z","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":97193,"stargazers_count":327,"watchers_count":327,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":265,"mirror_url":null,"open_issues_count":312,"forks":265,"open_issues":312,"watchers":327,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2785"},"html":{"href":"https://github.com/RIOT-OS/RIOT/pull/2785"},"issue":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/issues/2785"},"comments":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/issues/2785/comments"},"review_comments":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/2785/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/2785/commits"},"statuses":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/b0c89431dc627177936b74b69f049f1843757a78"}}}}