mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
net_getservbyport() - Get name of TCP service
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1134 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
0ef53540c0
commit
babf7c77ac
@ -515,6 +515,15 @@ int net_hosterror_notfound(int error)
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Get name of TCP service */
|
||||
char *net_getservbyport(int port)
|
||||
{
|
||||
struct servent *entry;
|
||||
|
||||
entry = getservbyport(htons((unsigned short) port), "tcp");
|
||||
return entry == NULL ? NULL : entry->s_name;
|
||||
}
|
||||
|
||||
int is_ipv4_address(const char *host)
|
||||
{
|
||||
while (*host != '\0') {
|
||||
|
@ -73,6 +73,9 @@ int net_host2ip(const char *host, IPADDR *ip);
|
||||
/* Get socket error */
|
||||
int net_geterror(GIOChannel *handle);
|
||||
|
||||
/* Get name of TCP service */
|
||||
char *net_getservbyport(int port);
|
||||
|
||||
int is_ipv4_address(const char *host);
|
||||
int is_ipv6_address(const char *host);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user