packetTimeoutTable.h 722 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef PRRT_PACKETTIMEOUTTABLE_H
#define PRRT_PACKETTIMEOUTTABLE_H

#include <bits/pthreadtypes.h>
#include "../../util/bptree.h"
#include "../packet.h"

typedef struct prrtPacketTimeoutTable {
    pthread_mutex_t lock;
    BPTreeNode* packetList;
} PrrtPacketTimeoutTable;

PrrtPacketTimeoutTable* PrrtPacketTimeoutTable_create(void);
bool PrrtPacketTimeoutTable_insert(PrrtPacketTimeoutTable* table, PrrtPacket* packet);
List *PrrtPacketTimeoutTable_expire_packets(PrrtPacketTimeoutTable *table, prrtTimestamp_t now);
PrrtPacket *PrrtPacketTimeoutTable_remove(PrrtPacketTimeoutTable *table, prrtTimestamp_t stamp);
bool PrrtPacketTimeoutTable_destroy(PrrtPacketTimeoutTable* table);

#endif //PRRT_PACKETTIMEOUTTABLE_H