Skip to content

Commit

Permalink
Fix styling issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gogapp committed Aug 14, 2018
1 parent f085d05 commit 49d6975
Show file tree
Hide file tree
Showing 4 changed files with 233 additions and 178 deletions.
22 changes: 4 additions & 18 deletions include/gatekeeper_rhhh.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,30 +92,16 @@ struct rte_hash *
create_dblcounter(unsigned int socket_id, uint16_t proto, int dblcounter_id,
int dblcounter_size);

//static
extern int
rhhh1D_v4_output(double threshold, unsigned int socket_id);

static int
extern int
calcPred2D_v4(struct ip_key *key, uint32_t src_mask, uint32_t dst_mask);

//static
int
extern int
rhhh2D_v4_output(double threshold, unsigned int socket_id);

//static
int

extern int
rhhh1D_v6_output(double threshold, unsigned int socket_id);

/*static int
calcPred2D_v6(struct ip_key *key, uint32_t src_mask, uint32_t dst_mask);
//static
int
rhhh2D_v6_output(double threshold, unsigned int socket_id);
*/

extern HeavyHitter *rhhh_output;
extern int numhitters;

#endif /* _GATEKEEPER_RHHH_H_ */
11 changes: 9 additions & 2 deletions include/space_saving.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ struct ip_data
struct counter_bucket ct_bucket;
};

int max(int a, int b);

/*
* Create a counter table of size = 1.0/epsion.
* @epsilon is the error parameter for space saving algorithm.
Expand All @@ -103,17 +105,22 @@ create_bucket(unsigned int socket_id, uint16_t proto, int bkt_id);

/* Increment Counter Algorithm. */
static int
increment_counter(unsigned int socket_id, uint16_t proto, struct ip_data **element);
increment_counter(unsigned int socket_id, uint16_t proto,
struct ip_data **element);

/* Space Saving algorithm. */
//static
int space_saving(unsigned int socket_id, uint16_t proto, struct ip_key *key,
struct rte_hash *ct_table);

/*
* Iterate through the elements in the Counter Table and find the heavy hitters.
*/
int SSiterate(struct rte_hash *ct_table, int proto, int threshold);

/* Estimate a lower bound for the frequency of an element. */
int SSEstLow(struct rte_hash *ct_table, struct ip_key *key);

/* Estimate an upper bound on the frequency of an element. */
int SSEstUpp(struct rte_hash *ct_table, struct ip_key *key);

#endif /* _SPACE_SAVING_H */
Loading

0 comments on commit 49d6975

Please sign in to comment.