]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/globals.h
replace remaining %m printf glibc extension with %s strerror(errno)
[netatalk.git] / etc / afpd / globals.h
1 /*
2  * $Id: globals.h,v 1.18.2.2.2.5 2004-06-15 00:35:06 bfernhomberg Exp $
3  *
4  * Copyright (c) 1990,1993 Regents of The University of Michigan.
5  * All Rights Reserved.  See COPYRIGHT.
6  */
7
8 #ifndef AFPD_GLOBALS_H
9 #define AFPD_GLOBALS_H 1
10
11 #include <sys/param.h>
12 #include <sys/cdefs.h>
13
14 #ifdef ADMIN_GRP
15 #include <grp.h>
16 #include <sys/types.h>
17 #endif /* ADMIN_GRP */
18
19 #ifdef HAVE_NETDB_H
20 #include <netdb.h>  /* this isn't header-protected under ultrix */
21 #endif /* HAVE_NETDB_H */
22
23 #include <netatalk/at.h>
24 #include <atalk/afp.h>
25 #include <atalk/compat.h>
26 #include <atalk/unicode.h>
27 #include <atalk/uam.h>
28
29 /* test for inline */
30 #ifndef __inline__
31 #define __inline__
32 #endif
33
34 #define MACFILELEN 31
35
36 #define OPTION_DEBUG         (1 << 0)
37 #define OPTION_USERVOLFIRST  (1 << 1)
38 #define OPTION_NOUSERVOL     (1 << 2)
39 #define OPTION_PROXY         (1 << 3)
40 #define OPTION_CUSTOMICON    (1 << 4)
41 #define OPTION_NOSLP         (1 << 5)
42 #define OPTION_ANNOUNCESSH   (1 << 6)
43
44 #ifdef FORCE_UIDGID
45 /* set up a structure for this */
46 typedef struct uidgidset_t {
47     uid_t uid;
48     gid_t gid;
49 } uidgidset;
50 #endif /* FORCE_UIDGID */
51
52 /* a couple of these options could get stuck in unions to save
53  * space. */
54 struct afp_volume_name {
55     time_t     mtime;
56     char       *name;
57     char       *full_name;
58     int        loaded;
59 };
60
61 struct afp_options {
62     int connections, port, transports, tickleval, timeout, server_notif, flags;
63     unsigned char passwdbits, passwdminlen, loginmaxfail;
64     u_int32_t server_quantum;
65     char hostname[MAXHOSTNAMELEN + 1], *server, *ipaddr, *configfile;
66     struct at_addr ddpaddr;
67     char *uampath, *fqdn;
68     char *pidfile;
69     struct afp_volume_name defaultvol, systemvol, uservol;
70
71     char *guest, *loginmesg, *keyfile, *passwdfile;
72     char *uamlist;
73     char *authprintdir;
74     char *signature;
75     char *k5service, *k5realm, *k5keytab;
76     char *unixcodepage,*maccodepage;
77     charset_t maccharset, unixcharset; 
78     mode_t umask;
79     mode_t save_mask;
80     int    sleep;
81 #ifdef ADMIN_GRP
82     gid_t admingid;
83 #endif /* ADMIN_GRP */
84 };
85
86 #define AFPOBJ_TMPSIZ (MAXPATHLEN)
87 typedef struct AFPObj {
88     int proto;
89     unsigned long servernum;
90     void *handle, *config;
91     struct afp_options options;
92     char *Obj, *Type, *Zone;
93     char username[MACFILELEN + 1];
94     void (*logout)(void), (*exit)(int);
95     int (*reply)(void *, int);
96     int (*attention)(void *, AFPUserBytes);
97     void (*sleep)(void);
98     /* to prevent confusion, only use these in afp_* calls */
99     char oldtmp[AFPOBJ_TMPSIZ + 1], newtmp[AFPOBJ_TMPSIZ + 1];
100     void *uam_cookie; /* cookie for uams */
101     struct session_info  sinfo;
102
103 #ifdef FORCE_UIDGID
104     int                 force_uid;
105     uidgidset           uidgid;
106 #endif
107 } AFPObj;
108
109 extern int              afp_version;
110 extern int              afp_errno;
111 extern unsigned char    nologin;
112 extern struct dir       *curdir;
113 extern char             getwdbuf[];
114
115 /* FIXME CNID */
116 extern char             Cnid_srv[MAXHOSTNAMELEN + 1];
117 extern int              Cnid_port;
118
119 extern int  get_afp_errno   __P((const int param));
120 extern void afp_options_init __P((struct afp_options *));
121 extern int afp_options_parse __P((int, char **, struct afp_options *));
122 extern int afp_options_parseline __P((char *, struct afp_options *));
123 extern void afp_options_free __P((struct afp_options *,
124                                       const struct afp_options *));
125 extern void setmessage __P((const char *));
126 extern void readmessage __P((AFPObj *));
127
128 /* gettok.c */
129 extern void initline   __P((int, char *));
130 extern int  parseline  __P((int, char *));
131
132 /* afp_util.c */
133 const char *AfpNum2name __P((int ));
134
135 #ifndef NO_DDP
136 extern void afp_over_asp __P((AFPObj *));
137 #endif /* NO_DDP */
138 extern void afp_over_dsi __P((AFPObj *));
139
140 #endif /* globals.h */