{"action":"opened","number":2006,"pull_request":{"url":"https://api.github.com/repos/mono/mono/pulls/2006","id":43662404,"html_url":"https://github.com/mono/mono/pull/2006","diff_url":"https://github.com/mono/mono/pull/2006.diff","patch_url":"https://github.com/mono/mono/pull/2006.patch","issue_url":"https://api.github.com/repos/mono/mono/issues/2006","number":2006,"state":"open","locked":false,"title":"[Mono.Posix] Add wrappers for struct sockaddr_*","user":{"login":"steffen-kiess","id":947515,"avatar_url":"https://avatars.githubusercontent.com/u/947515?v=3","gravatar_id":"","url":"https://api.github.com/users/steffen-kiess","html_url":"https://github.com/steffen-kiess","followers_url":"https://api.github.com/users/steffen-kiess/followers","following_url":"https://api.github.com/users/steffen-kiess/following{/other_user}","gists_url":"https://api.github.com/users/steffen-kiess/gists{/gist_id}","starred_url":"https://api.github.com/users/steffen-kiess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steffen-kiess/subscriptions","organizations_url":"https://api.github.com/users/steffen-kiess/orgs","repos_url":"https://api.github.com/users/steffen-kiess/repos","events_url":"https://api.github.com/users/steffen-kiess/events{/privacy}","received_events_url":"https://api.github.com/users/steffen-kiess/received_events","type":"User","site_admin":false},"body":"Add wrappers for the sockaddr_* structures and add the syscalls using these\r\nstructures (bind(), accept(), ...).\r\n\r\nThis commit is the second part of https://github.com/mono/mono/pull/1977\r\n\r\nThe interface for Sockaddr* should now be easier to use (and closer to C interface).\r\n\r\nThe code also should be free of heap memory allocations for the most important cases. (In particular passing a SockaddrIn or SockaddrIn6 to sendmsg() or recvmsg()). Currently the code uses alloca() to allocate memory in sys-socket.c, if mono supports platforms without alloca() I can add a fallback to malloc(). (The alloca() is needed to allocate the native structure which has a length not known at compile time.)\r\n\r\nAll functions return ENOBUFS when the size of the returned buffer is incorrect. (I.e. if the result has to be truncated or the data is to short for an SockaddrIn or SockaddrIn6.)\r\n\r\nRegarding the byte order for the port number,  jonpryor wrote:\r\n\r\n> We should not automagically fix to/from network byte order, as even in other places of .NET you need to explicitly convert to/from network byte order, and \"magic\" here will just sow confusion. A NetworkUInt16 type is an interesting idea, but in the interests of simplicity and consistency, let's not pursue that idea.\r\n\r\nI cannot find anywhere in .NET where you have to do the byte order conversion manually. OTOH the way it is now (without automatic conversion) it is closer to the C API.\r\n\r\nThis pull request requires changes to create-native-map, see https://github.com/mono/mono-tools/pull/44\r\n","created_at":"2015-08-28T19:20:25Z","updated_at":"2015-08-28T19:20:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mono/mono/pulls/2006/commits","review_comments_url":"https://api.github.com/repos/mono/mono/pulls/2006/comments","review_comment_url":"https://api.github.com/repos/mono/mono/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mono/mono/issues/2006/comments","statuses_url":"https://api.github.com/repos/mono/mono/statuses/1c2ca7ac8f30ce0ba8b951a57b20c9b00e2b793b","head":{"label":"steffen-kiess:posix-sockets-2","ref":"posix-sockets-2","sha":"1c2ca7ac8f30ce0ba8b951a57b20c9b00e2b793b","user":{"login":"steffen-kiess","id":947515,"avatar_url":"https://avatars.githubusercontent.com/u/947515?v=3","gravatar_id":"","url":"https://api.github.com/users/steffen-kiess","html_url":"https://github.com/steffen-kiess","followers_url":"https://api.github.com/users/steffen-kiess/followers","following_url":"https://api.github.com/users/steffen-kiess/following{/other_user}","gists_url":"https://api.github.com/users/steffen-kiess/gists{/gist_id}","starred_url":"https://api.github.com/users/steffen-kiess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steffen-kiess/subscriptions","organizations_url":"https://api.github.com/users/steffen-kiess/orgs","repos_url":"https://api.github.com/users/steffen-kiess/repos","events_url":"https://api.github.com/users/steffen-kiess/events{/privacy}","received_events_url":"https://api.github.com/users/steffen-kiess/received_events","type":"User","site_admin":false},"repo":{"id":3240307,"name":"mono","full_name":"steffen-kiess/mono","owner":{"login":"steffen-kiess","id":947515,"avatar_url":"https://avatars.githubusercontent.com/u/947515?v=3","gravatar_id":"","url":"https://api.github.com/users/steffen-kiess","html_url":"https://github.com/steffen-kiess","followers_url":"https://api.github.com/users/steffen-kiess/followers","following_url":"https://api.github.com/users/steffen-kiess/following{/other_user}","gists_url":"https://api.github.com/users/steffen-kiess/gists{/gist_id}","starred_url":"https://api.github.com/users/steffen-kiess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steffen-kiess/subscriptions","organizations_url":"https://api.github.com/users/steffen-kiess/orgs","repos_url":"https://api.github.com/users/steffen-kiess/repos","events_url":"https://api.github.com/users/steffen-kiess/events{/privacy}","received_events_url":"https://api.github.com/users/steffen-kiess/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/steffen-kiess/mono","description":"Mono open source ECMA CLI, C# and .NET implementation.","fork":true,"url":"https://api.github.com/repos/steffen-kiess/mono","forks_url":"https://api.github.com/repos/steffen-kiess/mono/forks","keys_url":"https://api.github.com/repos/steffen-kiess/mono/keys{/key_id}","collaborators_url":"https://api.github.com/repos/steffen-kiess/mono/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/steffen-kiess/mono/teams","hooks_url":"https://api.github.com/repos/steffen-kiess/mono/hooks","issue_events_url":"https://api.github.com/repos/steffen-kiess/mono/issues/events{/number}","events_url":"https://api.github.com/repos/steffen-kiess/mono/events","assignees_url":"https://api.github.com/repos/steffen-kiess/mono/assignees{/user}","branches_url":"https://api.github.com/repos/steffen-kiess/mono/branches{/branch}","tags_url":"https://api.github.com/repos/steffen-kiess/mono/tags","blobs_url":"https://api.github.com/repos/steffen-kiess/mono/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/steffen-kiess/mono/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/steffen-kiess/mono/git/refs{/sha}","trees_url":"https://api.github.com/repos/steffen-kiess/mono/git/trees{/sha}","statuses_url":"https://api.github.com/repos/steffen-kiess/mono/statuses/{sha}","languages_url":"https://api.github.com/repos/steffen-kiess/mono/languages","stargazers_url":"https://api.github.com/repos/steffen-kiess/mono/stargazers","contributors_url":"https://api.github.com/repos/steffen-kiess/mono/contributors","subscribers_url":"https://api.github.com/repos/steffen-kiess/mono/subscribers","subscription_url":"https://api.github.com/repos/steffen-kiess/mono/subscription","commits_url":"https://api.github.com/repos/steffen-kiess/mono/commits{/sha}","git_commits_url":"https://api.github.com/repos/steffen-kiess/mono/git/commits{/sha}","comments_url":"https://api.github.com/repos/steffen-kiess/mono/comments{/number}","issue_comment_url":"https://api.github.com/repos/steffen-kiess/mono/issues/comments{/number}","contents_url":"https://api.github.com/repos/steffen-kiess/mono/contents/{+path}","compare_url":"https://api.github.com/repos/steffen-kiess/mono/compare/{base}...{head}","merges_url":"https://api.github.com/repos/steffen-kiess/mono/merges","archive_url":"https://api.github.com/repos/steffen-kiess/mono/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/steffen-kiess/mono/downloads","issues_url":"https://api.github.com/repos/steffen-kiess/mono/issues{/number}","pulls_url":"https://api.github.com/repos/steffen-kiess/mono/pulls{/number}","milestones_url":"https://api.github.com/repos/steffen-kiess/mono/milestones{/number}","notifications_url":"https://api.github.com/repos/steffen-kiess/mono/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/steffen-kiess/mono/labels{/name}","releases_url":"https://api.github.com/repos/steffen-kiess/mono/releases{/id}","created_at":"2012-01-22T15:46:26Z","updated_at":"2015-08-24T16:56:09Z","pushed_at":"2015-08-28T19:10:14Z","git_url":"git://github.com/steffen-kiess/mono.git","ssh_url":"git@github.com:steffen-kiess/mono.git","clone_url":"https://github.com/steffen-kiess/mono.git","svn_url":"https://github.com/steffen-kiess/mono","homepage":"http://www.mono-project.com/","size":434539,"stargazers_count":1,"watchers_count":1,"language":"C#","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":1,"default_branch":"master"}},"base":{"label":"mono:master","ref":"master","sha":"a3e273b98b14bc2098b9f6171a0629bc94d92ef0","user":{"login":"mono","id":53395,"avatar_url":"https://avatars.githubusercontent.com/u/53395?v=3","gravatar_id":"","url":"https://api.github.com/users/mono","html_url":"https://github.com/mono","followers_url":"https://api.github.com/users/mono/followers","following_url":"https://api.github.com/users/mono/following{/other_user}","gists_url":"https://api.github.com/users/mono/gists{/gist_id}","starred_url":"https://api.github.com/users/mono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mono/subscriptions","organizations_url":"https://api.github.com/users/mono/orgs","repos_url":"https://api.github.com/users/mono/repos","events_url":"https://api.github.com/users/mono/events{/privacy}","received_events_url":"https://api.github.com/users/mono/received_events","type":"Organization","site_admin":false},"repo":{"id":791611,"name":"mono","full_name":"mono/mono","owner":{"login":"mono","id":53395,"avatar_url":"https://avatars.githubusercontent.com/u/53395?v=3","gravatar_id":"","url":"https://api.github.com/users/mono","html_url":"https://github.com/mono","followers_url":"https://api.github.com/users/mono/followers","following_url":"https://api.github.com/users/mono/following{/other_user}","gists_url":"https://api.github.com/users/mono/gists{/gist_id}","starred_url":"https://api.github.com/users/mono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mono/subscriptions","organizations_url":"https://api.github.com/users/mono/orgs","repos_url":"https://api.github.com/users/mono/repos","events_url":"https://api.github.com/users/mono/events{/privacy}","received_events_url":"https://api.github.com/users/mono/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mono/mono","description":"Mono open source ECMA CLI, C# and .NET implementation.","fork":false,"url":"https://api.github.com/repos/mono/mono","forks_url":"https://api.github.com/repos/mono/mono/forks","keys_url":"https://api.github.com/repos/mono/mono/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mono/mono/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mono/mono/teams","hooks_url":"https://api.github.com/repos/mono/mono/hooks","issue_events_url":"https://api.github.com/repos/mono/mono/issues/events{/number}","events_url":"https://api.github.com/repos/mono/mono/events","assignees_url":"https://api.github.com/repos/mono/mono/assignees{/user}","branches_url":"https://api.github.com/repos/mono/mono/branches{/branch}","tags_url":"https://api.github.com/repos/mono/mono/tags","blobs_url":"https://api.github.com/repos/mono/mono/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mono/mono/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mono/mono/git/refs{/sha}","trees_url":"https://api.github.com/repos/mono/mono/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mono/mono/statuses/{sha}","languages_url":"https://api.github.com/repos/mono/mono/languages","stargazers_url":"https://api.github.com/repos/mono/mono/stargazers","contributors_url":"https://api.github.com/repos/mono/mono/contributors","subscribers_url":"https://api.github.com/repos/mono/mono/subscribers","subscription_url":"https://api.github.com/repos/mono/mono/subscription","commits_url":"https://api.github.com/repos/mono/mono/commits{/sha}","git_commits_url":"https://api.github.com/repos/mono/mono/git/commits{/sha}","comments_url":"https://api.github.com/repos/mono/mono/comments{/number}","issue_comment_url":"https://api.github.com/repos/mono/mono/issues/comments{/number}","contents_url":"https://api.github.com/repos/mono/mono/contents/{+path}","compare_url":"https://api.github.com/repos/mono/mono/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mono/mono/merges","archive_url":"https://api.github.com/repos/mono/mono/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mono/mono/downloads","issues_url":"https://api.github.com/repos/mono/mono/issues{/number}","pulls_url":"https://api.github.com/repos/mono/mono/pulls{/number}","milestones_url":"https://api.github.com/repos/mono/mono/milestones{/number}","notifications_url":"https://api.github.com/repos/mono/mono/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mono/mono/labels{/name}","releases_url":"https://api.github.com/repos/mono/mono/releases{/id}","created_at":"2010-07-22T18:06:36Z","updated_at":"2015-08-27T20:29:49Z","pushed_at":"2015-08-28T18:53:14Z","git_url":"git://github.com/mono/mono.git","ssh_url":"git@github.com:mono/mono.git","clone_url":"https://github.com/mono/mono.git","svn_url":"https://github.com/mono/mono","homepage":"http://www.mono-project.com/","size":1485681,"stargazers_count":3760,"watchers_count":3760,"language":"C#","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1873,"mirror_url":null,"open_issues_count":118,"forks":1873,"open_issues":118,"watchers":3760,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mono/mono/pulls/2006"},"html":{"href":"https://github.com/mono/mono/pull/2006"},"issue":{"href":"https://api.github.com/repos/mono/mono/issues/2006"},"comments":{"href":"https://api.github.com/repos/mono/mono/issues/2006/comments"},"review_comments":{"href":"https://api.github.com/repos/mono/mono/pulls/2006/comments"},"review_comment":{"href":"https://api.github.com/repos/mono/mono/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mono/mono/pulls/2006/commits"},"statuses":{"href":"https://api.github.com/repos/mono/mono/statuses/1c2ca7ac8f30ce0ba8b951a57b20c9b00e2b793b"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":2015,"deletions":12,"changed_files":10}}