diff options
Diffstat (limited to '')
-rw-r--r-- | include/packet_ring.h | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/include/packet_ring.h b/include/packet_ring.h index 3ac6b91..d97a64d 100644 --- a/include/packet_ring.h +++ b/include/packet_ring.h @@ -57,6 +57,26 @@ extern "C" { #define ACKRING_DEFAULTSIZE 100 +enum ReadWriteExtReturnVals { + ReadSuccess = 1, + ReadTimeo, + ReadTimeoFatal, + ReadErrLen, + ReadNoAccount, + WriteSuccess, + WriteSelectRetry, + WriteErrAccount, + WriteErrFatal, + WriteTimeo, + WriteNoAccount, + NullEvent +}; + +enum edgeLevel { + LOW = 0, + HIGH = 1 +}; + struct ReportStruct { intmax_t packetID; intmax_t packetLen; @@ -64,8 +84,8 @@ struct ReportStruct { struct timeval prevPacketTime; struct timeval sentTime; struct timeval prevSentTime; - int errwrite; - int emptyreport; + enum ReadWriteExtReturnVals err_readwrite; + bool emptyreport; int l2errors; int l2len; int expected_l2len; @@ -77,7 +97,7 @@ struct ReportStruct { uint32_t burstsize; uint32_t burstperiod; uint32_t remaining; - int transit_ready; + bool transit_ready; int writecnt; long write_time; bool scheduled; @@ -85,6 +105,9 @@ struct ReportStruct { struct timeval sentTimeRX; struct timeval sentTimeTX; struct iperf_tcpstats tcpstats; +#if defined(HAVE_DECL_SO_MAX_PACING_RATE) + intmax_t FQPacingRate; +#endif }; struct PacketRing { @@ -94,10 +117,12 @@ struct PacketRing { int producer; int consumer; int maxcount; - int consumerdone; + bool consumerdone; int awaitcounter; - int mutex_enable; + bool mutex_enable; int bytes; + enum edgeLevel uplevel; + enum edgeLevel downlevel; // Use a condition variables // o) awake_producer - producer waits for the consumer thread to @@ -116,6 +141,7 @@ extern void enqueue_ackring(struct PacketRing *pr, struct ReportStruct *metapack extern struct ReportStruct *dequeue_ackring(struct PacketRing * pr); extern void packetring_free(struct PacketRing *pr); extern void free_ackring(struct PacketRing *pr); +extern enum edgeLevel toggleLevel(enum edgeLevel level); #ifdef HAVE_THREAD_DEBUG extern int packetring_getcount(struct PacketRing *pr); #endif |