Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions include/linkpulse/device_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,30 @@
#define LINKPULSE_DEVICE_STORE_H

#include "linkpulse/discovery.h"
#include "linkpulse/isp.h"

/* Identifies which physical network (by gateway MAC) an observation belongs
to, so devices and ISP identity stay scoped per-router instead of pooled
into one global list across every network ever connected to. */
typedef struct {
const char *gateway_mac;
const char *gateway_hostname;
const char *gateway_vendor;
const lp_isp_info_t *isp; /* NULL when not yet known this poll */
} lp_network_context_t;

/* Opens the per-user MAC-keyed XML device store. The returned handle is opaque. */
int lp_win32_device_store_open(void **store);

/* Applies persisted label, trust, type, and icon metadata to an observation. */
void lp_win32_device_store_apply(void *store, lp_neighbor_t *neighbor);
/* Applies persisted label, trust, type, and icon metadata for the given
network's device to an observation. gateway_mac may be NULL/empty for an
unresolved network. */
void lp_win32_device_store_apply(void *store, const char *gateway_mac, lp_neighbor_t *neighbor);

/* Records observed metadata and persists the store atomically. */
void lp_win32_device_store_observe(void *store, const lp_neighbor_t *neighbor);
/* Records observed device and ISP metadata under the given network and
persists the store atomically. */
void lp_win32_device_store_observe(void *store, const lp_network_context_t *network_context,
const lp_neighbor_t *neighbor);

/* Releases the store and any XML resources owned by it. */
void lp_win32_device_store_close(void *store);
Expand Down
3 changes: 3 additions & 0 deletions include/linkpulse/discovery.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ typedef struct {
typedef lp_status_t (*lp_net_neighbor_snapshot_fn)(lp_neighbor_list_t *out);
typedef lp_status_t (*lp_net_local_networks_fn)(lp_local_network_list_t *out);

/* Refreshes best-effort name/type metadata for one already-known neighbor. */
lp_status_t lp_net_refresh_neighbor_identity(lp_neighbor_t *neighbor);

typedef struct {
lp_net_neighbor_snapshot_fn snapshot_fn;
lp_net_local_networks_fn local_networks_fn;
Expand Down
Loading
Loading