Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/ipfw/dn_aqm.h
Show All 30 Lines | |||||
* API for writing an Active Queue Management algorithm for Dummynet | * API for writing an Active Queue Management algorithm for Dummynet | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _IP_DN_AQM_H | #ifndef _IP_DN_AQM_H | ||||
#define _IP_DN_AQM_H | #define _IP_DN_AQM_H | ||||
#include <sys/ck.h> | |||||
/* NOW is the current time in millisecond*/ | /* NOW is the current time in millisecond*/ | ||||
#define NOW ((V_dn_cfg.curr_time * tick) / 1000) | #define NOW ((V_dn_cfg.curr_time * tick) / 1000) | ||||
#define AQM_UNOW (V_dn_cfg.curr_time * tick) | #define AQM_UNOW (V_dn_cfg.curr_time * tick) | ||||
#define AQM_TIME_1US ((aqm_time_t)(1)) | #define AQM_TIME_1US ((aqm_time_t)(1)) | ||||
#define AQM_TIME_1MS ((aqm_time_t)(1000)) | #define AQM_TIME_1MS ((aqm_time_t)(1000)) | ||||
#define AQM_TIME_1S ((aqm_time_t)(AQM_TIME_1MS * 1000)) | #define AQM_TIME_1S ((aqm_time_t)(AQM_TIME_1MS * 1000)) | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | #define DN_AQM_NAME_MAX 50 | ||||
int (*config)(struct dn_fsk *, struct dn_extra_parms *ep, int); | int (*config)(struct dn_fsk *, struct dn_extra_parms *ep, int); | ||||
int (*deconfig)(struct dn_fsk *); | int (*deconfig)(struct dn_fsk *); | ||||
int (*init)(struct dn_queue *); | int (*init)(struct dn_queue *); | ||||
int (*cleanup)(struct dn_queue *); | int (*cleanup)(struct dn_queue *); | ||||
int (*getconfig)(struct dn_fsk *, struct dn_extra_parms *); | int (*getconfig)(struct dn_fsk *, struct dn_extra_parms *); | ||||
int ref_count; /*Number of queues instances in the system */ | int ref_count; /*Number of queues instances in the system */ | ||||
int cfg_ref_count; /*Number of AQM instances in the system */ | int cfg_ref_count; /*Number of AQM instances in the system */ | ||||
SLIST_ENTRY (dn_aqm) next; /* Next AQM in the list */ | CK_LIST_ENTRY(dn_aqm) next; /* Next AQM in the list */ | ||||
}; | }; | ||||
/* Helper function to update queue and scheduler statistics. | /* Helper function to update queue and scheduler statistics. | ||||
* negative len + drop -> drop | * negative len + drop -> drop | ||||
* negative len -> dequeue | * negative len -> dequeue | ||||
* positive len -> enqueue | * positive len -> enqueue | ||||
* positive len + drop -> drop during enqueue | * positive len + drop -> drop during enqueue | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |