2 * Copyright (c) 1990,1993 Regents of The University of Michigan.
3 * All Rights Reserved. See COPYRIGHT.
7 #define AFPD_GLOBALS_H 1
10 #include <sys/cdefs.h>
14 #include <sys/types.h>
15 #endif /* ADMIN_GRP */
18 #include <netdb.h> /* this isn't header-protected under ultrix */
19 #endif /* HAVE_NETDB_H */
21 #include <netatalk/at.h>
22 #include <atalk/afp.h>
23 #include <atalk/compat.h>
24 #include <atalk/unicode.h>
25 #include <atalk/uam.h>
28 #define MAXUSERLEN 256
30 #define OPTION_DEBUG (1 << 0)
31 #define OPTION_USERVOLFIRST (1 << 1)
32 #define OPTION_NOUSERVOL (1 << 2)
33 #define OPTION_PROXY (1 << 3)
34 #define OPTION_CUSTOMICON (1 << 4)
35 #define OPTION_NOSLP (1 << 5)
36 #define OPTION_ANNOUNCESSH (1 << 6)
37 #define OPTION_UUID (1 << 7)
38 #define OPTION_ACL2MACCESS (1 << 8)
39 #define OPTION_NOZEROCONF (1 << 9)
40 #define OPTION_CATSEARCH_DB (1 << 10)
43 /* set up a structure for this */
44 typedef struct uidgidset_t {
48 #endif /* FORCE_UIDGID */
50 /* a couple of these options could get stuck in unions to save
52 struct afp_volume_name {
60 int connections, transports, tickleval, timeout, server_notif, flags, dircachesize;
61 unsigned char passwdbits, passwdminlen, loginmaxfail;
62 u_int32_t server_quantum;
63 char hostname[MAXHOSTNAMELEN + 1], *server, *ipaddr, *port, *configfile;
64 struct at_addr ddpaddr;
69 struct afp_volume_name defaultvol, systemvol, uservol;
72 char *guest, *loginmesg, *keyfile, *passwdfile;
76 unsigned char signature[16];
77 char *k5service, *k5realm, *k5keytab;
78 char *unixcodepage,*maccodepage;
79 charset_t maccharset, unixcharset;
85 #endif /* ADMIN_GRP */
88 /* default value for winbind authentication */
89 char *ntdomain, *ntseparator;
93 #define AFPOBJ_TMPSIZ (MAXPATHLEN)
94 typedef struct _AFPObj {
96 unsigned long servernum;
97 void *handle; /* either (DSI *) or (ASP *) */
99 struct afp_options options;
100 char *Obj, *Type, *Zone;
101 char username[MAXUSERLEN];
102 void (*logout)(void), (*exit)(int);
103 int (*reply)(void *, int);
104 int (*attention)(void *, AFPUserBytes);
106 /* to prevent confusion, only use these in afp_* calls */
107 char oldtmp[AFPOBJ_TMPSIZ + 1], newtmp[AFPOBJ_TMPSIZ + 1];
108 void *uam_cookie; /* cookie for uams */
109 struct session_info sinfo;
110 uid_t uid; /* client running user id */
118 /* typedef for AFP functions handlers */
119 typedef int (*AFPCmd)(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen);
122 extern AFPObj *AFPobj;
124 extern int afp_version;
125 extern int afp_errno;
126 extern unsigned char nologin;
127 extern struct dir *curdir;
128 extern char getwdbuf[];
131 extern const char *Cnid_srv;
132 extern const char *Cnid_port;
134 extern int get_afp_errno (const int param);
135 extern void afp_options_init (struct afp_options *);
136 extern int afp_options_parse (int, char **, struct afp_options *);
137 extern int afp_options_parseline (char *, struct afp_options *);
138 extern void afp_options_free (struct afp_options *,
139 const struct afp_options *);
140 extern void setmessage (const char *);
141 extern void readmessage (AFPObj *);
144 extern void initline (int, char *);
145 extern int parseline (int, char *);
148 extern const char *AfpNum2name (int );
149 extern const char *AfpErr2name(int err);
152 extern struct dir rootParent;
155 extern void afp_over_asp (AFPObj *);
157 extern void afp_over_dsi (AFPObj *);
159 #endif /* globals.h */