*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->NetBSD man pages -> ppsratecheck (9)              
Title
Content
Arch
Section
 

PPSRATECHECK(9)

Contents


NAME    [Toc]    [Back]

     ppsratecheck - function to help implement rate-limited actions

SYNOPSIS    [Toc]    [Back]

     #include <sys/time.h>

     int
     ppsratecheck(struct timeval *lasttime, int *curpps, int maxpps);

DESCRIPTION    [Toc]    [Back]

     The 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 disabled,
     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 ALSO    [Toc]    [Back]

      
      
     log(9), printf(9), ratecheck(9), time(9)

HISTORY    [Toc]    [Back]

     The ppsratecheck() function appeared in NetBSD 1.5.

BSD                             August 3, 2000                             BSD
[ Back ]
 Similar pages
Name OS Title
XmSetProtocolHooks Tru64 A VendorShell function that allows pre and post actions to be executed when a protocol message is re...
XmSetProtocolHooks IRIX A VendorShell function that allows pre and post actions to be executed when a protocol message is received fro
iflBitArray IRIX limited subscriptable bit array class
crtcommand IRIX implement new commands in C
rquota IRIX implement quotas on remote machines
nos-tun FreeBSD implement ``nos'' or ``ka9q'' style IP over IP tunnel
login_fbtab OpenBSD implement device security based on /etc/fbtab
ioctl NetBSD how to implement a new ioctl call to access device drivers
grio IRIX guaranteed-rate I/O
dmAudioRateConverterGetParams IRIX get rate converter parameter values
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service