Implement "lookup dscp N" which does a lookup of the DSCP (top 6 bits
of ip->ip_tos) in a table. This can be useful to direct traffic to different pipes/queues according to the DSCP of the packet, as follows: ipfw add 100 queue tablearg lookup dscp 3 // table 3 maps dscp->queue This change is a no-op (but harmless) until the two-line kernel side is committed, which will happen shortly.
This commit is contained in:
parent
6eafba267e
commit
72662a7566
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=205169
@ -231,7 +231,7 @@ static struct _s_x rule_action_params[] = {
|
|||||||
*/
|
*/
|
||||||
static int lookup_key[] = {
|
static int lookup_key[] = {
|
||||||
TOK_DSTIP, TOK_SRCIP, TOK_DSTPORT, TOK_SRCPORT,
|
TOK_DSTIP, TOK_SRCIP, TOK_DSTPORT, TOK_SRCPORT,
|
||||||
TOK_UID, TOK_JAIL, -1 };
|
TOK_UID, TOK_JAIL, TOK_DSCP, -1 };
|
||||||
|
|
||||||
static struct _s_x rule_options[] = {
|
static struct _s_x rule_options[] = {
|
||||||
{ "tagged", TOK_TAGGED },
|
{ "tagged", TOK_TAGGED },
|
||||||
@ -258,6 +258,7 @@ static struct _s_x rule_options[] = {
|
|||||||
{ "iplen", TOK_IPLEN },
|
{ "iplen", TOK_IPLEN },
|
||||||
{ "ipid", TOK_IPID },
|
{ "ipid", TOK_IPID },
|
||||||
{ "ipprecedence", TOK_IPPRECEDENCE },
|
{ "ipprecedence", TOK_IPPRECEDENCE },
|
||||||
|
{ "dscp", TOK_DSCP },
|
||||||
{ "iptos", TOK_IPTOS },
|
{ "iptos", TOK_IPTOS },
|
||||||
{ "ipttl", TOK_IPTTL },
|
{ "ipttl", TOK_IPTTL },
|
||||||
{ "ipversion", TOK_IPVER },
|
{ "ipversion", TOK_IPVER },
|
||||||
@ -3519,7 +3520,7 @@ ipfw_add(char *av[])
|
|||||||
char *p;
|
char *p;
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
if (av[0] && av[1])
|
if (!av[0] || !av[1])
|
||||||
errx(EX_USAGE, "format: lookup argument tablenum");
|
errx(EX_USAGE, "format: lookup argument tablenum");
|
||||||
cmd->opcode = O_IP_DST_LOOKUP;
|
cmd->opcode = O_IP_DST_LOOKUP;
|
||||||
cmd->len |= F_INSN_SIZE(ipfw_insn) + 2;
|
cmd->len |= F_INSN_SIZE(ipfw_insn) + 2;
|
||||||
|
@ -125,6 +125,7 @@ enum tokens {
|
|||||||
TOK_IPLEN,
|
TOK_IPLEN,
|
||||||
TOK_IPID,
|
TOK_IPID,
|
||||||
TOK_IPPRECEDENCE,
|
TOK_IPPRECEDENCE,
|
||||||
|
TOK_DSCP,
|
||||||
TOK_IPTOS,
|
TOK_IPTOS,
|
||||||
TOK_IPTTL,
|
TOK_IPTTL,
|
||||||
TOK_IPVER,
|
TOK_IPVER,
|
||||||
|
Loading…
Reference in New Issue
Block a user