/* Copyright (c) 2013 IOnU Security Inc. All rights reserved Created August 2013 by Kendrick Webster K2Daemon/ClientCache.h - header for client cache module This module encapsulates containers for efficiently storing and accessing client connection and retry state data. Its public functions operate on that data. It has grown organically to a size that probably requires refactoring. Potential sub-modules include: UDP protocol, client cache, retry cache, high-level message handlers. */ #pragma once #include "ClientMap.h" namespace ClientCache { // handle a received UDP datagram of octects in global // with data format and semantics described by K2Client/K2IPC.h void HandlePacket(unsigned int len); // sends message to the client identified by if it is connected and idle typedef enum { SENT_PENDING_ACK, // message sent, awaiting ACK CLIENT_OFFLINE, // client is not logged in CLIENT_BUSY // awaiting ACK for an earlier message } send_message_result_t; send_message_result_t SendMessage(const char* nqueue_id, const char* client_urn, const char* info); // send a device status notification () to the device identified by void SendDeviceStatus(ClientMap::id_t client_id, const char* info); // Timer event for retries and timeouts void Timer(); // Dump a list of connected clients to the logger void DumpClients(); }