waffle

user and group backend daemon
git clone git://git.2f30.org/waffle
Log | Files | Refs | LICENSE

waffle.h (1072B)


      1 /* See LICENSE file for copyright and license details. */
      2 #include <sys/types.h>
      3 #include <grp.h>
      4 #include <pwd.h>
      5 #include "paths.h"
      6 #include "proto.h"
      7 
      8 #define LEN(x) (sizeof (x) / sizeof *(x))
      9 
     10 struct backend_ops {
     11 	int (*init)(void);
     12 	void (*term)(void);
     13 	int (*pwbyname)(const char *, struct passwd *);
     14 	int (*pwbyuid)(uid_t, struct passwd *);
     15 	int (*grbyname)(const char *, struct group *);
     16 	int (*grbygid)(gid_t, struct group *);
     17 };
     18 
     19 /* waffle.c */
     20 extern int daemonize;
     21 extern int verbose;
     22 /* dummy.c */
     23 extern struct backend_ops dummy_ops;
     24 /* ldap.c */
     25 extern struct backend_ops ldap_ops;
     26 
     27 /* req.c */
     28 int handle_req(int);
     29 int process_req(int, struct nscdreq *, char *);
     30 
     31 /* backend.c */
     32 int backends_init(void);
     33 void backends_term(void);
     34 int backends_pwbyname(const char *, struct passwd *);
     35 int backends_pwbyuid(const char *, struct passwd *);
     36 int backends_grbyname(const char *, struct group *);
     37 int backends_grbygid(const char *, struct group *);
     38 
     39 /* util.c */
     40 void loginfo(const char *, ...);
     41 void logwarn(const char *, ...);
     42 void logerr(const char *, ...);