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

39 lines
1.2 KiB
C
Raw Normal View History

2016-12-16 03:28:12 +00:00
#ifndef IPNS_NAMESYS_PB_H
#define IPNS_NAMESYS_PB_H
2016-12-21 00:08:51 +00:00
#include <stdint.h>
2016-12-16 03:28:12 +00:00
2016-12-21 00:08:51 +00:00
typedef int32_t IpnsEntry_ValidityType;
2016-12-16 03:28:12 +00:00
struct ipns_entry {
2016-12-21 00:08:51 +00:00
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;
2016-12-16 03:28:12 +00:00
};
struct namesys_pb {
// TODO
struct ipns_entry *IpnsEntry;
};
// setting an EOL says "this record is valid until..."
const IpnsEntry_ValidityType IpnsEntry_EOL = 0;
char *IpnsEntry_ValidityType_name[] = {
"EOL",
NULL
};
int IpnsEntry_ValidityType_value (char *s);
2016-12-21 00:08:51 +00:00
struct ipns_entry* ipfs_namesys_pb_new_ipns_entry ();
2016-12-16 03:28:12 +00:00
char* ipfs_namesys_pb_get_validity (struct ipns_entry*);
2016-12-21 00:08:51 +00:00
char* ipns_entry_data_for_sig(struct ipns_entry*);
2016-12-16 03:28:12 +00:00
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);
2016-12-16 03:28:12 +00:00
#endif // IPNS_NAMESYS_PB_H