Sleds/K2Daemon/OfficeSubscriptions.h

37 lines
1.2 KiB
C++

/*
Copyright (c) 2013 IOnU Security Inc. All rights reserved
Created October 2013 by Kendrick Webster
K2Daemon/OfficeSubscriptions.h - header for office subscriptions module
Clients may subscribe to online/offline status notifications for clients
within a specified list of offices. This module keeps track of which
clients are interested in which offices. It also facilitates the
delivery of status notifications to interested clients.
*/
#pragma once
namespace OfficeSubscriptions
{
// Subscribe a client to a list of offices (represented as
// office URNs delimited by <K2IPC_OFFICE_DELIMITER>).
// The list is replaced (not appended).
// An empty list ("") removes all subscriptions.
void Subscribe(const char* client_urn, const char* office_urns);
// Send status notifications to clients interested in the
// office to which <client_urn> belongs.
typedef enum
{
OFFLINE,
ONLINE
} client_state_t;
void NotifyStatus(const char* client_urn, client_state_t client_state);
// returns the number of subscribed offices
unsigned int OfficeCount(void);
// returns the number of subscriptions (client * office)
unsigned int SubscriptionCount(void);
}