2 * Copyright (C) 2011-2013 Tobias Brunner
3 * Copyright (C) 2008 Martin Willi
4 * Hochschule fuer Technik Rapperswil
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 #include "stroke_socket.h"
20 #include <sys/types.h>
22 #include <sys/socket.h>
30 #include "stroke_config.h"
31 #include "stroke_control.h"
32 #include "stroke_cred.h"
33 #include "stroke_ca.h"
34 #include "stroke_attribute.h"
35 #include "stroke_handler.h"
36 #include "stroke_list.h"
37 #include "stroke_counter.h"
40 * To avoid clogging the thread pool with (blocking) jobs, we limit the number
41 * of concurrently handled stroke commands.
43 #define MAX_CONCURRENT_DEFAULT 4
45 typedef struct stroke_job_context_t stroke_job_context_t
;
46 typedef struct private_stroke_socket_t private_stroke_socket_t
;
49 * private data of stroke_socket
51 struct private_stroke_socket_t
{
56 stroke_socket_t
public;
59 * Service accepting stroke connections
61 stream_service_t
*service
;
64 * configuration backend
66 stroke_config_t
*config
;
71 stroke_attribute_t
*attribute
;
74 * attribute handler (requests only)
76 stroke_handler_t
*handler
;
79 * controller to control daemon
81 stroke_control_t
*control
;
94 * status information logging
99 * Counter values for IKE events
101 stroke_counter_t
*counter
;
104 * TRUE if log level changes are not allowed
106 bool prevent_loglevel_changes
;
110 * Helper function which corrects the string pointers
111 * in a stroke_msg_t. Strings in a stroke_msg sent over "wire"
112 * contains RELATIVE addresses (relative to the beginning of the
113 * stroke_msg). They must be corrected if they reach our address
116 static void pop_string(stroke_msg_t
*msg
, char **string
)
123 /* check for sanity of string pointer and string */
124 if (string
< (char**)msg
||
125 string
> (char**)((char*)msg
+ sizeof(stroke_msg_t
)) ||
126 (unsigned long)*string
< (unsigned long)((char*)msg
->buffer
- (char*)msg
) ||
127 (unsigned long)*string
> msg
->length
)
129 *string
= "(invalid pointer in stroke msg)";
133 *string
= (char*)msg
+ (unsigned long)*string
;
138 * Pop the strings of a stroke_end_t struct and log them for debugging purposes
140 static void pop_end(stroke_msg_t
*msg
, const char* label
, stroke_end_t
*end
)
142 pop_string(msg
, &end
->address
);
143 pop_string(msg
, &end
->subnets
);
144 pop_string(msg
, &end
->sourceip
);
145 pop_string(msg
, &end
->dns
);
146 pop_string(msg
, &end
->auth
);
147 pop_string(msg
, &end
->auth2
);
148 pop_string(msg
, &end
->id
);
149 pop_string(msg
, &end
->id2
);
150 pop_string(msg
, &end
->rsakey
);
151 pop_string(msg
, &end
->cert
);
152 pop_string(msg
, &end
->cert2
);
153 pop_string(msg
, &end
->ca
);
154 pop_string(msg
, &end
->ca2
);
155 pop_string(msg
, &end
->groups
);
156 pop_string(msg
, &end
->groups2
);
157 pop_string(msg
, &end
->cert_policy
);
158 pop_string(msg
, &end
->updown
);
160 DBG2(DBG_CFG
, " %s=%s", label
, end
->address
);
161 DBG2(DBG_CFG
, " %ssubnet=%s", label
, end
->subnets
);
162 DBG2(DBG_CFG
, " %ssourceip=%s", label
, end
->sourceip
);
163 DBG2(DBG_CFG
, " %sdns=%s", label
, end
->dns
);
164 DBG2(DBG_CFG
, " %sauth=%s", label
, end
->auth
);
165 DBG2(DBG_CFG
, " %sauth2=%s", label
, end
->auth2
);
166 DBG2(DBG_CFG
, " %sid=%s", label
, end
->id
);
167 DBG2(DBG_CFG
, " %sid2=%s", label
, end
->id2
);
168 DBG2(DBG_CFG
, " %srsakey=%s", label
, end
->rsakey
);
169 DBG2(DBG_CFG
, " %scert=%s", label
, end
->cert
);
170 DBG2(DBG_CFG
, " %scert2=%s", label
, end
->cert2
);
171 DBG2(DBG_CFG
, " %sca=%s", label
, end
->ca
);
172 DBG2(DBG_CFG
, " %sca2=%s", label
, end
->ca2
);
173 DBG2(DBG_CFG
, " %sgroups=%s", label
, end
->groups
);
174 DBG2(DBG_CFG
, " %sgroups2=%s", label
, end
->groups2
);
175 DBG2(DBG_CFG
, " %supdown=%s", label
, end
->updown
);
179 * Add a connection to the configuration list
181 static void stroke_add_conn(private_stroke_socket_t
*this, stroke_msg_t
*msg
)
183 pop_string(msg
, &msg
->add_conn
.name
);
184 DBG1(DBG_CFG
, "received stroke: add connection '%s'", msg
->add_conn
.name
);
186 DBG2(DBG_CFG
, "conn %s", msg
->add_conn
.name
);
187 pop_end(msg
, "left", &msg
->add_conn
.me
);
188 pop_end(msg
, "right", &msg
->add_conn
.other
);
189 pop_string(msg
, &msg
->add_conn
.eap_identity
);
190 pop_string(msg
, &msg
->add_conn
.aaa_identity
);
191 pop_string(msg
, &msg
->add_conn
.xauth_identity
);
192 pop_string(msg
, &msg
->add_conn
.algorithms
.ike
);
193 pop_string(msg
, &msg
->add_conn
.algorithms
.esp
);
194 pop_string(msg
, &msg
->add_conn
.algorithms
.ah
);
195 pop_string(msg
, &msg
->add_conn
.ikeme
.mediated_by
);
196 pop_string(msg
, &msg
->add_conn
.ikeme
.peerid
);
197 DBG2(DBG_CFG
, " eap_identity=%s", msg
->add_conn
.eap_identity
);
198 DBG2(DBG_CFG
, " aaa_identity=%s", msg
->add_conn
.aaa_identity
);
199 DBG2(DBG_CFG
, " xauth_identity=%s", msg
->add_conn
.xauth_identity
);
200 DBG2(DBG_CFG
, " ike=%s", msg
->add_conn
.algorithms
.ike
);
201 DBG2(DBG_CFG
, " esp=%s", msg
->add_conn
.algorithms
.esp
);
202 DBG2(DBG_CFG
, " ah=%s", msg
->add_conn
.algorithms
.ah
);
203 DBG2(DBG_CFG
, " dpddelay=%d", msg
->add_conn
.dpd
.delay
);
204 DBG2(DBG_CFG
, " dpdtimeout=%d", msg
->add_conn
.dpd
.timeout
);
205 DBG2(DBG_CFG
, " dpdaction=%d", msg
->add_conn
.dpd
.action
);
206 DBG2(DBG_CFG
, " closeaction=%d", msg
->add_conn
.close_action
);
207 DBG2(DBG_CFG
, " mediation=%s", msg
->add_conn
.ikeme
.mediation ?
"yes" : "no");
208 DBG2(DBG_CFG
, " mediated_by=%s", msg
->add_conn
.ikeme
.mediated_by
);
209 DBG2(DBG_CFG
, " me_peerid=%s", msg
->add_conn
.ikeme
.peerid
);
210 DBG2(DBG_CFG
, " keyexchange=ikev%u", msg
->add_conn
.version
);
212 this->config
->add(this->config
, msg
);
213 this->attribute
->add_dns(this->attribute
, msg
);
214 this->handler
->add_attributes(this->handler
, msg
);
218 * Delete a connection from the list
220 static void stroke_del_conn(private_stroke_socket_t
*this, stroke_msg_t
*msg
)
222 pop_string(msg
, &msg
->del_conn
.name
);
223 DBG1(DBG_CFG
, "received stroke: delete connection '%s'", msg
->del_conn
.name
);
225 this->config
->del(this->config
, msg
);
226 this->attribute
->del_dns(this->attribute
, msg
);
227 this->handler
->del_attributes(this->handler
, msg
);
231 * initiate a connection by name
233 static void stroke_initiate(private_stroke_socket_t
*this, stroke_msg_t
*msg
, FILE *out
)
235 pop_string(msg
, &msg
->initiate
.name
);
236 DBG1(DBG_CFG
, "received stroke: initiate '%s'", msg
->initiate
.name
);
238 this->control
->initiate(this->control
, msg
, out
);
242 * terminate a connection by name
244 static void stroke_terminate(private_stroke_socket_t
*this, stroke_msg_t
*msg
, FILE *out
)
246 pop_string(msg
, &msg
->terminate
.name
);
247 DBG1(DBG_CFG
, "received stroke: terminate '%s'", msg
->terminate
.name
);
249 this->control
->terminate(this->control
, msg
, out
);
253 * terminate a connection by peers virtual IP
255 static void stroke_terminate_srcip(private_stroke_socket_t
*this,
256 stroke_msg_t
*msg
, FILE *out
)
258 pop_string(msg
, &msg
->terminate_srcip
.start
);
259 pop_string(msg
, &msg
->terminate_srcip
.end
);
260 DBG1(DBG_CFG
, "received stroke: terminate-srcip %s-%s",
261 msg
->terminate_srcip
.start
, msg
->terminate_srcip
.end
);
263 this->control
->terminate_srcip(this->control
, msg
, out
);
267 * rekey a connection by name/id
269 static void stroke_rekey(private_stroke_socket_t
*this, stroke_msg_t
*msg
, FILE *out
)
271 pop_string(msg
, &msg
->terminate
.name
);
272 DBG1(DBG_CFG
, "received stroke: rekey '%s'", msg
->rekey
.name
);
274 this->control
->rekey(this->control
, msg
, out
);
278 * route a policy (install SPD entries)
280 static void stroke_route(private_stroke_socket_t
*this, stroke_msg_t
*msg
, FILE *out
)
282 pop_string(msg
, &msg
->route
.name
);
283 DBG1(DBG_CFG
, "received stroke: route '%s'", msg
->route
.name
);
285 this->control
->route(this->control
, msg
, out
);
291 static void stroke_unroute(private_stroke_socket_t
*this, stroke_msg_t
*msg
, FILE *out
)
293 pop_string(msg
, &msg
->terminate
.name
);
294 DBG1(DBG_CFG
, "received stroke: unroute '%s'", msg
->route
.name
);
296 this->control
->unroute(this->control
, msg
, out
);
300 * Add a ca information record to the cainfo list
302 static void stroke_add_ca(private_stroke_socket_t
*this,
303 stroke_msg_t
*msg
, FILE *out
)
305 pop_string(msg
, &msg
->add_ca
.name
);
306 DBG1(DBG_CFG
, "received stroke: add ca '%s'", msg
->add_ca
.name
);
308 pop_string(msg
, &msg
->add_ca
.cacert
);
309 pop_string(msg
, &msg
->add_ca
.crluri
);
310 pop_string(msg
, &msg
->add_ca
.crluri2
);
311 pop_string(msg
, &msg
->add_ca
.ocspuri
);
312 pop_string(msg
, &msg
->add_ca
.ocspuri2
);
313 pop_string(msg
, &msg
->add_ca
.certuribase
);
314 DBG2(DBG_CFG
, "ca %s", msg
->add_ca
.name
);
315 DBG2(DBG_CFG
, " cacert=%s", msg
->add_ca
.cacert
);
316 DBG2(DBG_CFG
, " crluri=%s", msg
->add_ca
.crluri
);
317 DBG2(DBG_CFG
, " crluri2=%s", msg
->add_ca
.crluri2
);
318 DBG2(DBG_CFG
, " ocspuri=%s", msg
->add_ca
.ocspuri
);
319 DBG2(DBG_CFG
, " ocspuri2=%s", msg
->add_ca
.ocspuri2
);
320 DBG2(DBG_CFG
, " certuribase=%s", msg
->add_ca
.certuribase
);
322 this->ca
->add(this->ca
, msg
);
326 * Delete a ca information record from the cainfo list
328 static void stroke_del_ca(private_stroke_socket_t
*this,
329 stroke_msg_t
*msg
, FILE *out
)
331 pop_string(msg
, &msg
->del_ca
.name
);
332 DBG1(DBG_CFG
, "received stroke: delete ca '%s'", msg
->del_ca
.name
);
334 this->ca
->del(this->ca
, msg
);
339 * show status of daemon
341 static void stroke_status(private_stroke_socket_t
*this,
342 stroke_msg_t
*msg
, FILE *out
, bool all
, bool wait
)
344 pop_string(msg
, &(msg
->status
.name
));
346 this->list
->status(this->list
, msg
, out
, all
, wait
);
350 * list various information
352 static void stroke_list(private_stroke_socket_t
*this, stroke_msg_t
*msg
,
355 if (msg
->list
.flags
& LIST_CAINFOS
)
357 this->ca
->list(this->ca
, msg
, out
);
359 this->list
->list(this->list
, msg
, out
);
363 * reread various information
365 static void stroke_reread(private_stroke_socket_t
*this,
366 stroke_msg_t
*msg
, FILE *out
)
368 this->cred
->reread(this->cred
, msg
, out
);
372 * purge various information
374 static void stroke_purge(private_stroke_socket_t
*this,
375 stroke_msg_t
*msg
, FILE *out
)
377 if (msg
->purge
.flags
& PURGE_OCSP
)
379 lib
->credmgr
->flush_cache(lib
->credmgr
, CERT_X509_OCSP_RESPONSE
);
381 if (msg
->purge
.flags
& PURGE_CRLS
)
383 lib
->credmgr
->flush_cache(lib
->credmgr
, CERT_X509_CRL
);
385 if (msg
->purge
.flags
& PURGE_CERTS
)
387 lib
->credmgr
->flush_cache(lib
->credmgr
, CERT_X509
);
389 if (msg
->purge
.flags
& PURGE_IKE
)
391 this->control
->purge_ike(this->control
, msg
, out
);
396 * Print a certificate in PEM to out
398 static void print_pem_cert(FILE *out
, certificate_t
*cert
)
402 if (cert
->get_encoding(cert
, CERT_PEM
, &encoded
))
404 fprintf(out
, "%.*s", (int)encoded
.len
, encoded
.ptr
);
410 * Export in-memory credentials
412 static void stroke_export(private_stroke_socket_t
*this,
413 stroke_msg_t
*msg
, FILE *out
)
415 pop_string(msg
, &msg
->export
.selector
);
417 if (msg
->export
.flags
& EXPORT_X509
)
419 enumerator_t
*enumerator
;
420 identification_t
*id
;
423 id
= identification_create_from_string(msg
->export
.selector
);
424 enumerator
= lib
->credmgr
->create_cert_enumerator(lib
->credmgr
,
425 CERT_X509
, KEY_ANY
, id
, FALSE
);
426 while (enumerator
->enumerate(enumerator
, &cert
))
428 print_pem_cert(out
, cert
);
430 enumerator
->destroy(enumerator
);
434 if (msg
->export
.flags
& (EXPORT_CONN_CERT
| EXPORT_CONN_CHAIN
))
436 enumerator_t
*sas
, *auths
, *certs
;
442 sas
= charon
->ike_sa_manager
->create_enumerator(
443 charon
->ike_sa_manager
, TRUE
);
444 while (sas
->enumerate(sas
, &ike_sa
))
446 if (streq(msg
->export
.selector
, ike_sa
->get_name(ike_sa
)))
448 auths
= ike_sa
->create_auth_cfg_enumerator(ike_sa
, FALSE
);
449 while (auths
->enumerate(auths
, &auth
))
451 bool got_subject
= FALSE
;
453 certs
= auth
->create_enumerator(auth
);
454 while (certs
->enumerate(certs
, &rule
, &cert
))
458 case AUTH_RULE_CA_CERT
:
459 case AUTH_RULE_IM_CERT
:
460 if (msg
->export
.flags
& EXPORT_CONN_CHAIN
)
462 print_pem_cert(out
, cert
);
465 case AUTH_RULE_SUBJECT_CERT
:
468 print_pem_cert(out
, cert
);
476 certs
->destroy(certs
);
478 auths
->destroy(auths
);
488 static void stroke_leases(private_stroke_socket_t
*this,
489 stroke_msg_t
*msg
, FILE *out
)
491 pop_string(msg
, &msg
->leases
.pool
);
492 pop_string(msg
, &msg
->leases
.address
);
494 this->list
->leases(this->list
, msg
, out
);
498 * Callback function for usage report
500 static void report_usage(FILE *out
, int count
, size_t bytes
,
501 backtrace_t
*bt
, bool detailed
)
503 fprintf(out
, "%d bytes total, %d allocations, %d bytes average:\n",
504 bytes
, count
, bytes
/ count
);
505 bt
->log(bt
, out
, detailed
);
509 * Callback function for memusage summary
511 static void sum_usage(FILE *out
, int count
, size_t bytes
, int whitelisted
)
513 fprintf(out
, "Total memory usage: %zu\n", bytes
);
519 static void stroke_memusage(private_stroke_socket_t
*this,
520 stroke_msg_t
*msg
, FILE *out
)
522 if (lib
->leak_detective
)
524 lib
->leak_detective
->usage(lib
->leak_detective
,
525 (leak_detective_report_cb_t
)report_usage
,
526 (leak_detective_summary_cb_t
)sum_usage
, out
);
531 * Set username and password for a connection
533 static void stroke_user_creds(private_stroke_socket_t
*this,
534 stroke_msg_t
*msg
, FILE *out
)
536 pop_string(msg
, &msg
->user_creds
.name
);
537 pop_string(msg
, &msg
->user_creds
.username
);
538 pop_string(msg
, &msg
->user_creds
.password
);
540 DBG1(DBG_CFG
, "received stroke: user-creds '%s'", msg
->user_creds
.name
);
542 this->config
->set_user_credentials(this->config
, msg
, out
);
546 * Print stroke counter values
548 static void stroke_counters(private_stroke_socket_t
*this,
549 stroke_msg_t
*msg
, FILE *out
)
551 pop_string(msg
, &msg
->counters
.name
);
553 if (msg
->counters
.reset
)
555 this->counter
->reset(this->counter
, msg
->counters
.name
);
559 this->counter
->print(this->counter
, out
, msg
->counters
.name
);
564 * set the verbosity debug output
566 static void stroke_loglevel(private_stroke_socket_t
*this,
567 stroke_msg_t
*msg
, FILE *out
)
571 pop_string(msg
, &(msg
->loglevel
.type
));
572 DBG1(DBG_CFG
, "received stroke: loglevel %d for %s",
573 msg
->loglevel
.level
, msg
->loglevel
.type
);
575 if (this->prevent_loglevel_changes
)
577 DBG1(DBG_CFG
, "prevented log level change");
578 fprintf(out
, "command not allowed!\n");
581 if (strcaseeq(msg
->loglevel
.type
, "any"))
587 group
= enum_from_name(debug_names
, msg
->loglevel
.type
);
590 fprintf(out
, "unknown type '%s'!\n", msg
->loglevel
.type
);
594 charon
->set_level(charon
, group
, msg
->loglevel
.level
);
598 * set various config options
600 static void stroke_config(private_stroke_socket_t
*this,
601 stroke_msg_t
*msg
, FILE *out
)
603 this->cred
->cachecrl(this->cred
, msg
->config
.cachecrl
);
607 * process a stroke request
609 static bool on_accept(private_stroke_socket_t
*this, stream_t
*stream
)
616 if (!stream
->read_all(stream
, &len
, sizeof(len
)))
618 if (errno
!= EWOULDBLOCK
)
620 DBG1(DBG_CFG
, "reading length of stroke message failed: %s",
629 if (!stream
->read_all(stream
, (char*)msg
+ sizeof(len
), len
- sizeof(len
)))
631 if (errno
!= EWOULDBLOCK
)
633 DBG1(DBG_CFG
, "reading stroke message failed: %s", strerror(errno
));
639 DBG3(DBG_CFG
, "stroke message %b", (void*)msg
, len
);
641 out
= stream
->get_file(stream
);
644 DBG1(DBG_CFG
, "creating stroke output stream failed");
651 stroke_initiate(this, msg
, out
);
654 stroke_route(this, msg
, out
);
657 stroke_unroute(this, msg
, out
);
660 stroke_terminate(this, msg
, out
);
662 case STR_TERMINATE_SRCIP
:
663 stroke_terminate_srcip(this, msg
, out
);
666 stroke_rekey(this, msg
, out
);
669 stroke_status(this, msg
, out
, FALSE
, TRUE
);
672 stroke_status(this, msg
, out
, TRUE
, TRUE
);
674 case STR_STATUS_ALL_NOBLK
:
675 stroke_status(this, msg
, out
, TRUE
, FALSE
);
678 stroke_add_conn(this, msg
);
681 stroke_del_conn(this, msg
);
684 stroke_add_ca(this, msg
, out
);
687 stroke_del_ca(this, msg
, out
);
690 stroke_loglevel(this, msg
, out
);
693 stroke_config(this, msg
, out
);
696 stroke_list(this, msg
, out
);
699 stroke_reread(this, msg
, out
);
702 stroke_purge(this, msg
, out
);
705 stroke_export(this, msg
, out
);
708 stroke_leases(this, msg
, out
);
711 stroke_memusage(this, msg
, out
);
714 stroke_user_creds(this, msg
, out
);
717 stroke_counters(this, msg
, out
);
720 DBG1(DBG_CFG
, "received unknown stroke");
728 METHOD(stroke_socket_t
, destroy
, void,
729 private_stroke_socket_t
*this)
731 DESTROY_IF(this->service
);
732 lib
->credmgr
->remove_set(lib
->credmgr
, &this->ca
->set
);
733 lib
->credmgr
->remove_set(lib
->credmgr
, &this->cred
->set
);
734 charon
->backends
->remove_backend(charon
->backends
, &this->config
->backend
);
735 hydra
->attributes
->remove_provider(hydra
->attributes
, &this->attribute
->provider
);
736 hydra
->attributes
->remove_handler(hydra
->attributes
, &this->handler
->handler
);
737 charon
->bus
->remove_listener(charon
->bus
, &this->counter
->listener
);
738 this->cred
->destroy(this->cred
);
739 this->ca
->destroy(this->ca
);
740 this->config
->destroy(this->config
);
741 this->attribute
->destroy(this->attribute
);
742 this->handler
->destroy(this->handler
);
743 this->control
->destroy(this->control
);
744 this->list
->destroy(this->list
);
745 this->counter
->destroy(this->counter
);
752 stroke_socket_t
*stroke_socket_create()
754 private_stroke_socket_t
*this;
762 .prevent_loglevel_changes
= lib
->settings
->get_bool(lib
->settings
,
763 "%s.plugins.stroke.prevent_loglevel_changes", FALSE
, charon
->name
),
766 this->cred
= stroke_cred_create();
767 this->attribute
= stroke_attribute_create();
768 this->handler
= stroke_handler_create();
769 this->ca
= stroke_ca_create(this->cred
);
770 this->config
= stroke_config_create(this->ca
, this->cred
, this->attribute
);
771 this->control
= stroke_control_create();
772 this->list
= stroke_list_create(this->attribute
);
773 this->counter
= stroke_counter_create();
775 lib
->credmgr
->add_set(lib
->credmgr
, &this->ca
->set
);
776 lib
->credmgr
->add_set(lib
->credmgr
, &this->cred
->set
);
777 charon
->backends
->add_backend(charon
->backends
, &this->config
->backend
);
778 hydra
->attributes
->add_provider(hydra
->attributes
, &this->attribute
->provider
);
779 hydra
->attributes
->add_handler(hydra
->attributes
, &this->handler
->handler
);
780 charon
->bus
->add_listener(charon
->bus
, &this->counter
->listener
);
782 max_concurrent
= lib
->settings
->get_int(lib
->settings
,
783 "%s.plugins.stroke.max_concurrent", MAX_CONCURRENT_DEFAULT
,
785 uri
= lib
->settings
->get_str(lib
->settings
,
786 "%s.plugins.stroke.socket", "unix://" STROKE_SOCKET
, charon
->name
);
787 this->service
= lib
->streams
->create_service(lib
->streams
, uri
, 10);
790 DBG1(DBG_CFG
, "creating stroke socket failed");
794 this->service
->on_accept(this->service
, (stream_service_cb_t
)on_accept
,
795 this, JOB_PRIO_CRITICAL
, max_concurrent
);
797 return &this->public;