Lines Matching refs:port
121 unsigned FAST_FUNC bb_lookup_port(const char *port, const char *protocol, unsigned port_nr) in bb_lookup_port() argument
123 if (port) { in bb_lookup_port()
124 port_nr = bb_strtou(port, NULL, 10); in bb_lookup_port()
126 struct servent *tserv = getservbyname(port, protocol); in bb_lookup_port()
128 bb_error_msg_and_die("bad port '%s'", port); in bb_lookup_port()
153 void FAST_FUNC set_nport(struct sockaddr *sa, unsigned port) in set_nport() argument
158 sin6->sin6_port = port; in set_nport()
164 sin->sin_port = port; in set_nport()
177 const char *host, int port,
232 port = bb_strtou(cp, NULL, 10);
233 if (errno || (unsigned)port > 0xffff) {
304 set_nport(&r->u.sa, htons(port));
311 #define str2sockaddr(host, port, af, ai_flags) str2sockaddr(host, port, ai_flags) argument
315 len_and_sockaddr* FAST_FUNC host_and_af2sockaddr(const char *host, int port, sa_family_t af) in host_and_af2sockaddr() argument
317 return str2sockaddr(host, port, af, 0); in host_and_af2sockaddr()
320 len_and_sockaddr* FAST_FUNC xhost_and_af2sockaddr(const char *host, int port, sa_family_t af) in xhost_and_af2sockaddr() argument
322 return str2sockaddr(host, port, af, DIE_ON_ERROR); in xhost_and_af2sockaddr()
326 len_and_sockaddr* FAST_FUNC host2sockaddr(const char *host, int port) in host2sockaddr() argument
328 return str2sockaddr(host, port, AF_UNSPEC, 0); in host2sockaddr()
331 len_and_sockaddr* FAST_FUNC xhost2sockaddr(const char *host, int port) in xhost2sockaddr() argument
333 return str2sockaddr(host, port, AF_UNSPEC, DIE_ON_ERROR); in xhost2sockaddr()
336 len_and_sockaddr* FAST_FUNC xdotted2sockaddr(const char *host, int port) in xdotted2sockaddr() argument
338 return str2sockaddr(host, port, AF_UNSPEC, AI_NUMERICHOST | DIE_ON_ERROR); in xdotted2sockaddr()
381 static int create_and_bind_or_die(const char *bindaddr, int port, int sock_type) in create_and_bind_or_die() argument
387 lsa = xdotted2sockaddr(bindaddr, port); in create_and_bind_or_die()
392 set_nport(&lsa->u.sa, htons(port)); in create_and_bind_or_die()
400 int FAST_FUNC create_and_bind_stream_or_die(const char *bindaddr, int port) in create_and_bind_stream_or_die() argument
402 return create_and_bind_or_die(bindaddr, port, SOCK_STREAM); in create_and_bind_stream_or_die()
405 int FAST_FUNC create_and_bind_dgram_or_die(const char *bindaddr, int port) in create_and_bind_dgram_or_die() argument
407 return create_and_bind_or_die(bindaddr, port, SOCK_DGRAM); in create_and_bind_dgram_or_die()
447 int FAST_FUNC create_and_connect_stream_or_die(const char *peer, int port) in create_and_connect_stream_or_die() argument
452 lsa = xhost2sockaddr(peer, port); in create_and_connect_stream_or_die()