{"action":"created","comment":{"url":"https://api.github.com/repos/openthread/openthread/pulls/comments/85041031","pull_request_review_id":5780073,"id":85041031,"diff_hunk":"@@ -0,0 +1,323 @@\n+/*\n+ *  Copyright (c) 2016, The OpenThread Authors.\n+ *  All rights reserved.\n+ *\n+ *  Redistribution and use in source and binary forms, with or without\n+ *  modification, are permitted provided that the following conditions are met:\n+ *  1. Redistributions of source code must retain the above copyright\n+ *     notice, this list of conditions and the following disclaimer.\n+ *  2. Redistributions in binary form must reproduce the above copyright\n+ *     notice, this list of conditions and the following disclaimer in the\n+ *     documentation and/or other materials provided with the distribution.\n+ *  3. Neither the name of the copyright holder nor the\n+ *     names of its contributors may be used to endorse or promote products\n+ *     derived from this software without specific prior written permission.\n+ *\n+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n+ *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ *  POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+/**\n+ * @file\n+ *   This file includes definations for DHCPv6 Service.\n+ */\n+\n+#ifndef DHCP6_HPP_\n+#define DHCP6_HPP_\n+\n+#include <common/message.hpp>\n+#include <net/udp6.hpp>\n+\n+using Thread::Encoding::BigEndian::HostSwap16;\n+using Thread::Encoding::BigEndian::HostSwap32;\n+\n+namespace Thread {\n+namespace Dhcp6 {\n+\n+enum\n+{\n+    kDhcpClientPort = 546,\n+    kDhcpServerPort = 547,\n+};\n+\n+#define TRANSACTION_ID_SIZE 3\n+OT_TOOL_PACKED_BEGIN\n+struct Dhcp6HeaderPoD\n+{\n+    uint8_t mType;\n+    uint8_t mTransactionId[TRANSACTION_ID_SIZE];\n+} OT_TOOL_PACKED_END;\n+\n+typedef enum Type\n+{\n+    kTypeSolicit = 1,\n+    kTypeAdvertise = 2,\n+    kTypeRequest = 3,\n+    kTypeConfirm = 4,\n+    kTypeRenew = 5,\n+    kTypeRebind = 6,\n+    kTypeReply = 7,\n+    kTypeRelease = 8,\n+    kTypeDecline = 9,\n+    kTypeReconfigure = 10,\n+    kTypeInformationRequest = 11,\n+    kTypeRelayForward = 12,\n+    kTypeRelayReply = 13,\n+    kTypeLeaseQuery = 14,\n+    kTypeLeaseQueryReply = 15,\n+} Type;\n+\n+OT_TOOL_PACKED_BEGIN\n+class Dhcp6Header: private Dhcp6HeaderPoD\n+{\n+public:\n+    void Init() { mType = 0; mTransactionId[0] = 0; }\n+\n+    Type GetType(void) { return static_cast<Type>(mType); }\n+    void SetType(Type aType) { mType = static_cast<uint8_t>(aType); }\n+\n+    uint8_t *GetTransactionId(void) { return mTransactionId; }\n+    void SetTransactionId(uint8_t *buf) { memcpy(mTransactionId, buf, TRANSACTION_ID_SIZE); }\n+} OT_TOOL_PACKED_END;\n+\n+typedef enum Code\n+{\n+    kOptionClientIdentifier = 1,\n+    kOptionServerIdentifier = 2,\n+    kOptionIaNa = 3,\n+    kOptionIaTa = 4,\n+    kOptionIaAddress = 5,\n+    kOptionRequestOption = 6,\n+    kOptionPreference = 7,\n+    kOptionElapsedTime = 8,\n+    kOptionRelayMessage = 9,\n+    kOptionAuthentication = 11,\n+    kOptionServerUnicast = 12,\n+    kOptionStatusCode = 13,\n+    kOptionRapidCommit = 14,\n+    kOptionUserClass = 15,\n+    kOptionVendorClass = 16,\n+    kOptionVendorSpecificInformation = 17,\n+    kOptionInterfaceId = 18,\n+    kOptionReconfigureMessage = 19,\n+    kOptionReconfigureAccept = 20,\n+    kOptionLeaseQuery = 44,\n+    kOptionClientData = 45,\n+    kOptionClientLastTransactionTime = 46,\n+} Code;\n+\n+OT_TOOL_PACKED_BEGIN\n+class Dhcp6Option\n+{\n+public:\n+    void Init() { mCode = 0; mLength = 0; }\n+\n+    Code GetCode(void) { return static_cast<Code>(HostSwap16(mCode)); }\n+    void SetCode(Code aCode) { mCode = HostSwap16(static_cast<uint16_t>(aCode)); }\n+\n+    uint16_t GetLength(void) { return HostSwap16(mLength); }\n+    void SetLength(uint16_t aLength) { mLength = HostSwap16(aLength); }\n+\n+private:\n+    uint16_t mCode;\n+    uint16_t mLength;\n+} OT_TOOL_PACKED_END;\n+\n+typedef enum DuidType\n+{\n+    kDuidLLT = 1,\n+    kDuidEN = 2,\n+    kDuidLL = 3,\n+} DuidType;\n+\n+#define ADDRESS_LL_LEN             8\n+#define ENTERPRISE_IDENTIFIER_LEN  8\n+#define HARDWARE_TYPE_EUI64        27\n+\n+OT_TOOL_PACKED_BEGIN\n+struct DuidLLT\n+{\n+    uint16_t mDuidHardwareType;\n+    uint32_t mTime;\n+    uint8_t  mDuidAddrLL[ADDRESS_LL_LEN];\n+} OT_TOOL_PACKED_END;\n+\n+struct DuidEN\n+{\n+    uint32_t mEnterpriseNumber;\n+    uint32_t mIdentifier[ENTERPRISE_IDENTIFIER_LEN];\n+} OT_TOOL_PACKED_END;\n+\n+struct DuidLL","path":"src/core/net/dhcp6.hpp","position":160,"original_position":160,"commit_id":"772704c8b5488b6acea54a2630fec05e6669f86a","original_commit_id":"772704c8b5488b6acea54a2630fec05e6669f86a","user":{"login":"librasungirl","id":19217991,"avatar_url":"https://avatars.githubusercontent.com/u/19217991?v=3","gravatar_id":"","url":"https://api.github.com/users/librasungirl","html_url":"https://github.com/librasungirl","followers_url":"https://api.github.com/users/librasungirl/followers","following_url":"https://api.github.com/users/librasungirl/following{/other_user}","gists_url":"https://api.github.com/users/librasungirl/gists{/gist_id}","starred_url":"https://api.github.com/users/librasungirl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/librasungirl/subscriptions","organizations_url":"https://api.github.com/users/librasungirl/orgs","repos_url":"https://api.github.com/users/librasungirl/repos","events_url":"https://api.github.com/users/librasungirl/events{/privacy}","received_events_url":"https://api.github.com/users/librasungirl/received_events","type":"User","site_admin":false},"body":"Thanks, will update.","created_at":"2016-10-26T02:44:16Z","updated_at":"2016-10-26T02:44:16Z","html_url":"https://github.com/openthread/openthread/pull/884#discussion_r85041031","pull_request_url":"https://api.github.com/repos/openthread/openthread/pulls/884","_links":{"self":{"href":"https://api.github.com/repos/openthread/openthread/pulls/comments/85041031"},"html":{"href":"https://github.com/openthread/openthread/pull/884#discussion_r85041031"},"pull_request":{"href":"https://api.github.com/repos/openthread/openthread/pulls/884"}}},"pull_request":{"url":"https://api.github.com/repos/openthread/openthread/pulls/884","id":90913535,"html_url":"https://github.com/openthread/openthread/pull/884","diff_url":"https://github.com/openthread/openthread/pull/884.diff","patch_url":"https://github.com/openthread/openthread/pull/884.patch","issue_url":"https://api.github.com/repos/openthread/openthread/issues/884","number":884,"state":"open","locked":false,"title":"intial implementation of Dhcp client/server(solicit/release)","user":{"login":"librasungirl","id":19217991,"avatar_url":"https://avatars.githubusercontent.com/u/19217991?v=3","gravatar_id":"","url":"https://api.github.com/users/librasungirl","html_url":"https://github.com/librasungirl","followers_url":"https://api.github.com/users/librasungirl/followers","following_url":"https://api.github.com/users/librasungirl/following{/other_user}","gists_url":"https://api.github.com/users/librasungirl/gists{/gist_id}","starred_url":"https://api.github.com/users/librasungirl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/librasungirl/subscriptions","organizations_url":"https://api.github.com/users/librasungirl/orgs","repos_url":"https://api.github.com/users/librasungirl/repos","events_url":"https://api.github.com/users/librasungirl/events{/privacy}","received_events_url":"https://api.github.com/users/librasungirl/received_events","type":"User","site_admin":false},"body":"To Resolve #459 \r\n\r\nThis PR is an initial implement. Further refinement and some enhancement will be patched soon.\r\n@jwhui , would you please have a look and share your opinions if any in advance?\r\n\r\n\r\nAttached some tests here:\r\n[testdhcp_ping.pcapng.zip](https://github.com/openthread/openthread/files/552025/testdhcp_ping.pcapng.zip)\r\n[testdhcp_solicit_release.pcapng.zip]\r\n[Leader_5_3_8.zip](https://github.com/openthread/openthread/files/552036/Leader_5_3_8.zip)\r\n","created_at":"2016-10-25T23:54:32Z","updated_at":"2016-10-26T02:44:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bfe83a6d3e0ab173c8161d75731d17e5b8b895ac","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openthread/openthread/pulls/884/commits","review_comments_url":"https://api.github.com/repos/openthread/openthread/pulls/884/comments","review_comment_url":"https://api.github.com/repos/openthread/openthread/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openthread/openthread/issues/884/comments","statuses_url":"https://api.github.com/repos/openthread/openthread/statuses/772704c8b5488b6acea54a2630fec05e6669f86a","head":{"label":"librasungirl:pr/dhcp","ref":"pr/dhcp","sha":"772704c8b5488b6acea54a2630fec05e6669f86a","user":{"login":"librasungirl","id":19217991,"avatar_url":"https://avatars.githubusercontent.com/u/19217991?v=3","gravatar_id":"","url":"https://api.github.com/users/librasungirl","html_url":"https://github.com/librasungirl","followers_url":"https://api.github.com/users/librasungirl/followers","following_url":"https://api.github.com/users/librasungirl/following{/other_user}","gists_url":"https://api.github.com/users/librasungirl/gists{/gist_id}","starred_url":"https://api.github.com/users/librasungirl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/librasungirl/subscriptions","organizations_url":"https://api.github.com/users/librasungirl/orgs","repos_url":"https://api.github.com/users/librasungirl/repos","events_url":"https://api.github.com/users/librasungirl/events{/privacy}","received_events_url":"https://api.github.com/users/librasungirl/received_events","type":"User","site_admin":false},"repo":{"id":58746751,"name":"openthread","full_name":"librasungirl/openthread","owner":{"login":"librasungirl","id":19217991,"avatar_url":"https://avatars.githubusercontent.com/u/19217991?v=3","gravatar_id":"","url":"https://api.github.com/users/librasungirl","html_url":"https://github.com/librasungirl","followers_url":"https://api.github.com/users/librasungirl/followers","following_url":"https://api.github.com/users/librasungirl/following{/other_user}","gists_url":"https://api.github.com/users/librasungirl/gists{/gist_id}","starred_url":"https://api.github.com/users/librasungirl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/librasungirl/subscriptions","organizations_url":"https://api.github.com/users/librasungirl/orgs","repos_url":"https://api.github.com/users/librasungirl/repos","events_url":"https://api.github.com/users/librasungirl/events{/privacy}","received_events_url":"https://api.github.com/users/librasungirl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/librasungirl/openthread","description":"OpenThread is an open-source implementation of the Thread networking protocol","fork":true,"url":"https://api.github.com/repos/librasungirl/openthread","forks_url":"https://api.github.com/repos/librasungirl/openthread/forks","keys_url":"https://api.github.com/repos/librasungirl/openthread/keys{/key_id}","collaborators_url":"https://api.github.com/repos/librasungirl/openthread/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/librasungirl/openthread/teams","hooks_url":"https://api.github.com/repos/librasungirl/openthread/hooks","issue_events_url":"https://api.github.com/repos/librasungirl/openthread/issues/events{/number}","events_url":"https://api.github.com/repos/librasungirl/openthread/events","assignees_url":"https://api.github.com/repos/librasungirl/openthread/assignees{/user}","branches_url":"https://api.github.com/repos/librasungirl/openthread/branches{/branch}","tags_url":"https://api.github.com/repos/librasungirl/openthread/tags","blobs_url":"https://api.github.com/repos/librasungirl/openthread/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/librasungirl/openthread/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/librasungirl/openthread/git/refs{/sha}","trees_url":"https://api.github.com/repos/librasungirl/openthread/git/trees{/sha}","statuses_url":"https://api.github.com/repos/librasungirl/openthread/statuses/{sha}","languages_url":"https://api.github.com/repos/librasungirl/openthread/languages","stargazers_url":"https://api.github.com/repos/librasungirl/openthread/stargazers","contributors_url":"https://api.github.com/repos/librasungirl/openthread/contributors","subscribers_url":"https://api.github.com/repos/librasungirl/openthread/subscribers","subscription_url":"https://api.github.com/repos/librasungirl/openthread/subscription","commits_url":"https://api.github.com/repos/librasungirl/openthread/commits{/sha}","git_commits_url":"https://api.github.com/repos/librasungirl/openthread/git/commits{/sha}","comments_url":"https://api.github.com/repos/librasungirl/openthread/comments{/number}","issue_comment_url":"https://api.github.com/repos/librasungirl/openthread/issues/comments{/number}","contents_url":"https://api.github.com/repos/librasungirl/openthread/contents/{+path}","compare_url":"https://api.github.com/repos/librasungirl/openthread/compare/{base}...{head}","merges_url":"https://api.github.com/repos/librasungirl/openthread/merges","archive_url":"https://api.github.com/repos/librasungirl/openthread/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/librasungirl/openthread/downloads","issues_url":"https://api.github.com/repos/librasungirl/openthread/issues{/number}","pulls_url":"https://api.github.com/repos/librasungirl/openthread/pulls{/number}","milestones_url":"https://api.github.com/repos/librasungirl/openthread/milestones{/number}","notifications_url":"https://api.github.com/repos/librasungirl/openthread/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/librasungirl/openthread/labels{/name}","releases_url":"https://api.github.com/repos/librasungirl/openthread/releases{/id}","deployments_url":"https://api.github.com/repos/librasungirl/openthread/deployments","created_at":"2016-05-13T14:23:42Z","updated_at":"2016-10-25T23:43:39Z","pushed_at":"2016-10-25T23:43:35Z","git_url":"git://github.com/librasungirl/openthread.git","ssh_url":"git@github.com:librasungirl/openthread.git","clone_url":"https://github.com/librasungirl/openthread.git","svn_url":"https://github.com/librasungirl/openthread","homepage":"","size":94694,"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":"openthread:master","ref":"master","sha":"f60084049970aa9012d23f6ea3e0682c2e07cb98","user":{"login":"openthread","id":16142269,"avatar_url":"https://avatars.githubusercontent.com/u/16142269?v=3","gravatar_id":"","url":"https://api.github.com/users/openthread","html_url":"https://github.com/openthread","followers_url":"https://api.github.com/users/openthread/followers","following_url":"https://api.github.com/users/openthread/following{/other_user}","gists_url":"https://api.github.com/users/openthread/gists{/gist_id}","starred_url":"https://api.github.com/users/openthread/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openthread/subscriptions","organizations_url":"https://api.github.com/users/openthread/orgs","repos_url":"https://api.github.com/users/openthread/repos","events_url":"https://api.github.com/users/openthread/events{/privacy}","received_events_url":"https://api.github.com/users/openthread/received_events","type":"Organization","site_admin":false},"repo":{"id":55808787,"name":"openthread","full_name":"openthread/openthread","owner":{"login":"openthread","id":16142269,"avatar_url":"https://avatars.githubusercontent.com/u/16142269?v=3","gravatar_id":"","url":"https://api.github.com/users/openthread","html_url":"https://github.com/openthread","followers_url":"https://api.github.com/users/openthread/followers","following_url":"https://api.github.com/users/openthread/following{/other_user}","gists_url":"https://api.github.com/users/openthread/gists{/gist_id}","starred_url":"https://api.github.com/users/openthread/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openthread/subscriptions","organizations_url":"https://api.github.com/users/openthread/orgs","repos_url":"https://api.github.com/users/openthread/repos","events_url":"https://api.github.com/users/openthread/events{/privacy}","received_events_url":"https://api.github.com/users/openthread/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openthread/openthread","description":"OpenThread released by Nest is an open-source implementation of the Thread networking protocol","fork":false,"url":"https://api.github.com/repos/openthread/openthread","forks_url":"https://api.github.com/repos/openthread/openthread/forks","keys_url":"https://api.github.com/repos/openthread/openthread/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openthread/openthread/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openthread/openthread/teams","hooks_url":"https://api.github.com/repos/openthread/openthread/hooks","issue_events_url":"https://api.github.com/repos/openthread/openthread/issues/events{/number}","events_url":"https://api.github.com/repos/openthread/openthread/events","assignees_url":"https://api.github.com/repos/openthread/openthread/assignees{/user}","branches_url":"https://api.github.com/repos/openthread/openthread/branches{/branch}","tags_url":"https://api.github.com/repos/openthread/openthread/tags","blobs_url":"https://api.github.com/repos/openthread/openthread/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openthread/openthread/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openthread/openthread/git/refs{/sha}","trees_url":"https://api.github.com/repos/openthread/openthread/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openthread/openthread/statuses/{sha}","languages_url":"https://api.github.com/repos/openthread/openthread/languages","stargazers_url":"https://api.github.com/repos/openthread/openthread/stargazers","contributors_url":"https://api.github.com/repos/openthread/openthread/contributors","subscribers_url":"https://api.github.com/repos/openthread/openthread/subscribers","subscription_url":"https://api.github.com/repos/openthread/openthread/subscription","commits_url":"https://api.github.com/repos/openthread/openthread/commits{/sha}","git_commits_url":"https://api.github.com/repos/openthread/openthread/git/commits{/sha}","comments_url":"https://api.github.com/repos/openthread/openthread/comments{/number}","issue_comment_url":"https://api.github.com/repos/openthread/openthread/issues/comments{/number}","contents_url":"https://api.github.com/repos/openthread/openthread/contents/{+path}","compare_url":"https://api.github.com/repos/openthread/openthread/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openthread/openthread/merges","archive_url":"https://api.github.com/repos/openthread/openthread/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openthread/openthread/downloads","issues_url":"https://api.github.com/repos/openthread/openthread/issues{/number}","pulls_url":"https://api.github.com/repos/openthread/openthread/pulls{/number}","milestones_url":"https://api.github.com/repos/openthread/openthread/milestones{/number}","notifications_url":"https://api.github.com/repos/openthread/openthread/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openthread/openthread/labels{/name}","releases_url":"https://api.github.com/repos/openthread/openthread/releases{/id}","deployments_url":"https://api.github.com/repos/openthread/openthread/deployments","created_at":"2016-04-08T20:47:41Z","updated_at":"2016-10-22T15:46:58Z","pushed_at":"2016-10-25T23:54:32Z","git_url":"git://github.com/openthread/openthread.git","ssh_url":"git@github.com:openthread/openthread.git","clone_url":"https://github.com/openthread/openthread.git","svn_url":"https://github.com/openthread/openthread","homepage":"","size":561437,"stargazers_count":1004,"watchers_count":1004,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":224,"mirror_url":null,"open_issues_count":45,"forks":224,"open_issues":45,"watchers":1004,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openthread/openthread/pulls/884"},"html":{"href":"https://github.com/openthread/openthread/pull/884"},"issue":{"href":"https://api.github.com/repos/openthread/openthread/issues/884"},"comments":{"href":"https://api.github.com/repos/openthread/openthread/issues/884/comments"},"review_comments":{"href":"https://api.github.com/repos/openthread/openthread/pulls/884/comments"},"review_comment":{"href":"https://api.github.com/repos/openthread/openthread/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openthread/openthread/pulls/884/commits"},"statuses":{"href":"https://api.github.com/repos/openthread/openthread/statuses/772704c8b5488b6acea54a2630fec05e6669f86a"}}}}
{"actor":{"display_login":"librasungirl"}}