summaryrefslogtreecommitdiff
path: root/nss/protocols.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2010-10-04 20:27:57 +0000
committerArthur de Jong <arthur@arthurdejong.org>2010-10-04 20:27:57 +0000
commitd5c07d9403bc42f08de10331979a73f2db399b59 (patch)
treed4be106bf36e52c0ff2ee11132f5accbc5cb2180 /nss/protocols.c
parent6a2c600499039036b1fa0efcd45747b21308375c (diff)
parent24fae4c5df0c5152891893ab677edb4a9b497d11 (diff)
merge changes from trunk
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1242 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nss/protocols.c')
-rw-r--r--nss/protocols.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/nss/protocols.c b/nss/protocols.c
index ded7b17..0ead9a3 100644
--- a/nss/protocols.c
+++ b/nss/protocols.c
@@ -30,6 +30,7 @@
#include "common.h"
#include "compat/attrs.h"
+/* read a single protocol entry from the stream */
static nss_status_t read_protoent(
TFILE *fp,struct protoent *result,
char *buffer,size_t buflen,int *errnop)
@@ -44,9 +45,10 @@ static nss_status_t read_protoent(
#ifdef NSS_FLAVOUR_GLIBC
+/* get a protocol entry by name */
nss_status_t _nss_ldap_getprotobyname_r(
- const char *name,struct protoent *result,char *buffer,
- size_t buflen,int *errnop)
+ const char *name,struct protoent *result,
+ char *buffer,size_t buflen,int *errnop)
{
NSS_BYNAME(NSLCD_ACTION_PROTOCOL_BYNAME,buffer,buflen,
name,
@@ -54,9 +56,10 @@ nss_status_t _nss_ldap_getprotobyname_r(
return retv;
}
+/* get a protocol entry by number */
nss_status_t _nss_ldap_getprotobynumber_r(
- int number,struct protoent *result,char *buffer,
- size_t buflen,int *errnop)
+ int number,struct protoent *result,
+ char *buffer,size_t buflen,int *errnop)
{
NSS_BYINT32(NSLCD_ACTION_PROTOCOL_BYNUMBER,buffer,buflen,
number,
@@ -67,19 +70,23 @@ nss_status_t _nss_ldap_getprotobynumber_r(
/* thread-local file pointer to an ongoing request */
static __thread TFILE *protoentfp;
+/* start a request to read all protocol entries */
nss_status_t _nss_ldap_setprotoent(int UNUSED(stayopen))
{
NSS_SETENT(protoentfp);
}
+/* get a single protocol entry */
nss_status_t _nss_ldap_getprotoent_r(
- struct protoent *result,char *buffer,size_t buflen,int *errnop)
+ struct protoent *result,
+ char *buffer,size_t buflen,int *errnop)
{
NSS_GETENT(protoentfp,NSLCD_ACTION_PROTOCOL_ALL,buffer,buflen,
read_protoent(protoentfp,result,buffer,buflen,errnop));
return retv;
}
+/* close the stream opened by setprotoent() above */
nss_status_t _nss_ldap_endprotoent(void)
{
NSS_ENDENT(protoentfp);