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:
12
winnet.c
12
winnet.c
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user