You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

background.c 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #include "background.h"
  2. static struct background backgrounds[0]
  3. __table_start ( struct background, background );
  4. static struct background backgrounds_end[0]
  5. __table_end ( struct background, background );
  6. /** @file */
  7. /**
  8. * Call send method of all background protocols
  9. *
  10. * @v timestamp Current time
  11. * @ret None -
  12. * @err None -
  13. *
  14. * This calls each background protocol's background::send() method.
  15. */
  16. void background_send ( unsigned long timestamp ) {
  17. struct background *background;
  18. for ( background = backgrounds ; background < backgrounds_end ;
  19. background++ ) {
  20. if ( background->send )
  21. background->send ( timestamp );
  22. }
  23. }
  24. /**
  25. * Call process method of all background protocols
  26. *
  27. * @v timestamp Current time
  28. * @v ptype Packet type
  29. * @v ip IP header, if present
  30. * @ret None -
  31. * @err None -
  32. *
  33. * This calls each background protocol's background::process() method.
  34. */
  35. void background_process ( unsigned long timestamp, unsigned short ptype,
  36. struct iphdr *ip ) {
  37. struct background *background;
  38. for ( background = backgrounds ; background < backgrounds_end ;
  39. background++ ) {
  40. if ( background->process )
  41. background->process ( timestamp, ptype, ip );
  42. }
  43. }