GNUnet 0.26.1
 
Loading...
Searching...
No Matches
conversation_api.c
Go to the documentation of this file.
1/*
2 This file is part of GNUnet
3 Copyright (C) 2013, 2014 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
28#include "platform.h"
30#include "conversation.h"
31
32
63
64
120
121
126{
131
137
138
202
203
209static void
211
212
220static void
222 size_t data_size,
223 const void *data)
224{
225 struct GNUNET_CONVERSATION_Caller *caller = cls;
226 struct GNUNET_CONVERSATION_Phone *phone = caller->phone;
227 struct GNUNET_MQ_Envelope *e;
228 struct ClientAudioMessage *am;
229
230 e = GNUNET_MQ_msg_extra (am,
231 data_size,
233 am->cid = caller->cid;
234 GNUNET_memcpy (&am[1],
235 data,
236 data_size);
238 e);
239}
240
241
250 const struct ClientPhoneRingMessage *ring)
251{
252 // FIXME
253 return GNUNET_OK;
254}
255
256
263static void
265 const struct ClientPhoneRingMessage *ring)
266{
267 struct GNUNET_CONVERSATION_Phone *phone = cls;
268 struct GNUNET_CONVERSATION_Caller *caller;
269 struct GNUNET_CRYPTO_BlindablePublicKey caller_id;
270 size_t key_len;
271 size_t read;
272
273 key_len = ntohl (ring->key_len);
274 switch (phone->state)
275 {
276 case PS_REGISTER:
277 GNUNET_assert (0);
278 break;
279
280 case PS_READY:
281 if ((GNUNET_SYSERR ==
283 key_len,
284 &caller_id,
285 &read)) ||
286 (read != key_len))
287 {
288 GNUNET_break (0);
289 break;
290 }
291 caller = GNUNET_new (struct GNUNET_CONVERSATION_Caller);
292 caller->phone = phone;
295 caller);
296 caller->caller_id = caller_id;
297 caller->cid = ring->cid;
298 caller->state = CS_RINGING;
301 caller,
302 &caller->caller_id);
303 break;
304 }
305}
306
307
315static struct GNUNET_CONVERSATION_Caller *
317 uint32_t cid)
318{
319 struct GNUNET_CONVERSATION_Caller *caller;
320
321 for (caller = phone->caller_head; NULL != caller; caller = caller->next)
322 if (cid == caller->cid)
323 return caller;
324 return NULL;
325}
326
327
334static void
336 const struct ClientPhoneHangupMessage *hang)
337{
338 struct GNUNET_CONVERSATION_Phone *phone = cls;
339 struct GNUNET_CONVERSATION_Caller *caller;
340
341 caller = find_caller (phone,
342 hang->cid);
343 if (NULL == caller)
344 {
346 "Received HANG_UP message for unknown caller ID %u\n",
347 (unsigned int) hang->cid);
348 return;
349 }
350
352 "Received HANG_UP message, terminating call with `%s'\n",
354 switch (caller->state)
355 {
356 case CS_RINGING:
359 caller,
360 &caller->caller_id);
361 break;
362
363 case CS_ACTIVE:
364 caller->speaker->disable_speaker (caller->speaker->cls);
365 caller->mic->disable_microphone (caller->mic->cls);
368 caller,
369 &caller->caller_id);
370 break;
371
377 caller,
378 &caller->caller_id);
379 break;
380 }
383 caller);
384 GNUNET_free (caller);
385}
386
387
394static void
396 const struct ClientPhoneSuspendMessage *suspend)
397{
398 struct GNUNET_CONVERSATION_Phone *phone = cls;
399 struct GNUNET_CONVERSATION_Caller *caller;
400
401 caller = find_caller (phone,
402 suspend->cid);
403 if (NULL == caller)
404 return;
405 switch (caller->state)
406 {
407 case CS_RINGING:
408 GNUNET_break_op (0);
409 break;
410
411 case CS_ACTIVE:
412 caller->state = CS_CALLER_SUSPENDED;
413 caller->speaker->disable_speaker (caller->speaker->cls);
414 caller->mic->disable_microphone (caller->mic->cls);
415 caller->event_handler (caller->event_handler_cls,
417 break;
418
420 caller->state = CS_BOTH_SUSPENDED;
421 caller->event_handler (caller->event_handler_cls,
423 break;
424
427 GNUNET_break_op (0);
428 break;
429 }
430}
431
432
439static void
441 const struct ClientPhoneResumeMessage *resume)
442{
443 struct GNUNET_CONVERSATION_Phone *phone = cls;
444 struct GNUNET_CONVERSATION_Caller *caller;
445
446 caller = find_caller (phone,
447 resume->cid);
448 if (NULL == caller)
449 return;
450 switch (caller->state)
451 {
452 case CS_RINGING:
453 GNUNET_break_op (0);
454 break;
455
456 case CS_ACTIVE:
458 GNUNET_break_op (0);
459 break;
460
462 caller->state = CS_ACTIVE;
463 caller->speaker->enable_speaker (caller->speaker->cls);
464 caller->mic->enable_microphone (caller->mic->cls,
466 caller);
467 caller->event_handler (caller->event_handler_cls,
469 break;
470
472 caller->state = CS_CALLEE_SUSPENDED;
473 caller->event_handler (caller->event_handler_cls,
475 break;
476 }
477}
478
479
487static int
489 const struct ClientAudioMessage *am)
490{
491 (void) cls;
492 (void) am;
493
494 /* any variable-size payload is OK */
495 return GNUNET_OK;
496}
497
498
505static void
507 const struct ClientAudioMessage *am)
508{
509 struct GNUNET_CONVERSATION_Phone *phone = cls;
510 struct GNUNET_CONVERSATION_Caller *caller;
511
512 caller = find_caller (phone,
513 am->cid);
514 if (NULL == caller)
515 return;
516 switch (caller->state)
517 {
518 case CS_RINGING:
519 GNUNET_break_op (0);
520 break;
521
522 case CS_ACTIVE:
523 caller->speaker->play (caller->speaker->cls,
524 ntohs (am->header.size) - sizeof(struct
526 &am[1]);
527 break;
528
532 break;
533 }
534}
535
536
543static void
545 enum GNUNET_MQ_Error error)
546{
547 struct GNUNET_CONVERSATION_Phone *phone = cls;
548
549 (void) error;
551 _ (
552 "Connection to conversation service lost, trying to reconnect\n"));
554}
555
556
562static void
564{
565 struct GNUNET_CONVERSATION_Caller *caller;
566
567 while (NULL != (caller = phone->caller_head))
568 {
569 /* make sure mic/speaker are disabled *before* callback */
570 if (CS_ACTIVE == caller->state)
571 {
572 caller->speaker->disable_speaker (caller->speaker->cls);
573 caller->mic->disable_microphone (caller->mic->cls);
574 caller->state = CS_CALLER_SUSPENDED;
575 }
578 caller,
579 &caller->caller_id);
581 }
582}
583
584
590static void
640
641
654 const struct GNUNET_IDENTITY_Ego *ego,
657 void *event_handler_cls)
658{
660 char *line;
661 struct GNUNET_HashCode line_port;
662
663 if (GNUNET_OK !=
665 "CONVERSATION",
666 "LINE",
667 &line))
668 {
670 "CONVERSATION",
671 "LINE");
672 return NULL;
673 }
675 strlen (line),
676 &line_port);
679 if (GNUNET_OK !=
682 {
683 GNUNET_break (0);
685 return NULL;
686 }
687 phone->cfg = cfg;
689 phone->event_handler = event_handler;
690 phone->event_handler_cls = event_handler_cls;
692 phone->my_record.version = htonl (1);
693 phone->my_record.reserved = htonl (0);
694 phone->my_record.line_port = line_port;
696 if ((NULL == phone->mq) ||
697 (NULL == phone->ns))
698 {
699 GNUNET_break (0);
701 return NULL;
702 }
703 return phone;
704}
705
706
715void
725
726
737void
740 event_handler,
741 void *event_handler_cls,
744{
745 struct GNUNET_CONVERSATION_Phone *phone = caller->phone;
746 struct GNUNET_MQ_Envelope *e;
747 struct ClientPhonePickupMessage *pick;
748
749 GNUNET_assert (CS_RINGING == caller->state);
750 caller->speaker = speaker;
751 caller->mic = mic;
752 e = GNUNET_MQ_msg (pick,
754 pick->cid = caller->cid;
756 e);
757 caller->state = CS_ACTIVE;
758 caller->event_handler = event_handler;
759 caller->event_handler_cls = event_handler_cls;
760 caller->speaker->enable_speaker (caller->speaker->cls);
761 caller->mic->enable_microphone (caller->mic->cls,
763 caller);
764}
765
766
773void
775{
776 struct GNUNET_CONVERSATION_Phone *phone = caller->phone;
777 struct GNUNET_MQ_Envelope *e;
778 struct ClientPhoneHangupMessage *hang;
779
780 switch (caller->state)
781 {
782 case CS_ACTIVE:
783 caller->speaker->disable_speaker (caller->speaker->cls);
784 caller->mic->disable_microphone (caller->mic->cls);
785 break;
786
787 default:
788 break;
789 }
792 caller);
793 e = GNUNET_MQ_msg (hang,
795 hang->cid = caller->cid;
797 e);
798 GNUNET_free (caller);
799}
800
801
807void
809{
811 if (NULL != phone->ns)
812 {
814 phone->ns = NULL;
815 }
816 if (NULL != phone->mq)
817 {
819 phone->mq = NULL;
820 }
822}
823
824
832void
834{
835 struct GNUNET_CONVERSATION_Phone *phone = caller->phone;
836 struct GNUNET_MQ_Envelope *e;
837 struct ClientPhoneSuspendMessage *suspend;
838
839 GNUNET_assert ((CS_ACTIVE == caller->state) ||
840 (CS_CALLER_SUSPENDED == caller->state));
841 if (CS_ACTIVE == caller->state)
842 {
843 caller->speaker->disable_speaker (caller->speaker->cls);
844 caller->mic->disable_microphone (caller->mic->cls);
845 }
846 caller->speaker = NULL;
847 caller->mic = NULL;
848 e = GNUNET_MQ_msg (suspend,
850 suspend->cid = caller->cid;
852 e);
853 if (CS_ACTIVE == caller->state)
854 caller->state = CS_CALLEE_SUSPENDED;
855 else
856 caller->state = CS_BOTH_SUSPENDED;
857}
858
859
867void
871{
872 struct GNUNET_CONVERSATION_Phone *phone = caller->phone;
873 struct GNUNET_MQ_Envelope *e;
874 struct ClientPhoneResumeMessage *resume;
875
877 (CS_BOTH_SUSPENDED == caller->state));
878 caller->speaker = speaker;
879 caller->mic = mic;
880 e = GNUNET_MQ_msg (resume,
882 resume->cid = caller->cid;
884 e);
885 if (CS_CALLEE_SUSPENDED == caller->state)
886 {
887 caller->state = CS_ACTIVE;
888 caller->speaker->enable_speaker (caller->speaker->cls);
889 caller->mic->enable_microphone (caller->mic->cls,
891 caller);
892 }
893 else
894 {
895 caller->state = CS_CALLER_SUSPENDED;
896 }
897}
898
899
900/* end of conversation_api.c */
struct GNUNET_MQ_MessageHandlers handlers[]
Definition 003.c:1
constants for network protocols
CallerState
Possible states of a caller.
@ CS_CALLEE_SUSPENDED
We suspended the conversation.
@ CS_BOTH_SUSPENDED
Both sides suspended the conversation.
@ CS_ACTIVE
The phone is in an active conversation.
@ CS_CALLER_SUSPENDED
Caller suspended the conversation.
@ CS_RINGING
The phone is ringing (user knows about incoming call).
static enum GNUNET_GenericReturnValue check_phone_ring(void *cls, const struct ClientPhoneRingMessage *ring)
We received a struct ClientPhoneRingMessage
static void clean_up_callers(struct GNUNET_CONVERSATION_Phone *phone)
Clean up all callers of the given phone.
static void handle_phone_ring(void *cls, const struct ClientPhoneRingMessage *ring)
We received a struct ClientPhoneRingMessage
static struct GNUNET_CONVERSATION_Caller * find_caller(struct GNUNET_CONVERSATION_Phone *phone, uint32_t cid)
Find the record of the caller matching the cid.
static void handle_phone_hangup(void *cls, const struct ClientPhoneHangupMessage *hang)
We received a struct ClientPhoneHangupMessage.
static int check_phone_audio(void *cls, const struct ClientAudioMessage *am)
We received a struct ClientAudioMessage, check it is well-formed.
static void handle_phone_resume(void *cls, const struct ClientPhoneResumeMessage *resume)
We received a struct ClientPhoneResumeMessage.
static void reconnect_phone(struct GNUNET_CONVERSATION_Phone *phone)
The phone got disconnected, reconnect to the service.
static void handle_phone_suspend(void *cls, const struct ClientPhoneSuspendMessage *suspend)
We received a struct ClientPhoneSuspendMessage.
static void phone_error_handler(void *cls, enum GNUNET_MQ_Error error)
We encountered an error talking with the conversation service.
static void transmit_phone_audio(void *cls, size_t data_size, const void *data)
Process recorded audio data.
static void handle_phone_audio(void *cls, const struct ClientAudioMessage *am)
We received a struct ClientAudioMessage
PhoneState
Possible states of a phone.
@ PS_REGISTER
We still need to register the phone.
@ PS_READY
We are waiting for calls.
#define GNUNET_GNSRECORD_TYPE_PHONE
Endpoint for conversation.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition gnunet-arm.c:108
static struct GNUNET_SPEAKER_Handle * speaker
Handle to the speaker.
static struct GNUNET_MICROPHONE_Handle * mic
Our microphone.
static char * line
Desired phone line (string to be converted to a hash).
static struct GNUNET_CONVERSATION_Phone * phone
Phone handle.
static char * data
The data to insert into the dht.
static struct GNUNET_GNSRECORD_Data rd[50]
The record data under a single label.
static size_t data_size
Number of bytes in data.
API to the conversation service.
struct GNUNET_MQ_Handle * GNUNET_CLIENT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *service_name, const struct GNUNET_MQ_MessageHandler *handlers, GNUNET_MQ_ErrorHandler error_handler, void *error_handler_cls)
Create a message queue to connect to a GNUnet service.
Definition client.c:1060
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_string(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be a string.
void GNUNET_CONVERSATION_phone_get_record(struct GNUNET_CONVERSATION_Phone *phone, struct GNUNET_GNSRECORD_Data *rd)
Fill in a namestore record with the contact information for this phone.
struct GNUNET_CONVERSATION_Phone * GNUNET_CONVERSATION_phone_create(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_IDENTITY_Ego *ego, GNUNET_CONVERSATION_PhoneEventHandler event_handler, void *event_handler_cls)
Create a new phone.
void(* GNUNET_CONVERSATION_CallerEventHandler)(void *cls, enum GNUNET_CONVERSATION_CallerEventCode code)
Function called with an event emitted by a caller.
void GNUNET_CONVERSATION_caller_suspend(struct GNUNET_CONVERSATION_Caller *caller)
Pause conversation of an active call.
void GNUNET_CONVERSATION_phone_destroy(struct GNUNET_CONVERSATION_Phone *phone)
Destroys a phone.
void(* GNUNET_CONVERSATION_PhoneEventHandler)(void *cls, enum GNUNET_CONVERSATION_PhoneEventCode code, struct GNUNET_CONVERSATION_Caller *caller, const struct GNUNET_CRYPTO_BlindablePublicKey *caller_id)
Function called with an event emitted by a phone.
void GNUNET_CONVERSATION_caller_resume(struct GNUNET_CONVERSATION_Caller *caller, struct GNUNET_SPEAKER_Handle *speaker, struct GNUNET_MICROPHONE_Handle *mic)
Resume suspended conversation of a phone.
void GNUNET_CONVERSATION_caller_hang_up(struct GNUNET_CONVERSATION_Caller *caller)
Hang up up a (possibly ringing) phone.
void GNUNET_CONVERSATION_caller_pick_up(struct GNUNET_CONVERSATION_Caller *caller, GNUNET_CONVERSATION_CallerEventHandler event_handler, void *event_handler_cls, struct GNUNET_SPEAKER_Handle *speaker, struct GNUNET_MICROPHONE_Handle *mic)
Picks up a (ringing) phone.
@ GNUNET_CONVERSATION_EC_CALLER_RESUME
We are the callee and the caller resumed the call.
@ GNUNET_CONVERSATION_EC_CALLER_SUSPEND
We are the callee and the caller suspended the call.
@ GNUNET_CONVERSATION_EC_PHONE_HUNG_UP
The conversation was terminated by the caller.
@ GNUNET_CONVERSATION_EC_PHONE_RING
We are the callee and the phone is ringing.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_get_peer_identity(const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_PeerIdentity *dst)
Retrieve the identity of the host's peer.
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
const char * GNUNET_GNSRECORD_pkey_to_zkey(const struct GNUNET_CRYPTO_BlindablePublicKey *pkey)
Convert public key to the respective absolute domain name in the ".zkey" pTLD.
@ GNUNET_GNSRECORD_RF_NONE
Entry for no flags / cleared flags.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
Definition crypto_hash.c:41
const struct GNUNET_CRYPTO_BlindablePrivateKey * GNUNET_IDENTITY_ego_get_private_key(const struct GNUNET_IDENTITY_Ego *ego)
Obtain the ECC key associated with a ego.
#define GNUNET_log(kind,...)
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_read_public_key_from_buffer(const void *buffer, size_t len, struct GNUNET_CRYPTO_BlindablePublicKey *key, size_t *read)
Reads a GNUNET_CRYPTO_BlindablePublicKey from a compact buffer.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
GNUNET_GenericReturnValue
Named constants for return values.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
@ GNUNET_OK
@ GNUNET_SYSERR
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
void GNUNET_log_config_missing(enum GNUNET_ErrorType kind, const char *section, const char *option)
Log error message about missing configuration option.
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
GNUNET_MQ_Error
Error codes for the queue.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition mq.c:305
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
void GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq)
Destroy the message queue.
Definition mq.c:700
void GNUNET_NAMESTORE_disconnect(struct GNUNET_NAMESTORE_Handle *h)
Disconnect from the namestore service (and free associated resources).
struct GNUNET_NAMESTORE_Handle * GNUNET_NAMESTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the namestore service.
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME
Client <-> Server message to resume connection.
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER
Client -> Server message to register a phone.
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICK_UP
Client -> Server message to reject/hangup a call.
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND
Client <-> Server message to suspend connection.
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP
Client -> Server message to reject/hangup a call.
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO
Client <-> Server message to send audio data.
#define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING
Client <- Server message to indicate a ringing phone.
#define _(String)
GNU gettext support macro.
Definition platform.h:179
Message Client <-> Service to transmit the audio.
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO.
uint32_t cid
CID, internal caller ID to identify which active call we are sending data to.
Client <-> Service hang up phone that may or may not be ringing.
uint32_t cid
CID, internal caller ID to identify which active call we are talking about.
Client -> Service pick up phone that is ringing.
uint32_t cid
CID, internal caller ID to identify which active call we are talking about.
Client -> Service message to register a phone.
struct GNUNET_HashCode line_port
Phone line / CADET port to register.
Service <-> Client message for phone was resumed.
uint32_t cid
CID, internal caller ID to identify which active call we are talking about.
Service -> Client message for phone is ringing.
uint32_t cid
CID, internal caller ID number used in the future to identify which active call we are talking about.
uint32_t key_len
The identity key length.
Service <-> Client message for phone was suspended.
uint32_t cid
CID, internal caller ID to identify which active call we are talking about.
A caller is the handle we have for an incoming call.
uint32_t cid
Internal handle to identify the caller with the service.
struct GNUNET_CONVERSATION_Caller * next
We keep all callers in a DLL.
struct GNUNET_MICROPHONE_Handle * mic
Microphone, or NULL if none is attached.
void * event_handler_cls
Closure for event_handler.
struct GNUNET_SPEAKER_Handle * speaker
Speaker, or NULL if none is attached.
struct GNUNET_CONVERSATION_Phone * phone
Our phone.
enum CallerState state
State machine for the phone.
struct GNUNET_CONVERSATION_Caller * prev
We keep all callers in a DLL.
GNUNET_CONVERSATION_CallerEventHandler event_handler
Function to call for phone events.
struct GNUNET_CRYPTO_BlindablePublicKey caller_id
Identity of the person calling us.
A phone record specifies which peer is hosting a given user and may also specify the phone line that ...
struct GNUNET_HashCode line_port
Phone line (CADET port) to connect to.
struct GNUNET_PeerIdentity peer
Identity of the peer hosting the phone service.
uint32_t version
Version of the phone record, for now always one.
A phone is a device that can ring to signal an incoming call and that you can pick up to answer the c...
GNUNET_CONVERSATION_PhoneEventHandler event_handler
Function to call for phone events.
struct GNUNET_MQ_Handle * mq
Handle for transmitting to the CONVERSATION service.
struct GNUNET_CONVERSATION_Caller * caller_tail
We keep all callers in a DLL.
struct GNUNET_CRYPTO_BlindablePrivateKey my_zone
My GNS zone.
struct GNUNET_NAMESTORE_Handle * ns
Connection to NAMESTORE (for reverse lookup).
const struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
struct GNUNET_CONVERSATION_Caller * caller_head
We keep all callers in a DLL.
struct GNUNET_CONVERSATION_PhoneRecord my_record
This phone's record.
enum PhoneState state
State machine for the phone.
void * event_handler_cls
Closure for event_handler.
A private key for an identity as per LSD0001.
An identity key as per LSD0001.
uint32_t record_type
Type of the GNS/DNS record.
const void * data
Binary value stored in the DNS record.
size_t data_size
Number of bytes in data.
enum GNUNET_GNSRECORD_Flags flags
Flags for the record.
uint64_t expiration_time
Expiration time for the DNS record.
A 512-bit hashcode.
Handle for an ego.
Definition identity.h:37
A microphone is a device that can capture or otherwise produce audio data.
void * cls
Closure for the callbacks.
GNUNET_MICROPHONE_DisableCallback disable_microphone
Turn the microphone off.
GNUNET_MICROPHONE_EnableCallback enable_microphone
Turn on the microphone.
Handle to a message queue.
Definition mq.c:87
Message handler for a specific message type.
Connection to the NAMESTORE service.
A speaker is a device that can play or record audio data.
void * cls
Closure for the callbacks.
GNUNET_SPEAKER_PlayCallback play
Play audio.
GNUNET_SPEAKER_EnableCallback enable_speaker
Turn on the speaker.
GNUNET_SPEAKER_DisableCallback disable_speaker
Turn the speaker off.