1 // Copyright (C) 2006-2014 David Sugar, Tycho Softworks.
 2 // Copyright (C) 2015 Cherokees of Idaho.
 3 //
 4 // This program is free software; you can redistribute it and/or modify
 5 // it under the terms of the GNU General Public License as published by
 6 // the Free Software Foundation; either version 3 of the License, or
 7 // (at your option) any later version.
 8 //
 9 // This program is distributed in the hope that it will be useful,
 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
 12 // GNU General Public License for more details.
 13 //
 14 // You should have received a copy of the GNU General Public License
 15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
 16 
 26 #ifndef _SIPWITCH_CACHE_H_
 27 #define _SIPWITCH_CACHE_H_
 28 
 29 #ifndef _UCOMMON_STRING_H_
 30 #include <ucommon/string.h>
 31 #endif
 32 
 33 #ifndef _UCOMMON_PLATFORM_H_
 34 #include <ucommon/platform.h>
 35 #endif
 36 
 37 #ifndef _UCOMMON_SOCKET_H_
 38 #include <ucommon/socket.h>
 39 #endif
 40 
 41 #ifndef __SIPWITCH_NAMESPACE_H_
 43 #endif
 44 
 45 #ifndef __SIPWITCH_MAPPED_H_
 47 #endif
 48 
 49 namespace sipwitch {
 50 
 57 {
 58 protected:
 60 
 62 
 63 public:
 66 };
 67 
 73 {
 74 public:
 75  static void init(void);
 76  static void cleanup(void);
 77  static void userdump(void);
 78 };
 79 
 85 {
 86 private:
 87  void release(void);
 88 
 89 protected:
 91 
 92  static UserCache *request(
const char *
id);
 
 93 
 94 public:
 96   struct sockaddr_internet address;
 
 97 
 98   inline void set(
struct sockaddr *addr)
 
 99  {memcpy(&address, addr, sizeof(address));}
 100 
 108  static void add(const char *id, struct sockaddr *addr, time_t create, unsigned expire = 130);
 109 
 116 
 122 };
 123 
 124 } // namespace sipwitch
 125 
 126 #endif
Definitions for memory mapped objects that may be shared between processes. 
URI cache for tags, local, and remote id's. 
GNU SIP Witch library namespace. 
Cache management functions. 
User caches may be used to contact nearby users in multicast registries. 
void set(struct sockaddr *addr)