| $input_54052 > 77 | 4834 | | mksocs() |
| | 4835 | | { |
| $input_54076 > 77 | 4836 | | struct hostd *hp = hosts->ht_hosts[hosts->ht_local]; |
| $input_54100 > 77 | 4837 | | struct hostd *hp0 = hosts->ht_hosts[0]; |
| | 4838 | | struct sockaddr_in sin; |
| | 4839 | | char buf[128]; |
| | 4840 | | char *sfn; |
| | 4841 | | #ifndef WIN32 |
| | 4842 | | int d; |
| | 4843 | | #else |
| | 4844 | | HANDLE d; |
| | 4845 | | int e=0; |
| | 4846 | | #endif |
| | 4847 | | #ifndef NOSOCKOPT |
| | | | ... |
| | 4865 | | #endif |
| | 4866 | | #ifdef IMA_BEOLIN |
| | 4867 | | struct hostent *hostaddr; |
| | 4868 | | #endif |
| | 4869 | | short tmpp; |
| | 4870 | | |
| | 4871 | | |
| | 4872 | | |
| | 4873 | | |
| | 4874 | | |
| $input_54124 > 77 | 4875 | | if ((netsock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
|
| | 4876 | | pvmlogperror("mksocs() socket netsock"); |
| | 4877 | | return 1; |
| | 4878 | | } |
| | 4879 | | |
| $input_54292 > 77 | 4880 | | p = getenv("PVMNETSOCKPORT"); |
| | 4881 | | |
| $input_54348 > 77 | 4882 | | tmpp = (p) ? atoi(p) : 0; |
| | 4883 | | |
| | 4884 | | hp->hd_sad.sin_port = htons(tmpp);
|
| | 4885 | | |
| | 4886 | | do |
| | 4887 | | { |
| | 4888 | | oslen = sizeof(hp->hd_sad); |
| | 4889 | | if ((cc=bind(netsock, (struct sockaddr*)&hp->hd_sad, oslen)) |
| | 4890 | | == -1) |
| | 4891 | | { |
| | 4892 | | if (p) { |
| | 4893 | | tmpp++; |
| | 4894 | | hp->hd_sad.sin_port = htons(tmpp);
|
| | 4895 | | } else { |
| | 4896 | | pvmlogperror("mksocs() bind netsock"); |
| | 4897 | | return 1; |
| | 4898 | | } |
| | 4899 | | } |
| | 4900 | | } |
| | 4901 | | while ( cc == -1 && p && hp->hd_sad.sin_port < 65535 ); |
| | 4902 | | |
| | 4903 | | if ( cc == -1 ) { |
| | 4904 | | pvmlogperror("mksocs() bind netsock"); |
| | 4905 | | return 1; |
| | 4906 | | } |
| | 4907 | | |
| | 4908 | | oslen = sizeof(hp->hd_sad); |
| | 4909 | | if (getsockname(netsock, (struct sockaddr*)&hp->hd_sad, &oslen) == -1) { |
| | 4910 | | pvmlogperror("mksocs() getsockname netsock"); |
| | 4911 | | return 1; |
| | 4912 | | } |
| | 4913 | | |
| | 4914 | | |
| | 4915 | | |
| | 4916 | | |
| | 4917 | | |
| | 4918 | | if ((ppnetsock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
|
| | 4919 | | pvmlogperror("mksocs() socket ppnetsock"); |
| | 4920 | | return 1; |
| | 4921 | | } |
| | 4922 | | |
| | 4923 | | hp0->hd_sad.sin_port = 0; |
| | 4924 | | oslen = sizeof(hp0->hd_sad); |
| | 4925 | | if (bind(ppnetsock, (struct sockaddr*)&hp0->hd_sad, oslen) == -1) { |
| | 4926 | | pvmlogperror("mksocs() bind ppnetsock"); |
| | 4927 | | return 1; |
| | 4928 | | } |
| | 4929 | | oslen = sizeof(hp0->hd_sad); |
| | 4930 | | if (getsockname(ppnetsock, (struct sockaddr*)&hp0->hd_sad, &oslen) == -1) { |
| | 4931 | | pvmlogperror("mksocs() getsockname ppnetsock"); |
| | 4932 | | return 1; |
| | 4933 | | } |
| | 4934 | | |
| | 4935 | | |
| | 4936 | | |
| | 4937 | | |
| | 4938 | | |
| | 4939 | | #ifdef NOUNIXDOM |
| | 4940 | | if ((loclsock = socket(AF_INET, SOCK_STREAM, 0)) == -1) { |
| | | | ... |
| | 5022 | | || setsockopt(ppnetsock, SOL_SOCKET, SO_RCVBUF, |
| | 5023 | | (char*)&bsz, sizeof(bsz)) == -1) { |
| | 5024 | | pvmlogperror("mksocs() setsockopt"); |
| | 5025 | | return 1; |
| | 5026 | | } |
| | 5027 | | #endif |
| | 5028 | | |
| | 5029 | | p = inadport_hex(&sin); |
| | 5030 | | |
| | 5031 | | #else |
| | 5032 | | if ((loclsock = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
|
| | 5033 | | pvmlogperror("mksocs() socket loclsock"); |
| | 5034 | | return 1; |
| | 5035 | | } |
| | 5036 | | |
| | 5037 | | BZERO((char*)&uns, sizeof(uns));
|
| | 5038 | | uns.sun_family = AF_UNIX;
|
| $input_12 > 77 | 5039 | | spath[0] = 0; |