forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lightning.pb-c.h
861 lines (804 loc) · 26.2 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
/* 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 1001001 < 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 _Signature Signature;
typedef struct _BitcoinInput BitcoinInput;
typedef struct _BitcoinPubkey BitcoinPubkey;
typedef struct _Change Change;
typedef struct _Anchor Anchor;
typedef struct _OpenChannel OpenChannel;
typedef struct _OpenCommitSig OpenCommitSig;
typedef struct _OpenAnchorScriptsigs OpenAnchorScriptsigs;
typedef struct _OpenComplete OpenComplete;
typedef struct _Update Update;
typedef struct _UpdateAccept UpdateAccept;
typedef struct _UpdateSignature UpdateSignature;
typedef struct _UpdateComplete UpdateComplete;
typedef struct _CloseChannel CloseChannel;
typedef struct _CloseChannelComplete CloseChannelComplete;
typedef struct _Error Error;
typedef struct _Pkt Pkt;
/* --- enums --- */
/* --- 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 _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 }
/*
* Identifies consumption of a bitcoin output.
*/
struct _BitcoinInput
{
ProtobufCMessage base;
/*
* This is the transaction ID.
*/
Sha256Hash *txid;
/*
* This is the output number.
*/
uint32_t output;
/*
* And the subscript we're signing.
*/
ProtobufCBinaryData subscript;
/*
* The amount this input is worth.
*/
uint64_t amount;
};
#define BITCOIN_INPUT__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&bitcoin_input__descriptor) \
, NULL, 0, {0,NULL}, 0 }
/*
* Pubkey for commitment transaction input.
*/
struct _BitcoinPubkey
{
ProtobufCMessage base;
/*
* Either 65 or 33 bytes.
*/
ProtobufCBinaryData key;
};
#define BITCOIN_PUBKEY__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&bitcoin_pubkey__descriptor) \
, {0,NULL} }
/*
* Change, if we want any.
*/
struct _Change
{
ProtobufCMessage base;
uint64_t amount;
BitcoinPubkey *pubkey;
};
#define CHANGE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&change__descriptor) \
, 0, NULL }
/*
* All about an anchor transaction.
*/
struct _Anchor
{
ProtobufCMessage base;
/*
* 0 or more unspent inputs we want to use for anchor.
*/
size_t n_inputs;
BitcoinInput **inputs;
/*
* Pubkey for anchor to pay to for commitment tx (p2sh)
*/
BitcoinPubkey *pubkey;
/*
* Any change from anchor (in case we don't want to use them all)
*/
Change *change;
/*
* How much transaction fee we'll pay in the anchor tx.
*/
uint64_t fee;
/*
* How much we'll be putting into channel (== sum(inputs) - change - fee)
*/
uint64_t total;
/*
* How many confirmations on anchor before we'll use channel.
*/
uint32_t min_confirms;
};
#define ANCHOR__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&anchor__descriptor) \
, 0,NULL, NULL, NULL, 0, 0, 0 }
typedef enum {
OPEN_CHANNEL__LOCKTIME__NOT_SET = 0,
OPEN_CHANNEL__LOCKTIME_LOCKTIME_SECONDS = 2,
OPEN_CHANNEL__LOCKTIME_LOCKTIME_BLOCKS = 3,
} OpenChannel__LocktimeCase;
/*
* Set channel params.
*/
struct _OpenChannel
{
ProtobufCMessage base;
/*
* Hash seed for revoking commitment transactions.
*/
Sha256Hash *revocation_hash;
/*
* How to pay money to us from commit_tx.
*/
BitcoinPubkey *final;
/*
* How much transaction fee we'll pay for commitment txs.
*/
uint64_t commitment_fee;
/*
* The anchor transaction details.
*/
Anchor *anchor;
OpenChannel__LocktimeCase locktime_case;
union {
uint32_t locktime_seconds;
uint32_t locktime_blocks;
};
};
#define OPEN_CHANNEL__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&open_channel__descriptor) \
, NULL, NULL, 0, NULL, OPEN_CHANNEL__LOCKTIME__NOT_SET, {} }
/*
* Supply signature for commitment tx
*/
struct _OpenCommitSig
{
ProtobufCMessage base;
Signature *sig;
};
#define OPEN_COMMIT_SIG__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&open_commit_sig__descriptor) \
, NULL }
/*
* Supply ScriptSig for each anchor tx inputs.
*/
struct _OpenAnchorScriptsigs
{
ProtobufCMessage base;
size_t n_script;
ProtobufCBinaryData *script;
};
#define OPEN_ANCHOR_SCRIPTSIGS__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&open_anchor_scriptsigs__descriptor) \
, 0,NULL }
/*
* Indicates we've seen transaction 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 }
/*
* Let's spend some money in the channel!
*/
struct _Update
{
ProtobufCMessage base;
/*
* Hash for which I will supply preimage to revoke this.
*/
Sha256Hash *revocation_hash;
/*
* Change in current payment to-me (implies reverse to-you).
*/
/*
* FIXME: optional HTLC ops.
*/
int64_t delta;
};
#define UPDATE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&update__descriptor) \
, NULL, 0 }
/*
* OK, I accept that update; here's your signature.
*/
struct _UpdateAccept
{
ProtobufCMessage base;
/*
* Signature for your new commitment tx.
*/
Signature *sig;
/*
* Hash for which I will supply preimage to revoke this new commit tx.
*/
Sha256Hash *revocation_hash;
};
#define UPDATE_ACCEPT__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&update_accept__descriptor) \
, NULL, NULL }
/*
* Thanks for accepting, here's my last bit.
*/
struct _UpdateSignature
{
ProtobufCMessage base;
/*
* Signature for your new commitment tx.
*/
Signature *sig;
/*
* Hash preimage which revokes old commitment tx.
*/
Sha256Hash *revocation_preimage;
};
#define UPDATE_SIGNATURE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&update_signature__descriptor) \
, NULL, NULL }
/*
* Complete the update.
*/
struct _UpdateComplete
{
ProtobufCMessage base;
/*
* Hash preimage which revokes old commitment tx.
*/
Sha256Hash *revocation_preimage;
};
#define UPDATE_COMPLETE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&update_complete__descriptor) \
, NULL }
/*
* Begin cooperative close of channel.
*/
struct _CloseChannel
{
ProtobufCMessage base;
/*
* This is our signature a new transaction which spends the anchor
* output to my open->final and your open->final,
* as per the last commit tx.
*/
Signature *sig;
};
#define CLOSE_CHANNEL__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&close_channel__descriptor) \
, NULL }
/*
* OK, here's my sig so you can broadcast it too. We're done.
*/
struct _CloseChannelComplete
{
ProtobufCMessage base;
/*
* This is my signature for that same tx.
*/
Signature *sig;
};
#define CLOSE_CHANNEL_COMPLETE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&close_channel_complete__descriptor) \
, 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 }
typedef enum {
PKT__PKT__NOT_SET = 0,
PKT__PKT_OPEN = 201,
PKT__PKT_OPEN_COMMIT_SIG = 202,
PKT__PKT_OPEN_ANCHOR_SCRIPTSIGS = 203,
PKT__PKT_OPEN_COMPLETE = 204,
PKT__PKT_UPDATE = 1,
PKT__PKT_UPDATE_ACCEPT = 2,
PKT__PKT_UPDATE_SIGNATURE = 3,
PKT__PKT_UPDATE_COMPLETE = 4,
PKT__PKT_CLOSE = 401,
PKT__PKT_CLOSE_COMPLETE = 402,
PKT__PKT_ERROR = 1000,
} Pkt__PktCase;
/*
* This is the union which defines all of them
*/
struct _Pkt
{
ProtobufCMessage base;
Pkt__PktCase pkt_case;
union {
/*
* Opening
*/
OpenChannel *open;
OpenCommitSig *open_commit_sig;
OpenAnchorScriptsigs *open_anchor_scriptsigs;
OpenComplete *open_complete;
/*
* Updating (most common)
*/
Update *update;
UpdateAccept *update_accept;
UpdateSignature *update_signature;
UpdateComplete *update_complete;
/*
* Closing
*/
CloseChannel *close;
CloseChannelComplete *close_complete;
/*
* Unexpected issue.
*/
Error *error;
};
};
#define PKT__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&pkt__descriptor) \
, PKT__PKT__NOT_SET, {} }
/* 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);
/* 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);
/* BitcoinInput methods */
void bitcoin_input__init
(BitcoinInput *message);
size_t bitcoin_input__get_packed_size
(const BitcoinInput *message);
size_t bitcoin_input__pack
(const BitcoinInput *message,
uint8_t *out);
size_t bitcoin_input__pack_to_buffer
(const BitcoinInput *message,
ProtobufCBuffer *buffer);
BitcoinInput *
bitcoin_input__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void bitcoin_input__free_unpacked
(BitcoinInput *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);
/* Change methods */
void change__init
(Change *message);
size_t change__get_packed_size
(const Change *message);
size_t change__pack
(const Change *message,
uint8_t *out);
size_t change__pack_to_buffer
(const Change *message,
ProtobufCBuffer *buffer);
Change *
change__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void change__free_unpacked
(Change *message,
ProtobufCAllocator *allocator);
/* Anchor methods */
void anchor__init
(Anchor *message);
size_t anchor__get_packed_size
(const Anchor *message);
size_t anchor__pack
(const Anchor *message,
uint8_t *out);
size_t anchor__pack_to_buffer
(const Anchor *message,
ProtobufCBuffer *buffer);
Anchor *
anchor__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void anchor__free_unpacked
(Anchor *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);
/* 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);
/* OpenAnchorScriptsigs methods */
void open_anchor_scriptsigs__init
(OpenAnchorScriptsigs *message);
size_t open_anchor_scriptsigs__get_packed_size
(const OpenAnchorScriptsigs *message);
size_t open_anchor_scriptsigs__pack
(const OpenAnchorScriptsigs *message,
uint8_t *out);
size_t open_anchor_scriptsigs__pack_to_buffer
(const OpenAnchorScriptsigs *message,
ProtobufCBuffer *buffer);
OpenAnchorScriptsigs *
open_anchor_scriptsigs__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void open_anchor_scriptsigs__free_unpacked
(OpenAnchorScriptsigs *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);
/* Update methods */
void update__init
(Update *message);
size_t update__get_packed_size
(const Update *message);
size_t update__pack
(const Update *message,
uint8_t *out);
size_t update__pack_to_buffer
(const Update *message,
ProtobufCBuffer *buffer);
Update *
update__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void update__free_unpacked
(Update *message,
ProtobufCAllocator *allocator);
/* UpdateAccept methods */
void update_accept__init
(UpdateAccept *message);
size_t update_accept__get_packed_size
(const UpdateAccept *message);
size_t update_accept__pack
(const UpdateAccept *message,
uint8_t *out);
size_t update_accept__pack_to_buffer
(const UpdateAccept *message,
ProtobufCBuffer *buffer);
UpdateAccept *
update_accept__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void update_accept__free_unpacked
(UpdateAccept *message,
ProtobufCAllocator *allocator);
/* UpdateSignature methods */
void update_signature__init
(UpdateSignature *message);
size_t update_signature__get_packed_size
(const UpdateSignature *message);
size_t update_signature__pack
(const UpdateSignature *message,
uint8_t *out);
size_t update_signature__pack_to_buffer
(const UpdateSignature *message,
ProtobufCBuffer *buffer);
UpdateSignature *
update_signature__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void update_signature__free_unpacked
(UpdateSignature *message,
ProtobufCAllocator *allocator);
/* UpdateComplete methods */
void update_complete__init
(UpdateComplete *message);
size_t update_complete__get_packed_size
(const UpdateComplete *message);
size_t update_complete__pack
(const UpdateComplete *message,
uint8_t *out);
size_t update_complete__pack_to_buffer
(const UpdateComplete *message,
ProtobufCBuffer *buffer);
UpdateComplete *
update_complete__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void update_complete__free_unpacked
(UpdateComplete *message,
ProtobufCAllocator *allocator);
/* CloseChannel methods */
void close_channel__init
(CloseChannel *message);
size_t close_channel__get_packed_size
(const CloseChannel *message);
size_t close_channel__pack
(const CloseChannel *message,
uint8_t *out);
size_t close_channel__pack_to_buffer
(const CloseChannel *message,
ProtobufCBuffer *buffer);
CloseChannel *
close_channel__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void close_channel__free_unpacked
(CloseChannel *message,
ProtobufCAllocator *allocator);
/* CloseChannelComplete methods */
void close_channel_complete__init
(CloseChannelComplete *message);
size_t close_channel_complete__get_packed_size
(const CloseChannelComplete *message);
size_t close_channel_complete__pack
(const CloseChannelComplete *message,
uint8_t *out);
size_t close_channel_complete__pack_to_buffer
(const CloseChannelComplete *message,
ProtobufCBuffer *buffer);
CloseChannelComplete *
close_channel_complete__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void close_channel_complete__free_unpacked
(CloseChannelComplete *message,
ProtobufCAllocator *allocator);
/* Error methods */
void error__init
(Error *message);
size_t error__get_packed_size
(const Error *message);
size_t error__pack
(const Error *message,
uint8_t *out);
size_t error__pack_to_buffer
(const Error *message,
ProtobufCBuffer *buffer);
Error *
error__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void error__free_unpacked
(Error *message,
ProtobufCAllocator *allocator);
/* Pkt methods */
void pkt__init
(Pkt *message);
size_t pkt__get_packed_size
(const Pkt *message);
size_t pkt__pack
(const Pkt *message,
uint8_t *out);
size_t pkt__pack_to_buffer
(const Pkt *message,
ProtobufCBuffer *buffer);
Pkt *
pkt__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void pkt__free_unpacked
(Pkt *message,
ProtobufCAllocator *allocator);
/* --- per-message closures --- */
typedef void (*Sha256Hash_Closure)
(const Sha256Hash *message,
void *closure_data);
typedef void (*Signature_Closure)
(const Signature *message,
void *closure_data);
typedef void (*BitcoinInput_Closure)
(const BitcoinInput *message,
void *closure_data);
typedef void (*BitcoinPubkey_Closure)
(const BitcoinPubkey *message,
void *closure_data);
typedef void (*Change_Closure)
(const Change *message,
void *closure_data);
typedef void (*Anchor_Closure)
(const Anchor *message,
void *closure_data);
typedef void (*OpenChannel_Closure)
(const OpenChannel *message,
void *closure_data);
typedef void (*OpenCommitSig_Closure)
(const OpenCommitSig *message,
void *closure_data);
typedef void (*OpenAnchorScriptsigs_Closure)
(const OpenAnchorScriptsigs *message,
void *closure_data);
typedef void (*OpenComplete_Closure)
(const OpenComplete *message,
void *closure_data);
typedef void (*Update_Closure)
(const Update *message,
void *closure_data);
typedef void (*UpdateAccept_Closure)
(const UpdateAccept *message,
void *closure_data);
typedef void (*UpdateSignature_Closure)
(const UpdateSignature *message,
void *closure_data);
typedef void (*UpdateComplete_Closure)
(const UpdateComplete *message,
void *closure_data);
typedef void (*CloseChannel_Closure)
(const CloseChannel *message,
void *closure_data);
typedef void (*CloseChannelComplete_Closure)
(const CloseChannelComplete *message,
void *closure_data);
typedef void (*Error_Closure)
(const Error *message,
void *closure_data);
typedef void (*Pkt_Closure)
(const Pkt *message,
void *closure_data);
/* --- services --- */
/* --- descriptors --- */
extern const ProtobufCMessageDescriptor sha256_hash__descriptor;
extern const ProtobufCMessageDescriptor signature__descriptor;
extern const ProtobufCMessageDescriptor bitcoin_input__descriptor;
extern const ProtobufCMessageDescriptor bitcoin_pubkey__descriptor;
extern const ProtobufCMessageDescriptor change__descriptor;
extern const ProtobufCMessageDescriptor anchor__descriptor;
extern const ProtobufCMessageDescriptor open_channel__descriptor;
extern const ProtobufCMessageDescriptor open_commit_sig__descriptor;
extern const ProtobufCMessageDescriptor open_anchor_scriptsigs__descriptor;
extern const ProtobufCMessageDescriptor open_complete__descriptor;
extern const ProtobufCMessageDescriptor update__descriptor;
extern const ProtobufCMessageDescriptor update_accept__descriptor;
extern const ProtobufCMessageDescriptor update_signature__descriptor;
extern const ProtobufCMessageDescriptor update_complete__descriptor;
extern const ProtobufCMessageDescriptor close_channel__descriptor;
extern const ProtobufCMessageDescriptor close_channel_complete__descriptor;
extern const ProtobufCMessageDescriptor error__descriptor;
extern const ProtobufCMessageDescriptor pkt__descriptor;
PROTOBUF_C__END_DECLS
#endif /* PROTOBUF_C_lightning_2eproto__INCLUDED */