doc.c 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * lib/doc.c Documentation Purpose
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation version 2.1
  7. * of the License.
  8. *
  9. * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
  10. */
  11. /**
  12. * @mainpage
  13. *
  14. * @section remarks Remarks
  15. *
  16. * @subsection cache_alloc Allocation of Caches
  17. *
  18. * Almost all subsystem provide a function to allocate a new cache
  19. * of some form. The function usually looks like this:
  20. * @code
  21. * struct nl_cache *<object name>_alloc_cache(struct nl_handle *handle)
  22. * @endcode
  23. *
  24. * These functions allocate a new cache for the own object type,
  25. * initializes it properly and updates it to represent the current
  26. * state of their master, e.g. a link cache would include all
  27. * links currently configured in the kernel.
  28. *
  29. * Some of the allocation functions may take additional arguments
  30. * to further specify what will be part of the cache.
  31. *
  32. * All such functions return a newly allocated cache or NULL
  33. * in case of an error.
  34. *
  35. * @subsection addr Setting of Addresses
  36. * @code
  37. * int <object name>_set_addr(struct nl_object *, struct nl_addr *)
  38. * @endcode
  39. *
  40. * All attribute functions avaiable for assigning addresses to objects
  41. * take a struct nl_addr argument. The provided address object is
  42. * validated against the address family of the object if known already.
  43. * The assignment fails if the address families mismatch. In case the
  44. * address family has not been specified yet, the address family of
  45. * the new address is elected to be the new requirement.
  46. *
  47. * The function will acquire a new reference on the address object
  48. * before assignment, the caller is NOT responsible for this.
  49. *
  50. * All functions return 0 on success or a negative error code.
  51. *
  52. * @subsection flags Flags to Character StringTranslations
  53. * All functions converting a set of flags to a character string follow
  54. * the same principles, therefore, the following information applies
  55. * to all functions convertings flags to a character string and vice versa.
  56. *
  57. * @subsubsection flags2str Flags to Character String
  58. * @code
  59. * char *<object name>_flags2str(int flags, char *buf, size_t len)
  60. * @endcode
  61. * @arg flags Flags.
  62. * @arg buf Destination buffer.
  63. * @arg len Buffer length.
  64. *
  65. * Converts the specified flags to a character string separated by
  66. * commas and stores it in the specified destination buffer.
  67. *
  68. * @return The destination buffer
  69. *
  70. * @subsubsection str2flags Character String to Flags
  71. * @code
  72. * int <object name>_str2flags(const char *name)
  73. * @endcode
  74. * @arg name Name of flag.
  75. *
  76. * Converts the provided character string specifying a flag
  77. * to the corresponding numeric value.
  78. *
  79. * @return Link flag or a negative value if none was found.
  80. *
  81. * @subsubsection type2str Type to Character String
  82. * @code
  83. * char *<object name>_<type>2str(int type, char *buf, size_t len)
  84. * @endcode
  85. * @arg type Type as numeric value
  86. * @arg buf Destination buffer.
  87. * @arg len Buffer length.
  88. *
  89. * Converts an identifier (type) to a character string and stores
  90. * it in the specified destination buffer.
  91. *
  92. * @return The destination buffer or the type encoded in hexidecimal
  93. * form if the identifier is unknown.
  94. *
  95. * @subsubsection str2type Character String to Type
  96. * @code
  97. * int <object name>_str2<type>(const char *name)
  98. * @endcode
  99. * @arg name Name of identifier (type).
  100. *
  101. * Converts the provided character string specifying a identifier
  102. * to the corresponding numeric value.
  103. *
  104. * @return Identifier as numeric value or a negative value if none was found.
  105. */