ita_attr_settings.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright (C) 2012 Andreas Steffen
  3. * HSR Hochschule fuer Technik Rapperswil
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License as published by the
  7. * Free Software Foundation; either version 2 of the License, or (at your
  8. * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  12. * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  13. * for more details.
  14. */
  15. /**
  16. * @defgroup ita_attr_settings ita_attr_settings
  17. * @{ @ingroup ita_attr
  18. */
  19. #ifndef ITA_ATTR_SETTINGS_H_
  20. #define ITA_ATTR_SETTINGS_H_
  21. typedef struct ita_attr_settings_t ita_attr_settings_t;
  22. #include "pa_tnc/pa_tnc_attr.h"
  23. /**
  24. * Class implementing the ITA Settings PA-TNC attribute.
  25. *
  26. */
  27. struct ita_attr_settings_t {
  28. /**
  29. * Public PA-TNC attribute interface
  30. */
  31. pa_tnc_attr_t pa_tnc_attribute;
  32. /**
  33. * Add a setting to the list
  34. *
  35. * @param name name of the setting
  36. * @param value value of the setting
  37. */
  38. void (*add)(ita_attr_settings_t *this, char *name, chunk_t value);
  39. /**
  40. * Return an enumerator over all name/value pairs
  41. *
  42. * @return enumerator returns char **name, chunk_t *value
  43. */
  44. enumerator_t* (*create_enumerator)(ita_attr_settings_t *this);
  45. };
  46. /**
  47. * Creates an ita_attr_settings_t object with an empty settings list
  48. */
  49. pa_tnc_attr_t* ita_attr_settings_create(void);
  50. /**
  51. * Creates an ita_attr_settings_t object from received data
  52. *
  53. * @param length Total length of attribute value
  54. * @param value Unparsed attribute value (might be a segment)
  55. */
  56. pa_tnc_attr_t* ita_attr_settings_create_from_data(size_t length, chunk_t value);
  57. #endif /** ITA_ATTR_SETTINGS_H_ @}*/