]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/globals.h
add -advertise_ssh flag to afpd.conf, if set announce SSH tunneling capabilities.
[netatalk.git] / etc / afpd / globals.h
1 /*
2  * $Id: globals.h,v 1.18.2.2.2.4 2004-06-09 02:07:15 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
28 /* test for inline */
29 #ifndef __inline__
30 #define __inline__
31 #endif
32
33 #define MACFILELEN 31
34
35 #define OPTION_DEBUG         (1 << 0)
36 #define OPTION_USERVOLFIRST  (1 << 1)
37 #define OPTION_NOUSERVOL     (1 << 2)
38 #define OPTION_PROXY         (1 << 3)
39 #define OPTION_CUSTOMICON    (1 << 4)
40 #define OPTION_NOSLP         (1 << 5)
41 #define OPTION_ANNOUNCESSH   (1 << 6)
42
43 #ifdef FORCE_UIDGID
44 /* set up a structure for this */
45 typedef struct uidgidset_t {
46     uid_t uid;
47     gid_t gid;
48 } uidgidset;
49 #endif /* FORCE_UIDGID */
50
51 /* a couple of these options could get stuck in unions to save
52  * space. */
53 struct afp_volume_name {
54     time_t     mtime;
55     char       *name;
56     char       *full_name;
57     int        loaded;
58 };
59
60 struct afp_options {
61     int connections, port, transports, tickleval, timeout, server_notif, flags;
62     unsigned char passwdbits, passwdminlen, loginmaxfail;
63     u_int32_t server_quantum;
64     char hostname[MAXHOSTNAMELEN + 1], *server, *ipaddr, *configfile;
65     struct at_addr ddpaddr;
66     char *uampath, *fqdn;
67     char *pidfile;
68     struct afp_volume_name defaultvol, systemvol, uservol;
69
70     char *guest, *loginmesg, *keyfile, *passwdfile;
71     char *uamlist;
72     char *authprintdir;
73     char *signature;
74     char *k5service, *k5realm, *k5keytab;
75     char *unixcodepage,*maccodepage;
76     charset_t maccharset, unixcharset; 
77     mode_t umask;
78     mode_t save_mask;
79     int    sleep;
80 #ifdef ADMIN_GRP
81     gid_t admingid;
82 #endif /* ADMIN_GRP */
83 };
84
85 #define AFPOBJ_TMPSIZ (MAXPATHLEN)
86 typedef struct AFPObj {
87     int proto;
88     unsigned long servernum;
89     void *handle, *config;
90     struct afp_options options;
91     char *Obj, *Type, *Zone;
92     char username[MACFILELEN + 1];
93     void (*logout)(void), (*exit)(int);
94     int (*reply)(void *, int);
95     int (*attention)(void *, AFPUserBytes);
96     void (*sleep)(void);
97     /* to prevent confusion, only use these in afp_* calls */
98     char oldtmp[AFPOBJ_TMPSIZ + 1], newtmp[AFPOBJ_TMPSIZ + 1];
99     void *uam_cookie; /* cookie for uams */
100
101 #ifdef FORCE_UIDGID
102     int                 force_uid;
103     uidgidset           uidgid;
104 #endif
105 } AFPObj;
106
107 extern int              afp_version;
108 extern int              afp_errno;
109 extern unsigned char    nologin;
110 extern struct dir       *curdir;
111 extern char             getwdbuf[];
112
113 /* FIXME CNID */
114 extern char             Cnid_srv[MAXHOSTNAMELEN + 1];
115 extern int              Cnid_port;
116
117 extern int  get_afp_errno   __P((const int param));
118 extern void afp_options_init __P((struct afp_options *));
119 extern int afp_options_parse __P((int, char **, struct afp_options *));
120 extern int afp_options_parseline __P((char *, struct afp_options *));
121 extern void afp_options_free __P((struct afp_options *,
122                                       const struct afp_options *));
123 extern void setmessage __P((const char *));
124 extern void readmessage __P((AFPObj *));
125
126 /* gettok.c */
127 extern void initline   __P((int, char *));
128 extern int  parseline  __P((int, char *));
129
130 /* afp_util.c */
131 const char *AfpNum2name __P((int ));
132
133 #ifndef NO_DDP
134 extern void afp_over_asp __P((AFPObj *));
135 #endif /* NO_DDP */
136 extern void afp_over_dsi __P((AFPObj *));
137
138 #endif /* globals.h */