00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <netlink-local.h>
00013 #include <netlink-tc.h>
00014 #include <netlink/netlink.h>
00015 #include <netlink/route/cls/ematch.h>
00016
00017 static int container_parse(struct rtnl_ematch *e, void *data, size_t len)
00018 {
00019 memcpy(e->e_data, data, sizeof(uint32_t));
00020
00021 return 0;
00022 }
00023
00024 static int container_fill(struct rtnl_ematch *e, struct nl_msg *msg)
00025 {
00026 return nlmsg_append(msg, e->e_data, sizeof(uint32_t), 0);
00027 }
00028
00029 static struct rtnl_ematch_ops container_ops = {
00030 .eo_kind = TCF_EM_CONTAINER,
00031 .eo_name = "container",
00032 .eo_minlen = sizeof(uint32_t),
00033 .eo_datalen = sizeof(uint32_t),
00034 .eo_parse = container_parse,
00035 .eo_fill = container_fill,
00036 };
00037
00038 static void __init container_init(void)
00039 {
00040 rtnl_ematch_register(&container_ops);
00041 }