00001 00006 #ifndef RAZORBACK_CONNECTED_ENTITY_H 00007 #define RAZORBACK_CONNECTED_ENTITY_H 00008 00009 #include <razorback/visibility.h> 00010 00011 #include <razorback/types.h> 00012 #include <razorback/messages.h> 00013 #include <time.h> 00014 00015 #ifdef __cplusplus 00016 extern "C" { 00017 #endif 00018 00021 struct DispatcherEntity 00022 { 00023 uint8_t priority; 00024 uint32_t flags; 00025 struct List * addressList; 00026 uint8_t protocol; 00027 uint16_t port; 00028 bool usable; 00029 }; 00030 00033 struct ConnectedEntity 00034 { 00035 uuid_t uuidNuggetId; 00036 uuid_t uuidNuggetType; 00037 uuid_t uuidApplicationType; 00038 time_t tTimeOfLastHello; 00039 uint8_t locality; 00040 struct DispatcherEntity *dispatcher; 00041 }; 00042 00047 SO_PUBLIC extern bool ConnectedEntityList_Update (struct Message *message); 00048 00052 SO_PUBLIC extern uint32_t ConnectedEntityList_Count (void); 00053 SO_PUBLIC extern void ConnectedEntity_Destroy(struct ConnectedEntity *entity); 00054 00055 SO_PUBLIC extern bool 00056 ConnectedEntityList_AddPruneListener(void (*entityRemoved) (struct ConnectedEntity *entity, uint32_t remainingCount)); 00057 00058 SO_PUBLIC extern bool 00059 ConnectedEntityList_ForEach_Entity (int (*function) (struct ConnectedEntity *, void *), void *userData); 00060 00061 SO_PUBLIC extern struct ConnectedEntity *ConnectedEntityList_GetDedicatedDispatcher(void); 00062 SO_PUBLIC extern struct ConnectedEntity * ConnectedEntityList_GetDispatcher_HighestPriority(); 00063 00064 SO_PUBLIC extern bool ConnectedEntityList_SlaveInLocality(uint8_t locality); 00065 00066 #ifdef __cplusplus 00067 } 00068 #endif 00069 #endif // RAZORBACK_CONNECTED_ENTITY_H