]> git.ipfire.org Git - thirdparty/sarg.git/blob - documentation/usertab.txt
Rename configure.in as configure.ac
[thirdparty/sarg.git] / documentation / usertab.txt
1 /*!\file
2 \brief Provide a meanigfull name instead of the user ID or IP address shown in the
3 reports.
4 */
5
6
7 /*! \enum UserTabEnum
8 The possible sources to map the user ID or IP address to the name to display
9 in the reports.
10 */
11
12
13
14
15
16 /*! \var enum UserTabEnum which_usertab
17 Tell the database source to use to map the user ID or IP address to a meaningfull
18 name.
19 */
20
21
22
23
24
25 /*! \fn void init_usertab(const char *UserTabFile)
26 Initialize the data used by user_find().
27
28 If \a UserTabFile is ldap, the user ID is fetched from a LDAP server.
29
30 \param UserTabFile The name of the file to read or ldap. If it is empty, the function does nothing.
31
32 \note The memory and resources allocated by this function must be released by
33 a call to close_usertab().
34 */
35
36
37
38
39
40 /*! \fn void user_find(char *mappedname, int namelen, const char *userlogin)
41 Find the real name of the user with the ID or IP address in \a userlogin. The name is fetched
42 from the source initialized by init_usertab().
43
44 The usertab data must have been initialized by init_usertab().
45
46 \param mappedname A buffer to write the real name of the user.
47 \param namelen The size of the buffer.
48 \param userlogin The ID or IP address of the user.
49 */
50
51
52
53
54
55 /*! \fn void close_usertab(void)
56 Free the memory and resources allocated by init_usertab().
57 */
58
59
60
61
62
63 /*! \fn static void init_file_usertab(const char *UserTabFile)
64 Read the \a UserTabFile database.
65
66 The file contains the IP address or ID of the user then some spaces and
67 the real name of the user to show in the report.
68
69 Any trailing space or tabulation is removed from the real name. The user ID or IP cannot contain
70 a space or a tabulation but it may contain any other character, including the colon that was
71 forbidden in the past. That change was made to allow IPv6 addresses.
72
73 The file may contain comments if the line starts with a #.
74
75 \param UserTabFile The name of the file to read.
76 */
77
78
79
80
81
82 /*! \fn static void get_usertab_name(const char *user,char *name,int namelen)
83 Get the real name of the user from the usertab file read by init_file_usertab().
84
85 \param user The user ID or IP address to search.
86 \param name The buffer to store the real name of the user.
87 \param namelen The size of the \a name buffer.
88
89 If the user ID or IP address isn't found, the output buffer \a name contains
90 the unmatched input string.
91 */
92
93
94
95
96
97 /*! \fn static void init_ldap_usertab(void)
98 Initialize the communication with the LDAP server whose name is in
99 ::LDAPHost and connect to port ::LDAPPort.
100 */
101
102
103
104
105
106 /*! \fn static void get_ldap_name(const char *userlogin,char *mappedname,int namelen)
107 Get the real name of a user by searching the userlogin (user ID) in a LDAP.
108
109 \param userlogin The user ID to search.
110 \param name The buffer to store the real name of the user.
111 \param namelen The size of the \a name buffer.
112
113 If the user ID isn't found in the LDAP, the output buffer \a name contains
114 the unmatched input string.
115 */