10 class Slot : public Liveness {
12 /** Sequence number of the slot. */
14 /** HMAC of previous slot. */
15 Array<char> *prevhmac;
16 /** HMAC of this slot. */
18 /** Machine that sent this slot. */
20 /** MyVector of entries in this slot. */
21 MyVector<Entry *> *entries;
22 /** Pieces of information that are live. */
24 /** Flag that indicates whether this slot is still live for
25 * recording the machine that sent it. */
27 /** Number of chars of free space. */
29 /** Reference to Table */
31 LastMessage * fakeLastMessage;
33 int64_t localSequenceNumber;
36 Slot(Table *_table, int64_t _seqnum, int64_t _machineid, Array<char> *_prevhmac, Array<char> *_hmac, int64_t _localSequenceNumber);
37 Slot(Table *_table, int64_t _seqnum, int64_t _machineid, Array<char> *_prevhmac, int64_t _localSequenceNumber);
38 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 addShallowEntry(Entry *e);
45 bool hasSpace(Entry *e);
46 MyVector<Entry *> *getEntries();
47 Array<char> *encode(Mac *mac);
48 int getBaseSize() { return 2 * HMAC_SIZE + 2 * sizeof(int64_t) + sizeof(int); }
49 MyVector<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 *Slot_decode(Table *table, Array<char> *array, Mac *mac);
60 Slot *Slot_decode(Table *table, Array<char> *array, Mac *mac);