2017-03-15 10:43:03 +01:00
|
|
|
#ifndef LIGHTNING_LIGHTNINGD_GOSSIP_MSG_H
|
|
|
|
#define LIGHTNING_LIGHTNINGD_GOSSIP_MSG_H
|
|
|
|
#include "config.h"
|
|
|
|
#include <bitcoin/pubkey.h>
|
2017-08-29 06:12:04 +02:00
|
|
|
#include <gossipd/routing.h>
|
2017-03-15 10:43:03 +01:00
|
|
|
|
2018-09-27 07:29:11 +02:00
|
|
|
struct route_info;
|
|
|
|
|
2018-07-24 08:18:59 +02:00
|
|
|
struct peer_features {
|
2018-09-28 05:24:24 +02:00
|
|
|
u8 *localfeatures;
|
|
|
|
u8 *globalfeatures;
|
2018-07-24 08:18:59 +02:00
|
|
|
};
|
|
|
|
|
2017-03-15 10:43:03 +01:00
|
|
|
struct gossip_getnodes_entry {
|
2019-04-08 11:58:32 +02:00
|
|
|
struct node_id nodeid;
|
2018-01-16 20:44:32 +01:00
|
|
|
s64 last_timestamp; /* -1 means never: following fields ignored */
|
2018-09-29 08:33:47 +02:00
|
|
|
u8 *globalfeatures;
|
2017-10-23 06:17:38 +02:00
|
|
|
struct wireaddr *addresses;
|
2018-09-24 03:41:39 +02:00
|
|
|
u8 alias[32];
|
2018-01-16 20:44:32 +01:00
|
|
|
u8 color[3];
|
2017-03-15 10:43:03 +01:00
|
|
|
};
|
|
|
|
|
2019-04-08 11:58:44 +02:00
|
|
|
struct gossip_halfchannel_entry {
|
2018-09-20 02:59:46 +02:00
|
|
|
u8 message_flags;
|
|
|
|
u8 channel_flags;
|
2018-05-10 16:00:38 +02:00
|
|
|
u32 last_update_timestamp;
|
2017-09-01 06:18:54 +02:00
|
|
|
u32 delay;
|
2017-09-01 06:18:54 +02:00
|
|
|
u32 base_fee_msat;
|
|
|
|
u32 fee_per_millionth;
|
2017-03-22 13:30:09 +01:00
|
|
|
};
|
|
|
|
|
2019-04-08 11:58:44 +02:00
|
|
|
struct gossip_getchannels_entry {
|
|
|
|
struct node_id node[2];
|
|
|
|
struct amount_sat sat;
|
|
|
|
struct short_channel_id short_channel_id;
|
|
|
|
bool public;
|
|
|
|
bool local_disabled;
|
|
|
|
/* NULL if we haven't received an update */
|
|
|
|
struct gossip_halfchannel_entry *e[2];
|
|
|
|
};
|
|
|
|
|
2018-02-08 02:23:46 +01:00
|
|
|
struct gossip_getnodes_entry *
|
|
|
|
fromwire_gossip_getnodes_entry(const tal_t *ctx, const u8 **pptr, size_t *max);
|
2017-03-22 13:30:09 +01:00
|
|
|
void towire_gossip_getnodes_entry(u8 **pptr,
|
|
|
|
const struct gossip_getnodes_entry *entry);
|
2017-03-15 10:43:03 +01:00
|
|
|
|
2018-07-24 08:18:59 +02:00
|
|
|
struct peer_features *
|
|
|
|
fromwire_peer_features(const tal_t *ctx, const u8 **pptr, size_t *max);
|
|
|
|
void towire_peer_features(u8 **pptr, const struct peer_features *features);
|
|
|
|
|
2017-03-15 13:36:35 +01:00
|
|
|
void fromwire_route_hop(const u8 **pprt, size_t *max, struct route_hop *entry);
|
|
|
|
void towire_route_hop(u8 **pprt, const struct route_hop *entry);
|
|
|
|
|
2018-09-27 07:29:11 +02:00
|
|
|
void fromwire_route_info(const u8 **pprt, size_t *max, struct route_info *entry);
|
|
|
|
void towire_route_info(u8 **pprt, const struct route_info *entry);
|
|
|
|
|
2019-04-08 11:58:44 +02:00
|
|
|
struct gossip_getchannels_entry *
|
|
|
|
fromwire_gossip_getchannels_entry(const tal_t *ctx,
|
|
|
|
const u8 **pptr, size_t *max);
|
2017-03-22 13:30:09 +01:00
|
|
|
void towire_gossip_getchannels_entry(
|
|
|
|
u8 **pptr, const struct gossip_getchannels_entry *entry);
|
|
|
|
|
2017-08-28 18:06:01 +02:00
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_GOSSIP_MSG_H */
|