Each header should only include the other headers it needs to compile; `devtools/reduce-includes.sh */*.h` does this. The C files then need additional includes if they don't compile. And remove the entirely useless wire/onion_wire.h, which only serves to include wire/onion_wiregen.h. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
31 lines
1.1 KiB
C
31 lines
1.1 KiB
C
#ifndef LIGHTNING_COMMON_ONION_DECODE_H
|
|
#define LIGHTNING_COMMON_ONION_DECODE_H
|
|
#include "config.h"
|
|
#include <common/onion_encode.h>
|
|
|
|
/**
|
|
* onion_decode: decode payload from a decrypted onion.
|
|
* @ctx: context to allocate onion_contents off.
|
|
* @rs: the route_step, whose raw_payload is of at least length
|
|
* onion_payload_length().
|
|
* @path_key: the optional incoming path_key point.
|
|
* @accepted_extra_tlvs: Allow these types to be in the TLV without failing
|
|
* @amount_in: Incoming HTLC amount
|
|
* @cltv_expiry: Incoming HTLC cltv_expiry
|
|
* @failtlvtype: (out) the tlv type which failed to parse.
|
|
* @failtlvpos: (out) the offset in the tlv which failed to parse.
|
|
* @explanation: (out) if non-NULL, a string describing the problem on failure.
|
|
*
|
|
* If the payload is not valid, returns NULL.
|
|
*/
|
|
struct onion_payload *onion_decode(const tal_t *ctx,
|
|
const struct route_step *rs,
|
|
const struct pubkey *path_key,
|
|
const u64 *accepted_extra_tlvs,
|
|
struct amount_msat amount_in,
|
|
u32 cltv_expiry,
|
|
u64 *failtlvtype,
|
|
size_t *failtlvpos,
|
|
const char **explanation);
|
|
#endif /* LIGHTNING_COMMON_ONION_DECODE_H */
|