1 | /* |
1 | /* |
2 | util.C -- process management and other utility functions |
2 | util.C -- process management and other utility functions |
3 | |
3 | |
4 | Most of these are taken from tinc, see the AUTHORS file. |
4 | Some of these are taken from tinc, see the AUTHORS file. |
5 | |
5 | |
6 | This program is free software; you can redistribute it and/or modify |
6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by |
7 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or |
8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. |
9 | (at your option) any later version. |
… | |
… | |
140 | |
140 | |
141 | if (!confbase) |
141 | if (!confbase) |
142 | asprintf (&confbase, "%s/vpe", CONFDIR); |
142 | asprintf (&confbase, "%s/vpe", CONFDIR); |
143 | } |
143 | } |
144 | |
144 | |
145 | sockinfo::operator const char *() |
|
|
146 | { |
|
|
147 | static char hostport[15 + 1 + 5 + 1]; |
|
|
148 | in_addr ia = { host }; |
|
|
149 | |
|
|
150 | sprintf (hostport, "%.15s:%d", inet_ntoa (ia), ntohs (port) & 0xffff); |
|
|
151 | |
|
|
152 | return hostport; |
|
|
153 | } |
|
|
154 | |
|
|