Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

background.c 1.1KB

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