1 #ifndef NETDATA_REGISTRY_MACHINE_H
2 #define NETDATA_REGISTRY_MACHINE_H
4 #include "registry_internals.h"
6 // ----------------------------------------------------------------------------
9 // For each MACHINE-URL pair we keep this
10 struct registry_machine_url {
11 REGISTRY_URL *url; // de-duplicated URL
15 uint32_t first_t; // the first time we saw this
16 uint32_t last_t; // the last time we saw this
17 uint32_t usages; // how many times this has been accessed
19 typedef struct registry_machine_url REGISTRY_MACHINE_URL;
22 struct registry_machine {
23 char guid[GUID_LEN + 1]; // the GUID
25 uint32_t links; // the number of REGISTRY_PERSON_URL linked to this machine
27 DICTIONARY *machine_urls; // MACHINE_URL *
29 uint32_t first_t; // the first time we saw this
30 uint32_t last_t; // the last time we saw this
31 uint32_t usages; // how many times this has been accessed
33 typedef struct registry_machine REGISTRY_MACHINE;
35 extern REGISTRY_MACHINE *registry_machine_find(const char *machine_guid);
36 extern REGISTRY_MACHINE_URL *registry_machine_url_allocate(REGISTRY_MACHINE *m, REGISTRY_URL *u, time_t when);
37 extern REGISTRY_MACHINE *registry_machine_allocate(const char *machine_guid, time_t when);
38 extern REGISTRY_MACHINE *registry_machine_get(const char *machine_guid, time_t when);
39 extern REGISTRY_MACHINE_URL *registry_machine_link_to_url(REGISTRY_MACHINE *m, REGISTRY_URL *u, time_t when);
41 #endif //NETDATA_REGISTRY_MACHINE_H