From fd75395ba232c71ca0f5b43cbe38214c7975f643 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 30 May 2023 09:31:51 +0000 Subject: add feature splitby and fairness --- shaping/include/shaper.h | 15 +++++++++++++-- shaping/include/shaper_maat.h | 3 +-- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'shaping/include') diff --git a/shaping/include/shaper.h b/shaping/include/shaper.h index eb0ca65..cc7c608 100644 --- a/shaping/include/shaper.h +++ b/shaping/include/shaper.h @@ -67,13 +67,21 @@ enum shaping_packet_action { SHAPING_DROP }; +enum shaping_profile_type_in_rule { + PROFILE_IN_RULE_TYPE_PRIMARY = 0, + PROFILE_IN_RULE_TYPE_BORROW +}; + enum shaping_profile_type { - SHAPING_PROFILE_TYPE_PRIMARY = 0, - SHAPING_PROFILE_TYPE_BORROW + PROFILE_TYPE_GENERIC, + PROFILE_TYPE_HOST_FARINESS, + PROFILE_TYPE_MAX_MIN_HOST_FAIRNESS, + PROFILE_TYPE_SPLIT_BY_LOCAL_HOST }; struct shaping_profile_info { int id;//profile_id + enum shaping_profile_type type; int priority; int in_deposit_token; int out_deposit_token; @@ -88,6 +96,7 @@ struct shaping_profile_info { struct shaping_rule_info { int vsys_id; int id;//rule_id + int fair_factor; struct shaping_profile_info primary; struct shaping_profile_info borrowing[SHAPING_REF_PROFILE_NUM_MAX]; int borrowing_num; @@ -119,6 +128,8 @@ struct metadata struct shaping_flow { struct addr_tuple4 tuple4; + char *src_ip_str; + size_t src_ip_str_len; struct delay_queue packet_queue; struct shaping_rule_info matched_rule_infos[SHAPING_RULE_NUM_MAX]; int priority; diff --git a/shaping/include/shaper_maat.h b/shaping/include/shaper_maat.h index 9390161..df3558f 100644 --- a/shaping/include/shaper_maat.h +++ b/shaping/include/shaper_maat.h @@ -18,8 +18,7 @@ struct shaping_rule { struct shaping_profile { int id; - int split; - int host_fairness; + enum shaping_profile_type type; int in_limit_bandwidth; int out_limit_bandwidth; int valid; -- cgit v1.2.3