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.

nvo.h 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef _GPXE_NVO_H
  2. #define _GPXE_NVO_H
  3. /** @file
  4. *
  5. * Non-volatile stored options
  6. *
  7. */
  8. #include <stdint.h>
  9. struct nvs_device;
  10. struct dhcp_option_block;
  11. /**
  12. * A fragment of a non-volatile storage device used for stored options
  13. */
  14. struct nvo_fragment {
  15. /** Starting address of fragment within NVS device */
  16. unsigned int address;
  17. /** Length of fragment */
  18. size_t len;
  19. };
  20. /**
  21. * A block of non-volatile stored options
  22. */
  23. struct nvo_block {
  24. /** Underlying non-volatile storage device */
  25. struct nvs_device *nvs;
  26. /** List of option-containing fragments
  27. *
  28. * The list is terminated by a fragment with a length of zero.
  29. */
  30. struct nvo_fragment *fragments;
  31. /** Total length of all fragments
  32. *
  33. * This field is filled in by nvo_register().
  34. */
  35. size_t total_len;
  36. /** DHCP options block */
  37. struct dhcp_option_block *options;
  38. };
  39. extern int nvo_register ( struct nvo_block *nvo );
  40. extern int nvo_save ( struct nvo_block *nvo );
  41. extern void nvo_unregister ( struct nvo_block *nvo );
  42. #endif /* _GPXE_NVO_H */