(clientData, interp, argc, argv)
| 2077 | |
| 2078 | struct hostent * hostdesc; |
| 2079 | |
| 2080 | if (argc != 1) { |
| 2081 | Tcl_AppendResult (interp, "wrong # args: should be \"", argv [-1], " ", |
| 2082 | argv [0], "\"", (char *) NULL); |
| 2083 | return TCL_ERROR; |
| 2084 | } |
| 2085 | |
| 2086 | hostdesc = gethostbyaddr ((char *) &(client -> peeraddr.sin_addr.s_addr), |
| 2087 | sizeof (client -> peeraddr.sin_addr.s_addr), |
| 2088 | AF_INET); |
| 2089 | |
| 2090 | if (hostdesc != (struct hostent *) NULL) { |
| 2091 | Tcl_SetResult (interp, hostdesc -> h_name, TCL_VOLATILE); |
| 2092 | } else { |
| 2093 | Tcl_SetResult (interp, inet_ntoa (client -> peeraddr.sin_addr), |
| 2094 | TCL_VOLATILE); |
| 2095 | } |
| 2096 | |
| 2097 | return TCL_OK; |
| 2098 | } |
| 2099 | |
| 2100 |
no test coverage detected