Removed strayed code fragment
[strongswan.git] / src / charon / plugins / socket_raw / socket_raw_socket.c
1 /*
2 * Copyright (C) 2006 Tobias Brunner, Daniel Roethlisberger
3 * Copyright (C) 2005-2010 Martin Willi
4 * Copyright (C) 2005 Jan Hutter
5 * Hochschule fuer Technik Rapperswil
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 */
17
18 /* for struct in6_pktinfo */
19 #define _GNU_SOURCE
20
21 #include "socket_raw_socket.h"
22
23 #include <sys/types.h>
24 #include <sys/socket.h>
25 #include <string.h>
26 #include <errno.h>
27 #include <unistd.h>
28 #include <stdlib.h>
29 #include <fcntl.h>
30 #include <sys/ioctl.h>
31 #include <netinet/in.h>
32 #include <netinet/ip.h>
33 #include <netinet/ip6.h>
34 #include <netinet/udp.h>
35 #include <linux/types.h>
36 #include <linux/filter.h>
37 #include <net/if.h>
38
39 #include <daemon.h>
40 #include <threading/thread.h>
41
42 /* Maximum size of a packet */
43 #define MAX_PACKET 5000
44
45 /* constants for packet handling */
46 #define IP_LEN sizeof(struct iphdr)
47 #define IP6_LEN sizeof(struct ip6_hdr)
48 #define UDP_LEN sizeof(struct udphdr)
49 #define MARKER_LEN sizeof(u_int32_t)
50
51 /* offsets for packet handling */
52 #define IP_PROTO_OFFSET 9
53 #define IP6_PROTO_OFFSET 6
54 #define IKE_VERSION_OFFSET 17
55 #define IKE_LENGTH_OFFSET 24
56
57 /* from linux/udp.h */
58 #ifndef UDP_ENCAP
59 #define UDP_ENCAP 100
60 #endif /*UDP_ENCAP*/
61
62 #ifndef UDP_ENCAP_ESPINUDP
63 #define UDP_ENCAP_ESPINUDP 2
64 #endif /*UDP_ENCAP_ESPINUDP*/
65
66 /* needed for older kernel headers */
67 #ifndef IPV6_2292PKTINFO
68 #define IPV6_2292PKTINFO 2
69 #endif /*IPV6_2292PKTINFO*/
70
71 typedef struct private_socket_raw_socket_t private_socket_raw_socket_t;
72
73 /**
74 * Private data of an socket_t object
75 */
76 struct private_socket_raw_socket_t {
77
78 /**
79 * public functions
80 */
81 socket_raw_socket_t public;
82
83 /**
84 * regular port
85 */
86 int port;
87
88 /**
89 * port used for nat-t
90 */
91 int natt_port;
92
93 /**
94 * raw receiver socket for IPv4
95 */
96 int recv4;
97
98 /**
99 * raw receiver socket for IPv6
100 */
101 int recv6;
102
103 /**
104 * send socket on regular port for IPv4
105 */
106 int send4;
107
108 /**
109 * send socket on regular port for IPv6
110 */
111 int send6;
112
113 /**
114 * send socket on nat-t port for IPv4
115 */
116 int send4_natt;
117
118 /**
119 * send socket on nat-t port for IPv6
120 */
121 int send6_natt;
122 };
123
124 METHOD(socket_t, receiver, status_t,
125 private_socket_raw_socket_t *this, packet_t **packet)
126 {
127 char buffer[MAX_PACKET];
128 chunk_t data;
129 packet_t *pkt;
130 struct udphdr *udp;
131 host_t *source = NULL, *dest = NULL;
132 int bytes_read = 0, data_offset;
133 bool oldstate;
134 fd_set rfds;
135
136 FD_ZERO(&rfds);
137
138 if (this->recv4)
139 {
140 FD_SET(this->recv4, &rfds);
141 }
142 if (this->recv6)
143 {
144 FD_SET(this->recv6, &rfds);
145 }
146
147 DBG2(DBG_NET, "waiting for data on raw sockets");
148
149 oldstate = thread_cancelability(TRUE);
150 if (select(max(this->recv4, this->recv6) + 1, &rfds, NULL, NULL, NULL) <= 0)
151 {
152 thread_cancelability(oldstate);
153 return FAILED;
154 }
155 thread_cancelability(oldstate);
156
157 if (this->recv4 && FD_ISSET(this->recv4, &rfds))
158 {
159 /* IPv4 raw sockets return the IP header. We read src/dest
160 * information directly from the raw header */
161 struct iphdr *ip;
162 struct sockaddr_in src, dst;
163
164 bytes_read = recv(this->recv4, buffer, MAX_PACKET, 0);
165 if (bytes_read < 0)
166 {
167 DBG1(DBG_NET, "error reading from IPv4 socket: %s", strerror(errno));
168 return FAILED;
169 }
170 DBG3(DBG_NET, "received IPv4 packet %b", buffer, bytes_read);
171
172 /* read source/dest from raw IP/UDP header */
173 if (bytes_read < IP_LEN + UDP_LEN + MARKER_LEN)
174 {
175 DBG1(DBG_NET, "received IPv4 packet too short (%d bytes)",
176 bytes_read);
177 return FAILED;
178 }
179 ip = (struct iphdr*) buffer;
180 udp = (struct udphdr*) (buffer + IP_LEN);
181 src.sin_family = AF_INET;
182 src.sin_addr.s_addr = ip->saddr;
183 src.sin_port = udp->source;
184 dst.sin_family = AF_INET;
185 dst.sin_addr.s_addr = ip->daddr;
186 dst.sin_port = udp->dest;
187 source = host_create_from_sockaddr((sockaddr_t*)&src);
188 dest = host_create_from_sockaddr((sockaddr_t*)&dst);
189
190 pkt = packet_create();
191 pkt->set_source(pkt, source);
192 pkt->set_destination(pkt, dest);
193 DBG2(DBG_NET, "received packet: from %#H to %#H", source, dest);
194 data_offset = IP_LEN + UDP_LEN;
195 /* remove non esp marker */
196 if (dest->get_port(dest) == IKEV2_NATT_PORT)
197 {
198 data_offset += MARKER_LEN;
199 }
200 /* fill in packet */
201 data.len = bytes_read - data_offset;
202 data.ptr = malloc(data.len);
203 memcpy(data.ptr, buffer + data_offset, data.len);
204 pkt->set_data(pkt, data);
205 }
206 else if (this->recv6 && FD_ISSET(this->recv6, &rfds))
207 {
208 /* IPv6 raw sockets return no IP header. We must query
209 * src/dest via socket options/ancillary data */
210 struct msghdr msg;
211 struct cmsghdr *cmsgptr;
212 struct sockaddr_in6 src, dst;
213 struct iovec iov;
214 char ancillary[64];
215
216 msg.msg_name = &src;
217 msg.msg_namelen = sizeof(src);
218 iov.iov_base = buffer;
219 iov.iov_len = sizeof(buffer);
220 msg.msg_iov = &iov;
221 msg.msg_iovlen = 1;
222 msg.msg_control = ancillary;
223 msg.msg_controllen = sizeof(ancillary);
224 msg.msg_flags = 0;
225
226 bytes_read = recvmsg(this->recv6, &msg, 0);
227 if (bytes_read < 0)
228 {
229 DBG1(DBG_NET, "error reading from IPv6 socket: %s", strerror(errno));
230 return FAILED;
231 }
232 DBG3(DBG_NET, "received IPv6 packet %b", buffer, bytes_read);
233
234 if (bytes_read < IP_LEN + UDP_LEN + MARKER_LEN)
235 {
236 DBG3(DBG_NET, "received IPv6 packet too short (%d bytes)",
237 bytes_read);
238 return FAILED;
239 }
240
241 /* read ancillary data to get destination address */
242 for (cmsgptr = CMSG_FIRSTHDR(&msg); cmsgptr != NULL;
243 cmsgptr = CMSG_NXTHDR(&msg, cmsgptr))
244 {
245 if (cmsgptr->cmsg_len == 0)
246 {
247 DBG1(DBG_NET, "error reading IPv6 ancillary data");
248 return FAILED;
249 }
250 if (cmsgptr->cmsg_level == SOL_IPV6 &&
251 cmsgptr->cmsg_type == IPV6_2292PKTINFO)
252 {
253 struct in6_pktinfo *pktinfo;
254 pktinfo = (struct in6_pktinfo*)CMSG_DATA(cmsgptr);
255
256 memset(&dst, 0, sizeof(dst));
257 memcpy(&dst.sin6_addr, &pktinfo->ipi6_addr, sizeof(dst.sin6_addr));
258 dst.sin6_family = AF_INET6;
259 udp = (struct udphdr*) (buffer);
260 dst.sin6_port = udp->dest;
261 src.sin6_port = udp->source;
262 dest = host_create_from_sockaddr((sockaddr_t*)&dst);
263 }
264 }
265 /* ancillary data missing? */
266 if (dest == NULL)
267 {
268 DBG1(DBG_NET, "error reading IPv6 packet header");
269 return FAILED;
270 }
271
272 source = host_create_from_sockaddr((sockaddr_t*)&src);
273
274 pkt = packet_create();
275 pkt->set_source(pkt, source);
276 pkt->set_destination(pkt, dest);
277 DBG2(DBG_NET, "received packet: from %#H to %#H", source, dest);
278 data_offset = UDP_LEN;
279 /* remove non esp marker */
280 if (dest->get_port(dest) == IKEV2_NATT_PORT)
281 {
282 data_offset += MARKER_LEN;
283 }
284 /* fill in packet */
285 data.len = bytes_read - data_offset;
286 data.ptr = malloc(data.len);
287 memcpy(data.ptr, buffer + data_offset, data.len);
288 pkt->set_data(pkt, data);
289 }
290 else
291 {
292 /* oops, shouldn't happen */
293 return FAILED;
294 }
295
296 /* return packet */
297 *packet = pkt;
298 return SUCCESS;
299 }
300
301 METHOD(socket_t, sender, status_t,
302 private_socket_raw_socket_t *this, packet_t *packet)
303 {
304 int sport, skt, family;
305 ssize_t bytes_sent;
306 chunk_t data, marked;
307 host_t *src, *dst;
308 struct msghdr msg;
309 struct cmsghdr *cmsg;
310 struct iovec iov;
311
312 src = packet->get_source(packet);
313 dst = packet->get_destination(packet);
314 data = packet->get_data(packet);
315
316 DBG2(DBG_NET, "sending packet: from %#H to %#H", src, dst);
317
318 /* send data */
319 sport = src->get_port(src);
320 family = dst->get_family(dst);
321 if (sport == IKEV2_UDP_PORT)
322 {
323 if (family == AF_INET)
324 {
325 skt = this->send4;
326 }
327 else
328 {
329 skt = this->send6;
330 }
331 }
332 else if (sport == IKEV2_NATT_PORT)
333 {
334 if (family == AF_INET)
335 {
336 skt = this->send4_natt;
337 }
338 else
339 {
340 skt = this->send6_natt;
341 }
342 /* NAT keepalives without marker */
343 if (data.len != 1 || data.ptr[0] != 0xFF)
344 {
345 /* add non esp marker to packet */
346 if (data.len > MAX_PACKET - MARKER_LEN)
347 {
348 DBG1(DBG_NET, "unable to send packet: it's too big (%d bytes)",
349 data.len);
350 return FAILED;
351 }
352 marked = chunk_alloc(data.len + MARKER_LEN);
353 memset(marked.ptr, 0, MARKER_LEN);
354 memcpy(marked.ptr + MARKER_LEN, data.ptr, data.len);
355 /* let the packet do the clean up for us */
356 packet->set_data(packet, marked);
357 data = marked;
358 }
359 }
360 else
361 {
362 DBG1(DBG_NET, "unable to locate a send socket for port %d", sport);
363 return FAILED;
364 }
365
366 memset(&msg, 0, sizeof(struct msghdr));
367 msg.msg_name = dst->get_sockaddr(dst);;
368 msg.msg_namelen = *dst->get_sockaddr_len(dst);
369 iov.iov_base = data.ptr;
370 iov.iov_len = data.len;
371 msg.msg_iov = &iov;
372 msg.msg_iovlen = 1;
373 msg.msg_flags = 0;
374
375 if (!src->is_anyaddr(src))
376 {
377 if (family == AF_INET)
378 {
379 char buf[CMSG_SPACE(sizeof(struct in_pktinfo))];
380 struct in_pktinfo *pktinfo;
381 struct sockaddr_in *sin;
382
383 msg.msg_control = buf;
384 msg.msg_controllen = sizeof(buf);
385 cmsg = CMSG_FIRSTHDR(&msg);
386 cmsg->cmsg_level = SOL_IP;
387 cmsg->cmsg_type = IP_PKTINFO;
388 cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_pktinfo));
389 pktinfo = (struct in_pktinfo*)CMSG_DATA(cmsg);
390 memset(pktinfo, 0, sizeof(struct in_pktinfo));
391 sin = (struct sockaddr_in*)src->get_sockaddr(src);
392 memcpy(&pktinfo->ipi_spec_dst, &sin->sin_addr, sizeof(struct in_addr));
393 }
394 else
395 {
396 char buf[CMSG_SPACE(sizeof(struct in6_pktinfo))];
397 struct in6_pktinfo *pktinfo;
398 struct sockaddr_in6 *sin;
399
400 msg.msg_control = buf;
401 msg.msg_controllen = sizeof(buf);
402 cmsg = CMSG_FIRSTHDR(&msg);
403 cmsg->cmsg_level = SOL_IPV6;
404 cmsg->cmsg_type = IPV6_2292PKTINFO;
405 cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
406 pktinfo = (struct in6_pktinfo*)CMSG_DATA(cmsg);
407 memset(pktinfo, 0, sizeof(struct in6_pktinfo));
408 sin = (struct sockaddr_in6*)src->get_sockaddr(src);
409 memcpy(&pktinfo->ipi6_addr, &sin->sin6_addr, sizeof(struct in6_addr));
410 }
411 }
412
413 bytes_sent = sendmsg(skt, &msg, 0);
414
415 if (bytes_sent != data.len)
416 {
417 DBG1(DBG_NET, "error writing to socket: %s", strerror(errno));
418 return FAILED;
419 }
420 return SUCCESS;
421 }
422
423 /**
424 * open a socket to send packets
425 */
426 static int open_send_socket(private_socket_raw_socket_t *this,
427 int family, u_int16_t port)
428 {
429 int on = TRUE;
430 int type = UDP_ENCAP_ESPINUDP;
431 struct sockaddr_storage addr;
432 u_int sol;
433 int skt;
434
435 memset(&addr, 0, sizeof(addr));
436 /* precalculate constants depending on address family */
437 switch (family)
438 {
439 case AF_INET:
440 {
441 struct sockaddr_in *sin = (struct sockaddr_in *)&addr;
442 sin->sin_family = AF_INET;
443 sin->sin_addr.s_addr = INADDR_ANY;
444 sin->sin_port = htons(port);
445 sol = SOL_IP;
446 break;
447 }
448 case AF_INET6:
449 {
450 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&addr;
451 sin6->sin6_family = AF_INET6;
452 memcpy(&sin6->sin6_addr, &in6addr_any, sizeof(in6addr_any));
453 sin6->sin6_port = htons(port);
454 sol = SOL_IPV6;
455 break;
456 }
457 default:
458 return 0;
459 }
460
461 skt = socket(family, SOCK_DGRAM, IPPROTO_UDP);
462 if (skt < 0)
463 {
464 DBG1(DBG_NET, "could not open send socket: %s", strerror(errno));
465 return 0;
466 }
467
468 if (setsockopt(skt, SOL_SOCKET, SO_REUSEADDR, (void*)&on, sizeof(on)) < 0)
469 {
470 DBG1(DBG_NET, "unable to set SO_REUSEADDR on send socket: %s",
471 strerror(errno));
472 close(skt);
473 return 0;
474 }
475
476 /* bind the send socket */
477 if (bind(skt, (struct sockaddr *)&addr, sizeof(addr)) < 0)
478 {
479 DBG1(DBG_NET, "unable to bind send socket: %s",
480 strerror(errno));
481 close(skt);
482 return 0;
483 }
484
485 if (family == AF_INET)
486 {
487 /* enable UDP decapsulation globally, only for one socket needed */
488 if (setsockopt(skt, SOL_UDP, UDP_ENCAP, &type, sizeof(type)) < 0)
489 {
490 DBG1(DBG_NET, "unable to set UDP_ENCAP: %s; NAT-T may fail",
491 strerror(errno));
492 }
493 }
494
495 if (!charon->kernel_interface->bypass_socket(charon->kernel_interface,
496 skt, family))
497 {
498 DBG1(DBG_NET, "installing bypass policy on send socket failed");
499 }
500
501 return skt;
502 }
503
504 /**
505 * open a socket to receive packets
506 */
507 static int open_recv_socket(private_socket_raw_socket_t *this, int family)
508 {
509 int skt;
510 int on = TRUE;
511 u_int proto_offset, ip_len, sol, udp_header, ike_header;
512
513 /* precalculate constants depending on address family */
514 switch (family)
515 {
516 case AF_INET:
517 proto_offset = IP_PROTO_OFFSET;
518 ip_len = IP_LEN;
519 sol = SOL_IP;
520 break;
521 case AF_INET6:
522 proto_offset = IP6_PROTO_OFFSET;
523 ip_len = 0; /* IPv6 raw sockets contain no IP header */
524 sol = SOL_IPV6;
525 break;
526 default:
527 return 0;
528 }
529 udp_header = ip_len;
530 ike_header = ip_len + UDP_LEN;
531
532 /* This filter code filters out all non-IKEv2 traffic on
533 * a SOCK_RAW IP_PROTP_UDP socket. Handling of other
534 * IKE versions is done in pluto.
535 */
536 struct sock_filter ikev2_filter_code[] =
537 {
538 /* Destination Port must be either port or natt_port */
539 BPF_STMT(BPF_LD+BPF_H+BPF_ABS, udp_header + 2),
540 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, IKEV2_UDP_PORT, 1, 0),
541 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, IKEV2_NATT_PORT, 5, 12),
542 /* port */
543 /* IKE version must be 2.0 */
544 BPF_STMT(BPF_LD+BPF_B+BPF_ABS, ike_header + IKE_VERSION_OFFSET),
545 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x20, 0, 10),
546 /* packet length is length in IKEv2 header + ip header + udp header */
547 BPF_STMT(BPF_LD+BPF_W+BPF_ABS, ike_header + IKE_LENGTH_OFFSET),
548 BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, ip_len + UDP_LEN),
549 BPF_STMT(BPF_RET+BPF_A, 0),
550 /* natt_port */
551 /* nat-t: check for marker */
552 BPF_STMT(BPF_LD+BPF_W+BPF_ABS, ike_header),
553 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0, 0, 5),
554 /* nat-t: IKE version must be 2.0 */
555 BPF_STMT(BPF_LD+BPF_B+BPF_ABS, ike_header + MARKER_LEN + IKE_VERSION_OFFSET),
556 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x20, 0, 3),
557 /* nat-t: packet length is length in IKEv2 header + ip header + udp header + non esp marker */
558 BPF_STMT(BPF_LD+BPF_W+BPF_ABS, ike_header + MARKER_LEN + IKE_LENGTH_OFFSET),
559 BPF_STMT(BPF_ALU+BPF_ADD+BPF_K, ip_len + UDP_LEN + MARKER_LEN),
560 BPF_STMT(BPF_RET+BPF_A, 0),
561 /* packet doesn't match, ignore */
562 BPF_STMT(BPF_RET+BPF_K, 0),
563 };
564
565 /* Filter struct to use with setsockopt */
566 struct sock_fprog ikev2_filter = {
567 sizeof(ikev2_filter_code) / sizeof(struct sock_filter),
568 ikev2_filter_code
569 };
570
571 /* set up a raw socket */
572 skt = socket(family, SOCK_RAW, IPPROTO_UDP);
573 if (skt < 0)
574 {
575 DBG1(DBG_NET, "unable to create raw socket: %s", strerror(errno));
576 return 0;
577 }
578
579 if (setsockopt(skt, SOL_SOCKET, SO_ATTACH_FILTER,
580 &ikev2_filter, sizeof(ikev2_filter)) < 0)
581 {
582 DBG1(DBG_NET, "unable to attach IKEv2 filter to raw socket: %s",
583 strerror(errno));
584 close(skt);
585 return 0;
586 }
587
588 if (family == AF_INET6 &&
589 /* we use IPV6_2292PKTINFO, as IPV6_PKTINFO is defined as
590 * 2 or 50 depending on kernel header version */
591 setsockopt(skt, sol, IPV6_2292PKTINFO, &on, sizeof(on)) < 0)
592 {
593 DBG1(DBG_NET, "unable to set IPV6_PKTINFO on raw socket: %s",
594 strerror(errno));
595 close(skt);
596 return 0;
597 }
598
599 if (!charon->kernel_interface->bypass_socket(charon->kernel_interface,
600 skt, family))
601 {
602 DBG1(DBG_NET, "installing bypass policy on receive socket failed");
603 }
604
605 return skt;
606 }
607
608 METHOD(socket_raw_socket_t, destroy, void,
609 private_socket_raw_socket_t *this)
610 {
611 if (this->recv4)
612 {
613 close(this->recv4);
614 }
615 if (this->recv6)
616 {
617 close(this->recv6);
618 }
619 if (this->send4)
620 {
621 close(this->send4);
622 }
623 if (this->send6)
624 {
625 close(this->send6);
626 }
627 if (this->send4_natt)
628 {
629 close(this->send4_natt);
630 }
631 if (this->send6_natt)
632 {
633 close(this->send6_natt);
634 }
635 free(this);
636 }
637
638 /*
639 * See header for description
640 */
641 socket_raw_socket_t *socket_raw_socket_create()
642 {
643 private_socket_raw_socket_t *this;
644
645 INIT(this,
646 .public = {
647 .socket = {
648 .send = _sender,
649 .receive = _receiver,
650 },
651 .destroy = _destroy,
652 },
653 );
654
655 this->recv4 = open_recv_socket(this, AF_INET);
656 if (this->recv4 == 0)
657 {
658 DBG1(DBG_NET, "could not open IPv4 receive socket, IPv4 disabled");
659 }
660 else
661 {
662 this->send4 = open_send_socket(this, AF_INET, IKEV2_UDP_PORT);
663 if (this->send4 == 0)
664 {
665 DBG1(DBG_NET, "could not open IPv4 send socket, IPv4 disabled");
666 close(this->recv4);
667 }
668 else
669 {
670 this->send4_natt = open_send_socket(this, AF_INET, IKEV2_NATT_PORT);
671 if (this->send4_natt == 0)
672 {
673 DBG1(DBG_NET, "could not open IPv4 NAT-T send socket");
674 }
675 }
676 }
677
678 this->recv6 = open_recv_socket(this, AF_INET6);
679 if (this->recv6 == 0)
680 {
681 DBG1(DBG_NET, "could not open IPv6 receive socket, IPv6 disabled");
682 }
683 else
684 {
685 this->send6 = open_send_socket(this, AF_INET6, IKEV2_UDP_PORT);
686 if (this->send6 == 0)
687 {
688 DBG1(DBG_NET, "could not open IPv6 send socket, IPv6 disabled");
689 close(this->recv6);
690 }
691 else
692 {
693 this->send6_natt = open_send_socket(this, AF_INET6, IKEV2_NATT_PORT);
694 if (this->send6_natt == 0)
695 {
696 DBG1(DBG_NET, "could not open IPv6 NAT-T send socket");
697 }
698 }
699 }
700
701 if (!(this->send4 || this->send6) || !(this->recv4 || this->recv6))
702 {
703 DBG1(DBG_NET, "could not create any sockets");
704 destroy(this);
705 return NULL;
706 }
707
708 return &this->public;
709 }