summaryrefslogtreecommitdiff
path: root/nslcd.h
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2006-11-02 14:13:21 +0000
committerArthur de Jong <arthur@arthurdejong.org>2006-11-02 14:13:21 +0000
commiteee4fc27f887ed7c66e0b85e5b8b592eb28e134d (patch)
tree09c73592b74a6db144dae16c386da5cf5e921535 /nslcd.h
parentfbafd084e0829b25ec2a876123f17d2510552d7e (diff)
rename some constants and switch to a more sane naming scheme
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@56 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd.h')
-rw-r--r--nslcd.h72
1 files changed, 35 insertions, 37 deletions
diff --git a/nslcd.h b/nslcd.h
index b58d5d0..9ad5cf5 100644
--- a/nslcd.h
+++ b/nslcd.h
@@ -24,44 +24,42 @@
#define _NSLCD_H 1
/*
- The protocol used between the nslcd client and server
- is a simple binary protocol. It is request/response based
- where the client initiates a connection, does a single request
- and closes the connection again. Any mangled messages will be
- silently ignored by the server.
+ The protocol used between the nslcd client and server is a simple binary
+ protocol. It is request/response based where the client initiates a
+ connection, does a single request and closes the connection again. Any
+ mangled or not understood messages will be silently ignored by the server.
A request looks like:
int32 NSLCD_VERSION
- int32 NSLCD_RT_*
+ int32 NSLCD_ACTION_*
[request parameters if any]
A response looks like:
int32 NSLCD_VERSION
- int32 NSLCD_RT_* (the original request type)
+ int32 NSLCD_ACTION_* (the original request type)
int32 NSLCD_RS_* (response code)
[result value(s)]
- If a response would return multiple values (e.g. for the
- NSLCD_RT_GETPWDALL function) each return value will be preceded
- by a NSLCD_RS_* value.
+ If a response would return multiple values (e.g. for NSLCD_ACTION_*_ALL
+ functions) each return value will be preceded by a NSLCD_RS_* value.
These are the available data types:
INT32 - 32-bit integer value
TYPE - a typed field that is transferred using sizeof()
- STRING - a string length (32bit) followed by the string value
- (not null-terminted)
- LOOP - a 32-bit number noting the number of entries followed
- by the entries one at a time
+ STRING - a string length (32bit) followed by the string value (not
+ null-terminted)
+ LOOP - a 32-bit number noting the number of entries followed by the
+ entries one at a time
- Compound datatypes (such as PASSWD) are defined below as a
- combination of the above types. They are defined as macros so
- they can be expanded to code later on.
+ Compound datatypes (such as PASSWD) are defined below as a combination of
+ the above types. They are defined as macros so they can be expanded to code
+ later on.
The protocol is described in this generic fashion (instead of just
- transferring the allocated memory) because pointers will not
- be valid between transfers and this also makes the server
- independant of the NSS implementation.
+ transferring the allocated memory) because pointers will not be valid
+ between transfers and this also makes the server independant of the NSS
+ implementation.
*/
-/* used for transferring struct alias information */
+/* used for transferring alias information */
#define LDF_ALIAS \
LDF_STRING(ALIAS_NAME) \
LDF_LOOP( \
@@ -74,7 +72,7 @@
#define LDF_ETHER \
LDF_TYPE(ETHER_ADDR,u_int8_t[6])
-/* a group entry from /etc/group (struct group) */
+/* used for transferring group and membership information */
#define LDF_GROUP \
LDF_STRING(GROUP_NAME) \
LDF_STRING(GROUP_PASSWD) \
@@ -89,7 +87,7 @@
/* NETWORKS - TBD - struct netent */
-/* used for transferring struct passwd information */
+/* used for transferring user (/etc/passwd) information */
#define LDF_PASSWD \
LDF_STRING(PASSWD_NAME) \
LDF_STRING(PASSWD_PASSWD) \
@@ -123,21 +121,21 @@
#define NSLCD_VERSION 1
/* Request types. */
-#define NSLCD_RT_ALIAS_BYNAME 4001
-#define NSLCD_RT_GETPWBYNAME 1001
-#define NSLCD_RT_GETPWBYUID 1002
-#define NSLCD_RT_GETPWALL 1004
-#define NSLCD_RT_GETGRBYNAME 2003
-#define NSLCD_RT_GETGRBYGID 2004
-#define NSLCD_RT_GETHOSTBYNAME 3005
-#define NSLCD_RT_GETHOSTBYADDR 3008
+#define NSLCD_ACTION_ALIAS_BYNAME 4001
+#define NSLCD_ACTION_ALIAS_ALL 4002
#define NSLCD_ACTION_GROUP_BYNAME 5001
#define NSLCD_ACTION_GROUP_BYGID 5002
-#define NSLCD_ACTION_GROUP_ALL 5003
-
-/* Request result. */
-#define NSLCD_RS_UNAVAIL 2 /* sevice unavailable */
-#define NSLCD_RS_NOTFOUND 3 /* key was not found */
-#define NSLCD_RS_SUCCESS 0 /* everything ok */
+#define NSLCD_ACTION_GROUP_BYMEMBER 5003
+#define NSLCD_ACTION_GROUP_ALL 5004
+#define NSLCD_ACTION_PASSWD_BYNAME 1001
+#define NSLCD_ACTION_PASSWD_BYUID 1002
+#define NSLCD_ACTION_PASSWD_ALL 1004
+
+/* Request result codes. */
+#define NSLCD_RESULT_NOTFOUND 3 /* key was not found */
+#define NSLCD_RESULT_SUCCESS 0 /* everything ok */
+
+/* We need this for now, get rid of it later. */
+#define NSLCD_RESULT_UNAVAIL 2 /* sevice unavailable */
#endif /* not _NSLCD_H */