|
Packit |
61cb5a |
/*
|
|
Packit |
61cb5a |
* Copyright (c) 2011, Red Hat, Inc.
|
|
Packit |
61cb5a |
*
|
|
Packit |
61cb5a |
* Permission to use, copy, modify, and/or distribute this software for any
|
|
Packit |
61cb5a |
* purpose with or without fee is hereby granted, provided that the above
|
|
Packit |
61cb5a |
* copyright notice and this permission notice appear in all copies.
|
|
Packit |
61cb5a |
*
|
|
Packit |
61cb5a |
* THE SOFTWARE IS PROVIDED "AS IS" AND RED HAT, INC. DISCLAIMS ALL WARRANTIES
|
|
Packit |
61cb5a |
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
|
Packit |
61cb5a |
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL RED HAT, INC. BE LIABLE
|
|
Packit |
61cb5a |
* FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
Packit |
61cb5a |
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
|
Packit |
61cb5a |
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
Packit |
61cb5a |
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
Packit |
61cb5a |
*/
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
/*
|
|
Packit |
61cb5a |
* Author: Jan Friesse <jfriesse@redhat.com>
|
|
Packit |
61cb5a |
*/
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
#ifndef _GCRA_H_
|
|
Packit |
61cb5a |
#define _GCRA_H_
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
#ifdef __cplusplus
|
|
Packit |
61cb5a |
extern "C" {
|
|
Packit |
61cb5a |
#endif
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
/*
|
|
Packit |
61cb5a |
* Structures definition
|
|
Packit |
61cb5a |
*/
|
|
Packit |
61cb5a |
struct gcra_item {
|
|
Packit |
61cb5a |
uint64_t tat;
|
|
Packit |
61cb5a |
unsigned int interval;
|
|
Packit |
61cb5a |
unsigned int tau;
|
|
Packit |
61cb5a |
};
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
/*
|
|
Packit |
61cb5a |
* Prototypes
|
|
Packit |
61cb5a |
*/
|
|
Packit |
61cb5a |
extern void gcra_init(struct gcra_item *item, unsigned int interval,
|
|
Packit |
61cb5a |
unsigned int burst);
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
extern int gcra_rl(struct gcra_item *item, struct timeval tv);
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
#ifdef __cplusplus
|
|
Packit |
61cb5a |
}
|
|
Packit |
61cb5a |
#endif
|
|
Packit |
61cb5a |
|
|
Packit |
61cb5a |
#endif /* _GCRA_H_ */
|