]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/globals.h
Merge master
[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
11 #ifdef ADMIN_GRP
12 #include <grp.h>
13 #include <sys/types.h>
14 #endif /* ADMIN_GRP */
15
16 #ifdef HAVE_NETDB_H
17 #include <netdb.h>  /* this isn't header-protected under ultrix */
18 #endif /* HAVE_NETDB_H */
19
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>
25
26 #define MACFILELEN 31
27 #define MAXUSERLEN 256
28
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)
39
40 /* a couple of these options could get stuck in unions to save
41  * space. */
42 struct afp_volume_name {
43     time_t     mtime;
44     char       *name;
45     char       *full_name;
46     int        loaded;
47 };
48
49 struct afp_options {
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;
56     char *uampath, *fqdn;
57     char *pidfile;
58     char *sigconffile;
59     char *uuidconf;
60     struct afp_volume_name defaultvol, systemvol, uservol;
61     int  closevol;
62
63     char *guest, *loginmesg, *keyfile, *passwdfile;
64     char *uamlist;
65     char *authprintdir;
66     char *signatureopt;
67     unsigned char signature[16];
68     char *k5service, *k5realm, *k5keytab;
69     char *unixcodepage,*maccodepage;
70     charset_t maccharset, unixcharset; 
71     mode_t umask;
72     mode_t save_mask;
73 #ifdef ADMIN_GRP
74     gid_t admingid;
75 #endif /* ADMIN_GRP */
76     int    volnamelen;
77
78     /* default value for winbind authentication */
79     char *ntdomain, *ntseparator;
80     char *logconfig;
81 };
82
83 #define AFPOBJ_TMPSIZ (MAXPATHLEN)
84 typedef struct _AFPObj {
85     int proto;
86     unsigned long servernum;
87     void *handle;               /* either (DSI *) or (ASP *) */
88     void *config; 
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 */
101 } AFPObj;
102
103 /* typedef for AFP functions handlers */
104 typedef int (*AFPCmd)(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,  size_t *rbuflen);
105
106 /* afp_dsi.c */
107 extern AFPObj *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 const char *Cnid_srv;
117 extern const char *Cnid_port;
118
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 *);
127
128 /* gettok.c */
129 extern void initline   (int, char *);
130 extern int  parseline  (int, char *);
131
132 /* afp_util.c */
133 extern const char *AfpNum2name (int );
134 extern const char *AfpErr2name(int err);
135
136 /* directory.c */
137 extern struct dir rootParent;
138
139 extern void afp_over_dsi (AFPObj *);
140
141 #endif /* globals.h */