Lines 83-88
static struct _s_x tabletypes[] = {
Link Here
|
83 |
{ NULL, 0 } |
83 |
{ NULL, 0 } |
84 |
}; |
84 |
}; |
85 |
|
85 |
|
|
|
86 |
/* Default algorithms for various table types */ |
87 |
static struct _s_x tablealgos[] = { |
88 |
{ "addr:radix", IPFW_TABLE_ADDR }, |
89 |
{ "flow:hash", IPFW_TABLE_FLOW }, |
90 |
{ "iface:array", IPFW_TABLE_INTERFACE }, |
91 |
{ "number:array", IPFW_TABLE_NUMBER }, |
92 |
{ NULL, 0 } |
93 |
}; |
94 |
|
86 |
static struct _s_x tablevaltypes[] = { |
95 |
static struct _s_x tablevaltypes[] = { |
87 |
{ "skipto", IPFW_VTYPE_SKIPTO }, |
96 |
{ "skipto", IPFW_VTYPE_SKIPTO }, |
88 |
{ "pipe", IPFW_VTYPE_PIPE }, |
97 |
{ "pipe", IPFW_VTYPE_PIPE }, |
Lines 468-475
table_create(ipfw_obj_header *oh, int ac, char *av[])
Link Here
|
468 |
} |
477 |
} |
469 |
|
478 |
|
470 |
/* Set some defaults to preserve compatibility. */ |
479 |
/* Set some defaults to preserve compatibility. */ |
471 |
if (xi.algoname[0] == '\0' && xi.type == 0) |
480 |
if (xi.algoname[0] == '\0') { |
472 |
xi.type = IPFW_TABLE_ADDR; |
481 |
const char *algo; |
|
|
482 |
|
483 |
if (xi.type == 0) |
484 |
xi.type = IPFW_TABLE_ADDR; |
485 |
algo = match_value(tablealgos, xi.type); |
486 |
if (algo != NULL) |
487 |
strlcpy(xi.algoname, algo, sizeof(xi.algoname)); |
488 |
} |
473 |
if (xi.vmask == 0) |
489 |
if (xi.vmask == 0) |
474 |
xi.vmask = IPFW_VTYPE_LEGACY; |
490 |
xi.vmask = IPFW_VTYPE_LEGACY; |
475 |
|
491 |
|