Query: ppsratecheck
OS: netbsd
Section: 9
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
PPSRATECHECK(9) BSD Kernel Developer's Manual PPSRATECHECK(9)NAMEppsratecheck -- function to help implement rate-limited actionsSYNOPSIS#include <sys/time.h> int ppsratecheck(struct timeval *lasttime, int *curpps, int maxpps);DESCRIPTIONThe ppsratecheck() function provides easy way to perform packet-per-sec, or event-per-sec, rate limitation. The motivation for implementing ppsratecheck() was to provide a mechanism that could be used to add rate limitation to network packet output. For certain network packets, we may want to impose rate limitation, to avoid denial-of-service attack possibilities. maxpps specifies maximum permitted packets, or events, per second. If ppsratecheck() is called more than maxpps times in a given one second period, the function will return 0, indicating that we exceeded the limit. If we are below the limit, the function will return 1. If maxpps is set to 0, the function will always return 0 (no packets/events are permitted). Negative maxpps indicates that rate limitation is dis- abled, and ppsratecheck will always return 1. curpps and lasttime are used to maintain the number of recent calls. curpps will be incremented every time ppsratecheck() is called, and will be reset whenever necessary.SEE ALSOlog(9), printf(9), ratecheck(9), time_second(9)HISTORYThe ppsratecheck() function appeared in NetBSD 1.5.BSDAugust 3, 2000 BSD
Related Man Pages |
---|
tc-fq(8) - opensolaris |
tc-fq(8) - php |
tc-fq(8) - minix |
tc-fq(8) - opendarwin |
tc-fq(8) - redhat |
Similar Topics in the Unix Linux Community |
---|
find limitation |
Size limitation in Tar command |
how to get network packet size |
Is there a limit for a code line length in C? |
"Help Me!Urgent" |