7 class Slot : public Liveness {
9 /** Sequence number of the slot. */
11 /** HMAC of previous slot. */
13 /** HMAC of this slot. */
15 /** Machine that sent this slot. */
17 /** Vector of entries in this slot. */
18 Vector<Entry *> *entries;
19 /** Pieces of information that are live. */
21 /** Flag that indicates whether this slot is still live for
22 * recording the machine that sent it. */
24 /** Number of chars of free space. */
26 /** Reference to Table */
29 int64_t localSequenceNumber;
30 void addShallowEntry(Entry *e);
33 Slot(Table *_table, int64_t _seqnum, int64_t _machineid, char *_prevhmac, char *_hmac, int64_t _localSequenceNumber);
34 Slot(Table _table, int64_t _seqnum, int64_t _machineid, char *_prevhmac, int64_t _localSequenceNumber);
35 Slot(Table _table, int64_t _seqnum, int64_t _machineid, int64_t _localSequenceNumber);
37 char *getHMAC() { return hmac; }
38 char *getPrevHMAC() { return prevhmac; }
39 Entry *addEntry(Entry *e);
40 void removeEntry(Entry *e);
41 bool hasSpace(Entry *e);
42 Vector<Entry *> *getEntries();
43 char *encode(Mac *mac);
44 int getBaseSize() { return 2 * HMAC_SIZE + 2 * sizeof(int64_t) + sizeof(int); }
45 Vector<Entry *> *getLiveEntries(bool resize);
46 int64_t getSequenceNumber() { return seqnum; }
47 int64_t getMachineID() { return machineid; }
49 void decrementLiveCount();
50 bool isLive() { return livecount > 0; }
51 char *getSlotCryptIV();
54 Slot *Slotdecode(Table *table, char *array, Mac *mac);