1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-06 22:12:47 -05:00

More preparatory work: remove the <windows.h> include from lots of

source files in which it's no longer required (it was previously
required in anything that included <putty.h>, but not any more).
Also moved a couple of stray bits of exposed WinSock back into
winnet.c (getservbyname from ssh.c and AF_INET from proxy.c).

[originally from svn r2160]
This commit is contained in:
Simon Tatham
2002-10-30 17:57:31 +00:00
parent 78c69239f1
commit 52bdffbfe0
14 changed files with 51 additions and 47 deletions

View File

@ -370,7 +370,7 @@ void sk_getaddr(SockAddr addr, char *buf, int buflen)
int sk_addrtype(SockAddr addr)
{
return addr->family;
return (addr->family == AF_INET ? ADDRTYPE_IPV4 : ADDRTYPE_IPV6);
}
void sk_addrcopy(SockAddr addr, char *buf)
@ -1138,3 +1138,13 @@ SOCKET next_socket(int *state)
Actual_Socket s = index234(sktree, (*state)++);
return s ? s->s : INVALID_SOCKET;
}
int net_service_lookup(char *service)
{
struct servent *se;
se = getservbyname(service, NULL);
if (se != NULL)
return ntohs(se->s_port);
else
return 0;
}