2 * FILE : /usr/src/linux/include/net/qtype.h
4 * This file defines data structures for programs to send commands and
5 * parameters from user-level to kernel. Some of them are used directly in
6 * kernel. NOTE that parts of the definitions here are designed only for
11 /* NIC identification */
12 typedef struct t_qtype
14 char if_id[8]; //Identifier of the NIC. ex. eth0
15 u_int8_t if_dir; //1: Inbound
17 u_int32_t bandwidth; //Bandwidth of this NIC
18 //NOTE that "bandwidth" may be less than
19 //NIC's maximum capacity. If it is set
20 //this way, mechanism of "Maximum output
21 //rate control" will enforce the NIC to run
22 //at speed no more faster than "bandwidth".
26 /* Information of a service class or a bandwidth pipe(Bpipe)
28 * NOTE that in addition to Class_Name we need another T_Spec(defined below)
31 typedef struct t_clsname
33 char if_id[8]; // the if name, ex: fxp0
35 u_int8_t if_dir; // the direction of the interface
38 char agency[30]; // the name of the agency
40 char class[30]; // the name of the class
43 u_int8_t service_type; // the service type
50 u_int16_t po; /* 20020716 by ARGAY
52 * The most significant 8-bit is the precedence order at Agency
53 * level. The last significatn 8 bits represents the precedence
54 * order at Bpipe level
60 /* Specification of a service class (5 fields)
63 * 3. Destination address
64 * 4. Destination ports
67 * NOTE that except for "protocol_id", other data(including addresses and
68 * ports) may spread within a range. Therefore we use start(ex. s_saddr)
69 * and end(ex. e_saddr) to define the range. To describe a wildcard
70 * address or port, we have define their range as 0~2^32-1 and 0~2^16-1
73 typedef struct t_cspec
75 u_int32_t s_saddr; //the start of the source address
76 //ex: 01020300h (1.2.3.0)
78 u_int32_t e_saddr; //the end of the source address
79 //ex: 010203FFh (1.2.3.255)
81 u_int16_t s_sport; //the start of source port
84 u_int16_t e_sport; //the end of source port
87 u_int32_t s_daddr; //the start of the destination address
88 //ex: 02040600h (2.4.6.0)
90 u_int32_t e_daddr; //the end of the destination address
91 //ex: 020406FFh (2.4.6.255)
93 u_int16_t s_dport; //the start of destination port
96 u_int16_t e_dport; //the end of destination port
99 u_int8_t protocol_id; //the start of protocol ID
100 //0=wild card, or specific
105 /* Traffic specification
107 * This is only required for special classes which need policing, that is
108 * "Bandwidth pipe"(Bpipe). We now use 5 parameters defined by IETF in RFC
109 * 2210 as a Bpipe's traffic specification. "VOIP_T_Spec" is designed for
112 typedef union t_tspec
116 u_int32_t TokenRate; // the r value (bps)
117 u_int32_t TokenBucketSize; // the b value (byte)
118 u_int32_t PeakBandwidth; // the p value (bps)
119 u_int16_t MaxPacketSize; // the M value (byte)
120 u_int8_t MinPacketSize; // the m value (byte)
125 u_int8_t Coding_scheme; // the coding scheme
128 u_int8_t Suppression; // to indicate whether
129 // the silence supression
133 u_int8_t padding[12]; // the padding bits
141 * This structure defines the QoS requirements of a service class or a Bpipe.
142 * Actually, this strcture is not used for the current version. Instead, we
143 * pay most attention to the achieved throughput of each service class or a
148 u_int32_t delay; // the delay value(ms)
149 u_int32_t maxrate; // the maximum rate
150 u_int32_t minrate; // the minimum rate(must be supported by scheduler)
151 u_int32_t nominalrate; // the guaranteed value(byte per second)
152 u_int32_t loss; // the loss rate(UNIT= 10^-6)
156 /* Parameters of resources to reserve
158 * 2. Minimum guaranteed rate (bps)
169 u_int32_t b; //buffer size (byte)
170 u_int32_t r; //guaranteed rate(bps)
171 u_int8_t modFlag; //the flag to indicate what kind
173 // 0 : class modification (MOD_CLASS)
174 // 1 : bpipe modification (MOD_BPIPE)
175 // 2 : Rsc modification (MOD_RSC)
176 //This flag is only used when we have to
177 //change resource allocation of an EXISTING
178 //service class or Bpipe
180 u_int8_t enableBpipeFlag; /* 20020716 by ARGAY
181 * the flag to indicate whether an AR Bpipe is enabled
184 * Currently, only an AR Bpipe will be disabled when it
185 * should not be activated. IR Bpipes will NEVER be
199 //Parameters of RED queue management added by Binbon
200 typedef struct t_redspec{
202 /* RED parameters: unit= 1/1000000 */
203 u_int32_t wq; /* weighted average */
204 u_int32_t minthp; /* the proportion of minimum threshold to buf_len */
205 u_int32_t maxthp; /* the proportion of maximum threshold to buf_len */
206 u_int32_t maxp; /* maximum value of dropping probability */
211 /* Struct tc_wfq_qopt is the data structure containging commands and parameters
212 * sent from user-space to kernel. Each time when tc_wfq_qopt is used, not
213 * every member of this data strcuture contains data. It depends on which
214 * command the administrator wants to execute. For example, if we want to
215 * add a service class, only members in, cn, cs and er are required to fill in
216 * data. ts is not required.
224 u_int8_t qm; //added by Binbon
225 RED_Spec rs; //added by Binbon
227 struct tc_ken_prio_qopt {
233 u_int8_t qm; //added by Binbon
234 RED_Spec rs; //added by Binbon
237 /* The following codes are for PORTER.
239 // 2001/03/25 add by Jay
243 // u_int8_t cac_flag;
244 // unsigned long classID;
256 // u_int8_t cac_flag;
257 // unsigned long classID;
272 char if_id[8]; // the if name, ex: fxp0
274 u_int8_t if_dir; // the direction of the interface
279 struct db_ir *ir_head;
280 struct db_ar *ar_head;
285 //end of 2001/3/25 add by Jay