diff options
Diffstat (limited to 'src/service/messenger/messenger_api_message.c')
-rw-r--r-- | src/service/messenger/messenger_api_message.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/service/messenger/messenger_api_message.c b/src/service/messenger/messenger_api_message.c index 51213bce5..486a0e081 100644 --- a/src/service/messenger/messenger_api_message.c +++ b/src/service/messenger/messenger_api_message.c | |||
@@ -24,6 +24,7 @@ | |||
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include "messenger_api_message.h" | 26 | #include "messenger_api_message.h" |
27 | #include "gnunet_messenger_service.h" | ||
27 | 28 | ||
28 | struct GNUNET_MESSENGER_MessageSignature | 29 | struct GNUNET_MESSENGER_MessageSignature |
29 | { | 30 | { |
@@ -244,6 +245,9 @@ get_message_body_kind_size (enum GNUNET_MESSENGER_MessageKind kind) | |||
244 | length += member_size (struct GNUNET_MESSENGER_Message, body.connection.amount); | 245 | length += member_size (struct GNUNET_MESSENGER_Message, body.connection.amount); |
245 | length += member_size (struct GNUNET_MESSENGER_Message, body.connection.flags); | 246 | length += member_size (struct GNUNET_MESSENGER_Message, body.connection.flags); |
246 | break; | 247 | break; |
248 | case GNUNET_MESSENGER_KIND_TICKET: | ||
249 | length += member_size (struct GNUNET_MESSENGER_Message, body.ticket.identifier); | ||
250 | break; | ||
247 | default: | 251 | default: |
248 | break; | 252 | break; |
249 | } | 253 | } |
@@ -497,6 +501,9 @@ encode_message_body (enum GNUNET_MESSENGER_MessageKind kind, | |||
497 | encode_step (buffer, offset, &value0); | 501 | encode_step (buffer, offset, &value0); |
498 | encode_step (buffer, offset, &value1); | 502 | encode_step (buffer, offset, &value1); |
499 | break; | 503 | break; |
504 | case GNUNET_MESSENGER_KIND_TICKET: | ||
505 | encode_step (buffer, offset, &(body->ticket.identifier)); | ||
506 | break; | ||
500 | default: | 507 | default: |
501 | break; | 508 | break; |
502 | } | 509 | } |
@@ -686,6 +693,9 @@ decode_message_body (enum GNUNET_MESSENGER_MessageKind *kind, | |||
686 | body->connection.amount = GNUNET_be32toh (value0); | 693 | body->connection.amount = GNUNET_be32toh (value0); |
687 | body->connection.flags = GNUNET_be32toh (value1); | 694 | body->connection.flags = GNUNET_be32toh (value1); |
688 | break; | 695 | break; |
696 | case GNUNET_MESSENGER_KIND_TICKET: | ||
697 | decode_step (buffer, offset, &(body->ticket.identifier)); | ||
698 | break; | ||
689 | default: | 699 | default: |
690 | *kind = GNUNET_MESSENGER_KIND_UNKNOWN; | 700 | *kind = GNUNET_MESSENGER_KIND_UNKNOWN; |
691 | break; | 701 | break; |
@@ -1119,6 +1129,8 @@ is_service_message (const struct GNUNET_MESSENGER_Message *message) | |||
1119 | return GNUNET_YES; // Deletion should not apply individually! (inefficieny) | 1129 | return GNUNET_YES; // Deletion should not apply individually! (inefficieny) |
1120 | case GNUNET_MESSENGER_KIND_CONNECTION: | 1130 | case GNUNET_MESSENGER_KIND_CONNECTION: |
1121 | return GNUNET_YES; // Reserved for connection handling only! | 1131 | return GNUNET_YES; // Reserved for connection handling only! |
1132 | case GNUNET_MESSENGER_KIND_TICKET: | ||
1133 | return GNUNET_NO; | ||
1122 | default: | 1134 | default: |
1123 | return GNUNET_SYSERR; | 1135 | return GNUNET_SYSERR; |
1124 | } | 1136 | } |
@@ -1165,6 +1177,8 @@ filter_message_sending (const struct GNUNET_MESSENGER_Message *message) | |||
1165 | return GNUNET_YES; | 1177 | return GNUNET_YES; |
1166 | case GNUNET_MESSENGER_KIND_CONNECTION: | 1178 | case GNUNET_MESSENGER_KIND_CONNECTION: |
1167 | return GNUNET_SYSERR; // Reserved for connection handling only! | 1179 | return GNUNET_SYSERR; // Reserved for connection handling only! |
1180 | case GNUNET_MESSENGER_KIND_TICKET: | ||
1181 | return GNUNET_YES; | ||
1168 | default: | 1182 | default: |
1169 | return GNUNET_SYSERR; | 1183 | return GNUNET_SYSERR; |
1170 | } | 1184 | } |