{"action":"created","comment":{"url":"https://api.github.com/repos/google/gopacket/pulls/comments/32640689","id":32640689,"diff_hunk":"@@ -0,0 +1,155 @@\n+// +build darwin dragonfly freebsd netbsd openbsd","path":"bsdbpf/bsd_bpf_sniffer.go","position":1,"original_position":1,"commit_id":"d598b08ff679aff91d9026f5c8bbdb425908ccdf","original_commit_id":"d598b08ff679aff91d9026f5c8bbdb425908ccdf","user":{"login":"gconnell","id":1211830,"avatar_url":"https://avatars.githubusercontent.com/u/1211830?v=3","gravatar_id":"","url":"https://api.github.com/users/gconnell","html_url":"https://github.com/gconnell","followers_url":"https://api.github.com/users/gconnell/followers","following_url":"https://api.github.com/users/gconnell/following{/other_user}","gists_url":"https://api.github.com/users/gconnell/gists{/gist_id}","starred_url":"https://api.github.com/users/gconnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gconnell/subscriptions","organizations_url":"https://api.github.com/users/gconnell/orgs","repos_url":"https://api.github.com/users/gconnell/repos","events_url":"https://api.github.com/users/gconnell/events{/privacy}","received_events_url":"https://api.github.com/users/gconnell/received_events","type":"User","site_admin":false},"body":"Little nit:  could you move the copyright to the top and put this down below it?","created_at":"2015-06-17T15:41:15Z","updated_at":"2015-06-17T15:41:15Z","html_url":"https://github.com/google/gopacket/pull/88#discussion_r32640689","pull_request_url":"https://api.github.com/repos/google/gopacket/pulls/88","_links":{"self":{"href":"https://api.github.com/repos/google/gopacket/pulls/comments/32640689"},"html":{"href":"https://github.com/google/gopacket/pull/88#discussion_r32640689"},"pull_request":{"href":"https://api.github.com/repos/google/gopacket/pulls/88"}}},"pull_request":{"url":"https://api.github.com/repos/google/gopacket/pulls/88","id":37849968,"html_url":"https://github.com/google/gopacket/pull/88","diff_url":"https://github.com/google/gopacket/pull/88.diff","patch_url":"https://github.com/google/gopacket/pull/88.patch","issue_url":"https://api.github.com/repos/google/gopacket/issues/88","number":88,"state":"open","locked":false,"title":"Add rough draft BSD BPF sniffer API","user":{"login":"david415","id":50611,"avatar_url":"https://avatars.githubusercontent.com/u/50611?v=3","gravatar_id":"","url":"https://api.github.com/users/david415","html_url":"https://github.com/david415","followers_url":"https://api.github.com/users/david415/followers","following_url":"https://api.github.com/users/david415/following{/other_user}","gists_url":"https://api.github.com/users/david415/gists{/gist_id}","starred_url":"https://api.github.com/users/david415/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david415/subscriptions","organizations_url":"https://api.github.com/users/david415/orgs","repos_url":"https://api.github.com/users/david415/repos","events_url":"https://api.github.com/users/david415/events{/privacy}","received_events_url":"https://api.github.com/users/david415/received_events","type":"User","site_admin":false},"body":"OK... here's the code. I haven't done a smoke test lately but last time I tested it worked on OpenBSD, FreeBSD and NetBSD.\r\n\r\nMaybe we should be calling SetBpfBuflen instead of using the default. OpenBSD and NetBSD both default to a BPF bufLen of 32767 but FreeBSD uses 4096... obviously having a larger bufLen should improve performance.\r\n\r\n","created_at":"2015-06-16T22:45:14Z","updated_at":"2015-06-17T15:41:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"15022cf7b66894ff20c9df66da7a55bdc1a7c66d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/google/gopacket/pulls/88/commits","review_comments_url":"https://api.github.com/repos/google/gopacket/pulls/88/comments","review_comment_url":"https://api.github.com/repos/google/gopacket/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/gopacket/issues/88/comments","statuses_url":"https://api.github.com/repos/google/gopacket/statuses/d598b08ff679aff91d9026f5c8bbdb425908ccdf","head":{"label":"david415:87.add-basic-bsd-bpf-sniffer.1","ref":"87.add-basic-bsd-bpf-sniffer.1","sha":"d598b08ff679aff91d9026f5c8bbdb425908ccdf","user":{"login":"david415","id":50611,"avatar_url":"https://avatars.githubusercontent.com/u/50611?v=3","gravatar_id":"","url":"https://api.github.com/users/david415","html_url":"https://github.com/david415","followers_url":"https://api.github.com/users/david415/followers","following_url":"https://api.github.com/users/david415/following{/other_user}","gists_url":"https://api.github.com/users/david415/gists{/gist_id}","starred_url":"https://api.github.com/users/david415/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david415/subscriptions","organizations_url":"https://api.github.com/users/david415/orgs","repos_url":"https://api.github.com/users/david415/repos","events_url":"https://api.github.com/users/david415/events{/privacy}","received_events_url":"https://api.github.com/users/david415/received_events","type":"User","site_admin":false},"repo":{"id":37559505,"name":"gopacket","full_name":"david415/gopacket","owner":{"login":"david415","id":50611,"avatar_url":"https://avatars.githubusercontent.com/u/50611?v=3","gravatar_id":"","url":"https://api.github.com/users/david415","html_url":"https://github.com/david415","followers_url":"https://api.github.com/users/david415/followers","following_url":"https://api.github.com/users/david415/following{/other_user}","gists_url":"https://api.github.com/users/david415/gists{/gist_id}","starred_url":"https://api.github.com/users/david415/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david415/subscriptions","organizations_url":"https://api.github.com/users/david415/orgs","repos_url":"https://api.github.com/users/david415/repos","events_url":"https://api.github.com/users/david415/events{/privacy}","received_events_url":"https://api.github.com/users/david415/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/david415/gopacket","description":"Provides packet processing capabilities for Go","fork":true,"url":"https://api.github.com/repos/david415/gopacket","forks_url":"https://api.github.com/repos/david415/gopacket/forks","keys_url":"https://api.github.com/repos/david415/gopacket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/david415/gopacket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/david415/gopacket/teams","hooks_url":"https://api.github.com/repos/david415/gopacket/hooks","issue_events_url":"https://api.github.com/repos/david415/gopacket/issues/events{/number}","events_url":"https://api.github.com/repos/david415/gopacket/events","assignees_url":"https://api.github.com/repos/david415/gopacket/assignees{/user}","branches_url":"https://api.github.com/repos/david415/gopacket/branches{/branch}","tags_url":"https://api.github.com/repos/david415/gopacket/tags","blobs_url":"https://api.github.com/repos/david415/gopacket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/david415/gopacket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/david415/gopacket/git/refs{/sha}","trees_url":"https://api.github.com/repos/david415/gopacket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/david415/gopacket/statuses/{sha}","languages_url":"https://api.github.com/repos/david415/gopacket/languages","stargazers_url":"https://api.github.com/repos/david415/gopacket/stargazers","contributors_url":"https://api.github.com/repos/david415/gopacket/contributors","subscribers_url":"https://api.github.com/repos/david415/gopacket/subscribers","subscription_url":"https://api.github.com/repos/david415/gopacket/subscription","commits_url":"https://api.github.com/repos/david415/gopacket/commits{/sha}","git_commits_url":"https://api.github.com/repos/david415/gopacket/git/commits{/sha}","comments_url":"https://api.github.com/repos/david415/gopacket/comments{/number}","issue_comment_url":"https://api.github.com/repos/david415/gopacket/issues/comments{/number}","contents_url":"https://api.github.com/repos/david415/gopacket/contents/{+path}","compare_url":"https://api.github.com/repos/david415/gopacket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/david415/gopacket/merges","archive_url":"https://api.github.com/repos/david415/gopacket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/david415/gopacket/downloads","issues_url":"https://api.github.com/repos/david415/gopacket/issues{/number}","pulls_url":"https://api.github.com/repos/david415/gopacket/pulls{/number}","milestones_url":"https://api.github.com/repos/david415/gopacket/milestones{/number}","notifications_url":"https://api.github.com/repos/david415/gopacket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/david415/gopacket/labels{/name}","releases_url":"https://api.github.com/repos/david415/gopacket/releases{/id}","created_at":"2015-06-16T22:32:30Z","updated_at":"2015-06-16T22:32:31Z","pushed_at":"2015-06-17T07:49:26Z","git_url":"git://github.com/david415/gopacket.git","ssh_url":"git@github.com:david415/gopacket.git","clone_url":"https://github.com/david415/gopacket.git","svn_url":"https://github.com/david415/gopacket","homepage":"","size":12437,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":false,"has_wiki":false,"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":"google:master","ref":"master","sha":"6793422236fe607f7d48dda70fe642855e71b82f","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":32351944,"name":"gopacket","full_name":"google/gopacket","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/gopacket","description":"Provides packet processing capabilities for Go","fork":false,"url":"https://api.github.com/repos/google/gopacket","forks_url":"https://api.github.com/repos/google/gopacket/forks","keys_url":"https://api.github.com/repos/google/gopacket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/gopacket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/gopacket/teams","hooks_url":"https://api.github.com/repos/google/gopacket/hooks","issue_events_url":"https://api.github.com/repos/google/gopacket/issues/events{/number}","events_url":"https://api.github.com/repos/google/gopacket/events","assignees_url":"https://api.github.com/repos/google/gopacket/assignees{/user}","branches_url":"https://api.github.com/repos/google/gopacket/branches{/branch}","tags_url":"https://api.github.com/repos/google/gopacket/tags","blobs_url":"https://api.github.com/repos/google/gopacket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/gopacket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/gopacket/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/gopacket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/gopacket/statuses/{sha}","languages_url":"https://api.github.com/repos/google/gopacket/languages","stargazers_url":"https://api.github.com/repos/google/gopacket/stargazers","contributors_url":"https://api.github.com/repos/google/gopacket/contributors","subscribers_url":"https://api.github.com/repos/google/gopacket/subscribers","subscription_url":"https://api.github.com/repos/google/gopacket/subscription","commits_url":"https://api.github.com/repos/google/gopacket/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/gopacket/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/gopacket/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/gopacket/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/gopacket/contents/{+path}","compare_url":"https://api.github.com/repos/google/gopacket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/gopacket/merges","archive_url":"https://api.github.com/repos/google/gopacket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/gopacket/downloads","issues_url":"https://api.github.com/repos/google/gopacket/issues{/number}","pulls_url":"https://api.github.com/repos/google/gopacket/pulls{/number}","milestones_url":"https://api.github.com/repos/google/gopacket/milestones{/number}","notifications_url":"https://api.github.com/repos/google/gopacket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/gopacket/labels{/name}","releases_url":"https://api.github.com/repos/google/gopacket/releases{/id}","created_at":"2015-03-16T20:46:00Z","updated_at":"2015-06-17T13:55:53Z","pushed_at":"2015-06-17T07:49:26Z","git_url":"git://github.com/google/gopacket.git","ssh_url":"git@github.com:google/gopacket.git","clone_url":"https://github.com/google/gopacket.git","svn_url":"https://github.com/google/gopacket","homepage":"","size":12437,"stargazers_count":103,"watchers_count":103,"language":"Go","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":12,"forks":25,"open_issues":12,"watchers":103,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/gopacket/pulls/88"},"html":{"href":"https://github.com/google/gopacket/pull/88"},"issue":{"href":"https://api.github.com/repos/google/gopacket/issues/88"},"comments":{"href":"https://api.github.com/repos/google/gopacket/issues/88/comments"},"review_comments":{"href":"https://api.github.com/repos/google/gopacket/pulls/88/comments"},"review_comment":{"href":"https://api.github.com/repos/google/gopacket/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/gopacket/pulls/88/commits"},"statuses":{"href":"https://api.github.com/repos/google/gopacket/statuses/d598b08ff679aff91d9026f5c8bbdb425908ccdf"}}}}