Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/ip_dummynet.h
Show All 23 Lines | |||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _IP_DUMMYNET_H | #ifndef _IP_DUMMYNET_H | ||||
#define _IP_DUMMYNET_H | #define _IP_DUMMYNET_H | ||||
#define NEW_AQM | |||||
/* | /* | ||||
* Definition of the kernel-userland API for dummynet. | * Definition of the kernel-userland API for dummynet. | ||||
* | * | ||||
* Setsockopt() and getsockopt() pass a batch of objects, each | * Setsockopt() and getsockopt() pass a batch of objects, each | ||||
* of them starting with a "struct dn_id" which should fully identify | * of them starting with a "struct dn_id" which should fully identify | ||||
* the object and its relation with others in the sequence. | * the object and its relation with others in the sequence. | ||||
* The first object in each request should have | * The first object in each request should have | ||||
* type= DN_CMD_*, id = DN_API_VERSION. | * type= DN_CMD_*, id = DN_API_VERSION. | ||||
Show All 39 Lines | enum { | ||||
/* for compatibility with FreeBSD 7.2/8 */ | /* for compatibility with FreeBSD 7.2/8 */ | ||||
DN_COMPAT_PIPE, | DN_COMPAT_PIPE, | ||||
DN_COMPAT_QUEUE, | DN_COMPAT_QUEUE, | ||||
DN_GET_COMPAT, | DN_GET_COMPAT, | ||||
/* special commands for emulation of sysctl variables */ | /* special commands for emulation of sysctl variables */ | ||||
DN_SYSCTL_GET, | DN_SYSCTL_GET, | ||||
DN_SYSCTL_SET, | DN_SYSCTL_SET, | ||||
#ifdef NEW_AQM | |||||
/* subtypes used for setting/getting extra parameters. | |||||
* these subtypes used with IP_DUMMYNET3 command (get) | |||||
* and DN_TEXT (set). */ | |||||
DN_AQM_PARAMS, /* AQM extra params */ | |||||
DN_SCH_PARAMS, /* scheduler extra params */ | |||||
#endif | |||||
DN_LAST, | DN_LAST, | ||||
}; | }; | ||||
enum { /* subtype for schedulers, flowset and the like */ | enum { /* subtype for schedulers, flowset and the like */ | ||||
DN_SCHED_UNKNOWN = 0, | DN_SCHED_UNKNOWN = 0, | ||||
DN_SCHED_FIFO = 1, | DN_SCHED_FIFO = 1, | ||||
DN_SCHED_WF2QP = 2, | DN_SCHED_WF2QP = 2, | ||||
/* others are in individual modules */ | /* others are in individual modules */ | ||||
}; | }; | ||||
enum { /* user flags */ | enum { /* user flags */ | ||||
DN_HAVE_MASK = 0x0001, /* fs or sched has a mask */ | DN_HAVE_MASK = 0x0001, /* fs or sched has a mask */ | ||||
DN_NOERROR = 0x0002, /* do not report errors */ | DN_NOERROR = 0x0002, /* do not report errors */ | ||||
DN_QHT_HASH = 0x0004, /* qht is a hash table */ | DN_QHT_HASH = 0x0004, /* qht is a hash table */ | ||||
DN_QSIZE_BYTES = 0x0008, /* queue size is in bytes */ | DN_QSIZE_BYTES = 0x0008, /* queue size is in bytes */ | ||||
DN_HAS_PROFILE = 0x0010, /* a link has a profile */ | DN_HAS_PROFILE = 0x0010, /* a link has a profile */ | ||||
DN_IS_RED = 0x0020, | DN_IS_RED = 0x0020, | ||||
DN_IS_GENTLE_RED= 0x0040, | DN_IS_GENTLE_RED= 0x0040, | ||||
DN_IS_ECN = 0x0080, | DN_IS_ECN = 0x0080, | ||||
#ifdef NEW_AQM | |||||
DN_IS_AQM = 0x0100, /* AQMs: e.g Codel & PIE */ | |||||
#endif | |||||
DN_PIPE_CMD = 0x1000, /* pipe config... */ | DN_PIPE_CMD = 0x1000, /* pipe config... */ | ||||
}; | }; | ||||
/* | /* | ||||
* link template. | * link template. | ||||
*/ | */ | ||||
struct dn_link { | struct dn_link { | ||||
struct dn_id oid; | struct dn_id oid; | ||||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | #define ED_MAX_NAME_LEN 32 | ||||
char name[ED_MAX_NAME_LEN]; | char name[ED_MAX_NAME_LEN]; | ||||
int link_nr; | int link_nr; | ||||
int loss_level; | int loss_level; | ||||
int bandwidth; // XXX use link bandwidth? | int bandwidth; // XXX use link bandwidth? | ||||
int samples_no; /* actual len of samples[] */ | int samples_no; /* actual len of samples[] */ | ||||
int samples[ED_MAX_SAMPLES_NO]; /* may be shorter */ | int samples[ED_MAX_SAMPLES_NO]; /* may be shorter */ | ||||
}; | }; | ||||
#ifdef NEW_AQM | |||||
/* Extra parameters for AQM and scheduler. | |||||
* This struct is used to pass and retrieve parameters (configurations) | |||||
* to/from AQM and Scheduler. | |||||
*/ | |||||
struct dn_extra_parms { | |||||
struct dn_id oid; | |||||
char name[16]; | |||||
uint32_t nr; | |||||
#define DN_MAX_EXTRA_PARM 10 | |||||
int64_t par[DN_MAX_EXTRA_PARM]; | |||||
}; | |||||
#endif | |||||
/* | /* | ||||
* Overall structure of dummynet | * Overall structure of dummynet | ||||
In dummynet, packets are selected with the firewall rules, and passed | In dummynet, packets are selected with the firewall rules, and passed | ||||
to two different objects: PIPE or QUEUE (bad name). | to two different objects: PIPE or QUEUE (bad name). | ||||
A QUEUE defines a classifier, which groups packets into flows | A QUEUE defines a classifier, which groups packets into flows | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |