-
Notifications
You must be signed in to change notification settings - Fork 0
/
reload.txt
1232 lines (1016 loc) · 32.6 KB
/
reload.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright (c) 2013 IETF Trust, C.Jennings, B. Lowekamp, E. Rescorla,
// S.Baset and H. Schulzrinne for draft-ietf-p2psip-base-26
// Copyright (c) 2013 IETF Trust, N. Zong, X. Jiang, R. Even and Y. Zhang
// for draft-ietf-p2psip-drr-04.
// Copyright (c) 2013 IETF Trust, N. Zong, X. Jiang, R. Even and Y. Zhang
// for draft-ietf-p2psip-rpr-04
// Copyright (c) 2013 IETF Trust, H. Song, X. Jiang, R. Even and D. Bryan for
// draft-ietf-p2psip-diagnostics-10.
// Copyright (c) 2013 IETF Trust, C.Jennings, B. Lowekamp, E.Rescorla,
// S. Baset, H. Schulzrinne and T C. Schmidt for draft-ietf-p2psip-sip-09.
// Copyright (c) 2013 IETF Trust, J. Maenppa and G. Camarillo for
// draft-ietf-p2psip-service-discovery-08.
// Copryright (c) 2013 IETF Trust, J. Maenpaa, G. Camarillo and J. Hautakorpi
// for draft-ietf-p2psip-self-tuning-08.
// Copyright (c) 2013 IETF Trust, A. Knauf, G. Hege, T C. Schmidt and
// M. Waehlisch for draft-ietf-p2psip-share-01.
// Copyright (c) 2012 IETF Trust, A. Knauf, T C. Schmidt, G. Gege and
// M. Waehlisch for draft-ietf-p2psip-disco-00.
// Copyright (c) 2012-13 Marc Petit-Huguenin for the modifications and
// additional content
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// • Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// • Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// • Neither the name of Internet Society, IETF or IETF Trust, nor the names of
// specific contributors, may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//
// Unless specified otherwise, all the definitions are from
// draft-ietf-p2psip-base
// This document covers only RFCs and standard track internet-drafts.
uint32 node_id_length = 16; // NodeIdLength is defined in the configuration file
// Special case: all 1 (wildcard) and all 0 (invalid)
typedef opaque NodeId[node_id_length];
typedef opaque ResourceId<0..2^8-1>;
select (destination_type) {
case node:
NodeId node_id;
case resource:
ResourceId resource_id;
case opaque_id_type:
opaque opaque_id<0..2^8-1>;
/* This structure may be extended with new types */
} DestinationData;
// Note that the 0 values in the draft are named invalid<Type>, but I use the
// shorter name here, and in other places.
enum {
invalid(0),
node(1),
resource(2),
opaque_id_type(3),
/* 128-255 not allowed */ (255)
} DestinationType;
struct {
DestinationType type;
uint8 length;
DestinationData destination_data;
} Destination;
struct {
uint16 opaque_id; /* top bit MUST be 1 */
} Destination;
enum {
invalid(0),
exp-forward(1),
extensive_routing_mode(2), // draft-ietf-p2psip-drr-04
(255)
} ForwardingOptionType; // IANA registry "Forwarding Option Registry"
enum {
invalid(0),
DDR(1),
RPR(2), // draft-ietf-p2psip-rpr-04
(255)
} RouteMode; // draft-ietf-p2psip-drr-04
struct {
RouteMode routemode;
OverlayLinkType transport;
IpAddressPort ipaddressport;
Destination destination<1..2^8-1>;
} ExtensiveRoutingModeOption; // draft-ietf-p2psip-drr-04
struct {
ForwardingOptionType type;
// flags 0: FORWARD_CRITICAL
// flags 1: DESTINATION_CRITICAL
// flags 2: RESPONSE_COPY
// flags 3: IGNORE_STATE_KEEPING (draft-ietf-p2psip-drr-04)
uint8 flags;
uint16 length;
select (type) {
case extensive_routing_mode: // draft-ietf-p2psip-drr-04
ExtensiveRoutingModeOption mode_option;
/* This type may be extended */
} option;
} ForwardingOption;
struct {
uint32 relo_token; // always 0xd2454c4f
uint32 overlay;
uint16 configuration_sequence; // 0 = do not check sequence
uint8 version; // 0x01 = draft, 0x10 = RFC (when published)
uint8 ttl;
// fragment 31: fragment (always 1)
// fragment 30: last fragment
// fragment 24-29: always 0
// fragment 0-23: fragment offset
uint32 fragment;
uint32 length;
uint64 transaction_id;
uint32 max_response_length;
uint16 via_list_length;
uint16 destination_list_length;
uint16 options_length;
Destination via_list[via_list_length];
Destination destination_list [destination_list_length];
ForwardingOption options[options_length];
} ForwardingHeader;
enum {
invalid(0),
probe_req(1),
probe_ans(2),
attach_req(3),
attach_ans(4),
reserved_5(5), // need to find what is was
reserved_6(6), // need to find what is was
store_req(7),
store_ans(8),
fetch_req(9),
fetch_ans(10),
reserved_remove_req(11),
reserved_remove_ans(12),
find_req(13),
find_ans(14),
join_req(15),
join_ans(16),
leave_req(17),
leave_ans(18),
update_req(19),
update_ans(20),
route_query_req(21),
route_query_ans(22),
ping_req(23),
ping_ans(24),
stat_req(25),
stat_ans(26),
reserved_attachlite_req(27),
reserved_attachlite_ans(28),
app_attach_req(29),
app_attach_ans(30),
reserved_app_attachlite_req(31),
reserved_app_attachlite_ans(32),
config_update_req(33),
config_update_ans(34),
exp_a_req(35),
exp_a_ans(36),
exp_b_req(37),
exp_b_ans(38),
path_track_req(101), // draft-ietf-p2psip-diagnostics-10
path_track_ans(102), // draft-ietf-p2psip-diagnostics-10
error(0xffff),
(0..2^16-1)
} MessageCode; // IANA registry "RELOAD Message Code"
enum {
invalid(0),
responsible_set(1),
num_resources(2),
uptime(3),
exp-probe(4),
(255)
} ProbeInformationType; // IANA registry "RELOAD Probe Information Type Registry"
struct {
ProbeInformationType requested_info<0..2^8-1>;
} ProbeReq;
struct {
select (type) {
case responsible_set:
uint32 responsible_ppb;
case num_resources:
uint32 num_resources;
case uptime:
uint32 uptime;
/* This type may be extended */
};
} ProbeInformationData;
struct {
ProbeInformationType type;
uint8 length;
ProbeInformationData value;
} ProbeInformation;
struct {
ProbeInformation probe_info<0..2^16-1>;
} ProbeAns;
enum {
invalid(0),
ipv4_address (1),
ipv6_address (2),
(255)
} AddressType;
struct {
uint32 addr;
uint16 port;
} IPv4AddrPort;
struct {
uint128 addr;
uint16 port;
} IPv6AddrPort;
struct {
AddressType type;
uint8 length;
select (type) {
case ipv4_address:
IPv4AddrPort v4addr_port;
case ipv6_address:
IPv6AddrPort v6addr_port;
/* This structure can be extended */
};
} IpAddressPort;
enum {
INVALID(0),
DTLS-UDP-SR(1),
DTLS-UDP-SR-NO-ICE(3),
TLS-TCP-FH-NO-ICE(4),
EXP_LINK(5),
(255)
} OverlayLinkType; // IANA registry "RELOAD Overlay Link"
enum {
invalid(0),
host(1),
srflx(2),
prflx(3),
relay(4),
(255)
} CandType;
struct {
opaque name<0..2^16-1>; // byte-string (RFC 4566) without SP (see errata #2338)
opaque value<0..2^16-1>; // byte-string (RFC 4566) without SP (see errata #2338)
} IceExtension;
struct {
IpAddressPort addr_port;
OverlayLinkType overlay_link;
opaque foundation<0..255>; // 1*32ice-char (RFC 5245)
uint32 priority;
CandType type;
select (type) {
case host:
; /* empty */
case srflx:
case prflx:
case relay:
IpAddressPort rel_addr_port;
};
IceExtension extensions<0..2^16-1>;
} IceCandidate;
enum {
false(0),
true(1),
(255)
} Boolean;
struct {
opaque ufrag<0..2^8-1>;
opaque password<0..2^8-1>;
opaque role<0..2^8-1>;
IceCandidate candidates<0..2^16-1>;
Boolean send_update;
} AttachReqAns;
enum {
INVALID(0),
SIP-REGISTRATION(1), // draft-ietf-p2psip-sip-09
TURN-SERVICE(2),
CERTIFICATE_BY_NODE(3),
RESERVED_ROUTING_TABLE_SIZE(4),
RESERVED_SOFTWARE_VERSION(5),
RESERVED_MACHINE_UPTIME(6),
RESERVED_APP_UPTIME(7),
RESERVED_MEMORY_FOOTPRINT(8),
RESERVED_DATASIZE_STORED(9),
RESERVED_INSTANCES_STORED(10),
RESERVED_MESSAGES_SENT_RCVD(11),
RESERVED_EWMA_BYTES_SENT(12),
RESERVED_EWMA_BYTES_RCVD(13),
RESERVED_LAST_CONTACT(14),
RESERVED_RTT(15),
CERTIFICATE_BY_USER(16),
ACCESS-CONTROL-LIST(17), // draft-ietf-p2psip-share-01
REDIR(104), // draft-p2psip-service-discovery-08
DISCO-REGISTRATION(106), // draft-ietf-p2psip-disco-00
(0..2^32-1)
} KindId; // IANA registry "RELOAD Data Kind-ID"
struct {
uint8 iteration;
IpAddressPort server_address;
} TurnServer;
enum {
sip_registration_uri(1),
sip_registration_route(2),
(255)
} SipRegistrationType; // draft-ietf-p2psip-sip-09
select (SipRegistration.type) {
case sip_registration_uri:
opaque uri<0..2^16-1>;
case sip_registration_route:
opaque contact_prefs<0..2^16-1>; // RFC 2533
Destination destination_list<0..2^16-1>;
/* This type can be extended */
} SipRegistrationData; // draft-ietf-p2psip-sip-09
struct {
SipRegistrationType type;
uint16 length;
SipRegistrationData data;
} SipRegistration; // draft-ietf-p2psip-sip-09
enum {
none(0),
(255)
} RedirServiceProviderExtType; // draft-p2psip-service-discovery-08
struct {
RedirServiceProviderExtType type;
Destination destination_list<0..2^16-1>;
opaque namespace<0..2^16-1>;
uint16 level;
uint16 node;
uint16 length;
select (type) {
/* This type can be extended */
} extension;
} RedirServiceProvider; // draft-p2psip-service-discovery-08
struct {
Boolean exists;
uint32 length;
select (kind) {
case TURN_SERVICE:
TurnServer turn_server;
case SIP-REGISTRATION: // draft-ietf-p2psip-sip-09
SipRegistration sip_registration;
case CERTIFICATE_BY_NODE:
case CERTIFICATE_BY_USER:
opaque certificate[length];
case REDIR: // draft-p2psip-service-discovery-08
RedirServiceProvider redir;
case ACCESS-CONTROL-LIST:
AccessControlListItem access_control; // draft-ietf-p2psip-share-01
case DISCO-REGISTRATION:
DisCoRegistration disco_registration; // draft-ietf-p2psip-disco-01
/* This structure may be extended */
};
} DataValue;
struct {
uint32 index;
DataValue value;
} ArrayEntry;
typedef opaque DictionaryKey<0..2^16-1>;
struct {
DictionaryKey key;
DataValue value;
} DictionaryEntry;
// INVALID and RESERVED do not make sense.
enum {
SINGLE,
ARRAY,
DICTIONARY,
EXP-DATA,
} DataModel; // IANA registry "RELOAD Data Model"
DataModel data_model; // data_model in configuration file
struct {
select (data_model) { // Derived from KindId. IANA registry "RELOAD Data Model"
case single_value:
DataValue single_value_entry;
case array:
ArrayEntry array_entry;
case dictionary:
DictionaryEntry dictionary_entry;
/* This structure may be extended */
};
} StoredDataValue;
enum {
invalid(0),
cert_hash(1),
cert_hash_node_id(2),
none(3),
(255)
} SignerIdentityType;
enum {
none(0),
md5(1),
sha1(2),
sha224(3),
sha256(4),
sha384(5),
sha512(6),
(255)
} HashAlgorithm; // RFC 5246. IANA registry "TLS HashAlgorithm"
struct {
select (identity_type) {
case cert_hash:
HashAlgorithm hash_alg; // From TLS
opaque certificate_hash<0..2^8-1>;
case cert_hash_node_id:
HashAlgorithm hash_alg; // From TLS
opaque certificate_node_id_hash<0..2^8-1>;
case none:
; /* empty */
/* This structure may be extended with new types if necessary*/
};
} SignerIdentityValue;
struct {
SignerIdentityType identity_type;
uint16 length;
SignerIdentityValue identity[SignerIdentity.length];
} SignerIdentity;
enum {
anonymous(0),
rsa(1),
dsa(2),
ecdsa(3),
(255)
} SignatureAlgorithm; // RFC 5246. IANA registry "TLS SignatureAlgorithm"
struct {
HashAlgorithm hash;
SignatureAlgorithm signature;
} SignatureAndHashAlgorithm; // RFC 5246
struct {
SignatureAndHashAlgorithm algorithm; // From TLS
SignerIdentity identity;
opaque signature_value<0..2^16-1>;
} Signature;
struct {
uint32 length;
uint64 storage_time; // Number of milliseconds since Jan 1, 1970 UTC, no leap seconds
uint32 lifetime; // remaining in seconds, from the time stored or retrieved
StoredDataValue value;
Signature signature;
} StoredData;
struct {
KindId kind;
uint64 generation_counter; // 0 = do not check
StoredData values<0..2^32-1>;
} StoreKindData;
struct {
ResourceId resource;
uint8 replica_number; // 0 = original storage
StoreKindData kind_data<0..2^32-1>;
} StoreReq;
struct {
KindId kind;
uint64 generation_counter; // 0 never happen
NodeId replicas<0..2^16-1>;
} StoreKindResponse;
struct {
StoreKindResponse kind_responses<0..2^16-1>;
} StoreAns;
struct {
int32 first;
int32 last; // last always > first. Do not retrieve last.
} ArrayRange;
struct {
KindId kind;
uint64 generation;
uint16 length;
select (data_model) {
case single_value:
; /* empty */
case array:
ArrayRange indices<0..2^16-1>; // never overlap
case dictionary:
DictionaryKey keys<0..2^16-1>;
/* This structure may be extended */
};
} StoredDataSpecifier;
struct {
ResourceId resource;
StoredDataSpecifier specifiers<0..2^16-1>;
} FetchReq;
struct {
KindId kind;
uint64 generation; // never 0
StoredData values<0..2^32-1>;
} FetchKindResponse;
struct {
FetchKindResponse kind_responses<0..2^32-1>;
} FetchAns;
struct {
ResourceId resource;
KindId kinds<0..2^8-1>;
} FindReq;
struct {
KindId kind;
ResourceId closest;
} FindKindData;
struct {
FindKindData results<0..2^16-1>;
} FindAns;
enum { CHORD-RELOAD } TopologyPlugin;
TopologyPlugin topology_plugin = CHORD-RELOAD; // Defined in configuration file
struct {
NodeId joining_peer_id;
uint16 length;
select (topology_plugin) {
case CHORD-RELOAD:
; /* empty */
/* This structure may be extended with new types if necessary */
};
} JoinReq;
struct {
uint16 length;
select (topology_plugin) {
case CHORD-RELOAD:
; /* empty */
/* This structure may be extended with new types if necessary */
};
} JoinAns;
enum {
invalid(0),
from_succ(1),
from_pred(2),
(255)
} ChordLeaveType;
struct {
ChordLeaveType type;
select (type) {
case from_succ:
NodeId successors<0..2^16-1>;
case from_pred:
NodeId predecessors<0..2^16-1>;
};
} ChordLeaveData;
struct {
NodeId leaving_peer_id;
uint16 length;
select (topology-plugin) {
case CHORD-RELOAD:
ChordLeaveData leave_data;
/* This structure may be extended with new types if necessary */
};
} LeaveReq;
struct {
} LeaveAns;
enum {
invalid(0),
peer_ready(1),
neighbors(2),
full(3),
(255)
} ChordUpdateType;
struct {
uint32 uptime;
ChordUpdateType type;
select (type) {
case peer_ready:
; /* empty */
case neighbors:
NodeId predecessors<0..2^16-1>;
NodeId successors<0..2^16-1>;
case full:
NodeId predecessors<0..2^16-1>;
NodeId successors<0..2^16-1>;
NodeId fingers<0..2^16-1>;
};
} ChordUpdateReq;
struct {
} ChordUpdateAns;
struct {
Boolean send_update;
Destination destination;
uint16 length;
select (topology_plugin) {
/* This structure may be extended with new types if necessary */
};
} RouteQueryReq;
struct {
NodeId next_peer;
} ChordRouteQueryAns;
struct {
opaque<0..2^16-1> padding; // filled with 0
} PingReq;
struct {
uint64 response_id; // ???
uint64 time;
} PingAns;
struct {
ResourceId resource;
StoredDataSpecifier specifiers<0..2^16-1>;
} StatReq;
struct {
Boolean exists;
uint32 value_length;
HashAlgorithm hash_algorithm;
opaque hash_value<0..255>;
} MetaData;
struct {
uint32 index;
MetaData value;
} ArrayEntryMeta;
struct {
DictionaryKey key;
MetaData value;
} DictionaryEntryMeta;
struct {
select (data_model) {
case single_value:
MetaData single_value_entry;
case array:
ArrayEntryMeta array_entry;
case dictionary:
DictionaryEntryMeta dictionary_entry;
/* This structure may be extended */
};
} MetaDataValue;
struct {
uint32 value_length;
uint64 storage_time;
uint32 lifetime;
MetaDataValue metadata;
} StoredMetaData;
struct {
KindId kind;
uint64 generation;
StoredMetaData values<0..2^32-1>;
} StatKindResponse;
struct {
StatKindResponse kind_responses<0..2^32-1>;
} StatAns;
struct {
opaque ufrag<0..2^8-1>;
opaque password<0..2^8-1>;
uint16 application; // IANA registry "RELOAD Application-ID"
opaque role<0..2^8-1>;
IceCandidate candidates<0..2^16-1>;
} AppAttachReq;
struct {
opaque ufrag<0..2^8-1>;
opaque password<0..2^8-1>;
uint16 application; // IANA registry "RELOAD Application-ID"
opaque role<0..2^8-1>;
IceCandidate candidates<0..2^16-1>;
} AppAttachAns; // Same than AppAttachReq
enum {
invalid(0),
config(1),
kind(2),
(255)
} ConfigUpdateType;
typedef opaque KindDescription<0..2^16-1>;
struct {
ConfigUpdateType type;
uint32 length;
select (type) {
case config:
opaque config_data<0..2^24-1>;
case kind:
KindDescription kinds<0..2^24-1>;
/* This structure may be extended with new types */
};
} ConfigUpdateReq;
struct {
} ConfigUpdateAns;
enum {
invalid(0),
exp-ext(1),
Diagnostic_Ping(2), // draft-ietf-p2psip-diagnostics-10
self_tuning_data(3), // draft-ietf-p2psip-self-tuning-08
(2^16-1)
} MessageExtensionType; // IANA registry "RELOAD Extensions Registry"
struct {
uint32 network_size;
uint32 join_rate;
uint32 leave_rate;
} SelfTuningData; // draft-ietf-p2psip-self-tuning-08
enum {
(2^16-1)
} DiagnosticKindId ; // draft-ietf-p2psip-diagnostics-10
struct {
DiagnosticKindId kind;
opaque diagnostic_extension_contents<0..2^32-1>;
} DiagnosticExtension; // draft-ietf-p2psip-diagnostics-10
struct {
uint64 expiration;
uint64 timestamp_initiated;
// dMFlags 0: reserved always 0
// dMFlags 1: STATUS_INFO
// dMFlags 2: ROUTING_TABLE_SIZE
// dMFlags 3: PROCESS_POWER
// dMFlags 4: BANDWIDTH
// dMFlags 5: SOFTWARE_VERSION
// dMFlags 6: MACHINE_UPTIME
// dMFlags 7: APP_UPTIME
// dMFlags 8: MEMORY_FOOTPRINT
// dMFlags 9: DATASIZE_STORED
// dMFlags 10: INSTANCES_STORED
// dMFlags 11: MESSAGES_SENT_RCVD
// dMFlags 12: EWMA_BYTES_SENT
// dMFlags 13: EWMA_BYTES_RCVD
// dMFlags 14: UNDERLAY_HOP
// dMFlags 15: BATTERY_STATUS
// dMFlags 16-62: unused - 0
// dMFlags 63: reserved always 0
uint64 dMFlags;
DiagnosticExtension diagnostic_extensions<0..2^32-1>; // Different from spec.
} DiagnosticsRequest; // draft-ietf-p2psip-diagnostics-10
struct {
Destination destination;
DiagnosticsRequest request; // Was DiagnosticRequest
} PathTrackReq; // draft-ietf-p2psip-diagnostics-10
enum { // Different from spec
reserved_0(0x0000),
STATUS_INFO(0x0001),
ROUTING_TABLE_SIZE(0x0002),
PROCESS_POWER(0x0003),
BANDWIDTH(0x0004),
SOFTWARE_VERSION(0x0005),
MACHINE_UPTIME(0x0006),
APP_UPTIME(0x0007),
MEMORY_FOOTPRINT(0x0008),
DATASIZE_STORED(0x0009),
INSTANCES_STORED(0x000A),
MESSAGES_SENT_RCVD(0x000B),
EWMA_BYTES_SENT(0x000C),
EWMA_BYTES_RCVD(0x000D),
UNDERLAY_HOP(0x000E),
BATTERY_STATUS(0x000F),
reserved_63(0x003F),
local_user(0xfffe),
reserver_65535(0xffff),
(2^16-1)
} DiagnosticKindId; // draft-ietf-p2psip-diagnostics-10
struct {
DiagnosticKindId kind;
uint16 length;
select (kind) {
case STATUS_INFO:
uint8 congestion_status; // 0x00 = 0 load; 0x0F=congested; other reserved
case ROUTING_TABLE_SIZE:
uint32 number_peers;
case PROCESS_POWER:
uint32 processing_power; // in MIPS
case BANDWIDTH:
uint32 bandwidth; // in Kbps
case SOFTWARE_VERSION:
opaque software_version[length]; // ASCII encoding, format = HTTP User-Agent/Server
case MACHINE_UPTIME:
uint64 machine_uptime; // in seconds
case APP_UPTIME:
uint64 app_uptime; // in seconds
case MEMORY_FOOTPRINT:
uint32 memory_footprint; // in kibibyte
case DATASIZE_STORED:
uint64 datasize_stored; // in bytes
case INSTANCES_STORED:
struct {
KindId kind;
uint64 instances;
}[length];
case MESSAGES_SENT_RCVD:
struct {
MessageCode message_code;
uint64 sent;
uint64 received;
}[length];
case EWMA_BYTES_SENT:
uint32 ewma_bytes_sent;
case EWMA_BYTES_RCVD:
uint32 ewma_bytes_received;
case UNDERLAY_HOP:
uint8 hops;
case BATTERY_STATUS:
// battery_status 7: battery power =0
// battery_status 0-6: reserved (0)
uint8 battery_status;
/* This structure may be extended with new types*/
};
opaque diagnostic_info_contents<0..2^16-1>;
} DiagnosticInfo; // draft-ietf-p2psip-diagnostics-10
struct {
uint64 expiration;
uint64 timestamp_received;
uint8 hop_counter;
DiagnosticInfo diagnostic_info_list<0..2^32-1>;
} DiagnosticsResponse; // draft-ietf-p2psip-diagnostics-10
struct {
Destination next_hop;
DiagnosticResponse response;
} PathTrackAns; // draft-ietf-p2psip-diagnostics-10
enum {
pattern(1),
(255)
} ResourceNameType; // draft-ietf-p2psip-share-01
struct {
ResourceNameType type;
uint16 length;
select (type) {
case pattern:
opaque resource_name<0..2^16-1>;
/* Types can be extended */
}
} ResourceNameExtension; // draft-ietf-p2psip-share-01
struct {
ResourceNameExtension res_name_ext;
opaque to_user<0..2^16-1>;
KindId kind;
Boolean allow_delegation;
} AccessControlListItem; // draft-ietf-p2psip-share-01
struct {
ResourceNameExtension res_name_ext;
opaque coordinate<0..2^16-1>;
NodeId node_id;
} DisCoRegistration; // draft-ietf-p2psip-disco-00
enum {
invalid(0),
Unused(1),
Error_Forbidden(2),
Error_Not_Found(3),
Error_Request_Timeout(4),
Error_Generation_Counter_Too_Low(5),
Error_Incompatible_with_Overlay(6),
Error_Unsupported_Forwarding_Option(7),
Error_Data_Too_Large(8),
Error_Data_Too_Old(9),
Error_TTL_Exceeded(10),
Error_Message_Too_Large(11),