bac05cf7f3d2f387e7267ae642ca3fa788e76c32
[strongswan.git] / src / charon / plugins / stroke / stroke_list.c
1 /*
2 * Copyright (C) 2008 Martin Willi
3 * Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 *
15 * $Id$
16 */
17
18 #include "stroke_list.h"
19
20 #include <daemon.h>
21 #include <utils/linked_list.h>
22 #include <credentials/certificates/x509.h>
23 #include <credentials/certificates/ac.h>
24 #include <credentials/certificates/crl.h>
25
26 /* warning intervals for list functions */
27 #define CERT_WARNING_INTERVAL 30 /* days */
28 #define CRL_WARNING_INTERVAL 7 /* days */
29 #define AC_WARNING_INTERVAL 1 /* day */
30
31 typedef struct private_stroke_list_t private_stroke_list_t;
32
33 /**
34 * private data of stroke_list
35 */
36 struct private_stroke_list_t {
37
38 /**
39 * public functions
40 */
41 stroke_list_t public;
42
43 /**
44 * timestamp of daemon start
45 */
46 time_t uptime;
47 };
48
49 /**
50 * log an IKE_SA to out
51 */
52 static void log_ike_sa(FILE *out, ike_sa_t *ike_sa, bool all)
53 {
54 ike_sa_id_t *id = ike_sa->get_id(ike_sa);
55
56 fprintf(out, "%12s[%d]: %N, %H[%D]...%H[%D]\n",
57 ike_sa->get_name(ike_sa), ike_sa->get_unique_id(ike_sa),
58 ike_sa_state_names, ike_sa->get_state(ike_sa),
59 ike_sa->get_my_host(ike_sa), ike_sa->get_my_id(ike_sa),
60 ike_sa->get_other_host(ike_sa), ike_sa->get_other_id(ike_sa));
61
62 if (all)
63 {
64 char *ike_proposal = ike_sa->get_proposal(ike_sa);
65
66 fprintf(out, "%12s[%d]: IKE SPIs: %.16llx_i%s %.16llx_r%s",
67 ike_sa->get_name(ike_sa), ike_sa->get_unique_id(ike_sa),
68 id->get_initiator_spi(id), id->is_initiator(id) ? "*" : "",
69 id->get_responder_spi(id), id->is_initiator(id) ? "" : "*");
70
71
72 if (ike_sa->get_state(ike_sa) == IKE_ESTABLISHED)
73 {
74 u_int32_t rekey = ike_sa->get_statistic(ike_sa, STAT_REKEY_TIME);
75 u_int32_t reauth = ike_sa->get_statistic(ike_sa, STAT_REAUTH_TIME);
76
77 if (rekey)
78 {
79 fprintf(out, ", rekeying in %V", &rekey);
80 }
81 if (reauth)
82 {
83 fprintf(out, ", reauthentication in %V", &reauth);
84 }
85 if (!rekey && !reauth)
86 {
87 fprintf(out, ", rekeying disabled");
88 }
89 }
90 fprintf(out, "\n");
91
92 if (ike_proposal)
93 {
94 fprintf(out, "%12s[%d]: IKE proposal: %s\n",
95 ike_sa->get_name(ike_sa), ike_sa->get_unique_id(ike_sa),
96 ike_proposal);
97 }
98 }
99 }
100
101 /**
102 * log an CHILD_SA to out
103 */
104 static void log_child_sa(FILE *out, child_sa_t *child_sa, bool all)
105 {
106 u_int32_t rekey, now = time(NULL);
107 u_int32_t use_in, use_out, use_fwd;
108 encryption_algorithm_t encr_alg;
109 integrity_algorithm_t int_alg;
110 size_t encr_len, int_len;
111 mode_t mode;
112
113 child_sa->get_stats(child_sa, &mode, &encr_alg, &encr_len,
114 &int_alg, &int_len, &rekey, &use_in, &use_out,
115 &use_fwd);
116
117 fprintf(out, "%12s{%d}: %N, %N",
118 child_sa->get_name(child_sa), child_sa->get_reqid(child_sa),
119 child_sa_state_names, child_sa->get_state(child_sa),
120 mode_names, mode);
121
122 if (child_sa->get_state(child_sa) == CHILD_INSTALLED)
123 {
124 fprintf(out, ", %N SPIs: %.8x_i %.8x_o",
125 protocol_id_names, child_sa->get_protocol(child_sa),
126 htonl(child_sa->get_spi(child_sa, TRUE)),
127 htonl(child_sa->get_spi(child_sa, FALSE)));
128
129 if (all)
130 {
131 fprintf(out, "\n%12s{%d}: ", child_sa->get_name(child_sa),
132 child_sa->get_reqid(child_sa));
133
134
135 if (child_sa->get_protocol(child_sa) == PROTO_ESP)
136 {
137 fprintf(out, "%N", encryption_algorithm_names, encr_alg);
138
139 if (encr_len)
140 {
141 fprintf(out, "-%d", encr_len);
142 }
143 if (int_alg != AUTH_UNDEFINED)
144 {
145 fprintf(out, "/");
146 }
147 }
148
149 if (int_alg != AUTH_UNDEFINED)
150 {
151 fprintf(out, "%N", integrity_algorithm_names, int_alg);
152 if (int_len)
153 {
154 fprintf(out, "-%d", int_len);
155 }
156 }
157 fprintf(out, ", rekeying ");
158
159 if (rekey)
160 {
161 fprintf(out, "in %#V", &now, &rekey);
162 }
163 else
164 {
165 fprintf(out, "disabled");
166 }
167
168 fprintf(out, ", last use: ");
169 use_in = max(use_in, use_fwd);
170 if (use_in)
171 {
172 fprintf(out, "%ds_i ", now - use_in);
173 }
174 else
175 {
176 fprintf(out, "no_i ");
177 }
178 if (use_out)
179 {
180 fprintf(out, "%ds_o ", now - use_out);
181 }
182 else
183 {
184 fprintf(out, "no_o ");
185 }
186 }
187 }
188
189 fprintf(out, "\n%12s{%d}: %#R=== %#R\n",
190 child_sa->get_name(child_sa), child_sa->get_reqid(child_sa),
191 child_sa->get_traffic_selectors(child_sa, TRUE),
192 child_sa->get_traffic_selectors(child_sa, FALSE));
193 }
194
195 /**
196 * Implementation of stroke_list_t.status.
197 */
198 static void status(private_stroke_list_t *this, stroke_msg_t *msg, FILE *out, bool all)
199 {
200 enumerator_t *enumerator, *children;
201 iterator_t *iterator;
202 host_t *host;
203 peer_cfg_t *peer_cfg;
204 ike_cfg_t *ike_cfg;
205 child_cfg_t *child_cfg;
206 ike_sa_t *ike_sa;
207 char *name = NULL;
208 bool found = FALSE;
209 time_t uptime;
210
211 name = msg->status.name;
212
213 if (all)
214 {
215 uptime = time(NULL) - this->uptime;
216 fprintf(out, "Performance:\n");
217 fprintf(out, " uptime: %V, since %#T\n", &uptime, &this->uptime, FALSE);
218 fprintf(out, " worker threads: %d idle of %d,",
219 charon->processor->get_idle_threads(charon->processor),
220 charon->processor->get_total_threads(charon->processor));
221 fprintf(out, " job queue load: %d,",
222 charon->processor->get_job_load(charon->processor));
223 fprintf(out, " scheduled events: %d\n",
224 charon->scheduler->get_job_load(charon->scheduler));
225 iterator = charon->kernel_interface->create_address_iterator(
226 charon->kernel_interface);
227 fprintf(out, "Listening IP addresses:\n");
228 while (iterator->iterate(iterator, (void**)&host))
229 {
230 fprintf(out, " %H\n", host);
231 }
232 iterator->destroy(iterator);
233
234 fprintf(out, "Connections:\n");
235 enumerator = charon->backends->create_peer_cfg_enumerator(charon->backends);
236 while (enumerator->enumerate(enumerator, (void**)&peer_cfg))
237 {
238 if (peer_cfg->get_ike_version(peer_cfg) != 2 ||
239 (name && !streq(name, peer_cfg->get_name(peer_cfg))))
240 {
241 continue;
242 }
243
244 ike_cfg = peer_cfg->get_ike_cfg(peer_cfg);
245 fprintf(out, "%12s: %s[%D]...%s[%D]\n", peer_cfg->get_name(peer_cfg),
246 ike_cfg->get_my_addr(ike_cfg), peer_cfg->get_my_id(peer_cfg),
247 ike_cfg->get_other_addr(ike_cfg), peer_cfg->get_other_id(peer_cfg));
248 /* TODO: list CAs and groups */
249 children = peer_cfg->create_child_cfg_enumerator(peer_cfg);
250 while (children->enumerate(children, &child_cfg))
251 {
252 linked_list_t *my_ts, *other_ts;
253 my_ts = child_cfg->get_traffic_selectors(child_cfg, TRUE, NULL, NULL);
254 other_ts = child_cfg->get_traffic_selectors(child_cfg, FALSE, NULL, NULL);
255 fprintf(out, "%12s: %#R=== %#R\n", child_cfg->get_name(child_cfg),
256 my_ts, other_ts);
257 my_ts->destroy_offset(my_ts, offsetof(traffic_selector_t, destroy));
258 other_ts->destroy_offset(other_ts, offsetof(traffic_selector_t, destroy));
259 }
260 children->destroy(children);
261 }
262 enumerator->destroy(enumerator);
263 }
264
265 fprintf(out, "Security Associations:\n");
266 enumerator = charon->controller->create_ike_sa_enumerator(charon->controller);
267 while (enumerator->enumerate(enumerator, &ike_sa))
268 {
269 bool ike_printed = FALSE;
270 child_sa_t *child_sa;
271 iterator_t *children = ike_sa->create_child_sa_iterator(ike_sa);
272
273 if (name == NULL || streq(name, ike_sa->get_name(ike_sa)))
274 {
275 log_ike_sa(out, ike_sa, all);
276 found = TRUE;
277 ike_printed = TRUE;
278 }
279
280 while (children->iterate(children, (void**)&child_sa))
281 {
282 if (name == NULL || streq(name, child_sa->get_name(child_sa)))
283 {
284 if (!ike_printed)
285 {
286 log_ike_sa(out, ike_sa, all);
287 found = TRUE;
288 ike_printed = TRUE;
289 }
290 log_child_sa(out, child_sa, all);
291 }
292 }
293 children->destroy(children);
294 }
295 enumerator->destroy(enumerator);
296
297 if (!found)
298 {
299 if (name)
300 {
301 fprintf(out, " no match\n");
302 }
303 else
304 {
305 fprintf(out, " none\n");
306 }
307 }
308 }
309
310 /**
311 * create a unique certificate list without duplicates
312 * certicates having the same issuer are grouped together.
313 */
314 static linked_list_t* create_unique_cert_list(certificate_type_t type)
315 {
316 linked_list_t *list = linked_list_create();
317 enumerator_t *enumerator = charon->credentials->create_cert_enumerator(
318 charon->credentials, type, KEY_ANY,
319 NULL, FALSE);
320 certificate_t *cert;
321
322 while (enumerator->enumerate(enumerator, (void**)&cert))
323 {
324 iterator_t *iterator = list->create_iterator(list, TRUE);
325 identification_t *issuer = cert->get_issuer(cert);
326 bool previous_same, same = FALSE, last = TRUE;
327 certificate_t *list_cert;
328
329 while (iterator->iterate(iterator, (void**)&list_cert))
330 {
331 /* exit if we have a duplicate? */
332 if (list_cert->equals(list_cert, cert))
333 {
334 last = FALSE;
335 break;
336 }
337 /* group certificates with same issuer */
338 previous_same = same;
339 same = list_cert->has_issuer(list_cert, issuer);
340 if (previous_same && !same)
341 {
342 iterator->insert_before(iterator, (void *)cert->get_ref(cert));
343 last = FALSE;
344 break;
345 }
346 }
347 iterator->destroy(iterator);
348
349 if (last)
350 {
351 list->insert_last(list, (void *)cert->get_ref(cert));
352 }
353 }
354 enumerator->destroy(enumerator);
355 return list;
356 }
357
358 /**
359 * list all X.509 certificates matching the flags
360 */
361 static void stroke_list_certs(linked_list_t *list, char *label,
362 x509_flag_t flags, bool utc, FILE *out)
363 {
364 bool first = TRUE;
365 time_t now = time(NULL);
366 enumerator_t *enumerator = list->create_enumerator(list);
367 certificate_t *cert;
368
369 while (enumerator->enumerate(enumerator, (void**)&cert))
370 {
371 x509_t *x509 = (x509_t*)cert;
372 x509_flag_t x509_flags = x509->get_flags(x509);
373
374 /* list only if flag is set, or flags == 0 (ignoring self-signed) */
375 if ((x509_flags & flags) || (flags == (x509_flags & ~X509_SELF_SIGNED)))
376 {
377 enumerator_t *enumerator;
378 identification_t *altName;
379 bool first_altName = TRUE;
380 chunk_t serial = x509->get_serial(x509);
381 identification_t *authkey = x509->get_authKeyIdentifier(x509);
382 time_t notBefore, notAfter;
383 public_key_t *public = cert->get_public_key(cert);
384
385 if (first)
386 {
387 fprintf(out, "\n");
388 fprintf(out, "List of %s:\n", label);
389 first = FALSE;
390 }
391 fprintf(out, "\n");
392
393 /* list subjectAltNames */
394 enumerator = x509->create_subjectAltName_enumerator(x509);
395 while (enumerator->enumerate(enumerator, (void**)&altName))
396 {
397 if (first_altName)
398 {
399 fprintf(out, " altNames: ");
400 first_altName = FALSE;
401 }
402 else
403 {
404 fprintf(out, ", ");
405 }
406 fprintf(out, "%D", altName);
407 }
408 if (!first_altName)
409 {
410 fprintf(out, "\n");
411 }
412 enumerator->destroy(enumerator);
413
414 fprintf(out, " subject: \"%D\"\n", cert->get_subject(cert));
415 fprintf(out, " issuer: \"%D\"\n", cert->get_issuer(cert));
416 fprintf(out, " serial: %#B\n", &serial);
417
418 /* list validity */
419 cert->get_validity(cert, &now, &notBefore, &notAfter);
420 fprintf(out, " validity: not before %#T, ", &notBefore, utc);
421 if (now < notBefore)
422 {
423 fprintf(out, "not valid yet (valid in %#V)\n", &now, &notBefore);
424 }
425 else
426 {
427 fprintf(out, "ok\n");
428 }
429 fprintf(out, " not after %#T, ", &notAfter, utc);
430 if (now > notAfter)
431 {
432 fprintf(out, "expired (%#V ago)\n", &now, &notAfter);
433 }
434 else
435 {
436 fprintf(out, "ok");
437 if (now > notAfter - CERT_WARNING_INTERVAL * 60 * 60 * 24)
438 {
439 fprintf(out, " (expires in %#V)", &now, &notAfter);
440 }
441 fprintf(out, " \n");
442 }
443
444 /* list public key information */
445 if (public)
446 {
447 private_key_t *private = NULL;
448 identification_t *id, *keyid;
449
450 id = public->get_id(public, ID_PUBKEY_SHA1);
451 keyid = public->get_id(public, ID_PUBKEY_INFO_SHA1);
452
453 private = charon->credentials->get_private(
454 charon->credentials,
455 public->get_type(public), keyid, NULL);
456 fprintf(out, " pubkey: %N %d bits%s\n",
457 key_type_names, public->get_type(public),
458 public->get_keysize(public) * 8,
459 private ? ", has private key" : "");
460 fprintf(out, " keyid: %D\n", keyid);
461 fprintf(out, " subjkey: %D\n", id);
462 DESTROY_IF(private);
463 public->destroy(public);
464 }
465
466 /* list optional authorityKeyIdentifier */
467 if (authkey)
468 {
469 fprintf(out, " authkey: %D\n", authkey);
470 }
471 }
472 }
473 enumerator->destroy(enumerator);
474 }
475
476 /**
477 * list all X.509 attribute certificates
478 */
479 static void stroke_list_acerts(linked_list_t *list, bool utc, FILE *out)
480 {
481 bool first = TRUE;
482 time_t thisUpdate, nextUpdate, now = time(NULL);
483 enumerator_t *enumerator = list->create_enumerator(list);
484 certificate_t *cert;
485
486 while (enumerator->enumerate(enumerator, (void**)&cert))
487 {
488 ac_t *ac = (ac_t*)cert;
489 chunk_t serial = ac->get_serial(ac);
490 chunk_t holderSerial = ac->get_holderSerial(ac);
491 identification_t *holderIssuer = ac->get_holderIssuer(ac);
492 identification_t *authkey = ac->get_authKeyIdentifier(ac);
493 identification_t *entityName = cert->get_subject(cert);
494
495 if (first)
496 {
497 fprintf(out, "\n");
498 fprintf(out, "List of X.509 Attribute Certificates:\n");
499 first = FALSE;
500 }
501 fprintf(out, "\n");
502
503 if (entityName)
504 {
505 fprintf(out, " holder: \"%D\"\n", entityName);
506 }
507 if (holderIssuer)
508 {
509 fprintf(out, " hissuer: \"%D\"\n", holderIssuer);
510 }
511 if (holderSerial.ptr)
512 {
513 fprintf(out, " hserial: %#B\n", &holderSerial);
514 }
515 fprintf(out, " issuer: \"%D\"\n", cert->get_issuer(cert));
516 fprintf(out, " serial: %#B\n", &serial);
517
518 /* list validity */
519 cert->get_validity(cert, &now, &thisUpdate, &nextUpdate);
520 fprintf(out, " updates: this %#T\n", &thisUpdate, utc);
521 fprintf(out, " next %#T, ", &nextUpdate, utc);
522 if (now > nextUpdate)
523 {
524 fprintf(out, "expired (%#V ago)\n", &now, &nextUpdate);
525 }
526 else
527 {
528 fprintf(out, "ok");
529 if (now > nextUpdate - AC_WARNING_INTERVAL * 60 * 60 * 24)
530 {
531 fprintf(out, " (expires in %#V)", &now, &nextUpdate);
532 }
533 fprintf(out, " \n");
534 }
535
536 /* list optional authorityKeyIdentifier */
537 if (authkey)
538 {
539 fprintf(out, " authkey: %D\n", authkey);
540 }
541 }
542 enumerator->destroy(enumerator);
543 }
544
545 /**
546 * list all X.509 CRLs
547 */
548 static void stroke_list_crls(linked_list_t *list, bool utc, FILE *out)
549 {
550 bool first = TRUE;
551 time_t thisUpdate, nextUpdate, now = time(NULL);
552 enumerator_t *enumerator = list->create_enumerator(list);
553 certificate_t *cert;
554
555 while (enumerator->enumerate(enumerator, (void**)&cert))
556 {
557 crl_t *crl = (crl_t*)cert;
558 chunk_t serial = crl->get_serial(crl);
559 identification_t *authkey = crl->get_authKeyIdentifier(crl);
560
561 if (first)
562 {
563 fprintf(out, "\n");
564 fprintf(out, "List of X.509 CRLs:\n");
565 first = FALSE;
566 }
567 fprintf(out, "\n");
568
569 fprintf(out, " issuer: \"%D\"\n", cert->get_issuer(cert));
570
571 /* list optional crlNumber */
572 if (serial.ptr)
573 {
574 fprintf(out, " serial: %#B\n", &serial);
575 }
576
577 /* count the number of revoked certificates */
578 {
579 int count = 0;
580 enumerator_t *enumerator = crl->create_enumerator(crl);
581
582 while (enumerator->enumerate(enumerator, NULL, NULL, NULL))
583 {
584 count++;
585 }
586 fprintf(out, " revoked: %d certificate%s\n", count,
587 (count == 1)? "" : "s");
588 enumerator->destroy(enumerator);
589 }
590
591 /* list validity */
592 cert->get_validity(cert, &now, &thisUpdate, &nextUpdate);
593 fprintf(out, " updates: this %#T\n", &thisUpdate, utc);
594 fprintf(out, " next %#T, ", &nextUpdate, utc);
595 if (now > nextUpdate)
596 {
597 fprintf(out, "expired (%#V ago)\n", &now, &nextUpdate);
598 }
599 else
600 {
601 fprintf(out, "ok");
602 if (now > nextUpdate - CRL_WARNING_INTERVAL * 60 * 60 * 24)
603 {
604 fprintf(out, " (expires in %#V)", &now, &nextUpdate);
605 }
606 fprintf(out, " \n");
607 }
608
609 /* list optional authorityKeyIdentifier */
610 if (authkey)
611 {
612 fprintf(out, " authkey: %D\n", authkey);
613 }
614 }
615 enumerator->destroy(enumerator);
616 }
617
618 /**
619 * list all OCSP responses
620 */
621 static void stroke_list_ocsp(linked_list_t* list, bool utc, FILE *out)
622 {
623 bool first = TRUE;
624 enumerator_t *enumerator = list->create_enumerator(list);
625 certificate_t *cert;
626
627 while (enumerator->enumerate(enumerator, (void**)&cert))
628 {
629 if (first)
630 {
631 fprintf(out, "\n");
632 fprintf(out, "List of OCSP responses:\n");
633 fprintf(out, "\n");
634 first = FALSE;
635 }
636
637 fprintf(out, " signer: \"%D\"\n", cert->get_issuer(cert));
638 }
639 enumerator->destroy(enumerator);
640 }
641
642 /**
643 * Implementation of stroke_list_t.list.
644 */
645 static void list(private_stroke_list_t *this, stroke_msg_t *msg, FILE *out)
646 {
647 linked_list_t *cert_list = NULL;
648
649 if (msg->list.flags & (LIST_CERTS | LIST_CACERTS | LIST_OCSPCERTS | LIST_AACERTS))
650 {
651 cert_list = create_unique_cert_list(CERT_X509);
652 }
653 if (msg->list.flags & LIST_CERTS)
654 {
655 stroke_list_certs(cert_list, "X.509 End Entity Certificates",
656 0, msg->list.utc, out);
657 }
658 if (msg->list.flags & LIST_CACERTS)
659 {
660 stroke_list_certs(cert_list, "X.509 CA Certificates",
661 X509_CA, msg->list.utc, out);
662 }
663 if (msg->list.flags & LIST_OCSPCERTS)
664 {
665 stroke_list_certs(cert_list, "X.509 OCSP Signer Certificates",
666 X509_OCSP_SIGNER, msg->list.utc, out);
667 }
668 if (msg->list.flags & LIST_AACERTS)
669 {
670 stroke_list_certs(cert_list, "X.509 AA Certificates",
671 X509_AA, msg->list.utc, out);
672 }
673 if (msg->list.flags & LIST_ACERTS)
674 {
675 linked_list_t *ac_list = create_unique_cert_list(CERT_X509_AC);
676
677 stroke_list_acerts(ac_list, msg->list.utc, out);
678 ac_list->destroy_offset(ac_list, offsetof(certificate_t, destroy));
679 }
680 if (msg->list.flags & LIST_CRLS)
681 {
682 linked_list_t *crl_list = create_unique_cert_list(CERT_X509_CRL);
683
684 stroke_list_crls(crl_list, msg->list.utc, out);
685 crl_list->destroy_offset(crl_list, offsetof(certificate_t, destroy));
686 }
687 if (msg->list.flags & LIST_OCSP)
688 {
689 linked_list_t *ocsp_list = create_unique_cert_list(CERT_X509_OCSP_RESPONSE);
690
691 stroke_list_ocsp(ocsp_list, msg->list.utc, out);
692 ocsp_list->destroy_offset(ocsp_list, offsetof(certificate_t, destroy));
693 }
694 DESTROY_OFFSET_IF(cert_list, offsetof(certificate_t, destroy));
695 }
696
697 /**
698 * Implementation of stroke_list_t.destroy
699 */
700 static void destroy(private_stroke_list_t *this)
701 {
702 free(this);
703 }
704
705 /*
706 * see header file
707 */
708 stroke_list_t *stroke_list_create()
709 {
710 private_stroke_list_t *this = malloc_thing(private_stroke_list_t);
711
712 this->public.list = (void(*)(stroke_list_t*, stroke_msg_t *msg, FILE *out))list;
713 this->public.status = (void(*)(stroke_list_t*, stroke_msg_t *msg, FILE *out,bool))status;
714 this->public.destroy = (void(*)(stroke_list_t*))destroy;
715
716 this->uptime = time(NULL);
717
718 return &this->public;
719 }
720