Lines Matching refs:addr
102 tcp_addr(const char *addr, int defport, struct sockaddr_storage *sap)
112 if (addr == NULL)
121 if (strncasecmp(addr, "tcp4://", 7) == 0) {
122 addr += 7;
124 } else if (strncasecmp(addr, "tcp6://", 7) == 0) {
125 addr += 7;
127 } else if (strncasecmp(addr, "tcp://", 6) == 0) {
128 addr += 6;
146 if (strchr(addr, ':') != strrchr(addr, ':')) {
147 if (addr[0] == '[')
148 pp = strrchr(addr, ':');
150 pp = strrchr(addr, ':');
163 if (strlcpy(iporhost, addr, size) >= size)
165 } else if (addr[0] == '[' && pp[-1] == ']') {
166 size = (size_t)(pp - addr - 2 + 1);
169 (void)strlcpy(iporhost, addr + 1, size);
171 size = (size_t)(pp - addr + 1);
174 (void)strlcpy(iporhost, addr, size);
194 tcp_setup_new(const char *addr, int side, void **ctxp)
199 PJDLOG_ASSERT(addr != NULL);
209 if ((ret = tcp_addr(addr, PROTO_TCP_DEFAULT_PORT, &tctx->tc_sa)) != 0) {
409 tcp_server(const char *addr, void **ctxp)
414 ret = tcp_setup_new(addr, TCP_SIDE_SERVER_LISTEN, ctxp);
522 tcp_address_match(const void *ctx, const char *addr)
531 if (tcp_addr(addr, PROTO_TCP_DEFAULT_PORT, &sa1) != 0)
568 tcp_local_address(const void *ctx, char *addr, size_t size)
579 PJDLOG_VERIFY(strlcpy(addr, "N/A", size) < size);
582 PJDLOG_VERIFY(snprintf(addr, size, "tcp://%S", &sa) < (ssize_t)size);
586 tcp_remote_address(const void *ctx, char *addr, size_t size)
597 PJDLOG_VERIFY(strlcpy(addr, "N/A", size) < size);
600 PJDLOG_VERIFY(snprintf(addr, size, "tcp://%S", &sa) < (ssize_t)size);