aboutsummaryrefslogtreecommitdiff
path: root/tests/test-classifier.c
diff options
context:
space:
mode:
authorJustin Pettit <jpettit@nicira.com>2011-11-09 17:10:27 -0800
committerJustin Pettit <jpettit@nicira.com>2011-11-10 18:03:04 -0800
commiteadef313296eac5c2fa99bc1d7a32e514a7989bf (patch)
tree505f7cdd370f7f8c53fa8536a6ad2af417d2a3fd /tests/test-classifier.c
parent58828b08f0f8b5a2ea5b88b06f48eb1db83b0938 (diff)
Prepend "nw_" to "frag" and "tos" elements.
Most of the members in structures referring to network elements indicate the layer (e.g., "tl_", "nw_", "tp_"). The "frag" and "tos" members didn't, so this commit add them.
Diffstat (limited to 'tests/test-classifier.c')
-rw-r--r--tests/test-classifier.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/test-classifier.c b/tests/test-classifier.c
index d66654bc..d167574d 100644
--- a/tests/test-classifier.c
+++ b/tests/test-classifier.c
@@ -55,7 +55,7 @@
CLS_FIELD(FWW_DL_SRC, dl_src, DL_SRC) \
CLS_FIELD(FWW_DL_DST | FWW_ETH_MCAST, dl_dst, DL_DST) \
CLS_FIELD(FWW_NW_PROTO, nw_proto, NW_PROTO) \
- CLS_FIELD(0, tos, TOS)
+ CLS_FIELD(0, nw_tos, NW_TOS)
/* Field indexes.
*
@@ -203,9 +203,9 @@ match(const struct cls_rule *wild, const struct flow *fixed)
& wild->wc.vlan_tci_mask);
} else if (f_idx == CLS_F_IDX_TUN_ID) {
eq = !((fixed->tun_id ^ wild->flow.tun_id) & wild->wc.tun_id_mask);
- } else if (f_idx == CLS_F_IDX_TOS) {
- eq = !((fixed->tos ^ wild->flow.tos)
- & wild->wc.tos_mask);
+ } else if (f_idx == CLS_F_IDX_NW_TOS) {
+ eq = !((fixed->nw_tos ^ wild->flow.nw_tos)
+ & wild->wc.nw_tos_mask);
} else {
NOT_REACHED();
}
@@ -266,7 +266,7 @@ static uint8_t dl_src_values[][6] = { { 0x00, 0x02, 0xe3, 0x0f, 0x80, 0xa4 },
static uint8_t dl_dst_values[][6] = { { 0x4a, 0x27, 0x71, 0xae, 0x64, 0xc1 },
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } };
static uint8_t nw_proto_values[] = { IPPROTO_TCP, IPPROTO_ICMP };
-static uint8_t tos_values[] = { 48, 0 };
+static uint8_t nw_tos_values[] = { 48, 0 };
static void *values[CLS_N_FIELDS][2];
@@ -300,8 +300,8 @@ init_values(void)
values[CLS_F_IDX_NW_PROTO][0] = &nw_proto_values[0];
values[CLS_F_IDX_NW_PROTO][1] = &nw_proto_values[1];
- values[CLS_F_IDX_TOS][0] = &tos_values[0];
- values[CLS_F_IDX_TOS][1] = &tos_values[1];
+ values[CLS_F_IDX_NW_TOS][0] = &nw_tos_values[0];
+ values[CLS_F_IDX_NW_TOS][1] = &nw_tos_values[1];
values[CLS_F_IDX_TP_SRC][0] = &tp_src_values[0];
values[CLS_F_IDX_TP_SRC][1] = &tp_src_values[1];
@@ -321,7 +321,7 @@ init_values(void)
#define N_DL_SRC_VALUES ARRAY_SIZE(dl_src_values)
#define N_DL_DST_VALUES ARRAY_SIZE(dl_dst_values)
#define N_NW_PROTO_VALUES ARRAY_SIZE(nw_proto_values)
-#define N_TOS_VALUES ARRAY_SIZE(tos_values)
+#define N_NW_TOS_VALUES ARRAY_SIZE(nw_tos_values)
#define N_FLOW_VALUES (N_NW_SRC_VALUES * \
N_NW_DST_VALUES * \
@@ -334,7 +334,7 @@ init_values(void)
N_DL_SRC_VALUES * \
N_DL_DST_VALUES * \
N_NW_PROTO_VALUES * \
- N_TOS_VALUES)
+ N_NW_TOS_VALUES)
static unsigned int
get_value(unsigned int *x, unsigned n_values)
@@ -370,7 +370,7 @@ compare_classifiers(struct classifier *cls, struct tcls *tcls)
memcpy(flow.dl_dst, dl_dst_values[get_value(&x, N_DL_DST_VALUES)],
ETH_ADDR_LEN);
flow.nw_proto = nw_proto_values[get_value(&x, N_NW_PROTO_VALUES)];
- flow.tos = tos_values[get_value(&x, N_TOS_VALUES)];
+ flow.nw_tos = nw_tos_values[get_value(&x, N_NW_TOS_VALUES)];
cr0 = classifier_lookup(cls, &flow);
cr1 = tcls_lookup(tcls, &flow);
@@ -468,8 +468,8 @@ make_rule(int wc_fields, unsigned int priority, int value_pat)
rule->cls_rule.wc.vlan_tci_mask = htons(UINT16_MAX);
} else if (f_idx == CLS_F_IDX_TUN_ID) {
rule->cls_rule.wc.tun_id_mask = htonll(UINT64_MAX);
- } else if (f_idx == CLS_F_IDX_TOS) {
- rule->cls_rule.wc.tos_mask = UINT8_MAX;
+ } else if (f_idx == CLS_F_IDX_NW_TOS) {
+ rule->cls_rule.wc.nw_tos_mask = UINT8_MAX;
} else {
NOT_REACHED();
}