Lines Matching defs:port
81 static char *lookup_service(unsigned short port, unsigned int flags, char *buf,
97 unsigned short port = 0;
103 port = addr->sin_port;
107 port = addr6->sin6_port;
124 lookup_service((unsigned short)(port & 0xffff), flags, buf, sizeof(buf));
156 service = lookup_service((unsigned short)(port & 0xffff), flags, srvbuf,
274 static char *lookup_service(unsigned short port, unsigned int flags, char *buf,
286 if (port) {
304 if (getservbyport_r(port, proto, &se, (void *)tmpbuf, sizeof(tmpbuf),
309 sep = getservbyport_r(port, proto, &se, (void *)tmpbuf, sizeof(tmpbuf));
311 if (getservbyport_r(port, proto, &se, (void *)tmpbuf) != 0) {
316 sep = getservbyport(port, proto);
321 sep = getservbyport(port, (char *)proto);
323 sep = getservbyport(port, proto);
331 /* get port as a string */
332 snprintf(tmpbuf, sizeof(tmpbuf), "%u", (unsigned int)ntohs(port));