forked from bitcoin-atom/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lightning.pb-c.h
1290 lines (1212 loc) · 39 KB
/
lightning.pb-c.h
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
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: lightning.proto */
#ifndef PROTOBUF_C_lightning_2eproto__INCLUDED
#define PROTOBUF_C_lightning_2eproto__INCLUDED
#include <protobuf-c/protobuf-c.h>
PROTOBUF_C__BEGIN_DECLS
#if PROTOBUF_C_VERSION_NUMBER < 1000000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1002001 < PROTOBUF_C_MIN_COMPILER_VERSION
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
#endif
typedef struct _Sha256Hash Sha256Hash;
typedef struct _Preimage Preimage;
typedef struct _Signature Signature;
typedef struct _Locktime Locktime;
typedef struct _BitcoinPubkey BitcoinPubkey;
typedef struct _Funding Funding;
typedef struct _Authenticate Authenticate;
typedef struct _Init Init;
typedef struct _OpenChannel OpenChannel;
typedef struct _OpenAnchor OpenAnchor;
typedef struct _OpenCommitSig OpenCommitSig;
typedef struct _OpenComplete OpenComplete;
typedef struct _RouteStep RouteStep;
typedef struct _Route Route;
typedef struct _Routing Routing;
typedef struct _UpdateAddHtlc UpdateAddHtlc;
typedef struct _UpdateFulfillHtlc UpdateFulfillHtlc;
typedef struct _FailInfo FailInfo;
typedef struct _FailReason FailReason;
typedef struct _UpdateFailHtlc UpdateFailHtlc;
typedef struct _UpdateFee UpdateFee;
typedef struct _UpdateCommit UpdateCommit;
typedef struct _UpdateRevocation UpdateRevocation;
typedef struct _CloseShutdown CloseShutdown;
typedef struct _CloseSignature CloseSignature;
typedef struct _Error Error;
typedef struct _NestedPkt NestedPkt;
typedef struct _Pkt Pkt;
/* --- enums --- */
typedef enum _OpenChannel__AnchorOffer {
/*
* I will create the anchor
*/
OPEN_CHANNEL__ANCHOR_OFFER__WILL_CREATE_ANCHOR = 1,
/*
* I won't create the anchor
*/
OPEN_CHANNEL__ANCHOR_OFFER__WONT_CREATE_ANCHOR = 2
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(OPEN_CHANNEL__ANCHOR_OFFER)
} OpenChannel__AnchorOffer;
/* --- messages --- */
/*
* Protobufs don't have fixed-length fields, so these are a hack.
*/
struct _Sha256Hash
{
ProtobufCMessage base;
uint64_t a;
uint64_t b;
uint64_t c;
uint64_t d;
};
#define SHA256_HASH__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&sha256_hash__descriptor) \
, 0, 0, 0, 0 }
struct _Preimage
{
ProtobufCMessage base;
uint64_t a;
uint64_t b;
uint64_t c;
uint64_t d;
};
#define PREIMAGE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&preimage__descriptor) \
, 0, 0, 0, 0 }
struct _Signature
{
ProtobufCMessage base;
uint64_t r1;
uint64_t r2;
uint64_t r3;
uint64_t r4;
uint64_t s1;
uint64_t s2;
uint64_t s3;
uint64_t s4;
};
#define SIGNATURE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&signature__descriptor) \
, 0, 0, 0, 0, 0, 0, 0, 0 }
typedef enum {
LOCKTIME__LOCKTIME__NOT_SET = 0,
LOCKTIME__LOCKTIME_SECONDS = 1,
LOCKTIME__LOCKTIME_BLOCKS = 2,
} Locktime__LocktimeCase;
struct _Locktime
{
ProtobufCMessage base;
Locktime__LocktimeCase locktime_case;
union {
uint32_t seconds;
uint32_t blocks;
};
};
#define LOCKTIME__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&locktime__descriptor) \
, LOCKTIME__LOCKTIME__NOT_SET, {0} }
/*
* Pubkey for commitment transaction input.
*/
struct _BitcoinPubkey
{
ProtobufCMessage base;
/*
* Must be 33 bytes.
*/
ProtobufCBinaryData key;
};
#define BITCOIN_PUBKEY__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&bitcoin_pubkey__descriptor) \
, {0,NULL} }
/*
* How much a node charges (or pays!) for sending.
*/
struct _Funding
{
ProtobufCMessage base;
/*
* Base amount (in satoshi).
*/
protobuf_c_boolean has_fixed;
int64_t fixed;
/*
* This is charge per millionth of a satoshi.
*/
protobuf_c_boolean has_per_micro_satoshi;
int32_t per_micro_satoshi;
};
#define FUNDING__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&funding__descriptor) \
, 0,0ll, 0,0 }
/*
* Set channel params.
*/
struct _Authenticate
{
ProtobufCMessage base;
/*
* Which node this is.
*/
BitcoinPubkey *node_id;
/*
* Signature of your session key. *
*/
Signature *session_sig;
};
#define AUTHENTICATE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&authenticate__descriptor) \
, NULL, NULL }
/*
* We're authenticated. Here's what we've received already.
*/
struct _Init
{
ProtobufCMessage base;
/*
* How many update_commit and update_revocation messages already received
*/
uint64_t ack;
/*
* What features do we support (odd) and require (even)
*/
protobuf_c_boolean has_features;
ProtobufCBinaryData features;
};
#define INIT__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&init__descriptor) \
, 0, 0,{0,NULL} }
/*
* Set channel params.
*/
struct _OpenChannel
{
ProtobufCMessage base;
/*
* Relative locktime for outputs going to us.
*/
Locktime *delay;
/*
* Hash for revoking first commitment transaction.
*/
Sha256Hash *revocation_hash;
/*
* Hash for revoking second commitment transaction.
*/
Sha256Hash *next_revocation_hash;
/*
* Pubkey for anchor to pay into commitment tx.
*/
BitcoinPubkey *commit_key;
/*
* How to pay money to us from commit_tx.
*/
BitcoinPubkey *final_key;
OpenChannel__AnchorOffer anch;
/*
* How far must anchor be buried before we consider channel live?
*/
protobuf_c_boolean has_min_depth;
uint32_t min_depth;
/*
* How much fee would I like on commitment tx?
*/
uint64_t initial_fee_rate;
};
#define OPEN_CHANNEL__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&open_channel__descriptor) \
, NULL, NULL, NULL, NULL, NULL, 0, 0,0u, 0 }
/*
* Whoever is supplying anchor sends this.
*/
struct _OpenAnchor
{
ProtobufCMessage base;
/*
* Transaction ID of anchor.
*/
Sha256Hash *txid;
/*
* Which output is going to the 2 of 2.
*/
uint32_t output_index;
/*
* Amount of anchor output.
*/
uint64_t amount;
};
#define OPEN_ANCHOR__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&open_anchor__descriptor) \
, NULL, 0, 0 }
/*
* Reply: signature for your initial commitment tx
*/
struct _OpenCommitSig
{
ProtobufCMessage base;
Signature *sig;
};
#define OPEN_COMMIT_SIG__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&open_commit_sig__descriptor) \
, NULL }
/*
* Indicates we've seen anchor reach min-depth.
*/
struct _OpenComplete
{
ProtobufCMessage base;
/*
* Block it went into.
*/
/*
* FIXME: add a merkle proof plus block headers here?
*/
Sha256Hash *blockid;
};
#define OPEN_COMPLETE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&open_complete__descriptor) \
, NULL }
typedef enum {
ROUTE_STEP__NEXT__NOT_SET = 0,
ROUTE_STEP__NEXT_END = 1,
ROUTE_STEP__NEXT_BITCOIN = 2,
} RouteStep__NextCase;
struct _RouteStep
{
ProtobufCMessage base;
/*
* How much to forward (difference is fee)
*/
uint32_t amount;
RouteStep__NextCase next_case;
union {
/*
* Actually, this is the last one
*/
protobuf_c_boolean end;
/*
* Next lightning node.
*/
/*
* Other realms go here...
*/
BitcoinPubkey *bitcoin;
};
};
#define ROUTE_STEP__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&route_step__descriptor) \
, 0, ROUTE_STEP__NEXT__NOT_SET, {0} }
struct _Route
{
ProtobufCMessage base;
size_t n_steps;
RouteStep **steps;
};
#define ROUTE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&route__descriptor) \
, 0,NULL }
struct _Routing
{
ProtobufCMessage base;
ProtobufCBinaryData info;
};
#define ROUTING__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&routing__descriptor) \
, {0,NULL} }
/*
* Start a new commitment tx to add an HTLC me -> you.
*/
struct _UpdateAddHtlc
{
ProtobufCMessage base;
/*
* Unique identifier for this HTLC.
*/
uint64_t id;
/*
* Amount for htlc (millisatoshi)
*/
uint32_t amount_msat;
/*
* Hash for HTLC R value.
*/
Sha256Hash *r_hash;
/*
* Time at which HTLC expires (absolute)
*/
Locktime *expiry;
/*
* Onion-wrapped routing information.
*/
Routing *route;
};
#define UPDATE_ADD_HTLC__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&update_add_htlc__descriptor) \
, 0, 0, NULL, NULL, NULL }
/*
* Complete your HTLC: I have the R value, pay me!
*/
struct _UpdateFulfillHtlc
{
ProtobufCMessage base;
/*
* Which HTLC
*/
uint64_t id;
/*
* HTLC payment_preimage.
*/
Preimage *r;
};
#define UPDATE_FULFILL_HTLC__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&update_fulfill_htlc__descriptor) \
, 0, NULL }
/*
* This is encrypted in fail_reason.
*/
struct _FailInfo
{
ProtobufCMessage base;
BitcoinPubkey *id;
uint32_t error_code;
char *reason;
};
#define FAIL_INFO__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&fail_info__descriptor) \
, NULL, 0, NULL }
struct _FailReason
{
ProtobufCMessage base;
ProtobufCBinaryData info;
};
#define FAIL_REASON__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&fail_reason__descriptor) \
, {0,NULL} }
struct _UpdateFailHtlc
{
ProtobufCMessage base;
/*
* Which HTLC
*/
uint64_t id;
/*
* Reason for failure (for relay to initial node)
*/
FailReason *reason;
};
#define UPDATE_FAIL_HTLC__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&update_fail_htlc__descriptor) \
, 0, NULL }
/*
* Fee rate change proposal
*/
struct _UpdateFee
{
ProtobufCMessage base;
uint32_t fee_rate;
};
#define UPDATE_FEE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&update_fee__descriptor) \
, 0 }
/*
* Commit all the staged changes.
*/
struct _UpdateCommit
{
ProtobufCMessage base;
/*
* Signature for your new commitment tx (if any outputs are HTLCs or to you)
*/
Signature *sig;
};
#define UPDATE_COMMIT__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&update_commit__descriptor) \
, NULL }
/*
* Complete the update.
*/
struct _UpdateRevocation
{
ProtobufCMessage base;
/*
* Hash preimage which revokes old commitment tx.
*/
Sha256Hash *revocation_preimage;
/*
* Revocation hash for my next commit transaction
*/
Sha256Hash *next_revocation_hash;
};
#define UPDATE_REVOCATION__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&update_revocation__descriptor) \
, NULL, NULL }
/*
* Start clearing out the channel HTLCs so we can close it
*/
struct _CloseShutdown
{
ProtobufCMessage base;
/*
* Output script for mutual close tx.
*/
ProtobufCBinaryData scriptpubkey;
};
#define CLOSE_SHUTDOWN__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&close_shutdown__descriptor) \
, {0,NULL} }
struct _CloseSignature
{
ProtobufCMessage base;
/*
* Fee in satoshis.
*/
uint64_t close_fee;
/*
* Signature on the close transaction.
*/
Signature *sig;
};
#define CLOSE_SIGNATURE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&close_signature__descriptor) \
, 0, NULL }
/*
* This means we're going to hang up; it's to help diagnose only!
*/
struct _Error
{
ProtobufCMessage base;
char *problem;
};
#define ERROR__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&error__descriptor) \
, NULL }
/*
* Nested message to transport standard protocol messages through the legacy transport
*/
struct _NestedPkt
{
ProtobufCMessage base;
uint32_t type;
ProtobufCBinaryData inner_pkt;
};
#define NESTED_PKT__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&nested_pkt__descriptor) \
, 0, {0,NULL} }
typedef enum {
PKT__PKT__NOT_SET = 0,
PKT__PKT_AUTH = 50,
PKT__PKT_INIT = 51,
PKT__PKT_OPEN = 20,
PKT__PKT_OPEN_ANCHOR = 21,
PKT__PKT_OPEN_COMMIT_SIG = 22,
PKT__PKT_OPEN_COMPLETE = 23,
PKT__PKT_UPDATE_ADD_HTLC = 2,
PKT__PKT_UPDATE_FULFILL_HTLC = 3,
PKT__PKT_UPDATE_FAIL_HTLC = 4,
PKT__PKT_UPDATE_FEE = 5,
PKT__PKT_UPDATE_COMMIT = 6,
PKT__PKT_UPDATE_REVOCATION = 7,
PKT__PKT_CLOSE_SHUTDOWN = 30,
PKT__PKT_CLOSE_SIGNATURE = 31,
PKT__PKT_ERROR = 40,
PKT__PKT_NESTED = 128,
} Pkt__PktCase;
/*
* This is the union which defines all of them
*/
struct _Pkt
{
ProtobufCMessage base;
Pkt__PktCase pkt_case;
union {
/*
* Start of connection
*/
Authenticate *auth;
Init *init;
/*
* Opening
*/
OpenChannel *open;
OpenAnchor *open_anchor;
OpenCommitSig *open_commit_sig;
OpenComplete *open_complete;
/*
* Updating (most common)
*/
UpdateAddHtlc *update_add_htlc;
UpdateFulfillHtlc *update_fulfill_htlc;
UpdateFailHtlc *update_fail_htlc;
UpdateFee *update_fee;
UpdateCommit *update_commit;
UpdateRevocation *update_revocation;
/*
* Closing
*/
CloseShutdown *close_shutdown;
CloseSignature *close_signature;
/*
* Unexpected issue.
*/
Error *error;
/*
* Shim to upgrade to new packet format
*/
NestedPkt *nested;
};
};
#define PKT__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&pkt__descriptor) \
, PKT__PKT__NOT_SET, {0} }
/* Sha256Hash methods */
void sha256_hash__init
(Sha256Hash *message);
size_t sha256_hash__get_packed_size
(const Sha256Hash *message);
size_t sha256_hash__pack
(const Sha256Hash *message,
uint8_t *out);
size_t sha256_hash__pack_to_buffer
(const Sha256Hash *message,
ProtobufCBuffer *buffer);
Sha256Hash *
sha256_hash__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void sha256_hash__free_unpacked
(Sha256Hash *message,
ProtobufCAllocator *allocator);
/* Preimage methods */
void preimage__init
(Preimage *message);
size_t preimage__get_packed_size
(const Preimage *message);
size_t preimage__pack
(const Preimage *message,
uint8_t *out);
size_t preimage__pack_to_buffer
(const Preimage *message,
ProtobufCBuffer *buffer);
Preimage *
preimage__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void preimage__free_unpacked
(Preimage *message,
ProtobufCAllocator *allocator);
/* Signature methods */
void signature__init
(Signature *message);
size_t signature__get_packed_size
(const Signature *message);
size_t signature__pack
(const Signature *message,
uint8_t *out);
size_t signature__pack_to_buffer
(const Signature *message,
ProtobufCBuffer *buffer);
Signature *
signature__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void signature__free_unpacked
(Signature *message,
ProtobufCAllocator *allocator);
/* Locktime methods */
void locktime__init
(Locktime *message);
size_t locktime__get_packed_size
(const Locktime *message);
size_t locktime__pack
(const Locktime *message,
uint8_t *out);
size_t locktime__pack_to_buffer
(const Locktime *message,
ProtobufCBuffer *buffer);
Locktime *
locktime__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void locktime__free_unpacked
(Locktime *message,
ProtobufCAllocator *allocator);
/* BitcoinPubkey methods */
void bitcoin_pubkey__init
(BitcoinPubkey *message);
size_t bitcoin_pubkey__get_packed_size
(const BitcoinPubkey *message);
size_t bitcoin_pubkey__pack
(const BitcoinPubkey *message,
uint8_t *out);
size_t bitcoin_pubkey__pack_to_buffer
(const BitcoinPubkey *message,
ProtobufCBuffer *buffer);
BitcoinPubkey *
bitcoin_pubkey__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void bitcoin_pubkey__free_unpacked
(BitcoinPubkey *message,
ProtobufCAllocator *allocator);
/* Funding methods */
void funding__init
(Funding *message);
size_t funding__get_packed_size
(const Funding *message);
size_t funding__pack
(const Funding *message,
uint8_t *out);
size_t funding__pack_to_buffer
(const Funding *message,
ProtobufCBuffer *buffer);
Funding *
funding__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void funding__free_unpacked
(Funding *message,
ProtobufCAllocator *allocator);
/* Authenticate methods */
void authenticate__init
(Authenticate *message);
size_t authenticate__get_packed_size
(const Authenticate *message);
size_t authenticate__pack
(const Authenticate *message,
uint8_t *out);
size_t authenticate__pack_to_buffer
(const Authenticate *message,
ProtobufCBuffer *buffer);
Authenticate *
authenticate__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void authenticate__free_unpacked
(Authenticate *message,
ProtobufCAllocator *allocator);
/* Init methods */
void init__init
(Init *message);
size_t init__get_packed_size
(const Init *message);
size_t init__pack
(const Init *message,
uint8_t *out);
size_t init__pack_to_buffer
(const Init *message,
ProtobufCBuffer *buffer);
Init *
init__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void init__free_unpacked
(Init *message,
ProtobufCAllocator *allocator);
/* OpenChannel methods */
void open_channel__init
(OpenChannel *message);
size_t open_channel__get_packed_size
(const OpenChannel *message);
size_t open_channel__pack
(const OpenChannel *message,
uint8_t *out);
size_t open_channel__pack_to_buffer
(const OpenChannel *message,
ProtobufCBuffer *buffer);
OpenChannel *
open_channel__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void open_channel__free_unpacked
(OpenChannel *message,
ProtobufCAllocator *allocator);
/* OpenAnchor methods */
void open_anchor__init
(OpenAnchor *message);
size_t open_anchor__get_packed_size
(const OpenAnchor *message);
size_t open_anchor__pack
(const OpenAnchor *message,
uint8_t *out);
size_t open_anchor__pack_to_buffer
(const OpenAnchor *message,
ProtobufCBuffer *buffer);
OpenAnchor *
open_anchor__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void open_anchor__free_unpacked
(OpenAnchor *message,
ProtobufCAllocator *allocator);
/* OpenCommitSig methods */
void open_commit_sig__init
(OpenCommitSig *message);
size_t open_commit_sig__get_packed_size
(const OpenCommitSig *message);
size_t open_commit_sig__pack
(const OpenCommitSig *message,
uint8_t *out);
size_t open_commit_sig__pack_to_buffer
(const OpenCommitSig *message,
ProtobufCBuffer *buffer);
OpenCommitSig *
open_commit_sig__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void open_commit_sig__free_unpacked
(OpenCommitSig *message,
ProtobufCAllocator *allocator);
/* OpenComplete methods */
void open_complete__init
(OpenComplete *message);
size_t open_complete__get_packed_size
(const OpenComplete *message);
size_t open_complete__pack
(const OpenComplete *message,
uint8_t *out);
size_t open_complete__pack_to_buffer
(const OpenComplete *message,
ProtobufCBuffer *buffer);
OpenComplete *
open_complete__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void open_complete__free_unpacked
(OpenComplete *message,
ProtobufCAllocator *allocator);
/* RouteStep methods */
void route_step__init
(RouteStep *message);
size_t route_step__get_packed_size
(const RouteStep *message);
size_t route_step__pack
(const RouteStep *message,
uint8_t *out);
size_t route_step__pack_to_buffer
(const RouteStep *message,
ProtobufCBuffer *buffer);
RouteStep *
route_step__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void route_step__free_unpacked
(RouteStep *message,
ProtobufCAllocator *allocator);
/* Route methods */
void route__init
(Route *message);
size_t route__get_packed_size
(const Route *message);
size_t route__pack
(const Route *message,
uint8_t *out);
size_t route__pack_to_buffer
(const Route *message,
ProtobufCBuffer *buffer);
Route *
route__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void route__free_unpacked
(Route *message,
ProtobufCAllocator *allocator);
/* Routing methods */
void routing__init
(Routing *message);
size_t routing__get_packed_size
(const Routing *message);
size_t routing__pack
(const Routing *message,
uint8_t *out);
size_t routing__pack_to_buffer
(const Routing *message,
ProtobufCBuffer *buffer);
Routing *
routing__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void routing__free_unpacked
(Routing *message,
ProtobufCAllocator *allocator);
/* UpdateAddHtlc methods */
void update_add_htlc__init
(UpdateAddHtlc *message);
size_t update_add_htlc__get_packed_size
(const UpdateAddHtlc *message);
size_t update_add_htlc__pack
(const UpdateAddHtlc *message,
uint8_t *out);
size_t update_add_htlc__pack_to_buffer
(const UpdateAddHtlc *message,
ProtobufCBuffer *buffer);
UpdateAddHtlc *
update_add_htlc__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void update_add_htlc__free_unpacked
(UpdateAddHtlc *message,
ProtobufCAllocator *allocator);
/* UpdateFulfillHtlc methods */
void update_fulfill_htlc__init
(UpdateFulfillHtlc *message);
size_t update_fulfill_htlc__get_packed_size
(const UpdateFulfillHtlc *message);
size_t update_fulfill_htlc__pack
(const UpdateFulfillHtlc *message,
uint8_t *out);
size_t update_fulfill_htlc__pack_to_buffer
(const UpdateFulfillHtlc *message,
ProtobufCBuffer *buffer);
UpdateFulfillHtlc *
update_fulfill_htlc__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void update_fulfill_htlc__free_unpacked
(UpdateFulfillHtlc *message,
ProtobufCAllocator *allocator);
/* FailInfo methods */
void fail_info__init
(FailInfo *message);
size_t fail_info__get_packed_size
(const FailInfo *message);
size_t fail_info__pack
(const FailInfo *message,
uint8_t *out);
size_t fail_info__pack_to_buffer
(const FailInfo *message,
ProtobufCBuffer *buffer);
FailInfo *
fail_info__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void fail_info__free_unpacked
(FailInfo *message,
ProtobufCAllocator *allocator);
/* FailReason methods */
void fail_reason__init
(FailReason *message);
size_t fail_reason__get_packed_size
(const FailReason *message);
size_t fail_reason__pack
(const FailReason *message,
uint8_t *out);
size_t fail_reason__pack_to_buffer
(const FailReason *message,
ProtobufCBuffer *buffer);
FailReason *
fail_reason__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void fail_reason__free_unpacked
(FailReason *message,
ProtobufCAllocator *allocator);
/* UpdateFailHtlc methods */
void update_fail_htlc__init
(UpdateFailHtlc *message);
size_t update_fail_htlc__get_packed_size
(const UpdateFailHtlc *message);
size_t update_fail_htlc__pack
(const UpdateFailHtlc *message,