2015-05-26 06:38:12 +02:00
/* 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 ;
2015-06-01 04:26:09 +02:00
typedef struct _Signature Signature ;
2015-05-28 23:38:27 +02:00
typedef struct _BitcoinInput BitcoinInput ;
typedef struct _BitcoinPubkey BitcoinPubkey ;
2015-06-05 04:54:58 +02:00
typedef struct _Change Change ;
2015-05-26 06:38:12 +02:00
typedef struct _Anchor Anchor ;
typedef struct _OpenChannel OpenChannel ;
typedef struct _OpenCommitSig OpenCommitSig ;
2015-06-04 03:36:57 +02:00
typedef struct _OpenAnchorScriptsigs OpenAnchorScriptsigs ;
2015-05-29 03:22:18 +02:00
typedef struct _LeakAnchorSigsAndPretendWeDidnt LeakAnchorSigsAndPretendWeDidnt ;
2015-05-26 06:38:12 +02:00
typedef struct _OpenComplete OpenComplete ;
typedef struct _Update Update ;
typedef struct _UpdateAccept UpdateAccept ;
typedef struct _UpdateComplete UpdateComplete ;
typedef struct _NewAnchor NewAnchor ;
typedef struct _NewAnchorAck NewAnchorAck ;
2015-05-28 23:38:27 +02:00
typedef struct _NewAnchorCommitSig NewAnchorCommitSig ;
2015-05-26 06:38:12 +02:00
typedef struct _NewAnchorAccept NewAnchorAccept ;
typedef struct _NewAnchorComplete NewAnchorComplete ;
typedef struct _CloseChannel CloseChannel ;
typedef struct _CloseChannelComplete CloseChannelComplete ;
typedef struct _Error Error ;
typedef struct _Pkt Pkt ;
/* --- enums --- */
/* --- messages --- */
/*
2015-06-01 04:26:09 +02:00
* Protobufs don ' t have fixed - length fields , so these are a hack .
2015-05-26 06:38:12 +02:00
*/
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 }
2015-06-01 04:26:09 +02:00
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 }
2015-05-26 06:38:12 +02:00
/*
2015-05-28 23:38:27 +02:00
* Identifies consumption of a bitcoin output .
2015-05-26 06:38:12 +02:00
*/
2015-05-28 23:38:27 +02:00
struct _BitcoinInput
2015-05-26 06:38:12 +02:00
{
ProtobufCMessage base ;
/*
* This is the transaction ID .
*/
Sha256Hash * txid ;
/*
* This is the output number .
*/
uint32_t output ;
2015-05-28 23:38:27 +02:00
/*
* And the subscript we ' re signing .
*/
ProtobufCBinaryData subscript ;
/*
* The amount this input is worth .
*/
uint64_t amount ;
2015-05-26 06:38:12 +02:00
} ;
2015-05-28 23:38:27 +02:00
# define BITCOIN_INPUT__INIT \
{ PROTOBUF_C_MESSAGE_INIT ( & bitcoin_input__descriptor ) \
, NULL , 0 , { 0 , NULL } , 0 }
2015-05-26 06:38:12 +02:00
2015-05-28 23:38:27 +02:00
/*
* 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 } }
2015-06-05 04:54:58 +02:00
/*
* 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 }
2015-05-26 06:38:12 +02:00
/*
* All about an anchor transaction .
*/
struct _Anchor
{
ProtobufCMessage base ;
/*
* 0 or more unspent inputs we want to use for anchor .
*/
size_t n_inputs ;
2015-05-28 23:38:27 +02:00
BitcoinInput * * inputs ;
/*
* Pubkey for anchor to pay to for commitment tx ( p2sh )
*/
BitcoinPubkey * pubkey ;
2015-05-26 06:38:12 +02:00
/*
* Any change from anchor ( in case we don ' t want to use them all )
*/
2015-06-05 04:54:58 +02:00
Change * change ;
2015-05-26 06:38:12 +02:00
/*
* How much transaction fee we ' ll pay in the anchor tx .
*/
uint64_t fee ;
2015-05-28 23:38:27 +02:00
/*
* How much we ' ll be putting into channel ( = = sum ( inputs ) - change - fee )
*/
uint64_t total ;
2015-05-26 06:38:12 +02:00
/*
* How many confirmations on anchor before we ' ll use channel .
*/
uint32_t min_confirms ;
} ;
# define ANCHOR__INIT \
{ PROTOBUF_C_MESSAGE_INIT ( & anchor__descriptor ) \
2015-05-28 23:38:27 +02:00
, 0 , NULL , NULL , NULL , 0 , 0 , 0 }
2015-05-26 06:38:12 +02:00
/*
* Set channel params .
*/
struct _OpenChannel
{
ProtobufCMessage base ;
/*
* Seed which sets order we create outputs for all transactions .
*/
uint64_t seed ;
2015-05-29 05:11:16 +02:00
/*
* Relative locktime for outputs going to us .
*/
uint32_t locktime_seconds ;
2015-05-26 06:38:12 +02:00
/*
* Hash seed for revoking commitment transactions .
*/
Sha256Hash * revocation_hash ;
/*
2015-05-28 23:38:27 +02:00
* How to pay money to us from commit_tx .
2015-05-26 06:38:12 +02:00
*/
2015-06-07 22:59:15 +02:00
BitcoinPubkey * final ;
2015-05-26 06:38:12 +02:00
/*
* How much transaction fee we ' ll pay for commitment txs .
*/
uint64_t commitment_fee ;
/*
* The anchor transaction details .
*/
Anchor * anchor ;
2015-05-27 04:12:05 +02:00
/*
* Maximum transaction version we support .
*/
uint32_t tx_version ;
2015-05-26 06:38:12 +02:00
} ;
# define OPEN_CHANNEL__INIT \
{ PROTOBUF_C_MESSAGE_INIT ( & open_channel__descriptor ) \
2015-06-05 04:07:27 +02:00
, 0 , 0 , NULL , NULL , 0 , NULL , 0 }
2015-05-26 06:38:12 +02:00
/*
* Supply signature for commitment tx
*/
struct _OpenCommitSig
{
ProtobufCMessage base ;
2015-06-01 04:26:09 +02:00
Signature * sig ;
2015-05-26 06:38:12 +02:00
} ;
# define OPEN_COMMIT_SIG__INIT \
{ PROTOBUF_C_MESSAGE_INIT ( & open_commit_sig__descriptor ) \
, NULL }
/*
2015-05-28 23:38:27 +02:00
* Supply ScriptSig for each anchor tx inputs .
2015-05-26 06:38:12 +02:00
*/
2015-06-04 03:36:57 +02:00
struct _OpenAnchorScriptsigs
2015-05-26 06:38:12 +02:00
{
ProtobufCMessage base ;
2015-05-28 23:38:27 +02:00
size_t n_script ;
ProtobufCBinaryData * script ;
2015-05-26 06:38:12 +02:00
} ;
2015-06-04 03:36:57 +02:00
# define OPEN_ANCHOR_SCRIPTSIGS__INIT \
{ PROTOBUF_C_MESSAGE_INIT ( & open_anchor_scriptsigs__descriptor ) \
2015-05-28 23:38:27 +02:00
, 0 , NULL }
/*
* BROKEN AND INSECURE ! ! !
* This should not exist ; it ' s completely insecure ! But we need to sign
* the commitment transaction before we sign the anchor transaction , which
* doesn ' t work at all with current bitcoin ( as we don ' t know the anchor
* txid until it ' s signed by both sides , and then we ' d have to worry about
* malleability anyway ) . So for testing , we send the scriptsigs for the
* anchor transaction ' s inputs immediately .
*/
2015-05-29 03:22:18 +02:00
struct _LeakAnchorSigsAndPretendWeDidnt
2015-05-28 23:38:27 +02:00
{
ProtobufCMessage base ;
2015-06-04 03:36:57 +02:00
OpenAnchorScriptsigs * sigs ;
2015-05-28 23:38:27 +02:00
} ;
2015-05-29 03:22:18 +02:00
# define LEAK_ANCHOR_SIGS_AND_PRETEND_WE_DIDNT__INIT \
{ PROTOBUF_C_MESSAGE_INIT ( & leak_anchor_sigs_and_pretend_we_didnt__descriptor ) \
2015-05-26 06:38:12 +02:00
, 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 ) .
*/
int64_t delta ;
/*
* Signature for new commitment tx .
*/
2015-06-01 04:26:09 +02:00
Signature * sig ;
2015-05-26 06:38:12 +02:00
/*
* Signature for old anchor ( if any )
*/
/*
* FIXME : optional HTLC ops .
*/
2015-06-01 04:26:09 +02:00
Signature * old_anchor_sig ;
2015-05-26 06:38:12 +02:00
} ;
# define UPDATE__INIT \
{ PROTOBUF_C_MESSAGE_INIT ( & update__descriptor ) \
, NULL , 0 , NULL , NULL }
/*
* OK , I accept that update .
*/
struct _UpdateAccept
{
ProtobufCMessage base ;
/*
* Signature for new commitment tx .
*/
2015-06-01 04:26:09 +02:00
Signature * sig ;
2015-05-26 06:38:12 +02:00
/*
* Signature for old anchor ( if any )
*/
2015-06-01 04:26:09 +02:00
Signature * old_anchor_sig ;
2015-06-05 03:06:05 +02:00
/*
* Hash for which I will supply preimage to revoke this new commit tx .
*/
Sha256Hash * revocation_hash ;
2015-05-26 06:38:12 +02:00
/*
* Hash preimage which revokes old commitment tx .
*/
Sha256Hash * revocation_preimage ;
} ;
# define UPDATE_ACCEPT__INIT \
{ PROTOBUF_C_MESSAGE_INIT ( & update_accept__descriptor ) \
2015-06-05 03:06:05 +02:00
, NULL , NULL , NULL , NULL }
2015-05-26 06:38:12 +02:00
/*
* 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 }
/*
* Let ' s change the channel funding source .
*/
struct _NewAnchor
{
ProtobufCMessage base ;
/*
* The new anchor : previous anchor 2 x2 input assumed .
*/
Anchor * anchor ;
} ;
# define NEW_ANCHOR__INIT \
{ PROTOBUF_C_MESSAGE_INIT ( & new_anchor__descriptor ) \
, NULL }
/*
2015-05-28 23:38:27 +02:00
* That seems OK to me , let ' s add these too ( if any ) .
2015-05-26 06:38:12 +02:00
*/
struct _NewAnchorAck
{
ProtobufCMessage base ;
2015-05-28 23:38:27 +02:00
Anchor * anchor ;
2015-05-26 06:38:12 +02:00
} ;
# define NEW_ANCHOR_ACK__INIT \
{ PROTOBUF_C_MESSAGE_INIT ( & new_anchor_ack__descriptor ) \
, NULL }
/*
2015-05-28 23:38:27 +02:00
* Now we both send signatures for new commit sig .
2015-05-26 06:38:12 +02:00
*/
2015-05-28 23:38:27 +02:00
struct _NewAnchorCommitSig
2015-05-26 06:38:12 +02:00
{
ProtobufCMessage base ;
2015-06-01 04:26:09 +02:00
Signature * sig ;
2015-05-26 06:38:12 +02:00
} ;
2015-05-28 23:38:27 +02:00
# define NEW_ANCHOR_COMMIT_SIG__INIT \
{ PROTOBUF_C_MESSAGE_INIT ( & new_anchor_commit_sig__descriptor ) \
, NULL }
/*
* Here are the script sigs for the new anchor ' s new inputs .
*/
struct _NewAnchorAccept
{
ProtobufCMessage base ;
size_t n_script ;
ProtobufCBinaryData * script ;
} ;
2015-05-26 06:38:12 +02:00
# define NEW_ANCHOR_ACCEPT__INIT \
{ PROTOBUF_C_MESSAGE_INIT ( & new_anchor_accept__descriptor ) \
2015-05-28 23:38:27 +02:00
, 0 , NULL }
2015-05-26 06:38:12 +02:00
/*
* Complete the transfer to new anchor ( both ends need to send this ,
* once they ' re happy that it ' s reached their required depth ) .
*/
struct _NewAnchorComplete
{
ProtobufCMessage base ;
Sha256Hash * revocation_preimage ;
} ;
# define NEW_ANCHOR_COMPLETE__INIT \
{ PROTOBUF_C_MESSAGE_INIT ( & new_anchor_complete__descriptor ) \
, NULL }
/*
* Begin cooperative close of channel .
*/
struct _CloseChannel
{
ProtobufCMessage base ;
/*
2015-06-05 03:06:05 +02:00
* This is our signature a new transaction which spends the anchor
* output to my open - > script_to_me and your open - > script_to_me ,
* as per the last commit tx .
2015-05-26 06:38:12 +02:00
*/
2015-06-01 04:26:09 +02:00
Signature * sig ;
2015-05-26 06:38:12 +02:00
} ;
# define CLOSE_CHANNEL__INIT \
{ PROTOBUF_C_MESSAGE_INIT ( & close_channel__descriptor ) \
, NULL }
/*
2015-06-05 03:06:05 +02:00
* OK , here ' s my sig so you can broadcast it too . We ' re done .
2015-05-26 06:38:12 +02:00
*/
struct _CloseChannelComplete
{
ProtobufCMessage base ;
/*
2015-06-05 03:06:05 +02:00
* This is my signature for that same tx .
2015-05-26 06:38:12 +02:00
*/
2015-06-01 04:26:09 +02:00
Signature * sig ;
2015-05-26 06:38:12 +02:00
} ;
# 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 ,
2015-05-28 23:38:27 +02:00
PKT__PKT_OMG_FAIL = 205 ,
2015-05-26 06:38:12 +02:00
PKT__PKT_OPEN_COMMIT_SIG = 202 ,
2015-06-04 03:36:57 +02:00
PKT__PKT_OPEN_ANCHOR_SCRIPTSIGS = 203 ,
2015-05-26 06:38:12 +02:00
PKT__PKT_OPEN_COMPLETE = 204 ,
PKT__PKT_UPDATE = 1 ,
PKT__PKT_UPDATE_ACCEPT = 2 ,
PKT__PKT_UPDATE_COMPLETE = 3 ,
PKT__PKT_NEW_ANCHOR = 301 ,
PKT__PKT_NEW_ANCHOR_ACK = 302 ,
PKT__PKT_NEW_ANCHOR_ACCEPT = 303 ,
PKT__PKT_NEW_ANCHOR_COMPLETE = 304 ,
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 ;
2015-05-29 03:22:18 +02:00
LeakAnchorSigsAndPretendWeDidnt * omg_fail ;
2015-05-26 06:38:12 +02:00
OpenCommitSig * open_commit_sig ;
2015-06-04 03:36:57 +02:00
OpenAnchorScriptsigs * open_anchor_scriptsigs ;
2015-05-26 06:38:12 +02:00
OpenComplete * open_complete ;
/*
* Updating ( most common )
*/
Update * update ;
UpdateAccept * update_accept ;
UpdateComplete * update_complete ;
/*
* Topping up
*/
NewAnchor * new_anchor ;
NewAnchorAck * new_anchor_ack ;
NewAnchorAccept * new_anchor_accept ;
NewAnchorComplete * new_anchor_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 ) ;
2015-06-01 04:26:09 +02:00
/* 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 ) ;
2015-05-28 23:38:27 +02:00
/* 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 ,
2015-05-26 06:38:12 +02:00
uint8_t * out ) ;
2015-05-28 23:38:27 +02:00
size_t bitcoin_input__pack_to_buffer
( const BitcoinInput * message ,
2015-05-26 06:38:12 +02:00
ProtobufCBuffer * buffer ) ;
2015-05-28 23:38:27 +02:00
BitcoinInput *
bitcoin_input__unpack
2015-05-26 06:38:12 +02:00
( ProtobufCAllocator * allocator ,
size_t len ,
const uint8_t * data ) ;
2015-05-28 23:38:27 +02:00
void bitcoin_input__free_unpacked
( BitcoinInput * message ,
2015-05-26 06:38:12 +02:00
ProtobufCAllocator * allocator ) ;
2015-05-28 23:38:27 +02:00
/* 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 ) ;
2015-06-05 04:54:58 +02:00
/* 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 ) ;
2015-05-26 06:38:12 +02:00
/* 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 ) ;
2015-06-04 03:36:57 +02:00
/* 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 ,
2015-05-26 06:38:12 +02:00
uint8_t * out ) ;
2015-06-04 03:36:57 +02:00
size_t open_anchor_scriptsigs__pack_to_buffer
( const OpenAnchorScriptsigs * message ,
2015-05-26 06:38:12 +02:00
ProtobufCBuffer * buffer ) ;
2015-06-04 03:36:57 +02:00
OpenAnchorScriptsigs *
open_anchor_scriptsigs__unpack
2015-05-26 06:38:12 +02:00
( ProtobufCAllocator * allocator ,
size_t len ,
const uint8_t * data ) ;
2015-06-04 03:36:57 +02:00
void open_anchor_scriptsigs__free_unpacked
( OpenAnchorScriptsigs * message ,
2015-05-26 06:38:12 +02:00
ProtobufCAllocator * allocator ) ;
2015-05-29 03:22:18 +02:00
/* LeakAnchorSigsAndPretendWeDidnt methods */
void leak_anchor_sigs_and_pretend_we_didnt__init
( LeakAnchorSigsAndPretendWeDidnt * message ) ;
size_t leak_anchor_sigs_and_pretend_we_didnt__get_packed_size
( const LeakAnchorSigsAndPretendWeDidnt * message ) ;
size_t leak_anchor_sigs_and_pretend_we_didnt__pack
( const LeakAnchorSigsAndPretendWeDidnt * message ,
2015-05-28 23:38:27 +02:00
uint8_t * out ) ;
2015-05-29 03:22:18 +02:00
size_t leak_anchor_sigs_and_pretend_we_didnt__pack_to_buffer
( const LeakAnchorSigsAndPretendWeDidnt * message ,
2015-05-28 23:38:27 +02:00
ProtobufCBuffer * buffer ) ;
2015-05-29 03:22:18 +02:00
LeakAnchorSigsAndPretendWeDidnt *
leak_anchor_sigs_and_pretend_we_didnt__unpack
2015-05-28 23:38:27 +02:00
( ProtobufCAllocator * allocator ,
size_t len ,
const uint8_t * data ) ;
2015-05-29 03:22:18 +02:00
void leak_anchor_sigs_and_pretend_we_didnt__free_unpacked
( LeakAnchorSigsAndPretendWeDidnt * message ,
2015-05-28 23:38:27 +02:00
ProtobufCAllocator * allocator ) ;
2015-05-26 06:38:12 +02:00
/* 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 ) ;
/* 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 ) ;
/* NewAnchor methods */
void new_anchor__init
( NewAnchor * message ) ;
size_t new_anchor__get_packed_size
( const NewAnchor * message ) ;
size_t new_anchor__pack
( const NewAnchor * message ,
uint8_t * out ) ;
size_t new_anchor__pack_to_buffer
( const NewAnchor * message ,
ProtobufCBuffer * buffer ) ;
NewAnchor *
new_anchor__unpack
( ProtobufCAllocator * allocator ,
size_t len ,
const uint8_t * data ) ;
void new_anchor__free_unpacked
( NewAnchor * message ,
ProtobufCAllocator * allocator ) ;
/* NewAnchorAck methods */
void new_anchor_ack__init
( NewAnchorAck * message ) ;
size_t new_anchor_ack__get_packed_size
( const NewAnchorAck * message ) ;
size_t new_anchor_ack__pack
( const NewAnchorAck * message ,
uint8_t * out ) ;
size_t new_anchor_ack__pack_to_buffer
( const NewAnchorAck * message ,
ProtobufCBuffer * buffer ) ;
NewAnchorAck *
new_anchor_ack__unpack
( ProtobufCAllocator * allocator ,
size_t len ,
const uint8_t * data ) ;
void new_anchor_ack__free_unpacked
( NewAnchorAck * message ,
ProtobufCAllocator * allocator ) ;
2015-05-28 23:38:27 +02:00
/* NewAnchorCommitSig methods */
void new_anchor_commit_sig__init
( NewAnchorCommitSig * message ) ;
size_t new_anchor_commit_sig__get_packed_size
( const NewAnchorCommitSig * message ) ;
size_t new_anchor_commit_sig__pack
( const NewAnchorCommitSig * message ,
uint8_t * out ) ;
size_t new_anchor_commit_sig__pack_to_buffer
( const NewAnchorCommitSig * message ,
ProtobufCBuffer * buffer ) ;
NewAnchorCommitSig *
new_anchor_commit_sig__unpack
( ProtobufCAllocator * allocator ,
size_t len ,
const uint8_t * data ) ;
void new_anchor_commit_sig__free_unpacked
( NewAnchorCommitSig * message ,
ProtobufCAllocator * allocator ) ;
2015-05-26 06:38:12 +02:00
/* NewAnchorAccept methods */
void new_anchor_accept__init
( NewAnchorAccept * message ) ;
size_t new_anchor_accept__get_packed_size
( const NewAnchorAccept * message ) ;
size_t new_anchor_accept__pack
( const NewAnchorAccept * message ,
uint8_t * out ) ;
size_t new_anchor_accept__pack_to_buffer
( const NewAnchorAccept * message ,
ProtobufCBuffer * buffer ) ;
NewAnchorAccept *
new_anchor_accept__unpack
( ProtobufCAllocator * allocator ,
size_t len ,
const uint8_t * data ) ;
void new_anchor_accept__free_unpacked
( NewAnchorAccept * message ,
ProtobufCAllocator * allocator ) ;
/* NewAnchorComplete methods */
void new_anchor_complete__init
( NewAnchorComplete * message ) ;
size_t new_anchor_complete__get_packed_size
( const NewAnchorComplete * message ) ;
size_t new_anchor_complete__pack
( const NewAnchorComplete * message ,
uint8_t * out ) ;
size_t new_anchor_complete__pack_to_buffer
( const NewAnchorComplete * message ,
ProtobufCBuffer * buffer ) ;
NewAnchorComplete *
new_anchor_complete__unpack
( ProtobufCAllocator * allocator ,
size_t len ,
const uint8_t * data ) ;
void new_anchor_complete__free_unpacked
( NewAnchorComplete * 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 ) ;
2015-06-01 04:26:09 +02:00
typedef void ( * Signature_Closure )
( const Signature * message ,
void * closure_data ) ;
2015-05-28 23:38:27 +02:00
typedef void ( * BitcoinInput_Closure )
( const BitcoinInput * message ,
2015-05-26 06:38:12 +02:00
void * closure_data ) ;
2015-05-28 23:38:27 +02:00
typedef void ( * BitcoinPubkey_Closure )
( const BitcoinPubkey * message ,
void * closure_data ) ;
2015-06-05 04:54:58 +02:00
typedef void ( * Change_Closure )
( const Change * message ,
void * closure_data ) ;
2015-05-26 06:38:12 +02:00
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 ) ;
2015-06-04 03:36:57 +02:00
typedef void ( * OpenAnchorScriptsigs_Closure )
( const OpenAnchorScriptsigs * message ,
2015-05-26 06:38:12 +02:00
void * closure_data ) ;
2015-05-29 03:22:18 +02:00
typedef void ( * LeakAnchorSigsAndPretendWeDidnt_Closure )
( const LeakAnchorSigsAndPretendWeDidnt * message ,
2015-05-28 23:38:27 +02:00
void * closure_data ) ;
2015-05-26 06:38:12 +02:00
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 ( * UpdateComplete_Closure )
( const UpdateComplete * message ,
void * closure_data ) ;
typedef void ( * NewAnchor_Closure )
( const NewAnchor * message ,
void * closure_data ) ;
typedef void ( * NewAnchorAck_Closure )
( const NewAnchorAck * message ,
void * closure_data ) ;
2015-05-28 23:38:27 +02:00
typedef void ( * NewAnchorCommitSig_Closure )
( const NewAnchorCommitSig * message ,
void * closure_data ) ;
2015-05-26 06:38:12 +02:00
typedef void ( * NewAnchorAccept_Closure )
( const NewAnchorAccept * message ,
void * closure_data ) ;
typedef void ( * NewAnchorComplete_Closure )
( const NewAnchorComplete * 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 ;
2015-06-01 04:26:09 +02:00
extern const ProtobufCMessageDescriptor signature__descriptor ;
2015-05-28 23:38:27 +02:00
extern const ProtobufCMessageDescriptor bitcoin_input__descriptor ;
extern const ProtobufCMessageDescriptor bitcoin_pubkey__descriptor ;
2015-06-05 04:54:58 +02:00
extern const ProtobufCMessageDescriptor change__descriptor ;
2015-05-26 06:38:12 +02:00
extern const ProtobufCMessageDescriptor anchor__descriptor ;
extern const ProtobufCMessageDescriptor open_channel__descriptor ;
extern const ProtobufCMessageDescriptor open_commit_sig__descriptor ;
2015-06-04 03:36:57 +02:00
extern const ProtobufCMessageDescriptor open_anchor_scriptsigs__descriptor ;
2015-05-29 03:22:18 +02:00
extern const ProtobufCMessageDescriptor leak_anchor_sigs_and_pretend_we_didnt__descriptor ;
2015-05-26 06:38:12 +02:00
extern const ProtobufCMessageDescriptor open_complete__descriptor ;
extern const ProtobufCMessageDescriptor update__descriptor ;
extern const ProtobufCMessageDescriptor update_accept__descriptor ;
extern const ProtobufCMessageDescriptor update_complete__descriptor ;
extern const ProtobufCMessageDescriptor new_anchor__descriptor ;
extern const ProtobufCMessageDescriptor new_anchor_ack__descriptor ;
2015-05-28 23:38:27 +02:00
extern const ProtobufCMessageDescriptor new_anchor_commit_sig__descriptor ;
2015-05-26 06:38:12 +02:00
extern const ProtobufCMessageDescriptor new_anchor_accept__descriptor ;
extern const ProtobufCMessageDescriptor new_anchor_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 */