… | |
… | |
113 | sprintf (hostport, "%.15s", inet_ntoa (ia)); |
113 | sprintf (hostport, "%.15s", inet_ntoa (ia)); |
114 | |
114 | |
115 | return hostport; |
115 | return hostport; |
116 | } |
116 | } |
117 | |
117 | |
|
|
118 | bool |
|
|
119 | sockinfo::valid () const |
|
|
120 | { |
|
|
121 | return (prot & THISNODE->protocols) && host; |
|
|
122 | } |
|
|
123 | |
118 | sockinfo::operator const char *() const |
124 | sockinfo::operator const char *() const |
119 | { |
125 | { |
120 | in_addr ia = { host }; |
126 | in_addr ia = { host }; |
121 | |
127 | |
122 | sprintf (hostport, "%s/%.15s:%d", strprotocol (prot), inet_ntoa (ia), ntohs (port) & 0xffff); |
128 | sprintf (hostport, "%s/%.15s:%d", strprotocol (prot), inet_ntoa (ia), ntohs (port) & 0xffff); |