aboutsummaryrefslogtreecommitdiff
path: root/include/npassd/session.h
blob: 6763c6a8d356d052d65863c2f8673d32f0c46f6f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdbool.h>
#include <systemd/sd-bus.h>

#include "npassd/common.h"

#define SESSION_IFACE "org.freedesktop.Secret.Session"

/* reusable slots */
struct session {
	bool isactive;
	sd_bus_slot *slot;
	/* +32 for snprintf("/session/%d") */
	char path[sizeof(DBUS_OBJECT_PATH) + 32];
};

void session_init(struct session *s, size_t n);
int session_slot_available(struct session *s, size_t n);
int session_free(struct session *s);
int session_new(sd_bus *bus, struct session *s, unsigned slot_no);