1 // NodeMonitoringEvent.h 2 3 #ifndef NET_FS_NODE_MONITORING_EVENT_H 4 #define NET_FS_NODE_MONITORING_EVENT_H 5 6 #include <HashString.h> 7 #include <Referenceable.h> 8 #include <util/DoublyLinkedList.h> 9 10 class BMessage; 11 12 // NodeMonitoringEvent 13 struct NodeMonitoringEvent : public BReferenceable, 14 public DoublyLinkedListLinkImpl<NodeMonitoringEvent> { 15 NodeMonitoringEvent(); 16 virtual ~NodeMonitoringEvent(); 17 18 virtual status_t Init(const BMessage* message) = 0; 19 20 int32 opcode; 21 bigtime_t time; 22 BReferenceable* queryHandler; // only for query notifications 23 port_id remotePort; // 24 int32 remoteToken; // 25 }; 26 27 // EntryCreatedEvent 28 struct EntryCreatedEvent : NodeMonitoringEvent { 29 status_t Init(const BMessage* message); 30 31 dev_t volumeID; 32 ino_t directoryID; 33 ino_t nodeID; 34 HashString name; 35 }; 36 37 // EntryRemovedEvent 38 struct EntryRemovedEvent : NodeMonitoringEvent { 39 status_t Init(const BMessage* message); 40 41 dev_t volumeID; 42 ino_t directoryID; 43 dev_t nodeVolumeID; // == volumeID, unless this 44 // event is manually generated 45 // for an entry pointing to the 46 // root of a FS 47 ino_t nodeID; 48 HashString name; // filled in later 49 }; 50 51 // EntryMovedEvent 52 struct EntryMovedEvent : NodeMonitoringEvent { 53 status_t Init(const BMessage* message); 54 55 dev_t volumeID; 56 ino_t fromDirectoryID; 57 ino_t toDirectoryID; 58 dev_t nodeVolumeID; // usually == volumeID, unless 59 // the node is the root dir of 60 // a volume (the VolumeManager) 61 // fixes this field 62 ino_t nodeID; 63 HashString fromName; // filled in later 64 HashString toName; 65 }; 66 67 // StatChangedEvent 68 struct StatChangedEvent : NodeMonitoringEvent { 69 status_t Init(const BMessage* message); 70 71 dev_t volumeID; 72 ino_t nodeID; 73 }; 74 75 // AttributeChangedEvent 76 struct AttributeChangedEvent : NodeMonitoringEvent { 77 status_t Init(const BMessage* message); 78 79 dev_t volumeID; 80 ino_t nodeID; 81 HashString attribute; 82 }; 83 84 // VolumeMountedEvent 85 struct VolumeMountedEvent : NodeMonitoringEvent { 86 status_t Init(const BMessage* message); 87 88 dev_t newVolumeID; 89 dev_t volumeID; 90 ino_t directoryID; 91 }; 92 93 // VolumeUnmountedEvent 94 struct VolumeUnmountedEvent : NodeMonitoringEvent { 95 status_t Init(const BMessage* message); 96 97 dev_t volumeID; 98 }; 99 100 101 #endif // NET_FS_NODE_MONITORING_EVENT_H 102