action.c 622 B

1234567891011121314151617181920212223
  1. /* SPDX-License-Identifier: GPL-2.0
  2. * Copyright (c) 2018 Davide Caratti, Red Hat inc.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of version 2 of the GNU General Public
  6. * License as published by the Free Software Foundation.
  7. */
  8. #include <linux/bpf.h>
  9. #include <linux/pkt_cls.h>
  10. __attribute__((section("action-ok"),used)) int action_ok(struct __sk_buff *s)
  11. {
  12. return TC_ACT_OK;
  13. }
  14. __attribute__((section("action-ko"),used)) int action_ko(struct __sk_buff *s)
  15. {
  16. s->data = 0x0;
  17. return TC_ACT_OK;
  18. }
  19. char _license[] __attribute__((section("license"),used)) = "GPL";