noring.c 911 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #define _GNU_SOURCE
  2. #include "main.h"
  3. #include <assert.h>
  4. /* stub implementation: useful for measuring overhead */
  5. void alloc_ring(void)
  6. {
  7. }
  8. /* guest side */
  9. int add_inbuf(unsigned len, void *buf, void *datap)
  10. {
  11. return 0;
  12. }
  13. /*
  14. * skb_array API provides no way for producer to find out whether a given
  15. * buffer was consumed. Our tests merely require that a successful get_buf
  16. * implies that add_inbuf succeed in the past, and that add_inbuf will succeed,
  17. * fake it accordingly.
  18. */
  19. void *get_buf(unsigned *lenp, void **bufp)
  20. {
  21. return "Buffer";
  22. }
  23. void poll_used(void)
  24. {
  25. }
  26. void disable_call()
  27. {
  28. assert(0);
  29. }
  30. bool enable_call()
  31. {
  32. assert(0);
  33. }
  34. void kick_available(void)
  35. {
  36. assert(0);
  37. }
  38. /* host side */
  39. void disable_kick()
  40. {
  41. assert(0);
  42. }
  43. bool enable_kick()
  44. {
  45. assert(0);
  46. }
  47. void poll_avail(void)
  48. {
  49. }
  50. bool use_buf(unsigned *lenp, void **bufp)
  51. {
  52. return true;
  53. }
  54. void call_used(void)
  55. {
  56. assert(0);
  57. }