2 * Copyright (c) 1990,1993 Regents of The University of Michigan.
3 * All Rights Reserved. See COPYRIGHT.
7 #define AFPD_GLOBALS_H 1
13 #include <sys/types.h>
14 #endif /* ADMIN_GRP */
17 #include <netdb.h> /* this isn't header-protected under ultrix */
18 #endif /* HAVE_NETDB_H */
20 #include <netatalk/at.h>
21 #include <atalk/afp.h>
22 #include <atalk/compat.h>
23 #include <atalk/unicode.h>
24 #include <atalk/uam.h>
27 #define MAXUSERLEN 256
29 #define OPTION_DEBUG (1 << 0)
30 #define OPTION_USERVOLFIRST (1 << 1)
31 #define OPTION_NOUSERVOL (1 << 2)
32 #define OPTION_PROXY (1 << 3)
33 #define OPTION_CUSTOMICON (1 << 4)
34 #define OPTION_NOSLP (1 << 5)
35 #define OPTION_ANNOUNCESSH (1 << 6)
36 #define OPTION_UUID (1 << 7)
37 #define OPTION_ACL2MACCESS (1 << 8)
38 #define OPTION_NOZEROCONF (1 << 9)
40 /* a couple of these options could get stuck in unions to save
42 struct afp_volume_name {
50 int connections, transports, tickleval, timeout, server_notif, flags, dircachesize;
51 int sleep; /* Maximum time allowed to sleep (in tickles) */
52 int disconnected; /* Maximum time in disconnected state (in tickles) */
53 unsigned char passwdbits, passwdminlen, loginmaxfail;
54 u_int32_t server_quantum;
55 char hostname[MAXHOSTNAMELEN + 1], *server, *ipaddr, *port, *configfile;
60 struct afp_volume_name defaultvol, systemvol, uservol;
63 char *guest, *loginmesg, *keyfile, *passwdfile;
67 unsigned char signature[16];
68 char *k5service, *k5realm, *k5keytab;
69 char *unixcodepage,*maccodepage;
70 charset_t maccharset, unixcharset;
75 #endif /* ADMIN_GRP */
78 /* default value for winbind authentication */
79 char *ntdomain, *ntseparator;
83 #define AFPOBJ_TMPSIZ (MAXPATHLEN)
84 typedef struct _AFPObj {
86 unsigned long servernum;
87 void *handle; /* either (DSI *) or (ASP *) */
89 struct afp_options options;
90 char *Obj, *Type, *Zone;
91 char username[MAXUSERLEN];
92 void (*logout)(void), (*exit)(int);
93 int (*reply)(void *, int);
94 int (*attention)(void *, AFPUserBytes);
95 /* to prevent confusion, only use these in afp_* calls */
96 char oldtmp[AFPOBJ_TMPSIZ + 1], newtmp[AFPOBJ_TMPSIZ + 1];
97 void *uam_cookie; /* cookie for uams */
98 struct session_info sinfo;
99 uid_t uid; /* client running user id */
100 int ipc_fd; /* anonymous PF_UNIX socket for IPC with afpd parent */
103 /* typedef for AFP functions handlers */
104 typedef int (*AFPCmd)(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen);
107 extern AFPObj *AFPobj;
109 extern int afp_version;
110 extern int afp_errno;
111 extern unsigned char nologin;
112 extern struct dir *curdir;
113 extern char getwdbuf[];
116 extern const char *Cnid_srv;
117 extern const char *Cnid_port;
119 extern int get_afp_errno (const int param);
120 extern void afp_options_init (struct afp_options *);
121 extern int afp_options_parse (int, char **, struct afp_options *);
122 extern int afp_options_parseline (char *, struct afp_options *);
123 extern void afp_options_free (struct afp_options *,
124 const struct afp_options *);
125 extern void setmessage (const char *);
126 extern void readmessage (AFPObj *);
129 extern void initline (int, char *);
130 extern int parseline (int, char *);
133 extern const char *AfpNum2name (int );
134 extern const char *AfpErr2name(int err);
137 extern struct dir rootParent;
139 extern void afp_over_dsi (AFPObj *);
141 #endif /* globals.h */