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 13:42:04 +09:30
|
|
|
#include <gossipd/routing.h>
|
2017-03-15 10:43:03 +01:00
|
|
|
|
2018-09-27 14:59:11 +09:30
|
|
|
struct route_info;
|
|
|
|
|
2018-07-24 15:48:59 +09:30
|
|
|
struct peer_features {
|
2018-09-28 12:54:24 +09:30
|
|
|
u8 *localfeatures;
|
|
|
|
u8 *globalfeatures;
|
2018-07-24 15:48:59 +09:30
|
|
|
};
|
|
|
|
|
2017-03-15 10:43:03 +01:00
|
|
|
struct gossip_getnodes_entry {
|
2019-04-08 19:28:32 +09:30
|
|
|
struct node_id nodeid;
|
2018-01-17 06:14:32 +10:30
|
|
|
s64 last_timestamp; /* -1 means never: following fields ignored */
|
2018-09-29 16:03:47 +09:30
|
|
|
u8 *globalfeatures;
|
2017-10-23 14:47:38 +10:30
|
|
|
struct wireaddr *addresses;
|
2018-09-24 11:11:39 +09:30
|
|
|
u8 alias[32];
|
2018-01-17 06:14:32 +10:30
|
|
|
u8 color[3];
|
2017-03-15 10:43:03 +01:00
|
|
|
};
|
|
|
|
|
2019-04-08 19:28:44 +09:30
|
|
|
struct gossip_halfchannel_entry {
|
2018-09-19 17:59:46 -07:00
|
|
|
u8 message_flags;
|
|
|
|
u8 channel_flags;
|
2018-05-10 23:30:38 +09:30
|
|
|
u32 last_update_timestamp;
|
2017-09-01 13:48:54 +09:30
|
|
|
u32 delay;
|
2017-09-01 13:48:54 +09:30
|
|
|
u32 base_fee_msat;
|
|
|
|
u32 fee_per_millionth;
|
2019-05-31 16:58:06 +09:30
|
|
|
struct amount_msat min, max;
|
2017-03-22 13:30:09 +01:00
|
|
|
};
|
|
|
|
|
2019-04-08 19:28:44 +09:30
|
|
|
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 11:53:46 +10:30
|
|
|
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 15:48:59 +09:30
|
|
|
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 14:59:11 +09:30
|
|
|
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 19:28:44 +09:30
|
|
|
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-29 01:36:01 +09:30
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_GOSSIP_MSG_H */
|