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