{"action":"created","comment":{"url":"https://api.github.com/repos/DNS-OARC/dnscap/pulls/comments/78898445","id":78898445,"diff_hunk":"@@ -1099,6 +1130,11 @@ parse_args(int argc, char *argv[]) {\n \t\tusage(\"the -L and -l options are mutually exclusive\");\n \tif (background && (dumptrace || preso))\n \t\tusage(\"the -b option is incompatible with -d and -g\");\n+        if (sample && chooseSidesResponse)\n+        {\n+                if (!((dir_wanted & DIR_INITIATE) != 0) && ((dir_wanted & DIR_RESPONSE) != 0))","path":"src/dnscap.c","position":97,"original_position":97,"commit_id":"949db6eb7999d5b1457009da0590aaaa861df839","original_commit_id":"949db6eb7999d5b1457009da0590aaaa861df839","user":{"login":"jelu","id":1446909,"avatar_url":"https://avatars.githubusercontent.com/u/1446909?v=3","gravatar_id":"","url":"https://api.github.com/users/jelu","html_url":"https://github.com/jelu","followers_url":"https://api.github.com/users/jelu/followers","following_url":"https://api.github.com/users/jelu/following{/other_user}","gists_url":"https://api.github.com/users/jelu/gists{/gist_id}","starred_url":"https://api.github.com/users/jelu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jelu/subscriptions","organizations_url":"https://api.github.com/users/jelu/orgs","repos_url":"https://api.github.com/users/jelu/repos","events_url":"https://api.github.com/users/jelu/events{/privacy}","received_events_url":"https://api.github.com/users/jelu/received_events","type":"User","site_admin":false},"body":"Why check this? If both are true then both options have been used.","created_at":"2016-09-15T06:43:12Z","updated_at":"2016-09-15T06:43:12Z","html_url":"https://github.com/DNS-OARC/dnscap/pull/15#discussion_r78898445","pull_request_url":"https://api.github.com/repos/DNS-OARC/dnscap/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/DNS-OARC/dnscap/pulls/comments/78898445"},"html":{"href":"https://github.com/DNS-OARC/dnscap/pull/15#discussion_r78898445"},"pull_request":{"href":"https://api.github.com/repos/DNS-OARC/dnscap/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/DNS-OARC/dnscap/pulls/15","id":85232624,"html_url":"https://github.com/DNS-OARC/dnscap/pull/15","diff_url":"https://github.com/DNS-OARC/dnscap/pull/15.diff","patch_url":"https://github.com/DNS-OARC/dnscap/pull/15.patch","issue_url":"https://api.github.com/repos/DNS-OARC/dnscap/issues/15","number":15,"state":"open","locked":false,"title":"Added a Sampling Module to dnscap","user":{"login":"SuperAmbitiousItGuy","id":20840121,"avatar_url":"https://avatars.githubusercontent.com/u/20840121?v=3","gravatar_id":"","url":"https://api.github.com/users/SuperAmbitiousItGuy","html_url":"https://github.com/SuperAmbitiousItGuy","followers_url":"https://api.github.com/users/SuperAmbitiousItGuy/followers","following_url":"https://api.github.com/users/SuperAmbitiousItGuy/following{/other_user}","gists_url":"https://api.github.com/users/SuperAmbitiousItGuy/gists{/gist_id}","starred_url":"https://api.github.com/users/SuperAmbitiousItGuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SuperAmbitiousItGuy/subscriptions","organizations_url":"https://api.github.com/users/SuperAmbitiousItGuy/orgs","repos_url":"https://api.github.com/users/SuperAmbitiousItGuy/repos","events_url":"https://api.github.com/users/SuperAmbitiousItGuy/events{/privacy}","received_events_url":"https://api.github.com/users/SuperAmbitiousItGuy/received_events","type":"User","site_admin":false},"body":"Added a module that allows the output to be sampled. With the new -q option, the user is now able to decide whether the output should be sampled as follows: Only every nth query is output and only responses that correspond to one of these sampled queries will be output.\r\ne.g.:\r\ndnscap -r ./file.pcap -g -q 10 will output only every 10th query and these queries' corresponding responses.\r\nDue to the nature of this sampling, the -q option is not compatible with -s r (of which the user would informed by usage()).\r\n\r\nUpdated dnscap.1.in to match this addition.\r\n\r\nAdded uthash/uthash.h since I needed a hashtable for the sample module to work. The dnscap and uthash licenses should be compatible.\r\n______________________________________________________________\r\nI've made a very similar pull request at an outdated repository about 16 days ago already:\r\nhttps://github.com/DNS-OARC/dnscap/pull/10\r\n\r\nNow that I' have based my work on the DNS-OARC repo, there are still two issues to talk about:\r\n\r\n- \"Making the -q option more versatile\"\r\nAccording to an unfinished master's thesis, sampling the way I implemented, is as suitable as a random distribution for DNS traffic. Since this thesis is not published yet, I cannot provide a source to it.\r\nAlso, might it not be difficult to produce good random numbers at such high package processing speeds? A way could be using the content of the single packets to produce random numbers from (like the transaction id)?.\r\nAll in all, I'm worried that certain packages could be favored over others.\r\n \r\n\r\n- \"Using the already existing generic hashtable  dnscap/plugins/rssm/hashtable.c\"\r\nSimply put, I think it would mean a lot of unnecessary work that I probably can't do properly, since I don't have a lot of experience yet. This would probably make the hash table rather inefficient.\r\nI have absolutely no objection to somebody else doing so, though (although uthash seems quite OK to me).","created_at":"2016-09-14T13:58:09Z","updated_at":"2016-09-15T06:56:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6558943b313edfd9f293b5a8b7c9b06c57bf51d6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/DNS-OARC/dnscap/pulls/15/commits","review_comments_url":"https://api.github.com/repos/DNS-OARC/dnscap/pulls/15/comments","review_comment_url":"https://api.github.com/repos/DNS-OARC/dnscap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DNS-OARC/dnscap/issues/15/comments","statuses_url":"https://api.github.com/repos/DNS-OARC/dnscap/statuses/949db6eb7999d5b1457009da0590aaaa861df839","head":{"label":"SuperAmbitiousItGuy:develop","ref":"develop","sha":"949db6eb7999d5b1457009da0590aaaa861df839","user":{"login":"SuperAmbitiousItGuy","id":20840121,"avatar_url":"https://avatars.githubusercontent.com/u/20840121?v=3","gravatar_id":"","url":"https://api.github.com/users/SuperAmbitiousItGuy","html_url":"https://github.com/SuperAmbitiousItGuy","followers_url":"https://api.github.com/users/SuperAmbitiousItGuy/followers","following_url":"https://api.github.com/users/SuperAmbitiousItGuy/following{/other_user}","gists_url":"https://api.github.com/users/SuperAmbitiousItGuy/gists{/gist_id}","starred_url":"https://api.github.com/users/SuperAmbitiousItGuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SuperAmbitiousItGuy/subscriptions","organizations_url":"https://api.github.com/users/SuperAmbitiousItGuy/orgs","repos_url":"https://api.github.com/users/SuperAmbitiousItGuy/repos","events_url":"https://api.github.com/users/SuperAmbitiousItGuy/events{/privacy}","received_events_url":"https://api.github.com/users/SuperAmbitiousItGuy/received_events","type":"User","site_admin":false},"repo":{"id":68204786,"name":"dnscap","full_name":"SuperAmbitiousItGuy/dnscap","owner":{"login":"SuperAmbitiousItGuy","id":20840121,"avatar_url":"https://avatars.githubusercontent.com/u/20840121?v=3","gravatar_id":"","url":"https://api.github.com/users/SuperAmbitiousItGuy","html_url":"https://github.com/SuperAmbitiousItGuy","followers_url":"https://api.github.com/users/SuperAmbitiousItGuy/followers","following_url":"https://api.github.com/users/SuperAmbitiousItGuy/following{/other_user}","gists_url":"https://api.github.com/users/SuperAmbitiousItGuy/gists{/gist_id}","starred_url":"https://api.github.com/users/SuperAmbitiousItGuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SuperAmbitiousItGuy/subscriptions","organizations_url":"https://api.github.com/users/SuperAmbitiousItGuy/orgs","repos_url":"https://api.github.com/users/SuperAmbitiousItGuy/repos","events_url":"https://api.github.com/users/SuperAmbitiousItGuy/events{/privacy}","received_events_url":"https://api.github.com/users/SuperAmbitiousItGuy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SuperAmbitiousItGuy/dnscap","description":"Network capture utility designed specifically for DNS traffic","fork":true,"url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap","forks_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/forks","keys_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/teams","hooks_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/hooks","issue_events_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/issues/events{/number}","events_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/events","assignees_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/assignees{/user}","branches_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/branches{/branch}","tags_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/tags","blobs_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/git/refs{/sha}","trees_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/statuses/{sha}","languages_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/languages","stargazers_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/stargazers","contributors_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/contributors","subscribers_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/subscribers","subscription_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/subscription","commits_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/commits{/sha}","git_commits_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/git/commits{/sha}","comments_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/comments{/number}","issue_comment_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/issues/comments{/number}","contents_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/contents/{+path}","compare_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/merges","archive_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/downloads","issues_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/issues{/number}","pulls_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/pulls{/number}","milestones_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/milestones{/number}","notifications_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/labels{/name}","releases_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/releases{/id}","deployments_url":"https://api.github.com/repos/SuperAmbitiousItGuy/dnscap/deployments","created_at":"2016-09-14T12:34:44Z","updated_at":"2016-09-14T12:34:45Z","pushed_at":"2016-09-14T12:43:56Z","git_url":"git://github.com/SuperAmbitiousItGuy/dnscap.git","ssh_url":"git@github.com:SuperAmbitiousItGuy/dnscap.git","clone_url":"https://github.com/SuperAmbitiousItGuy/dnscap.git","svn_url":"https://github.com/SuperAmbitiousItGuy/dnscap","homepage":"https://www.dns-oarc.net/tools/dnscap","size":338,"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":"develop"}},"base":{"label":"DNS-OARC:develop","ref":"develop","sha":"4f120c267e063676fbb044696a252b14e4de08cd","user":{"login":"DNS-OARC","id":1955488,"avatar_url":"https://avatars.githubusercontent.com/u/1955488?v=3","gravatar_id":"","url":"https://api.github.com/users/DNS-OARC","html_url":"https://github.com/DNS-OARC","followers_url":"https://api.github.com/users/DNS-OARC/followers","following_url":"https://api.github.com/users/DNS-OARC/following{/other_user}","gists_url":"https://api.github.com/users/DNS-OARC/gists{/gist_id}","starred_url":"https://api.github.com/users/DNS-OARC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DNS-OARC/subscriptions","organizations_url":"https://api.github.com/users/DNS-OARC/orgs","repos_url":"https://api.github.com/users/DNS-OARC/repos","events_url":"https://api.github.com/users/DNS-OARC/events{/privacy}","received_events_url":"https://api.github.com/users/DNS-OARC/received_events","type":"Organization","site_admin":false},"repo":{"id":4931801,"name":"dnscap","full_name":"DNS-OARC/dnscap","owner":{"login":"DNS-OARC","id":1955488,"avatar_url":"https://avatars.githubusercontent.com/u/1955488?v=3","gravatar_id":"","url":"https://api.github.com/users/DNS-OARC","html_url":"https://github.com/DNS-OARC","followers_url":"https://api.github.com/users/DNS-OARC/followers","following_url":"https://api.github.com/users/DNS-OARC/following{/other_user}","gists_url":"https://api.github.com/users/DNS-OARC/gists{/gist_id}","starred_url":"https://api.github.com/users/DNS-OARC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DNS-OARC/subscriptions","organizations_url":"https://api.github.com/users/DNS-OARC/orgs","repos_url":"https://api.github.com/users/DNS-OARC/repos","events_url":"https://api.github.com/users/DNS-OARC/events{/privacy}","received_events_url":"https://api.github.com/users/DNS-OARC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DNS-OARC/dnscap","description":"Network capture utility designed specifically for DNS traffic","fork":false,"url":"https://api.github.com/repos/DNS-OARC/dnscap","forks_url":"https://api.github.com/repos/DNS-OARC/dnscap/forks","keys_url":"https://api.github.com/repos/DNS-OARC/dnscap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DNS-OARC/dnscap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DNS-OARC/dnscap/teams","hooks_url":"https://api.github.com/repos/DNS-OARC/dnscap/hooks","issue_events_url":"https://api.github.com/repos/DNS-OARC/dnscap/issues/events{/number}","events_url":"https://api.github.com/repos/DNS-OARC/dnscap/events","assignees_url":"https://api.github.com/repos/DNS-OARC/dnscap/assignees{/user}","branches_url":"https://api.github.com/repos/DNS-OARC/dnscap/branches{/branch}","tags_url":"https://api.github.com/repos/DNS-OARC/dnscap/tags","blobs_url":"https://api.github.com/repos/DNS-OARC/dnscap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DNS-OARC/dnscap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DNS-OARC/dnscap/git/refs{/sha}","trees_url":"https://api.github.com/repos/DNS-OARC/dnscap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DNS-OARC/dnscap/statuses/{sha}","languages_url":"https://api.github.com/repos/DNS-OARC/dnscap/languages","stargazers_url":"https://api.github.com/repos/DNS-OARC/dnscap/stargazers","contributors_url":"https://api.github.com/repos/DNS-OARC/dnscap/contributors","subscribers_url":"https://api.github.com/repos/DNS-OARC/dnscap/subscribers","subscription_url":"https://api.github.com/repos/DNS-OARC/dnscap/subscription","commits_url":"https://api.github.com/repos/DNS-OARC/dnscap/commits{/sha}","git_commits_url":"https://api.github.com/repos/DNS-OARC/dnscap/git/commits{/sha}","comments_url":"https://api.github.com/repos/DNS-OARC/dnscap/comments{/number}","issue_comment_url":"https://api.github.com/repos/DNS-OARC/dnscap/issues/comments{/number}","contents_url":"https://api.github.com/repos/DNS-OARC/dnscap/contents/{+path}","compare_url":"https://api.github.com/repos/DNS-OARC/dnscap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DNS-OARC/dnscap/merges","archive_url":"https://api.github.com/repos/DNS-OARC/dnscap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DNS-OARC/dnscap/downloads","issues_url":"https://api.github.com/repos/DNS-OARC/dnscap/issues{/number}","pulls_url":"https://api.github.com/repos/DNS-OARC/dnscap/pulls{/number}","milestones_url":"https://api.github.com/repos/DNS-OARC/dnscap/milestones{/number}","notifications_url":"https://api.github.com/repos/DNS-OARC/dnscap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DNS-OARC/dnscap/labels{/name}","releases_url":"https://api.github.com/repos/DNS-OARC/dnscap/releases{/id}","deployments_url":"https://api.github.com/repos/DNS-OARC/dnscap/deployments","created_at":"2012-07-06T22:17:06Z","updated_at":"2016-09-09T07:55:34Z","pushed_at":"2016-09-14T13:58:09Z","git_url":"git://github.com/DNS-OARC/dnscap.git","ssh_url":"git@github.com:DNS-OARC/dnscap.git","clone_url":"https://github.com/DNS-OARC/dnscap.git","svn_url":"https://github.com/DNS-OARC/dnscap","homepage":"https://www.dns-oarc.net/tools/dnscap","size":410,"stargazers_count":45,"watchers_count":45,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":3,"forks":20,"open_issues":3,"watchers":45,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/DNS-OARC/dnscap/pulls/15"},"html":{"href":"https://github.com/DNS-OARC/dnscap/pull/15"},"issue":{"href":"https://api.github.com/repos/DNS-OARC/dnscap/issues/15"},"comments":{"href":"https://api.github.com/repos/DNS-OARC/dnscap/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/DNS-OARC/dnscap/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/DNS-OARC/dnscap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DNS-OARC/dnscap/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/DNS-OARC/dnscap/statuses/949db6eb7999d5b1457009da0590aaaa861df839"}}}}
{"actor":{"display_login":"jelu"}}