TEXT   48

NuFW API

Guest on 2nd June 2022 01:59:09 AM

  1. <webpage id="api">
  2. <config param="rcsdate" value="$Date: 2022/12/01 23:48:25 $"/>
  3. <config param="filename" value="api.html"/>
  4. <head>
  5. <title>API</title>
  6. <summary>NuFW API</summary>
  7. </head>
  8. <section>
  9. <title> Nuauth </title>
  10. Here's the life of a packet inside
  11. <emphasis>nuauth</emphasis>
  12. :
  13. <figure>
  14. <title>Global Process</title>
  15. <mediaobject>
  16. <imageobject>
  17. <imagedata fileref="graphics/nuauth-flow.png"/>
  18. </imageobject>
  19. </mediaobject>
  20. </figure>
  21. </section>
  22. <section>
  23. <title>Modules coding</title>
  24. <para>
  25. The module can provide three functions :
  26. <itemizedlist>
  27. <listitem>
  28. <para>user_check : a function getting the password of a user and the groups he belongs to.</para>
  29. </listitem>
  30. <listitem>
  31. <para>acl_check : a function getting the corresponding access control list for a packet.</para>
  32. </listitem>
  33. <listitem>
  34. <para>user_packet_logs : a function logging user activities.</para>
  35. </listitem>
  36. </itemizedlist>
  37. </para>
  38. <section>
  39. <title>user_check</title>
  40. <para>
  41. The declaration of
  42. <varname>user_check</varname>
  43. is the following :
  44. <programlisting>GSList * user_check (u_int16_t userid,char *passwd);</programlisting>
  45. It takes an integer and a pointer to the zone allocated to contain the password of the user as parameters and returns the list of a pointer to a
  46. <varname>GSList</varname>
  47. of integer, each integer being the number of a group the user belongs to.
  48. </para>
  49. <para>
  50. The pointer
  51. <varname>passwd</varname>
  52. must contain the password of the user.
  53. </para>
  54. </section>
  55. <section>
  56. <title>acl_check</title>
  57. <para>
  58. The declaration of
  59. <varname>acl_check</varname>
  60. is the following :
  61. <programlisting>GSList * acl_check (connection* element);</programlisting>
  62. It takes a
  63. <varname>connection</varname>
  64. as parameters and returns a
  65. <varname>GSList</varname>
  66. of
  67. <varname>struct acl_group</varname>
  68. <footnote>
  69. <para>This structure contains a list of group (integer) and the corresponding decision.</para>
  70. </footnote>
  71. .
  72. </para>
  73. </section>
  74. <section>
  75. <title>user_packet_logs</title>
  76. <para>
  77. The declaration of
  78. <varname>user_packet_logs</varname>
  79. is the following :
  80. <programlisting>gint user_packet_logs (connection element, int state);</programlisting>
  81. It takes a
  82. <varname>connection</varname>
  83. and a
  84. <varname>state</varname>
  85. as parameters and return an int indicating status of the logging operation.
  86. <varname>state</varname>
  87. can take the follwing values :
  88. <itemizedlist>
  89. <listitem>
  90. <para>STATE_OPEN : log a connection opening (SYN_SENT for TCP).</para>
  91. </listitem>
  92. <listitem>
  93. <para>STATE_ESTABLISHED : log a connection establishment.</para>
  94. </listitem>
  95. <listitem>
  96. <para>STATE_CLOSE : log ending of a connection.</para>
  97. </listitem>
  98. <listitem>
  99. <para>STATE_DROP : log a connection rejected by the nufw system.</para>
  100. </listitem>
  101. </itemizedlist>
  102. </para>
  103. </section>
  104. </section>
  105. </webpage>

Raw Paste


Login or Register to edit or fork this paste. It's free.