]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/globals.h
0b07ac219557b62632dad0e6c61529e87d825b50
[netatalk.git] / etc / afpd / globals.h
1 /*
2  * Copyright (c) 1990,1993 Regents of The University of Michigan.
3  * All Rights Reserved.  See COPYRIGHT.
4  */
5
6 #ifndef AFPD_GLOBALS_H
7 #define AFPD_GLOBALS_H 1
8
9 #include <sys/param.h>
10 #include <sys/cdefs.h>
11 #include <netdb.h>  /* this isn't header-protected under ultrix */
12 #include <netatalk/at.h>
13 #include <atalk/afp.h>
14 #include <atalk/compat.h>
15
16 /* test for inline */
17 #ifndef __inline__
18 #define __inline__
19 #endif
20
21 #define MACFILELEN 31
22
23
24 #define OPTION_DEBUG         (1 << 0)
25 #define OPTION_USERVOLFIRST  (1 << 1)
26 #define OPTION_NOUSERVOL     (1 << 2)
27 #define OPTION_PROXY         (1 << 3)
28 #define OPTION_CUSTOMICON    (1 << 4)
29
30 /* a couple of these options could get stuck in unions to save
31  * space. */
32 struct afp_options {
33   int connections, port, transports, tickleval, flags;
34   unsigned char passwdbits, passwdminlen, loginmaxfail;
35   u_int32_t server_quantum;
36   char hostname[MAXHOSTNAMELEN + 1], *server, *ipaddr, *configfile;
37   struct at_addr ddpaddr;
38   char *uampath, *nlspath, *fqdn;
39   char *pidfile, *defaultvol, *systemvol;
40   char *guest, *loginmesg, *keyfile, *passwdfile;
41   char *uamlist;
42 };
43
44 #define AFPOBJ_TMPSIZ (MAXPATHLEN)
45 typedef struct AFPObj {
46   int proto;
47   unsigned long servernum;
48   void *handle, *config;
49   struct afp_options options;
50   char *Obj, *Type, *Zone;
51   char username[MACFILELEN + 1];
52   void (*logout)(void), (*exit)(int);
53   int (*reply)(void *, int);
54   int (*attention)(void *, AFPUserBytes);
55   /* to prevent confusion, only use these in afp_* calls */
56   char oldtmp[AFPOBJ_TMPSIZ + 1], newtmp[AFPOBJ_TMPSIZ + 1];
57   void *uam_cookie; /* cookie for uams */
58 } AFPObj;
59
60 extern int              afp_version;
61 extern unsigned char    nologin;
62 extern struct vol       *volumes;
63 extern struct dir       *curdir;
64 extern char             getwdbuf[];
65
66 extern void afp_options_init __P((struct afp_options *));
67 extern int afp_options_parse __P((int, char **, struct afp_options *));
68 extern int afp_options_parseline __P((char *, struct afp_options *));
69 extern void afp_options_free __P((struct afp_options *, 
70                                   const struct afp_options *));
71 extern void setmessage __P((const char *));
72 extern void readmessage __P((void));
73
74 /* gettok.c */
75 extern void initline   __P((int, char *));
76 extern int  parseline  __P((int, char *));
77
78 #ifndef NO_DDP
79 extern void afp_over_asp __P((AFPObj *));
80 #endif
81 extern void afp_over_dsi __P((AFPObj *));
82
83 #endif /* globals.h */