Fawkes API Fawkes Development Version
ProtobufPeerInterface.cpp
1
2/***************************************************************************
3 * ProtobufPeerInterface.cpp - Fawkes BlackBoard Interface - ProtobufPeerInterface
4 *
5 * Templated created: Thu Oct 12 10:49:19 2006
6 * Copyright 2017 Victor Mataré
7 *
8 ****************************************************************************/
9
10/* This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version. A runtime exception applies to
14 * this software (see LICENSE.GPL_WRE file mentioned below for details).
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Library General Public License for more details.
20 *
21 * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22 */
23
24#include <interfaces/ProtobufPeerInterface.h>
25
26#include <core/exceptions/software.h>
27
28#include <map>
29#include <string>
30#include <cstring>
31#include <cstdlib>
32
33namespace fawkes {
34
35/** @class ProtobufPeerInterface <interfaces/ProtobufPeerInterface.h>
36 * ProtobufPeerInterface Fawkes BlackBoard Interface.
37 * Current peers maintained by the protoboard plugin
38 * @ingroup FawkesInterfaces
39 */
40
41
42
43/** Constructor */
44ProtobufPeerInterface::ProtobufPeerInterface() : Interface()
45{
46 data_size = sizeof(ProtobufPeerInterface_data_t);
47 data_ptr = malloc(data_size);
48 data = (ProtobufPeerInterface_data_t *)data_ptr;
49 data_ts = (interface_data_ts_t *)data_ptr;
50 memset(data_ptr, 0, data_size);
51 add_fieldinfo(IFT_INT64, "peers", 16, &data->peers);
52 add_messageinfo("CreatePeerMessage");
53 add_messageinfo("CreatePeerLocalMessage");
54 add_messageinfo("CreatePeerCryptoMessage");
55 add_messageinfo("CreatePeerLocalCryptoMessage");
56 unsigned char tmp_hash[] = {0x58, 0xc8, 0xa0, 0x57, 0x5c, 0x89, 0x32, 0xeb, 0x5a, 0xf0, 0x75, 0xbc, 0x6d, 0x15, 0xb3, 0x90};
57 set_hash(tmp_hash);
58}
59
60/** Destructor */
61ProtobufPeerInterface::~ProtobufPeerInterface()
62{
63 free(data_ptr);
64}
65/* Methods */
66/** Get peers value.
67 * Currently active peers
68 * @return peers value
69 */
70int64_t *
71ProtobufPeerInterface::peers() const
72{
73 return data->peers;
74}
75
76/** Get peers value at given index.
77 * Currently active peers
78 * @param index index of value
79 * @return peers value
80 * @exception Exception thrown if index is out of bounds
81 */
82int64_t
83ProtobufPeerInterface::peers(unsigned int index) const
84{
85 if (index > 15) {
86 throw Exception("Index value %u out of bounds (0..15)", index);
87 }
88 return data->peers[index];
89}
90
91/** Get maximum length of peers value.
92 * @return length of peers value, can be length of the array or number of
93 * maximum number of characters for a string
94 */
95size_t
96ProtobufPeerInterface::maxlenof_peers() const
97{
98 return 16;
99}
100
101/** Set peers value.
102 * Currently active peers
103 * @param new_peers new peers value
104 */
105void
106ProtobufPeerInterface::set_peers(const int64_t * new_peers)
107{
108 set_field(data->peers, new_peers);
109}
110
111/** Set peers value at given index.
112 * Currently active peers
113 * @param new_peers new peers value
114 * @param index index for of the value
115 */
116void
117ProtobufPeerInterface::set_peers(unsigned int index, const int64_t new_peers)
118{
119 set_field(data->peers, index, new_peers);
120}
121/* =========== message create =========== */
122Message *
123ProtobufPeerInterface::create_message(const char *type) const
124{
125 if ( strncmp("CreatePeerMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
126 return new CreatePeerMessage();
127 } else if ( strncmp("CreatePeerLocalMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
128 return new CreatePeerLocalMessage();
129 } else if ( strncmp("CreatePeerCryptoMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
130 return new CreatePeerCryptoMessage();
131 } else if ( strncmp("CreatePeerLocalCryptoMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
132 return new CreatePeerLocalCryptoMessage();
133 } else {
134 throw UnknownTypeException("The given type '%s' does not match any known "
135 "message type for this interface type.", type);
136 }
137}
138
139
140/** Copy values from other interface.
141 * @param other other interface to copy values from
142 */
143void
144ProtobufPeerInterface::copy_values(const Interface *other)
145{
146 const ProtobufPeerInterface *oi = dynamic_cast<const ProtobufPeerInterface *>(other);
147 if (oi == NULL) {
148 throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)",
149 type(), other->type());
150 }
151 memcpy(data, oi->data, sizeof(ProtobufPeerInterface_data_t));
152}
153
154const char *
155ProtobufPeerInterface::enum_tostring(const char *enumtype, int val) const
156{
157 throw UnknownTypeException("Unknown enum type %s", enumtype);
158}
159
160/* =========== messages =========== */
161/** @class ProtobufPeerInterface::CreatePeerMessage <interfaces/ProtobufPeerInterface.h>
162 * CreatePeerMessage Fawkes BlackBoard Interface Message.
163 *
164
165 */
166
167
168/** Constructor with initial values.
169 * @param ini_address initial value for address
170 * @param ini_port initial value for port
171 */
172ProtobufPeerInterface::CreatePeerMessage::CreatePeerMessage(const char * ini_address, const int32_t ini_port) : Message("CreatePeerMessage")
173{
174 data_size = sizeof(CreatePeerMessage_data_t);
175 data_ptr = malloc(data_size);
176 memset(data_ptr, 0, data_size);
177 data = (CreatePeerMessage_data_t *)data_ptr;
179 strncpy(data->address, ini_address, 255-1);
180 data->address[255-1] = 0;
181 data->port = ini_port;
182 add_fieldinfo(IFT_STRING, "address", 255, data->address);
183 add_fieldinfo(IFT_INT32, "port", 1, &data->port);
184}
185/** Constructor */
187{
188 data_size = sizeof(CreatePeerMessage_data_t);
189 data_ptr = malloc(data_size);
190 memset(data_ptr, 0, data_size);
191 data = (CreatePeerMessage_data_t *)data_ptr;
193 add_fieldinfo(IFT_STRING, "address", 255, data->address);
194 add_fieldinfo(IFT_INT32, "port", 1, &data->port);
195}
196
197/** Destructor */
199{
200 free(data_ptr);
201}
202
203/** Copy constructor.
204 * @param m message to copy from
205 */
207{
208 data_size = m->data_size;
209 data_ptr = malloc(data_size);
210 memcpy(data_ptr, m->data_ptr, data_size);
211 data = (CreatePeerMessage_data_t *)data_ptr;
213}
214
215/* Methods */
216/** Get address value.
217 * IP address or host name
218 * @return address value
219 */
220char *
222{
223 return data->address;
224}
225
226/** Get maximum length of address value.
227 * @return length of address value, can be length of the array or number of
228 * maximum number of characters for a string
229 */
230size_t
232{
233 return 255;
234}
235
236/** Set address value.
237 * IP address or host name
238 * @param new_address new address value
239 */
240void
242{
243 set_field(data->address, new_address);
244}
245
246/** Get port value.
247 * Port to send to/receive on
248 * @return port value
249 */
250int32_t
252{
253 return data->port;
254}
255
256/** Get maximum length of port value.
257 * @return length of port value, can be length of the array or number of
258 * maximum number of characters for a string
259 */
260size_t
262{
263 return 1;
264}
265
266/** Set port value.
267 * Port to send to/receive on
268 * @param new_port new port value
269 */
270void
272{
273 set_field(data->port, new_port);
274}
275
276/** Clone this message.
277 * Produces a message of the same type as this message and copies the
278 * data to the new message.
279 * @return clone of this message
280 */
281Message *
283{
285}
286/** @class ProtobufPeerInterface::CreatePeerLocalMessage <interfaces/ProtobufPeerInterface.h>
287 * CreatePeerLocalMessage Fawkes BlackBoard Interface Message.
288 *
289
290 */
291
292
293/** Constructor with initial values.
294 * @param ini_address initial value for address
295 * @param ini_send_to_port initial value for send_to_port
296 * @param ini_recv_on_port initial value for recv_on_port
297 */
298ProtobufPeerInterface::CreatePeerLocalMessage::CreatePeerLocalMessage(const char * ini_address, const int32_t ini_send_to_port, const int32_t ini_recv_on_port) : Message("CreatePeerLocalMessage")
299{
300 data_size = sizeof(CreatePeerLocalMessage_data_t);
301 data_ptr = malloc(data_size);
302 memset(data_ptr, 0, data_size);
303 data = (CreatePeerLocalMessage_data_t *)data_ptr;
305 strncpy(data->address, ini_address, 255-1);
306 data->address[255-1] = 0;
307 data->send_to_port = ini_send_to_port;
308 data->recv_on_port = ini_recv_on_port;
309 add_fieldinfo(IFT_STRING, "address", 255, data->address);
310 add_fieldinfo(IFT_INT32, "send_to_port", 1, &data->send_to_port);
311 add_fieldinfo(IFT_INT32, "recv_on_port", 1, &data->recv_on_port);
312}
313/** Constructor */
315{
316 data_size = sizeof(CreatePeerLocalMessage_data_t);
317 data_ptr = malloc(data_size);
318 memset(data_ptr, 0, data_size);
319 data = (CreatePeerLocalMessage_data_t *)data_ptr;
321 add_fieldinfo(IFT_STRING, "address", 255, data->address);
322 add_fieldinfo(IFT_INT32, "send_to_port", 1, &data->send_to_port);
323 add_fieldinfo(IFT_INT32, "recv_on_port", 1, &data->recv_on_port);
324}
325
326/** Destructor */
328{
329 free(data_ptr);
330}
331
332/** Copy constructor.
333 * @param m message to copy from
334 */
336{
337 data_size = m->data_size;
338 data_ptr = malloc(data_size);
339 memcpy(data_ptr, m->data_ptr, data_size);
340 data = (CreatePeerLocalMessage_data_t *)data_ptr;
342}
343
344/* Methods */
345/** Get address value.
346 * IP address or host name
347 * @return address value
348 */
349char *
351{
352 return data->address;
353}
354
355/** Get maximum length of address value.
356 * @return length of address value, can be length of the array or number of
357 * maximum number of characters for a string
358 */
359size_t
361{
362 return 255;
363}
364
365/** Set address value.
366 * IP address or host name
367 * @param new_address new address value
368 */
369void
371{
372 set_field(data->address, new_address);
373}
374
375/** Get send_to_port value.
376 * Port to send to
377 * @return send_to_port value
378 */
379int32_t
381{
382 return data->send_to_port;
383}
384
385/** Get maximum length of send_to_port value.
386 * @return length of send_to_port value, can be length of the array or number of
387 * maximum number of characters for a string
388 */
389size_t
391{
392 return 1;
393}
394
395/** Set send_to_port value.
396 * Port to send to
397 * @param new_send_to_port new send_to_port value
398 */
399void
401{
402 set_field(data->send_to_port, new_send_to_port);
403}
404
405/** Get recv_on_port value.
406 * Port to receive on
407 * @return recv_on_port value
408 */
409int32_t
411{
412 return data->recv_on_port;
413}
414
415/** Get maximum length of recv_on_port value.
416 * @return length of recv_on_port value, can be length of the array or number of
417 * maximum number of characters for a string
418 */
419size_t
421{
422 return 1;
423}
424
425/** Set recv_on_port value.
426 * Port to receive on
427 * @param new_recv_on_port new recv_on_port value
428 */
429void
431{
432 set_field(data->recv_on_port, new_recv_on_port);
433}
434
435/** Clone this message.
436 * Produces a message of the same type as this message and copies the
437 * data to the new message.
438 * @return clone of this message
439 */
440Message *
442{
444}
445/** @class ProtobufPeerInterface::CreatePeerCryptoMessage <interfaces/ProtobufPeerInterface.h>
446 * CreatePeerCryptoMessage Fawkes BlackBoard Interface Message.
447 *
448
449 */
450
451
452/** Constructor with initial values.
453 * @param ini_address initial value for address
454 * @param ini_port initial value for port
455 * @param ini_crypto_key initial value for crypto_key
456 * @param ini_cipher initial value for cipher
457 */
458ProtobufPeerInterface::CreatePeerCryptoMessage::CreatePeerCryptoMessage(const char * ini_address, const int32_t ini_port, const char * ini_crypto_key, const char * ini_cipher) : Message("CreatePeerCryptoMessage")
459{
460 data_size = sizeof(CreatePeerCryptoMessage_data_t);
461 data_ptr = malloc(data_size);
462 memset(data_ptr, 0, data_size);
463 data = (CreatePeerCryptoMessage_data_t *)data_ptr;
465 strncpy(data->address, ini_address, 255-1);
466 data->address[255-1] = 0;
467 data->port = ini_port;
468 strncpy(data->crypto_key, ini_crypto_key, 1024-1);
469 data->crypto_key[1024-1] = 0;
470 strncpy(data->cipher, ini_cipher, 255-1);
471 data->cipher[255-1] = 0;
472 add_fieldinfo(IFT_STRING, "address", 255, data->address);
473 add_fieldinfo(IFT_INT32, "port", 1, &data->port);
474 add_fieldinfo(IFT_STRING, "crypto_key", 1024, data->crypto_key);
475 add_fieldinfo(IFT_STRING, "cipher", 255, data->cipher);
476}
477/** Constructor */
479{
480 data_size = sizeof(CreatePeerCryptoMessage_data_t);
481 data_ptr = malloc(data_size);
482 memset(data_ptr, 0, data_size);
483 data = (CreatePeerCryptoMessage_data_t *)data_ptr;
485 add_fieldinfo(IFT_STRING, "address", 255, data->address);
486 add_fieldinfo(IFT_INT32, "port", 1, &data->port);
487 add_fieldinfo(IFT_STRING, "crypto_key", 1024, data->crypto_key);
488 add_fieldinfo(IFT_STRING, "cipher", 255, data->cipher);
489}
490
491/** Destructor */
493{
494 free(data_ptr);
495}
496
497/** Copy constructor.
498 * @param m message to copy from
499 */
501{
502 data_size = m->data_size;
503 data_ptr = malloc(data_size);
504 memcpy(data_ptr, m->data_ptr, data_size);
505 data = (CreatePeerCryptoMessage_data_t *)data_ptr;
507}
508
509/* Methods */
510/** Get address value.
511 * IP address or host name
512 * @return address value
513 */
514char *
516{
517 return data->address;
518}
519
520/** Get maximum length of address value.
521 * @return length of address value, can be length of the array or number of
522 * maximum number of characters for a string
523 */
524size_t
526{
527 return 255;
528}
529
530/** Set address value.
531 * IP address or host name
532 * @param new_address new address value
533 */
534void
536{
537 set_field(data->address, new_address);
538}
539
540/** Get port value.
541 * Port to send to/receive on
542 * @return port value
543 */
544int32_t
546{
547 return data->port;
548}
549
550/** Get maximum length of port value.
551 * @return length of port value, can be length of the array or number of
552 * maximum number of characters for a string
553 */
554size_t
556{
557 return 1;
558}
559
560/** Set port value.
561 * Port to send to/receive on
562 * @param new_port new port value
563 */
564void
566{
567 set_field(data->port, new_port);
568}
569
570/** Get crypto_key value.
571 * Crypto key
572 * @return crypto_key value
573 */
574char *
576{
577 return data->crypto_key;
578}
579
580/** Get maximum length of crypto_key value.
581 * @return length of crypto_key value, can be length of the array or number of
582 * maximum number of characters for a string
583 */
584size_t
586{
587 return 1024;
588}
589
590/** Set crypto_key value.
591 * Crypto key
592 * @param new_crypto_key new crypto_key value
593 */
594void
596{
597 set_field(data->crypto_key, new_crypto_key);
598}
599
600/** Get cipher value.
601 * Cipher name
602 * @return cipher value
603 */
604char *
606{
607 return data->cipher;
608}
609
610/** Get maximum length of cipher value.
611 * @return length of cipher value, can be length of the array or number of
612 * maximum number of characters for a string
613 */
614size_t
616{
617 return 255;
618}
619
620/** Set cipher value.
621 * Cipher name
622 * @param new_cipher new cipher value
623 */
624void
626{
627 set_field(data->cipher, new_cipher);
628}
629
630/** Clone this message.
631 * Produces a message of the same type as this message and copies the
632 * data to the new message.
633 * @return clone of this message
634 */
635Message *
637{
639}
640/** @class ProtobufPeerInterface::CreatePeerLocalCryptoMessage <interfaces/ProtobufPeerInterface.h>
641 * CreatePeerLocalCryptoMessage Fawkes BlackBoard Interface Message.
642 *
643
644 */
645
646
647/** Constructor with initial values.
648 * @param ini_address initial value for address
649 * @param ini_send_to_port initial value for send_to_port
650 * @param ini_recv_on_port initial value for recv_on_port
651 * @param ini_crypto_key initial value for crypto_key
652 * @param ini_cipher initial value for cipher
653 */
654ProtobufPeerInterface::CreatePeerLocalCryptoMessage::CreatePeerLocalCryptoMessage(const char * ini_address, const int32_t ini_send_to_port, const int32_t ini_recv_on_port, const char * ini_crypto_key, const char * ini_cipher) : Message("CreatePeerLocalCryptoMessage")
655{
656 data_size = sizeof(CreatePeerLocalCryptoMessage_data_t);
657 data_ptr = malloc(data_size);
658 memset(data_ptr, 0, data_size);
659 data = (CreatePeerLocalCryptoMessage_data_t *)data_ptr;
661 strncpy(data->address, ini_address, 255-1);
662 data->address[255-1] = 0;
663 data->send_to_port = ini_send_to_port;
664 data->recv_on_port = ini_recv_on_port;
665 strncpy(data->crypto_key, ini_crypto_key, 1024-1);
666 data->crypto_key[1024-1] = 0;
667 strncpy(data->cipher, ini_cipher, 255-1);
668 data->cipher[255-1] = 0;
669 add_fieldinfo(IFT_STRING, "address", 255, data->address);
670 add_fieldinfo(IFT_INT32, "send_to_port", 1, &data->send_to_port);
671 add_fieldinfo(IFT_INT32, "recv_on_port", 1, &data->recv_on_port);
672 add_fieldinfo(IFT_STRING, "crypto_key", 1024, data->crypto_key);
673 add_fieldinfo(IFT_STRING, "cipher", 255, data->cipher);
674}
675/** Constructor */
677{
678 data_size = sizeof(CreatePeerLocalCryptoMessage_data_t);
679 data_ptr = malloc(data_size);
680 memset(data_ptr, 0, data_size);
681 data = (CreatePeerLocalCryptoMessage_data_t *)data_ptr;
683 add_fieldinfo(IFT_STRING, "address", 255, data->address);
684 add_fieldinfo(IFT_INT32, "send_to_port", 1, &data->send_to_port);
685 add_fieldinfo(IFT_INT32, "recv_on_port", 1, &data->recv_on_port);
686 add_fieldinfo(IFT_STRING, "crypto_key", 1024, data->crypto_key);
687 add_fieldinfo(IFT_STRING, "cipher", 255, data->cipher);
688}
689
690/** Destructor */
692{
693 free(data_ptr);
694}
695
696/** Copy constructor.
697 * @param m message to copy from
698 */
700{
701 data_size = m->data_size;
702 data_ptr = malloc(data_size);
703 memcpy(data_ptr, m->data_ptr, data_size);
704 data = (CreatePeerLocalCryptoMessage_data_t *)data_ptr;
706}
707
708/* Methods */
709/** Get address value.
710 * IP address or host name
711 * @return address value
712 */
713char *
715{
716 return data->address;
717}
718
719/** Get maximum length of address value.
720 * @return length of address value, can be length of the array or number of
721 * maximum number of characters for a string
722 */
723size_t
725{
726 return 255;
727}
728
729/** Set address value.
730 * IP address or host name
731 * @param new_address new address value
732 */
733void
735{
736 set_field(data->address, new_address);
737}
738
739/** Get send_to_port value.
740 * Port to send to
741 * @return send_to_port value
742 */
743int32_t
745{
746 return data->send_to_port;
747}
748
749/** Get maximum length of send_to_port value.
750 * @return length of send_to_port value, can be length of the array or number of
751 * maximum number of characters for a string
752 */
753size_t
755{
756 return 1;
757}
758
759/** Set send_to_port value.
760 * Port to send to
761 * @param new_send_to_port new send_to_port value
762 */
763void
765{
766 set_field(data->send_to_port, new_send_to_port);
767}
768
769/** Get recv_on_port value.
770 * Port to receive on
771 * @return recv_on_port value
772 */
773int32_t
775{
776 return data->recv_on_port;
777}
778
779/** Get maximum length of recv_on_port value.
780 * @return length of recv_on_port value, can be length of the array or number of
781 * maximum number of characters for a string
782 */
783size_t
785{
786 return 1;
787}
788
789/** Set recv_on_port value.
790 * Port to receive on
791 * @param new_recv_on_port new recv_on_port value
792 */
793void
795{
796 set_field(data->recv_on_port, new_recv_on_port);
797}
798
799/** Get crypto_key value.
800 * Crypto key
801 * @return crypto_key value
802 */
803char *
805{
806 return data->crypto_key;
807}
808
809/** Get maximum length of crypto_key value.
810 * @return length of crypto_key value, can be length of the array or number of
811 * maximum number of characters for a string
812 */
813size_t
815{
816 return 1024;
817}
818
819/** Set crypto_key value.
820 * Crypto key
821 * @param new_crypto_key new crypto_key value
822 */
823void
825{
826 set_field(data->crypto_key, new_crypto_key);
827}
828
829/** Get cipher value.
830 * Cipher name
831 * @return cipher value
832 */
833char *
835{
836 return data->cipher;
837}
838
839/** Get maximum length of cipher value.
840 * @return length of cipher value, can be length of the array or number of
841 * maximum number of characters for a string
842 */
843size_t
845{
846 return 255;
847}
848
849/** Set cipher value.
850 * Cipher name
851 * @param new_cipher new cipher value
852 */
853void
855{
856 set_field(data->cipher, new_cipher);
857}
858
859/** Clone this message.
860 * Produces a message of the same type as this message and copies the
861 * data to the new message.
862 * @return clone of this message
863 */
864Message *
866{
868}
869/** Check if message is valid and can be enqueued.
870 * @param message Message to check
871 * @return true if the message is valid, false otherwise.
872 */
873bool
875{
876 const CreatePeerMessage *m0 = dynamic_cast<const CreatePeerMessage *>(message);
877 if ( m0 != NULL ) {
878 return true;
879 }
880 const CreatePeerLocalMessage *m1 = dynamic_cast<const CreatePeerLocalMessage *>(message);
881 if ( m1 != NULL ) {
882 return true;
883 }
884 const CreatePeerCryptoMessage *m2 = dynamic_cast<const CreatePeerCryptoMessage *>(message);
885 if ( m2 != NULL ) {
886 return true;
887 }
888 const CreatePeerLocalCryptoMessage *m3 = dynamic_cast<const CreatePeerLocalCryptoMessage *>(message);
889 if ( m3 != NULL ) {
890 return true;
891 }
892 return false;
893}
894
895/// @cond INTERNALS
896EXPORT_INTERFACE(ProtobufPeerInterface)
897/// @endcond
898
899
900} // end namespace fawkes
Base class for exceptions in Fawkes.
Definition: exception.h:36
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:80
const char * type() const
Get type of interface.
Definition: interface.cpp:652
void * data_ptr
Pointer to local memory storage.
Definition: interface.h:244
void set_field(FieldT &field, DataT &data)
Set a field, set data_changed to true and update data_changed accordingly.
Definition: interface.h:304
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:44
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0, const interface_enum_map_t *enum_map=0)
Add an entry to the info list.
Definition: message.cpp:435
void * data_ptr
Pointer to memory that contains local data.
Definition: message.h:146
message_data_ts_t * data_ts
data timestamp aliasing pointer
Definition: message.h:156
unsigned int data_size
Size of memory needed to hold all data.
Definition: message.h:147
CreatePeerCryptoMessage Fawkes BlackBoard Interface Message.
void set_cipher(const char *new_cipher)
Set cipher value.
virtual Message * clone() const
Clone this message.
void set_address(const char *new_address)
Set address value.
size_t maxlenof_cipher() const
Get maximum length of cipher value.
void set_port(const int32_t new_port)
Set port value.
size_t maxlenof_crypto_key() const
Get maximum length of crypto_key value.
size_t maxlenof_port() const
Get maximum length of port value.
void set_crypto_key(const char *new_crypto_key)
Set crypto_key value.
size_t maxlenof_address() const
Get maximum length of address value.
CreatePeerLocalCryptoMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_send_to_port() const
Get maximum length of send_to_port value.
size_t maxlenof_recv_on_port() const
Get maximum length of recv_on_port value.
void set_send_to_port(const int32_t new_send_to_port)
Set send_to_port value.
void set_crypto_key(const char *new_crypto_key)
Set crypto_key value.
size_t maxlenof_cipher() const
Get maximum length of cipher value.
void set_address(const char *new_address)
Set address value.
void set_recv_on_port(const int32_t new_recv_on_port)
Set recv_on_port value.
size_t maxlenof_crypto_key() const
Get maximum length of crypto_key value.
void set_cipher(const char *new_cipher)
Set cipher value.
size_t maxlenof_address() const
Get maximum length of address value.
CreatePeerLocalMessage Fawkes BlackBoard Interface Message.
void set_send_to_port(const int32_t new_send_to_port)
Set send_to_port value.
void set_recv_on_port(const int32_t new_recv_on_port)
Set recv_on_port value.
size_t maxlenof_send_to_port() const
Get maximum length of send_to_port value.
void set_address(const char *new_address)
Set address value.
size_t maxlenof_address() const
Get maximum length of address value.
size_t maxlenof_recv_on_port() const
Get maximum length of recv_on_port value.
virtual Message * clone() const
Clone this message.
CreatePeerMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_port() const
Get maximum length of port value.
virtual Message * clone() const
Clone this message.
size_t maxlenof_address() const
Get maximum length of address value.
void set_address(const char *new_address)
Set address value.
void set_port(const int32_t new_port)
Set port value.
ProtobufPeerInterface Fawkes BlackBoard Interface.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
Fawkes library namespace.
@ IFT_INT32
32 bit integer field
Definition: types.h:42
@ IFT_STRING
string field
Definition: types.h:48
Timestamp data, must be present and first entries for each interface data structs!...
Definition: message.h:152