ingress.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * lib/route/qdisc/ingress.c ingress
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation version 2.1
  7. * of the License.
  8. *
  9. * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com>
  10. */
  11. /**
  12. * @ingroup qdisc
  13. * @defgroup qdisc_ingress Ingress qdisc
  14. *
  15. * @{
  16. */
  17. #include <netlink-private/netlink.h>
  18. #include <netlink-private/tc.h>
  19. #include <netlink/netlink.h>
  20. #include <netlink-private/route/tc-api.h>
  21. #include <netlink/route/qdisc.h>
  22. #include <netlink/utils.h>
  23. struct dumb {
  24. uint32_t foo;
  25. };
  26. static int dumb_msg_parser(struct rtnl_tc *tc, void *data)
  27. {
  28. return 0;
  29. }
  30. static void dumb_dump_line(struct rtnl_tc *tc, void *data,
  31. struct nl_dump_params *p)
  32. {
  33. }
  34. static int dumb_msg_fill(struct rtnl_tc *tc, void *data, struct nl_msg *msg)
  35. {
  36. return 0;
  37. }
  38. static struct rtnl_tc_ops ingress_ops = {
  39. .to_kind = "ingress",
  40. .to_type = RTNL_TC_TYPE_QDISC,
  41. .to_size = sizeof(struct dumb),
  42. .to_msg_parser = dumb_msg_parser,
  43. .to_dump[NL_DUMP_LINE] = dumb_dump_line,
  44. .to_msg_fill = dumb_msg_fill,
  45. };
  46. static void __init ingress_init(void)
  47. {
  48. rtnl_tc_register(&ingress_ops);
  49. }
  50. static void __exit ingress_exit(void)
  51. {
  52. rtnl_tc_unregister(&ingress_ops);
  53. }
  54. /** @} */