Lines Matching defs:meta
9 * The metadata ematch compares two meta objects where each object
10 * represents either a meta value stored in the kernel or a static
16 * The definition of a objects conists of the type (meta type), a
17 * identifier (meta id) and additional type specific information.
18 * The meta id is either TCF_META_TYPE_VALUE for values provided by
19 * userspace or a index to the meta operations table consisting of
20 * function pointers to type specific meta data collectors returning
21 * the value of the requested meta value.
43 * on the meta type. Obviously, the length of the data must also
53 * NOTE: Certain meta values depend on other subsystems and are
619 /* Meta value operations table listing all meta value collectors and
620 * assigns them to a type and meta id. */
850 struct meta_match *meta = (struct meta_match *) m->data;
853 if (meta_get(skb, info, &meta->lvalue, &l_value) < 0 ||
854 meta_get(skb, info, &meta->rvalue, &r_value) < 0)
857 r = meta_type_ops(&meta->lvalue)->compare(&l_value, &r_value);
859 switch (meta->lvalue.hdr.op) {
871 static void meta_delete(struct meta_match *meta)
873 if (meta) {
874 const struct meta_type_ops *ops = meta_type_ops(&meta->lvalue);
877 ops->destroy(&meta->lvalue);
878 ops->destroy(&meta->rvalue);
882 kfree(meta);
912 struct meta_match *meta = NULL;
930 meta = kzalloc(sizeof(*meta), GFP_KERNEL);
931 if (meta == NULL) {
936 memcpy(&meta->lvalue.hdr, &hdr->left, sizeof(hdr->left));
937 memcpy(&meta->rvalue.hdr, &hdr->right, sizeof(hdr->right));
939 if (!meta_is_supported(&meta->lvalue) ||
940 !meta_is_supported(&meta->rvalue)) {
945 if (meta_change_data(&meta->lvalue, tb[TCA_EM_META_LVALUE]) < 0 ||
946 meta_change_data(&meta->rvalue, tb[TCA_EM_META_RVALUE]) < 0)
949 m->datalen = sizeof(*meta);
950 m->data = (unsigned long) meta;
954 if (err && meta)
955 meta_delete(meta);
967 struct meta_match *meta = (struct meta_match *) em->data;
972 memcpy(&hdr.left, &meta->lvalue.hdr, sizeof(hdr.left));
973 memcpy(&hdr.right, &meta->rvalue.hdr, sizeof(hdr.right));
978 ops = meta_type_ops(&meta->lvalue);
979 if (ops->dump(skb, &meta->lvalue, TCA_EM_META_LVALUE) < 0 ||
980 ops->dump(skb, &meta->rvalue, TCA_EM_META_RVALUE) < 0)