c-ipfs/include/ipfs/namesys/pb.h

39 lines
1 KiB
C
Raw Normal View History

2017-09-14 21:49:19 +00:00
#pragma once
#include <stdint.h>
2016-12-16 03:28:12 +00:00
2017-09-14 21:49:19 +00:00
typedef int32_t IpnsEntry_ValidityType;
2016-12-16 03:28:12 +00:00
2017-09-14 21:49:19 +00:00
struct ipns_entry {
char *value;
char *signature;
int32_t *validityType;
char *validity;
uint64_t *sequence;
uint64_t *ttl;
struct routingResolver *cache; // cache and eol should be the last items.
struct timespec *eol;
};
struct namesys_pb {
// TODO
struct ipns_entry *IpnsEntry;
};
2016-12-16 03:28:12 +00:00
2017-09-14 21:49:19 +00:00
// setting an EOL says "this record is valid until..."
const static IpnsEntry_ValidityType IpnsEntry_EOL = 0;
2016-12-16 03:28:12 +00:00
2017-10-04 11:34:37 +00:00
/*
2017-09-14 21:49:19 +00:00
static char *IpnsEntry_ValidityType_name[] = {
"EOL",
NULL
};
2017-10-04 11:34:37 +00:00
*/
2016-12-16 03:28:12 +00:00
2017-09-14 21:49:19 +00:00
int IpnsEntry_ValidityType_value (char *s);
struct ipns_entry* ipfs_namesys_pb_new_ipns_entry ();
char* ipfs_namesys_pb_get_validity (struct ipns_entry*);
char* ipns_entry_data_for_sig(struct ipns_entry*);
char* ipfs_ipns_entry_get_signature(struct ipns_entry*);
int ipfs_namesys_pb_get_value (char**, struct ipns_entry*);
IpnsEntry_ValidityType ipfs_namesys_pb_get_validity_type (struct ipns_entry*);
void ipfs_namesys_ipnsentry_reset (struct ipns_entry *m);