aboutsummaryrefslogtreecommitdiff
path: root/src/conversation/conversation_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-05 15:40:55 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-05 15:40:55 +0000
commit95b51ca1ee2a3d75a9570934dfcf1862cf830b7e (patch)
treeb9784d7a5669524f4b28a08218a2cc95e420766a /src/conversation/conversation_api.c
parentd710c7df91151dde63d3304e4fdb27dc5fa8c781 (diff)
downloadgnunet-95b51ca1ee2a3d75a9570934dfcf1862cf830b7e.tar.gz
gnunet-95b51ca1ee2a3d75a9570934dfcf1862cf830b7e.zip
-enable printing and parsing of conversation's PHONE records
Diffstat (limited to 'src/conversation/conversation_api.c')
-rw-r--r--src/conversation/conversation_api.c36
1 files changed, 4 insertions, 32 deletions
diff --git a/src/conversation/conversation_api.c b/src/conversation/conversation_api.c
index 6ce198e64..130358613 100644
--- a/src/conversation/conversation_api.c
+++ b/src/conversation/conversation_api.c
@@ -32,34 +32,6 @@
32 32
33 33
34/** 34/**
35 * A phone record specifies which peer is hosting a given user and
36 * may also specify the phone line that is used (typically zero).
37 * The version is also right now always zero.
38 */
39struct PhoneRecord
40{
41
42 /**
43 * Version of the phone record, for now always zero. We may
44 * use other versions for anonymously hosted phone lines in
45 * the future.
46 */
47 uint32_t version GNUNET_PACKED;
48
49 /**
50 * Phone line to use at the peer.
51 */
52 uint32_t line GNUNET_PACKED;
53
54 /**
55 * Identity of the peer hosting the phone service.
56 */
57 struct GNUNET_PeerIdentity peer;
58
59};
60
61
62/**
63 * Possible states of the phone. 35 * Possible states of the phone.
64 */ 36 */
65enum PhoneState 37enum PhoneState
@@ -147,7 +119,7 @@ struct GNUNET_CONVERSATION_Phone
147 /** 119 /**
148 * This phone's record. 120 * This phone's record.
149 */ 121 */
150 struct PhoneRecord my_record; 122 struct GNUNET_CONVERSATION_PhoneRecord my_record;
151 123
152 /** 124 /**
153 * My GNS zone. 125 * My GNS zone.
@@ -473,7 +445,7 @@ GNUNET_CONVERSATION_phone_get_record (struct GNUNET_CONVERSATION_Phone *phone,
473{ 445{
474 rd->data = &phone->my_record; 446 rd->data = &phone->my_record;
475 rd->expiration_time = 0; 447 rd->expiration_time = 0;
476 rd->data_size = sizeof (struct PhoneRecord); 448 rd->data_size = sizeof (struct GNUNET_CONVERSATION_PhoneRecord);
477 rd->record_type = GNUNET_NAMESTORE_TYPE_PHONE; 449 rd->record_type = GNUNET_NAMESTORE_TYPE_PHONE;
478 rd->flags = GNUNET_NAMESTORE_RF_NONE; 450 rd->flags = GNUNET_NAMESTORE_RF_NONE;
479} 451}
@@ -702,7 +674,7 @@ struct GNUNET_CONVERSATION_Call
702 /** 674 /**
703 * Target phone record, only valid after the lookup is done. 675 * Target phone record, only valid after the lookup is done.
704 */ 676 */
705 struct PhoneRecord phone_record; 677 struct GNUNET_CONVERSATION_PhoneRecord phone_record;
706 678
707 /** 679 /**
708 * State machine for the call. 680 * State machine for the call.
@@ -932,7 +904,7 @@ handle_gns_response (void *cls,
932 { 904 {
933 if (GNUNET_NAMESTORE_TYPE_PHONE == rd[i].record_type) 905 if (GNUNET_NAMESTORE_TYPE_PHONE == rd[i].record_type)
934 { 906 {
935 if (rd[i].data_size != sizeof (struct PhoneRecord)) 907 if (rd[i].data_size != sizeof (struct GNUNET_CONVERSATION_PhoneRecord))
936 { 908 {
937 GNUNET_break_op (0); 909 GNUNET_break_op (0);
938 continue; 910 continue;