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.h 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef BACKGROUND_H
  2. #define BACKGROUND_H
  3. /** @file
  4. *
  5. * Background protocols
  6. *
  7. * Some protocols (e.g. ARP, IGMP) operate in the background; the
  8. * upper layers are not aware of their operation. When an ARP query
  9. * for the local station's IP address arrives, Etherboot must reply to
  10. * it regardless of what other operations are currently in progress.
  11. *
  12. * Background protocols are called in two circumstances: when
  13. * Etherboot is about to poll for a packet, and when Etherboot has
  14. * received a packet that the upper layer (whatever that may currently
  15. * be) isn't interested in.
  16. *
  17. */
  18. #include <gpxe/tables.h>
  19. #include "ip.h"
  20. /** A background protocol */
  21. struct background {
  22. /** Send method
  23. *
  24. * This method will be called whenever Etherboot is about to
  25. * poll for a packet. The background protocol should use this
  26. * method to send out any periodic transmissions that it may
  27. * require.
  28. */
  29. void ( *send ) ( unsigned long timestamp );
  30. /** Process method
  31. *
  32. * This method will be called whenever Etherboot has received
  33. * a packet and doesn't know what to do with it.
  34. */
  35. void ( *process ) ( unsigned long timestamp, unsigned short ptype,
  36. struct iphdr *ip );
  37. };
  38. /** A member of the background protocols table */
  39. #define __background __table ( struct background, background, 01 )
  40. /* Functions in background.c */
  41. extern void background_send ( unsigned long timestamp );
  42. extern void background_process ( unsigned long timestamp, unsigned short ptype,
  43. struct iphdr *ip );
  44. #endif /* BACKGROUND_H */