Feature ratelimit

This commit is contained in:
刘学利
2021-08-04 02:08:30 +00:00
parent 86a030143d
commit 7b9a6dbe5d
9 changed files with 430 additions and 192 deletions

10
src/tsg_leaky_bucket.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef __TSG_LEAK_BUCKET_H__
#define __TSG_LEAK_BUCKET_H__
struct leaky_bucket;
struct leaky_bucket *create_bucket(double rate, int bucket_size, int thread_seq);
void destroy_bucket(struct leaky_bucket **bucket, int thread_seq);
int is_permit_pass(int pkt_size, struct leaky_bucket * bucket, int thread_seq);
#endif