updated on Sat Jan 14 12:12:45 UTC 2012
[aur-mirror.git] / afpfs-ng / fix_afpfs-ng_includes.patch
blobf507a485ef86927b31171dc6b26224c0fb83cd44
1 diff -Naur afpfs-ng-0.8.1/cmdline/cmdline_afp.c afpfs-ng-0.8.1.patch/cmdline/cmdline_afp.c
2 --- afpfs-ng-0.8.1/cmdline/cmdline_afp.c 2008-02-19 02:54:19.000000000 +0100
3 +++ afpfs-ng-0.8.1.patch/cmdline/cmdline_afp.c 2011-09-10 12:13:50.102124369 +0200
4 @@ -3,9 +3,9 @@
6 */
8 -#include "afp.h"
9 -#include "midlevel.h"
10 -#include "map_def.h"
11 +#include "afpfs-ng/afp.h"
12 +#include "afpfs-ng/midlevel.h"
13 +#include "afpfs-ng/map_def.h"
15 #include <string.h>
16 #include <stdio.h>
17 diff -Naur afpfs-ng-0.8.1/cmdline/cmdline_testafp.c afpfs-ng-0.8.1.patch/cmdline/cmdline_testafp.c
18 --- afpfs-ng-0.8.1/cmdline/cmdline_testafp.c 2008-03-04 21:16:50.000000000 +0100
19 +++ afpfs-ng-0.8.1.patch/cmdline/cmdline_testafp.c 2011-09-10 12:13:50.102124369 +0200
20 @@ -3,8 +3,8 @@
24 -#include "afp.h"
25 -#include "midlevel.h"
26 +#include "afpfs-ng/afp.h"
27 +#include "afpfs-ng/midlevel.h"
29 #include "cmdline_main.h"
31 diff -Naur afpfs-ng-0.8.1/cmdline/getstatus.c afpfs-ng-0.8.1.patch/cmdline/getstatus.c
32 --- afpfs-ng-0.8.1/cmdline/getstatus.c 2008-02-18 04:28:09.000000000 +0100
33 +++ afpfs-ng-0.8.1.patch/cmdline/getstatus.c 2011-09-10 12:13:50.109124463 +0200
34 @@ -2,7 +2,7 @@
35 #include <string.h>
36 #include <pthread.h>
38 -#include "afp.h"
39 +#include "afpfs-ng/afp.h"
41 static int getstatus(char * address_string, unsigned int port)
43 diff -Naur afpfs-ng-0.8.1/configure.ac afpfs-ng-0.8.1.patch/configure.ac
44 --- afpfs-ng-0.8.1/configure.ac 2008-03-08 17:23:12.000000000 +0100
45 +++ afpfs-ng-0.8.1.patch/configure.ac 2011-09-10 12:13:50.109124463 +0200
46 @@ -11,6 +11,7 @@
47 AC_PROG_CC
48 AC_PROG_INSTALL
49 AC_PROG_LIBTOOL
50 +AM_PROG_CC_C_O
52 # Checks for libraries.
53 # FIXME: Replace `main' with a function in `-lncurses':
54 @@ -105,7 +106,7 @@
58 -AC_CONFIG_FILES([lib/Makefile fuse/Makefile cmdline/Makefile Makefile docs/Makefile])
59 +AC_CONFIG_FILES([lib/Makefile fuse/Makefile cmdline/Makefile Makefile include/Makefile include/afpfs-ng/Makefile docs/Makefile])
61 AC_OUTPUT
63 diff -Naur afpfs-ng-0.8.1/fuse/client.c afpfs-ng-0.8.1.patch/fuse/client.c
64 --- afpfs-ng-0.8.1/fuse/client.c 2008-03-08 03:44:16.000000000 +0100
65 +++ afpfs-ng-0.8.1.patch/fuse/client.c 2011-09-10 12:13:50.110124477 +0200
66 @@ -12,11 +12,11 @@
67 #include <grp.h>
69 #include "config.h"
70 -#include <afp.h>
71 +#include <afpfs-ng/afp.h>
72 #include "afp_server.h"
73 -#include "uams_def.h"
74 -#include "map_def.h"
75 -#include "libafpclient.h"
76 +#include "afpfs-ng/uams_def.h"
77 +#include "afpfs-ng/map_def.h"
78 +#include "afpfs-ng/libafpclient.h"
80 #define default_uam "Cleartxt Passwrd"
82 diff -Naur afpfs-ng-0.8.1/fuse/commands.c afpfs-ng-0.8.1.patch/fuse/commands.c
83 --- afpfs-ng-0.8.1/fuse/commands.c 2008-03-08 17:06:25.000000000 +0100
84 +++ afpfs-ng-0.8.1.patch/fuse/commands.c 2011-09-10 12:13:50.110124477 +0200
85 @@ -19,15 +19,15 @@
86 #include <getopt.h>
87 #include <signal.h>
89 -#include "afp.h"
90 -#include "dsi.h"
91 +#include "afpfs-ng/afp.h"
92 +#include "afpfs-ng/dsi.h"
93 #include "afp_server.h"
94 -#include "utils.h"
95 +#include "afpfs-ng/utils.h"
96 #include "daemon.h"
97 -#include "uams_def.h"
98 -#include "codepage.h"
99 -#include "libafpclient.h"
100 -#include "map_def.h"
101 +#include "afpfs-ng/uams_def.h"
102 +#include "afpfs-ng/codepage.h"
103 +#include "afpfs-ng/libafpclient.h"
104 +#include "afpfs-ng/map_def.h"
105 #include "fuse_int.h"
106 #include "fuse_error.h"
107 #include "fuse_internal.h"
108 diff -Naur afpfs-ng-0.8.1/fuse/daemon.c afpfs-ng-0.8.1.patch/fuse/daemon.c
109 --- afpfs-ng-0.8.1/fuse/daemon.c 2008-03-04 18:26:05.000000000 +0100
110 +++ afpfs-ng-0.8.1.patch/fuse/daemon.c 2011-09-10 12:13:50.110124477 +0200
111 @@ -23,11 +23,11 @@
112 #include <signal.h>
113 #include <sys/socket.h>
115 -#include "afp.h"
116 +#include "afpfs-ng/afp.h"
118 -#include "dsi.h"
119 +#include "afpfs-ng/dsi.h"
120 #include "afp_server.h"
121 -#include "utils.h"
122 +#include "afpfs-ng/utils.h"
123 #include "daemon.h"
124 #include "commands.h"
126 diff -Naur afpfs-ng-0.8.1/fuse/fuse_error.c afpfs-ng-0.8.1.patch/fuse/fuse_error.c
127 --- afpfs-ng-0.8.1/fuse/fuse_error.c 2008-01-18 05:40:10.000000000 +0100
128 +++ afpfs-ng-0.8.1.patch/fuse/fuse_error.c 2011-09-10 12:13:50.111124491 +0200
129 @@ -4,7 +4,7 @@
130 #include <unistd.h>
131 #include <string.h>
132 #include <stdio.h>
133 -#include "libafpclient.h"
134 +#include "afpfs-ng/libafpclient.h"
135 #include "fuse_internal.h"
137 #define TMP_FILE "/tmp/fuse_stderr"
138 diff -Naur afpfs-ng-0.8.1/fuse/fuse_int.c afpfs-ng-0.8.1.patch/fuse/fuse_int.c
139 --- afpfs-ng-0.8.1/fuse/fuse_int.c 2008-03-02 06:06:24.000000000 +0100
140 +++ afpfs-ng-0.8.1.patch/fuse/fuse_int.c 2011-09-10 12:13:50.111124491 +0200
141 @@ -18,7 +18,7 @@
142 #define FUSE_USE_VERSION 25
145 -#include "afp.h"
146 +#include "afpfs-ng/afp.h"
148 #include <fuse.h>
149 #include <stdio.h>
150 @@ -39,10 +39,10 @@
151 #include <pwd.h>
152 #include <stdarg.h>
154 -#include "dsi.h"
155 -#include "afp_protocol.h"
156 -#include "codepage.h"
157 -#include "midlevel.h"
158 +#include "afpfs-ng/dsi.h"
159 +#include "afpfs-ng/afp_protocol.h"
160 +#include "afpfs-ng/codepage.h"
161 +#include "afpfs-ng/midlevel.h"
162 #include "fuse_error.h"
164 /* Uncomment the following line to enable full debugging: */
165 diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/afp.h afpfs-ng-0.8.1.patch/include/afpfs-ng/afp.h
166 --- afpfs-ng-0.8.1/include/afpfs-ng/afp.h 1970-01-01 01:00:00.000000000 +0100
167 +++ afpfs-ng-0.8.1.patch/include/afpfs-ng/afp.h 2011-09-10 12:13:50.112124505 +0200
168 @@ -0,0 +1,533 @@
170 +#ifndef _AFP_H_
171 +#define _AFP_H_
173 +#include <arpa/inet.h>
174 +#include <pthread.h>
175 +#include <netdb.h>
176 +#include <sys/statvfs.h>
177 +#include <pwd.h>
178 +#include <afpfs-ng/afp_protocol.h>
179 +#include <afpfs-ng/libafpclient.h>
180 +#include <sys/types.h>
181 +#include <sys/stat.h>
182 +#include <unistd.h>
183 +#include <netinet/in.h>
186 +#define AFPFS_VERSION "0.8.1"
188 +/* This is the maximum AFP version this library supports */
189 +#define AFP_MAX_SUPPORTED_VERSION 32
191 +/* afp_url is used to pass locations around */
192 +struct afp_url {
193 + enum {TCPIP,AT} protocol;
194 + char username[AFP_MAX_USERNAME_LEN];
195 + char uamname[50];
196 + char password[AFP_MAX_PASSWORD_LEN];
197 + char servername[AFP_SERVER_NAME_UTF8_LEN];
198 + int port;
199 + char volumename[AFP_VOLUME_NAME_UTF8_LEN];
200 + char path[AFP_MAX_PATH];
202 + int requested_version;
203 + char zone[AFP_ZONE_LEN]; /* Only used for Appletalk */
204 + char volpassword[9];;
207 +struct afp_token {
208 + unsigned int length;
209 + char data[AFP_TOKEN_MAX_LEN];
212 +#define SERVER_MAX_VERSIONS 10
213 +#define SERVER_MAX_UAMS 10
215 +struct afp_rx_buffer {
216 + unsigned int size;
217 + unsigned int maxsize;
218 + char * data;
219 + int errorcode;
223 +struct afp_file_info {
224 + unsigned short attributes;
225 + unsigned int did;
226 + unsigned int creation_date;
227 + unsigned int modification_date;
228 + unsigned int backup_date;
229 + unsigned int fileid;
230 + unsigned short offspring;
231 + char sync;
232 + char finderinfo[32];
233 + char name[AFP_MAX_PATH];
234 + char basename[AFP_MAX_PATH];
235 + char translated_name[AFP_MAX_PATH];
236 + struct afp_unixprivs unixprivs;
237 + unsigned int accessrights;
238 + struct afp_file_info * next;
239 + struct afp_file_info * largelist_next;
240 + unsigned char isdir;
241 + unsigned long long size;
242 + unsigned short resourcesize;
243 + unsigned int resource;
244 + unsigned short forkid;
245 + struct afp_icon * icon;
246 + int eof;
250 +#define VOLUME_EXTRA_FLAGS_VOL_CHMOD_KNOWN 0x1
251 +#define VOLUME_EXTRA_FLAGS_VOL_CHMOD_BROKEN 0x2
252 +#define VOLUME_EXTRA_FLAGS_SHOW_APPLEDOUBLE 0x4
253 +#define VOLUME_EXTRA_FLAGS_VOL_SUPPORTS_UNIX 0x8
254 +#define VOLUME_EXTRA_FLAGS_NO_LOCKING 0x10
255 +#define VOLUME_EXTRA_FLAGS_IGNORE_UNIXPRIVS 0x20
256 +#define VOLUME_EXTRA_FLAGS_READONLY 0x40
258 +#define AFP_VOLUME_UNMOUNTED 0
259 +#define AFP_VOLUME_MOUNTED 1
260 +#define AFP_VOLUME_UNMOUNTING 2
262 +struct afp_volume {
263 + unsigned short volid;
264 + char flags; /* This is from afpGetSrvrParms */
265 + unsigned short attributes; /* This is from VolOpen */
266 + unsigned short signature; /* This is fixed or variable */
267 + unsigned int creation_date;
268 + unsigned int modification_date;
269 + unsigned int backup_date;
270 + struct statvfs stat;
271 + unsigned char mounted;
272 + char mountpoint[255];
273 + struct afp_server * server;
274 + char volume_name[AFP_VOLUME_NAME_LEN];
275 + char volume_name_printable[AFP_VOLUME_NAME_UTF8_LEN];
276 + unsigned short dtrefnum;
277 + char volpassword[AFP_VOLPASS_LEN];
278 + unsigned int extra_flags; /* This is an afpfs-ng specific field */
280 + /* Our directory ID cache */
281 + struct did_cache_entry * did_cache_base;
282 + pthread_mutex_t did_cache_mutex;
284 + /* Our journal of open forks */
285 + struct afp_file_info * open_forks;
286 + pthread_mutex_t open_forks_mutex;
288 + /* Used to trigger startup */
289 + pthread_cond_t startup_condition_cond;
291 + struct {
292 + uint64_t hits;
293 + uint64_t misses;
294 + uint64_t expired;
295 + uint64_t force_removed;
296 + } did_cache_stats;
298 + void * priv; /* This is a private structure for fuse/cmdline, etc */
299 + pthread_t thread; /* This is the per-volume thread */
301 + int mapping;
305 +#define SERVER_STATE_CONNECTED 1
306 +#define SERVER_STATE_DISCONNECTED 2
308 +enum server_type{
309 + AFPFS_SERVER_TYPE_UNKNOWN,
310 + AFPFS_SERVER_TYPE_NETATALK,
311 + AFPFS_SERVER_TYPE_AIRPORT,
312 + AFPFS_SERVER_TYPE_MACINTOSH,
315 +#define is_netatalk(x) ( (x)->machine_type == AFPFS_SERVER_TYPE_NETATALK )
316 +#define is_airport(x) ( (x)->machine_type == AFPFS_SERVER_TYPE_AIRPORT )
317 +#define is_macintosh(x) ( (x)->machine_type == AFPFS_SERVER_TYPE_MACINTOSH )
321 +struct afp_versions {
322 + char *av_name;
323 + int av_number;
325 +extern struct afp_versions afp_versions[];
327 +struct afp_server {
329 + /* Our buffer sizes */
330 + unsigned int tx_quantum;
331 + unsigned int rx_quantum;
333 + unsigned int tx_delay;
335 + /* Connection information */
336 + struct sockaddr_in address;
337 + int fd;
339 + /* Some stats, for information only */
340 + struct {
341 + uint64_t runt_packets;
342 + uint64_t incoming_dsi;
343 + uint64_t rx_bytes;
344 + uint64_t tx_bytes;
345 + uint64_t requests_pending;
346 + } stats;
348 + /* General information */
349 + char server_name[AFP_SERVER_NAME_LEN];
350 + char server_name_utf8[AFP_SERVER_NAME_UTF8_LEN];
351 + char server_name_printable[AFP_SERVER_NAME_UTF8_LEN];
353 + char machine_type[17];
354 + char icon[256];
355 + char signature[16];
356 + unsigned short flags;
357 + int connect_state;
358 + enum server_type server_type;
360 + /* This is the time we connected */
361 + time_t connect_time;
363 + /* UAMs */
364 + unsigned int supported_uams;
365 + unsigned int using_uam;
367 + /* Authentication */
368 + char username[AFP_MAX_USERNAME_LEN];
369 + char password[AFP_MAX_PASSWORD_LEN];
371 + /* Session */
372 + struct afp_token token;
373 + char need_resume;
375 + /* Versions */
376 + unsigned char requested_version;
377 + unsigned char versions[SERVER_MAX_VERSIONS];
378 + struct afp_versions *using_version;
380 + /* Volumes */
381 + unsigned char num_volumes;
382 + struct afp_volume * volumes;
384 + void * dsi;
385 + unsigned int exit_flag;
387 + /* Our DSI request queue */
388 + pthread_mutex_t requestid_mutex;
389 + pthread_mutex_t request_queue_mutex;
390 + unsigned short lastrequestid;
391 + unsigned short expectedrequestid;
392 + struct dsi_request * command_requests;
395 + char loginmesg[200];
396 + char servermesg[200];
397 + char path_encoding;
399 + /* This is the data for the incoming buffer */
400 + char * incoming_buffer;
401 + int data_read;
402 + int bufsize;
404 + /* And this is for the outgoing queue */
405 + pthread_mutex_t send_mutex;
407 + /* This is for user mapping */
408 + struct passwd passwd;
409 + unsigned int server_uid, server_gid;
410 + int server_gid_valid;
412 + struct afp_server *next;
414 + /* These are for DSI attention packets */
415 + unsigned int attention_quantum;
416 + unsigned int attention_len;
417 + char * attention_buffer;
421 +struct afp_extattr_info {
422 + unsigned int maxsize;
423 + unsigned int size;
424 + char data[1024];
426 +struct afp_comment {
427 + unsigned int maxsize;
428 + unsigned int size;
429 + char *data;
432 +struct afp_icon {
433 + unsigned int maxsize;
434 + unsigned int size;
435 + char *data;
438 +#define AFP_DEFAULT_ATTENTION_QUANTUM 1024
440 +void afp_unixpriv_to_stat(struct afp_file_info *fp,
441 + struct stat *stat);
443 +int init_uams(void) ;
445 +unsigned int find_uam_by_name(const char * name);
446 +char * uam_bitmap_to_string(unsigned int bitmap);
449 +char * get_uam_names_list(void);
451 +unsigned int default_uams_mask(void);
453 +struct afp_volume * find_volume_by_name(struct afp_server * server,
454 + const char * volname);
456 +struct afp_connection_request {
457 + unsigned int uam_mask;
458 + struct afp_url url;
461 +void afp_default_url(struct afp_url *url);
462 +int afp_parse_url(struct afp_url * url, const char * toparse, int verbose);
463 +void afp_print_url(struct afp_url * url);
464 +int afp_url_validate(char * url_string, struct afp_url * valid_url);
466 +int afp_list_volnames(struct afp_server * server, char * names, int max);
468 +/* User mapping */
469 +int afp_detect_mapping(struct afp_volume * volume);
471 +/* These are some functions that help with simple status text generation */
473 +int afp_status_header(char * text, int * len);
474 +int afp_status_server(struct afp_server * s,char * text, int * len);
477 +struct afp_server * afp_server_full_connect(void * priv, struct afp_connection_request * req);
479 +void * just_end_it_now(void *other);
480 +void add_fd_and_signal(int fd);
481 +void loop_disconnect(struct afp_server *s);
482 +void afp_wait_for_started_loop(void);
485 +struct afp_versions * pick_version(unsigned char *versions,
486 + unsigned char requested) ;
487 +int pick_uam(unsigned int u1, unsigned int u2);
489 +int afp_server_login(struct afp_server *server,
490 + char * mesg, unsigned int *l, unsigned int max);
493 +int afp_dologin(struct afp_server *server,
494 + unsigned int uam, char * username, char * passwd);
496 +void afp_free_server(struct afp_server **server);
498 +struct afp_server * afp_server_init(struct sockaddr_in * address);
499 +int afp_get_address(void * priv, const char * hostname, unsigned int port,
500 + struct sockaddr_in * address);
503 +int afp_main_loop(int command_fd);
504 +int afp_main_quick_startup(pthread_t * thread);
506 +int afp_server_destroy(struct afp_server *s) ;
507 +int afp_server_reconnect(struct afp_server * s, char * mesg,
508 + unsigned int *l, unsigned int max);
509 +int afp_server_connect(struct afp_server *s, int full);
511 +struct afp_server * afp_server_complete_connection(
512 + void * priv,
513 + struct afp_server * server,
514 + struct sockaddr_in * address, unsigned char * versions,
515 + unsigned int uams, char * username, char * password,
516 + unsigned int requested_version, unsigned int uam_mask);
518 +int afp_connect_volume(struct afp_volume * volume, struct afp_server * server,
519 + char * mesg, unsigned int * l, unsigned int max);
520 +int something_is_mounted(struct afp_server * server);
522 +int add_cache_entry(struct afp_file_info * file) ;
523 +struct afp_file_info * get_cache_by_name(char * name);
524 +struct afp_server * find_server_by_address(struct sockaddr_in * address);
525 +struct afp_server * find_server_by_signature(char * signature);
526 +struct afp_server * find_server_by_name(char * name);
527 +int server_still_valid(struct afp_server * server);
530 +struct afp_server * get_server_base(void);
531 +int afp_server_remove(struct afp_server * server);
533 +int afp_unmount_volume(struct afp_volume * volume);
534 +int afp_unmount_all_volumes(struct afp_server * server);
536 +#define volume_is_readonly(x) (((x)->attributes&kReadOnly) || \
537 + ((x)->extra_flags & VOLUME_EXTRA_FLAGS_READONLY))
539 +int afp_opendt(struct afp_volume *volume, unsigned short * refnum);
541 +int afp_closedt(struct afp_server * server, unsigned short * refnum);
543 +int afp_getcomment(struct afp_volume *volume, unsigned int did,
544 + const char * pathname, struct afp_comment * comment);
546 +int afp_addcomment(struct afp_volume *volume, unsigned int did,
547 + const char * pathname, char * comment,uint64_t *size);
549 +int afp_geticon(struct afp_volume * volume, unsigned int filecreator,
550 + unsigned int filetype, unsigned char icontype,
551 + unsigned short length, struct afp_icon * icon);
553 +/* Things you want to do to a server */
555 +int afp_getsrvrmsg(struct afp_server *server, unsigned short messagetype,unsigned char utf8, unsigned char block, char * mesg);
557 +int afp_login(struct afp_server *server, char * uaname,
558 + char * userauthinfo, unsigned int userauthinfo_len,
559 + struct afp_rx_buffer *rx);
561 +int afp_changepassword(struct afp_server *server, char * uaname,
562 + char * userauthinfo, unsigned int userauthinfo_len,
563 + struct afp_rx_buffer *rx);
565 +int afp_logincont(struct afp_server *server, unsigned short id,
566 + char * userauthinfo, unsigned int userauthinfo_len,
567 + struct afp_rx_buffer *rx);
569 +int afp_getsessiontoken(struct afp_server * server, int type,
570 + unsigned int timestamp, struct afp_token *outgoing_token,
571 + struct afp_token * incoming_token);
573 +int afp_getsrvrparms(struct afp_server *server);
575 +int afp_logout(struct afp_server *server,unsigned char wait);
577 +int afp_mapname(struct afp_server * server, unsigned char subfunction,
578 + char * name, unsigned int * id);
580 +int afp_mapid(struct afp_server * server, unsigned char subfunction,
581 + unsigned int id, char *name);
583 +int afp_getuserinfo(struct afp_server * server, int thisuser,
584 + unsigned int userid, unsigned short bitmap,
585 + unsigned int *newuid, unsigned int *newgid);
587 +int afp_zzzzz(struct afp_server *server);
589 +int afp_volopen(struct afp_volume * volume,
590 + unsigned short bitmap, char * password);
592 +int afp_flush(struct afp_volume * volume);
594 +int afp_getfiledirparms(struct afp_volume *volume, unsigned int did,
595 + unsigned int filebitmap, unsigned int dirbitmap, const char * pathname,
596 + struct afp_file_info *fp);
598 +int afp_enumerate(struct afp_volume * volume,
599 + unsigned int dirid,
600 + unsigned int filebitmap, unsigned int dirbitmap,
601 + unsigned short reqcount,
602 + unsigned short startindex,
603 + char * path,
604 + struct afp_file_info ** file_p);
606 +int afp_enumerateext2(struct afp_volume * volume,
607 + unsigned int dirid,
608 + unsigned int filebitmap, unsigned int dirbitmap,
609 + unsigned short reqcount,
610 + unsigned long startindex,
611 + char * path,
612 + struct afp_file_info ** file_p);
614 +int afp_openfork(struct afp_volume * volume,
615 + unsigned char forktype,
616 + unsigned int dirid,
617 + unsigned short accessmode,
618 + char * filename,
619 + struct afp_file_info *fp);
621 +int afp_read(struct afp_volume * volume, unsigned short forkid,
622 + uint32_t offset,
623 + uint32_t count, struct afp_rx_buffer * rx);
625 +int afp_readext(struct afp_volume * volume, unsigned short forkid,
626 + uint64_t offset,
627 + uint64_t count, struct afp_rx_buffer * rx);
629 +int afp_getvolparms(struct afp_volume * volume, unsigned short bitmap);
632 +int afp_createdir(struct afp_volume * volume, unsigned int dirid, const char * pathname, unsigned int *did_p);
634 +int afp_delete(struct afp_volume * volume,
635 + unsigned int dirid, char * pathname);
638 +int afp_createfile(struct afp_volume * volume, unsigned char flag,
639 + unsigned int did, char * pathname);
641 +int afp_write(struct afp_volume * volume, unsigned short forkid,
642 + uint32_t offset, uint32_t reqcount,
643 + char * data, uint32_t * written);
645 +int afp_writeext(struct afp_volume * volume, unsigned short forkid,
646 + uint64_t offset, uint64_t reqcount,
647 + char * data, uint64_t * written);
649 +int afp_flushfork(struct afp_volume * volume, unsigned short forkid);
651 +int afp_closefork(struct afp_volume * volume, unsigned short forkid);
652 +int afp_setfileparms(struct afp_volume * volume,
653 + unsigned int dirid, const char * pathname, unsigned short bitmap,
654 + struct afp_file_info *fp);
655 +int afp_setfiledirparms(struct afp_volume * volume,
656 + unsigned int dirid, const char * pathname, unsigned short bitmap,
657 + struct afp_file_info *fp);
659 +int afp_setdirparms(struct afp_volume * volume,
660 + unsigned int dirid, const char * pathname, unsigned short bitmap,
661 + struct afp_file_info *fp);
663 +int afp_volclose(struct afp_volume * volume);
666 +int afp_setforkparms(struct afp_volume *volume,
667 + unsigned short forkid, unsigned short bitmap, unsigned long len);
669 +int afp_byterangelock(struct afp_volume * volume,
670 + unsigned char flag,
671 + unsigned short forkid,
672 + uint32_t offset,
673 + uint32_t len, uint32_t *generated_offset);
675 +int afp_byterangelockext(struct afp_volume * volume,
676 + unsigned char flag,
677 + unsigned short forkid,
678 + uint64_t offset,
679 + uint64_t len, uint64_t *generated_offset);
681 +int afp_moveandrename(struct afp_volume *volume,
682 + unsigned int src_did,
683 + unsigned int dst_did,
684 + char * src_path, char * dst_path, char *new_name);
686 +int afp_rename(struct afp_volume * volume,
687 + unsigned int dirid,
688 + char * path_from, char * path_to);
690 +int afp_listextattr(struct afp_volume * volume,
691 + unsigned int dirid, unsigned short bitmap,
692 + char * pathname, struct afp_extattr_info * info);
694 +/* This is a currently undocumented command */
695 +int afp_newcommand76(struct afp_volume * volume, unsigned int dlen, char * data);
697 +/* For debugging */
698 +char * afp_get_command_name(char code);
701 +#endif
702 diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/afp_protocol.h afpfs-ng-0.8.1.patch/include/afpfs-ng/afp_protocol.h
703 --- afpfs-ng-0.8.1/include/afpfs-ng/afp_protocol.h 1970-01-01 01:00:00.000000000 +0100
704 +++ afpfs-ng-0.8.1.patch/include/afpfs-ng/afp_protocol.h 2011-09-10 12:13:50.112124505 +0200
705 @@ -0,0 +1,361 @@
707 +#ifndef _AFP_PROTOCOL_H_
708 +#define _AFP_PROTOCOL_H_
710 +#include <sys/types.h>
711 +#include <stddef.h>
712 +#include <unistd.h>
713 +#include <stdint.h>
715 +/* This file defines constants for the Apple File Protocol.
716 + All page references are from "Apple Filing Protocol Programming" version 3.2.
717 + except where noted.
720 +#define AFP_SERVER_NAME_LEN 33
721 +#define AFP_SERVER_NAME_UTF8_LEN 255
722 +#define AFP_VOLUME_NAME_LEN 33
723 +#define AFP_VOLUME_NAME_UTF8_LEN 33
724 +#define AFP_SIGNATURE_LEN 16
725 +#define AFP_MACHINETYPE_LEN 33
726 +#define AFP_LOGINMESG_LEN 200
727 +#define AFP_VOLPASS_LEN 8
728 +#define AFP_HOSTNAME_LEN 255
729 +/* This is actually just a guess, and only used for appletalk */
730 +#define AFP_ZONE_LEN 255
732 +#define AFP_SERVER_ICON_LEN 256
735 +#define AFP_MAX_USERNAME_LEN 127
736 +#define AFP_MAX_PASSWORD_LEN 127
739 +/* This is the maximum length of any UAM string */
740 +#define AFP_UAM_LENGTH 24
742 +/* This is the maximum length of any path description */
743 +#define AFP_MAX_PATH 768
745 +#define AFP_VOL_FLAT 1
746 +#define AFP_VOL_FIXED 2
747 +#define AFP_VOL_VARIABLE 3
749 +/* The root directory ID, p.26 */
751 +#define AFP_ROOT_DID 2
753 +/* Path type constants, p.249 */
755 +enum {
756 +kFPShortName = 1,
757 +kFPLongName = 2,
758 +kFPUTF8Name = 3
761 +/* fork types */
763 +#define AFP_FORKTYPE_DATA 0x0
764 +#define AFP_FORKTYPE_RESOURCE 0x80
766 +/* openfork access modes, from p.196 */
768 +#define AFP_OPENFORK_ALLOWREAD 1
769 +#define AFP_OPENFORK_ALLOWWRITE 2
770 +#define AFP_OPENFORK_DENYREAD 0x10
771 +#define AFP_OPENFORK_DENYWRITE 0x20
773 +/* Message type for getsrvmesg, p. 169*/
775 +typedef enum {
776 + AFPMESG_LOGIN = 0,
777 + AFPMESG_SERVER = 1
778 +} afpmessage_t;
780 +/* Message bitmap for getsrvrmsg */
782 +#define AFP_GETSRVRMSG_UTF8 0x2
783 +#define AFP_GETSRVRMSG_GETMSG 0x1
786 +/* Maximum Version length, p.17 */
787 +#define AFP_MAX_VERSION_LENGTH 16
789 +/* Maximum length of a token, this is undocumented */
790 +#define AFP_TOKEN_MAX_LEN 256
792 +/* The maximum size of a file for AFP 2 */
793 +#define AFP_MAX_AFP2_FILESIZE (4294967296)
795 +/* Unix privs, p.240 */
797 +struct afp_unixprivs {
798 + uint32_t uid __attribute__((__packed__));
799 + uint32_t gid __attribute__((__packed__));
800 + uint32_t permissions __attribute__((__packed__));
801 + uint32_t ua_permissions __attribute__((__packed__));
806 +/* AFP Volume attributes bitmap, p.241 */
808 +enum {
809 + kReadOnly = 0x01,
810 + kHasVolumePassword = 0x02,
811 + kSupportsFileIDs = 0x04,
812 + kSupportsCatSearch = 0x08,
813 + kSupportsBlankAccessPrivs = 0x10,
814 + kSupportsUnixPrivs = 0x20,
815 + kSupportsUTF8Names = 0x40,
816 + kNoNetworkUserIDs = 0x80,
817 + kDefaultPrivsFromParent = 0x100,
818 + kNoExchangeFiles = 0x200,
819 + kSupportsExtAttrs = 0x400,
820 + kSupportsACLs=0x800
823 +/* AFP file creation constantes, p.250 */
824 +enum {
825 +kFPSoftCreate = 0,
826 +kFPHardCreate = 0x80
829 +/* AFP Directory attributes, taken from the protocol guide p.236 */
831 +enum {
832 + kFPAttributeBit = 0x1,
833 + kFPParentDirIDBit = 0x2,
834 + kFPCreateDateBit = 0x4,
835 + kFPModDateBit = 0x8,
836 + kFPBackupDateBit = 0x10,
837 + kFPFinderInfoBit = 0x20,
838 + kFPLongNameBit = 0x40,
839 + kFPShortNameBit = 0x80,
840 + kFPNodeIDBit = 0x100,
841 + kFPOffspringCountBit = 0x0200,
842 + kFPOwnerIDBit = 0x0400,
843 + kFPGroupIDBit = 0x0800,
844 + kFPAccessRightsBit = 0x1000,
845 + kFPProDOSInfoBit = 0x2000, // AFP version 2.2 and earlier
846 + kFPUTF8NameBit = 0x2000, // AFP version 3.0 and later
847 + kFPUnixPrivsBit = 0x8000 // AFP version 3.0 and later
850 +/* AFP File bitmap, p.238. These are the ones not in the AFP Directory
851 + attributes map. */
853 +enum {
854 + kFPDataForkLenBit = 0x0200,
855 + kFPRsrcForkLenBit = 0x0400,
856 + kFPExtDataForkLenBit = 0x0800, // AFP version 3.0 and later
857 + kFPLaunchLimitBit = 0x1000,
858 + kFPExtRsrcForkLenBit = 0x4000, // AFP version 3.0 and later
861 +/* AFP Extended Attributes Bitmap, p.238 */
863 +enum {
864 + kXAttrNoFollow = 0x1,
865 + kXAttrCreate = 0x2,
866 + kXAttrREplace=0x4
870 +/* AFP function codes */
871 +enum AFPFunction
873 + afpByteRangeLock = 1, afpCloseVol, afpCloseDir, afpCloseFork,
874 + afpCopyFile, afpCreateDir, afpCreateFile,
875 + afpDelete, afpEnumerate, afpFlush, afpFlushFork,
876 + afpGetForkParms = 14, afpGetSrvrInfo, afpGetSrvrParms,
877 + afpGetVolParms, afpLogin, afpLoginCont, afpLogout, afpMapID,
878 + afpMapName, afpMoveAndRename, afpOpenVol, afpOpenDir, afpOpenFork,
879 + afpRead, afpRename, afpSetDirParms, afpSetFileParms,
880 + afpSetForkParms, afpSetVolParms, afpWrite, afpGetFileDirParms,
881 + afpSetFileDirParms, afpChangePassword,
882 + afpGetUserInfo=37,afpGetSrvrMsg = 38,
883 + afpOpenDT=48,
884 + afpCloseDT=49,
885 + afpGetIcon=51, afpGetIconInfo=52,
886 + afpAddComment=56, afpRemoveComment=57, afpGetComment=58,
887 + afpByteRangeLockExt=59, afpReadExt, afpWriteExt,
888 + afpGetAuthMethods=62,
889 + afp_LoginExt=63,
890 + afpGetSessionToken=64,
891 + afpDisconnectOldSession=65,
892 + afpEnumerateExt=66,
893 + afpCatSearchExt = 67,
894 + afpEnumerateExt2 = 68, afpGetExtAttr, afpSetExtAttr,
895 + afpRemoveExtAttr , afpListExtAttrs,
896 + afpZzzzz = 122,
897 + afpAddIcon=192,
900 +/* AFP Volume bitmap. Take from 242 of the protocol guide. */
901 +enum {
902 + kFPBadVolPre222Bitmap = 0xFe00,
903 + kFPBadVolBitmap = 0xF000,
904 + kFPVolAttributeBit = 0x1,
905 + kFPVolSignatureBit = 0x2,
906 + kFPVolCreateDateBit = 0x4,
907 + kFPVolModDateBit = 0x8,
908 + kFPVolBackupDateBit = 0x10,
909 + kFPVolIDBit = 0x20,
910 + kFPVolBytesFreeBit = 0x40,
911 + kFPVolBytesTotalBit = 0x80,
912 + kFPVolNameBit = 0x100,
913 + kFPVolExtBytesFreeBit = 0x200,
914 + kFPVolExtBytesTotalBit = 0x400,
915 + kFPVolBlockSizeBit = 0x800
918 +/* AFP Attention Codes -- 4 bits */
919 +#define AFPATTN_SHUTDOWN (1 << 15) /* shutdown/disconnect */
920 +#define AFPATTN_CRASH (1 << 14) /* server crashed */
921 +#define AFPATTN_MESG (1 << 13) /* server has message */
922 +#define AFPATTN_NORECONNECT (1 << 12) /* don't reconnect */
923 +/* server notification */
924 +#define AFPATTN_NOTIFY (AFPATTN_MESG | AFPATTN_NORECONNECT)
926 +/* extended bitmap -- 12 bits. volchanged is only useful w/ a server
927 + * notification, and time is only useful for shutdown. */
928 +#define AFPATTN_VOLCHANGED (1 << 0) /* volume has changed */
929 +#define AFPATTN_TIME(x) ((x) & 0xfff) /* time in minutes */
931 +#define kFPNoErr 0
933 +/* AFP result codes, p252 */
934 +#define kASPSessClosed -1072
935 +#define kFPAccessDenied -5000
936 +#define kFPAuthContinue -5001
937 +#define kFPBadUAM -5002
938 +#define kFPBadVersNum -5003
939 +#define kFPBitmapErr -5004
940 +#define kFPCantMove -5005
941 +#define kFPDenyConflict -5006
942 +#define kFPDirNotEmpty -5007
943 +#define kFPDiskFull -5008
944 +#define kFPEOFErr -5009
945 +#define kFPFileBusy -5010
946 +#define kFPFlatVol -5011
947 +#define kFPItemNotFound -5012
948 +#define kFPLockErr -5013
949 +#define kFPMiscErr -5014
950 +#define kFPNoMoreLocks -5015
951 +#define kFPNoServer -5016
952 +#define kFPObjectExists -5017
953 +#define kFPObjectNotFound -5018
954 +#define kFPParamErr -5019
955 +#define kFPRangeNotLocked -5020
956 +#define kFPRangeOverlap -5021
957 +#define kFPSessClosed -5022
958 +#define kFPUserNotAuth -5023
959 +#define kFPCallNotSupported -5024
960 +#define kFPObjectTypeErr -5025
961 +#define kFPTooManyFilesOpen -5026
962 +#define kFPServerGoingDown -5027
963 +#define kFPCantRename -5028
964 +#define kFPDirNotFound -5029
965 +#define kFPIconTypeError -5030
966 +#define kFPVolLocked -5031
967 +#define kFPObjectLocked -5032
968 +#define kFPContainsSharedErr -5033
969 +#define kFPIDNotFound -5034
970 +#define kFPIDExists -5035
971 +#define kFPDiffVolErr -5036
972 +#define kFPCatalogChanged -5037
973 +#define kFPSameObjectErr -5038
974 +#define kFPBadIDErr -5039
975 +#define kFPPwdSameErr -5040
976 +#define kFPPwdTooShortErr -5041
977 +#define kFPPwdExpiredErr -5042
978 +#define kFPInsideSharedErr -5043
979 +#define kFPInsideTrashErr -5044
980 +#define kFPPwdNeedsChangeErr -5045
981 +#define kFPPwdPolicyErr -5046
982 +#define kFPDiskQuotaExceeded –5047
986 +/* These flags determine to lock or unlock in ByteRangeLock(Ext) */
988 +enum {
989 +ByteRangeLock_Lock = 0,
990 +ByteRangeLock_Unlock = 1
993 +/* These flags are used in volopen and getsrvrparm replies, p.171 */
995 +#define HasConfigInfo 0x1
996 +#define HasPassword 0x80
998 +/* These are the subfunction for kFPMapID, as per p.248 */
1000 +enum {
1001 +kUserIDToName = 1,
1002 +kGroupIDToName = 2,
1003 +kUserIDToUTF8Name = 3,
1004 +kGroupIDToUTF8Name = 4,
1005 +kUserUUIDToUTF8Name = 5,
1006 +kGroupUUIDToUTF8Name = 6
1010 +/* These are the subfunction flags described in the FPMapName command, p.286.
1011 + Note that this is different than what's described on p. 186. */
1013 +enum {
1014 +kNameToUserID = 1,
1015 +kNameToGroupID = 2,
1016 +kUTF8NameToUserID = 3,
1017 +kUTF8NameToGroupID = 4,
1018 +kUTF8NameToUserUUID = 5,
1019 +kUTF8NameToGroupUUID = 6
1022 +/* These are bits for FPGetUserInfo, p.173. */
1023 +#define kFPGetUserInfo_USER_ID 1
1024 +#define kFPGetUserInfo_PRI_GROUPID 2
1026 +/* Flags for the replies of GetSrvrInfo and DSI GetStatus, p.240 */
1028 +enum {
1029 + kSupportsCopyfile = 0x01,
1030 + kSupportsChgPwd = 0x02,
1031 + kDontAllowSavePwd = 0x04,
1032 + kSupportsSrvrMsg = 0x08,
1033 + kSrvrSig = 0x10,
1034 + kSupportsTCP = 0x20,
1035 + kSupportsSrvrNotify = 0x40,
1036 + kSupportsReconnect = 0x80,
1037 + kSupportsDirServices = 0x100,
1038 + kSupportsUTF8SrvrName = 0x200,
1039 + kSupportsUUIDs = 0x400,
1040 + kSupportsSuperClient = 0x8000
1044 +/* p.247 */
1046 +enum {
1047 + kLoginWithoutID = 0,
1048 + kLoginWithID = 1,
1049 + kReconnWithID = 2,
1050 + kLoginWithTimeAndID = 3,
1051 + kReconnWithTimeAndID = 4,
1052 + kRecon1Login = 5,
1053 + kRecon1ReconnectLogin = 6,
1054 + kRecon1Refresh = 7, kGetKerberosSessionKey = 8
1058 +#define AFP_CHMOD_ALLOWED_BITS_22 \
1059 + (S_IRUSR |S_IWUSR | S_IRGRP | S_IWGRP |S_IROTH | S_IWOTH | S_IFREG )
1062 +#endif
1067 diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/codepage.h afpfs-ng-0.8.1.patch/include/afpfs-ng/codepage.h
1068 --- afpfs-ng-0.8.1/include/afpfs-ng/codepage.h 1970-01-01 01:00:00.000000000 +0100
1069 +++ afpfs-ng-0.8.1.patch/include/afpfs-ng/codepage.h 2011-09-10 12:13:50.113124518 +0200
1070 @@ -0,0 +1,11 @@
1071 +#ifndef __CODE_PAGE_H_
1072 +#define __CODE_PAGE_H_
1073 +int convert_utf8dec_to_utf8pre(const char *src, int src_len,
1074 + char * dest, int dest_len);
1075 +int convert_utf8pre_to_utf8dec(const char * src, int src_len,
1076 + char * dest, int dest_len);
1077 +int convert_path_to_unix(char encoding, char * dest,
1078 + char * src, int dest_len);
1079 +int convert_path_to_afp(char encoding, char * dest,
1080 + char * src, int dest_len);
1081 +#endif
1082 diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/dsi.h afpfs-ng-0.8.1.patch/include/afpfs-ng/dsi.h
1083 --- afpfs-ng-0.8.1/include/afpfs-ng/dsi.h 1970-01-01 01:00:00.000000000 +0100
1084 +++ afpfs-ng-0.8.1.patch/include/afpfs-ng/dsi.h 2011-09-10 12:13:50.115124544 +0200
1085 @@ -0,0 +1,33 @@
1087 +#ifndef __DSI_H_
1088 +#define __DSI_H_
1090 +#include "afpfs-ng/afp.h"
1092 +struct dsi_request
1094 + unsigned short requestid;
1095 + unsigned char subcommand;
1096 + void * other;
1097 + unsigned char wait;
1098 + pthread_cond_t condition_cond;
1099 + struct dsi_request * next;
1100 + int return_code;
1103 +int dsi_receive(struct afp_server * server, void * data, int size);
1104 +int dsi_getstatus(struct afp_server * server);
1106 +int dsi_opensession(struct afp_server *server);
1108 +int dsi_send(struct afp_server *server, char * msg, int size,int wait,unsigned char subcommand, void ** other);
1109 +struct dsi_session * dsi_create(struct afp_server *server);
1110 +int dsi_restart(struct afp_server *server);
1111 +int dsi_recv(struct afp_server * server);
1113 +#define DSI_BLOCK_TIMEOUT -1
1114 +#define DSI_DONT_WAIT 0
1115 +#define DSI_DEFAULT_TIMEOUT 5
1118 +#endif
1119 diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/libafpclient.h afpfs-ng-0.8.1.patch/include/afpfs-ng/libafpclient.h
1120 --- afpfs-ng-0.8.1/include/afpfs-ng/libafpclient.h 1970-01-01 01:00:00.000000000 +0100
1121 +++ afpfs-ng-0.8.1.patch/include/afpfs-ng/libafpclient.h 2011-09-10 12:13:50.115124544 +0200
1122 @@ -0,0 +1,50 @@
1124 +#ifndef __CLIENT_H_
1125 +#define __CLIENT_H_
1127 +#include <unistd.h>
1128 +#include <syslog.h>
1130 +#define MAX_CLIENT_RESPONSE 2048
1133 +enum loglevels {
1134 + AFPFSD,
1137 +struct afp_server;
1138 +struct afp_volume;
1140 +struct libafpclient {
1141 + int (*unmount_volume) (struct afp_volume * volume);
1142 + void (*log_for_client)(void * priv,
1143 + enum loglevels loglevel, int logtype, const char *message);
1144 + void (*forced_ending_hook)(void);
1145 + int (*scan_extra_fds)(int command_fd,fd_set *set, int * max_fd);
1146 + void (*loop_started)(void);
1147 +} ;
1149 +extern struct libafpclient * libafpclient;
1151 +void libafpclient_register(struct libafpclient * tmpclient);
1154 +void signal_main_thread(void);
1156 +/* These are logging functions */
1158 +#define MAXLOGSIZE 2048
1160 +#define LOG_METHOD_SYSLOG 1
1161 +#define LOG_METHOD_STDOUT 2
1163 +void set_log_method(int m);
1166 +void log_for_client(void * priv,
1167 + enum loglevels loglevel, int logtype, char * message,...);
1169 +void stdout_log_for_client(void * priv,
1170 + enum loglevels loglevel, int logtype, const char *message);
1172 +#endif
1173 diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/Makefile.am afpfs-ng-0.8.1.patch/include/afpfs-ng/Makefile.am
1174 --- afpfs-ng-0.8.1/include/afpfs-ng/Makefile.am 1970-01-01 01:00:00.000000000 +0100
1175 +++ afpfs-ng-0.8.1.patch/include/afpfs-ng/Makefile.am 2011-09-10 12:13:50.115124544 +0200
1176 @@ -0,0 +1,6 @@
1177 +## Process this file with automake to produce Makefile.in
1179 +afpfsincludedir = $(includedir)/afpfs-ng
1181 +afpfsinclude_HEADERS = afp.h afp_protocol.h libafpclient.h
1182 +nodist_afpfsinclude_HEADERS = codepage.h dsi.h map_def.h midlevel.h uams_def.h utils.h
1183 diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/map_def.h afpfs-ng-0.8.1.patch/include/afpfs-ng/map_def.h
1184 --- afpfs-ng-0.8.1/include/afpfs-ng/map_def.h 1970-01-01 01:00:00.000000000 +0100
1185 +++ afpfs-ng-0.8.1.patch/include/afpfs-ng/map_def.h 2011-09-10 12:13:50.116124557 +0200
1186 @@ -0,0 +1,15 @@
1187 +#ifndef __MAP_H_
1188 +#define __MAP_H_
1190 +#include "afpfs-ng/afp.h"
1192 +#define AFP_MAPPING_UNKNOWN 0
1193 +#define AFP_MAPPING_COMMON 1
1194 +#define AFP_MAPPING_LOGINIDS 2
1195 +#define AFP_MAPPING_NAME 3
1197 +unsigned int map_string_to_num(char * name);
1198 +char * get_mapping_name(struct afp_volume * volume);
1201 +#endif
1202 diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/midlevel.h afpfs-ng-0.8.1.patch/include/afpfs-ng/midlevel.h
1203 --- afpfs-ng-0.8.1/include/afpfs-ng/midlevel.h 1970-01-01 01:00:00.000000000 +0100
1204 +++ afpfs-ng-0.8.1.patch/include/afpfs-ng/midlevel.h 2011-09-10 12:13:50.116124557 +0200
1205 @@ -0,0 +1,64 @@
1206 +#ifndef __MIDLEVEL_H_
1207 +#define __MIDLEVEL_H_
1209 +#include <utime.h>
1210 +#include "afpfs-ng/afp.h"
1212 +int ml_open(struct afp_volume * volume, const char *path, int flags,
1213 + struct afp_file_info **newfp);
1215 +int ml_creat(struct afp_volume * volume, const char *path,mode_t mode);
1217 +int ml_readdir(struct afp_volume * volume,
1218 + const char *path,
1219 + struct afp_file_info **base);
1221 +int ml_read(struct afp_volume * volume, const char *path,
1222 + char *buf, size_t size, off_t offset,
1223 + struct afp_file_info *fp, int * eof);
1225 +int ml_chmod(struct afp_volume * vol, const char * path, mode_t mode);
1227 +int ml_unlink(struct afp_volume * vol, const char *path);
1229 +int ml_mkdir(struct afp_volume * vol, const char * path, mode_t mode);
1231 +int ml_close(struct afp_volume * volume, const char * path,
1232 + struct afp_file_info * fp);
1234 +int ml_getattr(struct afp_volume * volume, const char *path,
1235 + struct stat *stbuf);
1237 +int ml_write(struct afp_volume * volume, const char * path,
1238 + const char *data, size_t size, off_t offset,
1239 + struct afp_file_info * fp, uid_t uid,
1240 + gid_t gid);
1242 +int ml_readlink(struct afp_volume * vol, const char * path,
1243 + char *buf, size_t size);
1245 +int ml_rmdir(struct afp_volume * vol, const char *path);
1247 +int ml_chown(struct afp_volume * vol, const char * path,
1248 + uid_t uid, gid_t gid);
1250 +int ml_truncate(struct afp_volume * vol, const char * path, off_t offset);
1252 +int ml_utime(struct afp_volume * vol, const char * path,
1253 + struct utimbuf * timebuf);
1255 +int ml_symlink(struct afp_volume *vol, const char * path1, const char * path2);
1257 +int ml_rename(struct afp_volume * vol,
1258 + const char * path_from, const char * path_to);
1260 +int ml_statfs(struct afp_volume * vol, const char *path, struct statvfs *stat);
1262 +void afp_ml_filebase_free(struct afp_file_info **filebase);
1264 +int ml_passwd(struct afp_server *server,
1265 + char * username, char * oldpasswd, char * newpasswd);
1269 +#endif
1270 diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/uams_def.h afpfs-ng-0.8.1.patch/include/afpfs-ng/uams_def.h
1271 --- afpfs-ng-0.8.1/include/afpfs-ng/uams_def.h 1970-01-01 01:00:00.000000000 +0100
1272 +++ afpfs-ng-0.8.1.patch/include/afpfs-ng/uams_def.h 2011-09-10 12:13:50.116124557 +0200
1273 @@ -0,0 +1,16 @@
1274 +#ifndef __UAM_DEFS_H_
1275 +#define __UAM_DEFS_H_
1277 +#define UAM_NOUSERAUTHENT 0x1
1278 +#define UAM_CLEARTXTPASSWRD 0x2
1279 +#define UAM_RANDNUMEXCHANGE 0x4
1280 +#define UAM_2WAYRANDNUM 0x8
1281 +#define UAM_DHCAST128 0x10
1282 +#define UAM_CLIENTKRB 0x20
1283 +#define UAM_DHX2 0x40
1284 +#define UAM_RECON1 0x80
1286 +int uam_string_to_bitmap(char * name);
1287 +char * uam_bitmap_to_string(unsigned int bitmap);
1289 +#endif
1290 diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/utils.h afpfs-ng-0.8.1.patch/include/afpfs-ng/utils.h
1291 --- afpfs-ng-0.8.1/include/afpfs-ng/utils.h 1970-01-01 01:00:00.000000000 +0100
1292 +++ afpfs-ng-0.8.1.patch/include/afpfs-ng/utils.h 2011-09-10 12:13:50.116124557 +0200
1293 @@ -0,0 +1,43 @@
1294 +#ifndef __UTILS_H_
1295 +#define __UTILS_H_
1296 +#include <stdio.h>
1298 +#include "afpfs-ng/afp.h"
1300 +#if BYTE_ORDER == BIG_ENDIAN
1301 +#define hton64(x) (x)
1302 +#define ntoh64(x) (x)
1303 +#else /* BYTE_ORDER == BIG_ENDIAN */
1304 +#define hton64(x) ((u_int64_t) (htonl(((x) >> 32) & 0xffffffffLL)) | \
1305 + (u_int64_t) ((htonl(x) & 0xffffffffLL) << 32))
1306 +#define ntoh64(x) (hton64(x))
1307 +#endif /* BYTE_ORDER == BIG_ENDIAN */
1309 +#define min(a,b) (((a)<(b)) ? (a) : (b))
1310 +#define max(a,b) (((a)>(b)) ? (a) : (b))
1314 +unsigned char unixpath_to_afppath(
1315 + struct afp_server * server,
1316 + char * buf);
1318 +unsigned char sizeof_path_header(struct afp_server * server);
1322 +unsigned char copy_from_pascal(char *dest, char *pascal,unsigned int max_len) ;
1323 +unsigned short copy_from_pascal_two(char *dest, char *pascal,unsigned int max_len);
1325 +unsigned char copy_to_pascal(char *dest, const char *src);
1326 +unsigned short copy_to_pascal_two(char *dest, const char *src);
1328 +void copy_path(struct afp_server * server, char * dest, const char * pathname, unsigned char len);
1331 +char * create_path(struct afp_server * server, char * pathname, unsigned short * len);
1334 +int invalid_filename(struct afp_server * server, const char * filename);
1336 +#endif
1337 diff -Naur afpfs-ng-0.8.1/include/afp.h afpfs-ng-0.8.1.patch/include/afp.h
1338 --- afpfs-ng-0.8.1/include/afp.h 2008-03-08 17:08:18.000000000 +0100
1339 +++ afpfs-ng-0.8.1.patch/include/afp.h 1970-01-01 01:00:00.000000000 +0100
1340 @@ -1,533 +0,0 @@
1342 -#ifndef _AFP_H_
1343 -#define _AFP_H_
1345 -#include <arpa/inet.h>
1346 -#include <pthread.h>
1347 -#include <netdb.h>
1348 -#include <sys/statvfs.h>
1349 -#include <pwd.h>
1350 -#include <afp_protocol.h>
1351 -#include <libafpclient.h>
1352 -#include <sys/types.h>
1353 -#include <sys/stat.h>
1354 -#include <unistd.h>
1355 -#include <netinet/in.h>
1358 -#define AFPFS_VERSION "0.8.1"
1360 -/* This is the maximum AFP version this library supports */
1361 -#define AFP_MAX_SUPPORTED_VERSION 32
1363 -/* afp_url is used to pass locations around */
1364 -struct afp_url {
1365 - enum {TCPIP,AT} protocol;
1366 - char username[AFP_MAX_USERNAME_LEN];
1367 - char uamname[50];
1368 - char password[AFP_MAX_PASSWORD_LEN];
1369 - char servername[AFP_SERVER_NAME_UTF8_LEN];
1370 - int port;
1371 - char volumename[AFP_VOLUME_NAME_UTF8_LEN];
1372 - char path[AFP_MAX_PATH];
1374 - int requested_version;
1375 - char zone[AFP_ZONE_LEN]; /* Only used for Appletalk */
1376 - char volpassword[9];;
1379 -struct afp_token {
1380 - unsigned int length;
1381 - char data[AFP_TOKEN_MAX_LEN];
1384 -#define SERVER_MAX_VERSIONS 10
1385 -#define SERVER_MAX_UAMS 10
1387 -struct afp_rx_buffer {
1388 - unsigned int size;
1389 - unsigned int maxsize;
1390 - char * data;
1391 - int errorcode;
1395 -struct afp_file_info {
1396 - unsigned short attributes;
1397 - unsigned int did;
1398 - unsigned int creation_date;
1399 - unsigned int modification_date;
1400 - unsigned int backup_date;
1401 - unsigned int fileid;
1402 - unsigned short offspring;
1403 - char sync;
1404 - char finderinfo[32];
1405 - char name[AFP_MAX_PATH];
1406 - char basename[AFP_MAX_PATH];
1407 - char translated_name[AFP_MAX_PATH];
1408 - struct afp_unixprivs unixprivs;
1409 - unsigned int accessrights;
1410 - struct afp_file_info * next;
1411 - struct afp_file_info * largelist_next;
1412 - unsigned char isdir;
1413 - unsigned long long size;
1414 - unsigned short resourcesize;
1415 - unsigned int resource;
1416 - unsigned short forkid;
1417 - struct afp_icon * icon;
1418 - int eof;
1422 -#define VOLUME_EXTRA_FLAGS_VOL_CHMOD_KNOWN 0x1
1423 -#define VOLUME_EXTRA_FLAGS_VOL_CHMOD_BROKEN 0x2
1424 -#define VOLUME_EXTRA_FLAGS_SHOW_APPLEDOUBLE 0x4
1425 -#define VOLUME_EXTRA_FLAGS_VOL_SUPPORTS_UNIX 0x8
1426 -#define VOLUME_EXTRA_FLAGS_NO_LOCKING 0x10
1427 -#define VOLUME_EXTRA_FLAGS_IGNORE_UNIXPRIVS 0x20
1428 -#define VOLUME_EXTRA_FLAGS_READONLY 0x40
1430 -#define AFP_VOLUME_UNMOUNTED 0
1431 -#define AFP_VOLUME_MOUNTED 1
1432 -#define AFP_VOLUME_UNMOUNTING 2
1434 -struct afp_volume {
1435 - unsigned short volid;
1436 - char flags; /* This is from afpGetSrvrParms */
1437 - unsigned short attributes; /* This is from VolOpen */
1438 - unsigned short signature; /* This is fixed or variable */
1439 - unsigned int creation_date;
1440 - unsigned int modification_date;
1441 - unsigned int backup_date;
1442 - struct statvfs stat;
1443 - unsigned char mounted;
1444 - char mountpoint[255];
1445 - struct afp_server * server;
1446 - char volume_name[AFP_VOLUME_NAME_LEN];
1447 - char volume_name_printable[AFP_VOLUME_NAME_UTF8_LEN];
1448 - unsigned short dtrefnum;
1449 - char volpassword[AFP_VOLPASS_LEN];
1450 - unsigned int extra_flags; /* This is an afpfs-ng specific field */
1452 - /* Our directory ID cache */
1453 - struct did_cache_entry * did_cache_base;
1454 - pthread_mutex_t did_cache_mutex;
1456 - /* Our journal of open forks */
1457 - struct afp_file_info * open_forks;
1458 - pthread_mutex_t open_forks_mutex;
1460 - /* Used to trigger startup */
1461 - pthread_cond_t startup_condition_cond;
1463 - struct {
1464 - uint64_t hits;
1465 - uint64_t misses;
1466 - uint64_t expired;
1467 - uint64_t force_removed;
1468 - } did_cache_stats;
1470 - void * priv; /* This is a private structure for fuse/cmdline, etc */
1471 - pthread_t thread; /* This is the per-volume thread */
1473 - int mapping;
1477 -#define SERVER_STATE_CONNECTED 1
1478 -#define SERVER_STATE_DISCONNECTED 2
1480 -enum server_type{
1481 - AFPFS_SERVER_TYPE_UNKNOWN,
1482 - AFPFS_SERVER_TYPE_NETATALK,
1483 - AFPFS_SERVER_TYPE_AIRPORT,
1484 - AFPFS_SERVER_TYPE_MACINTOSH,
1487 -#define is_netatalk(x) ( (x)->machine_type == AFPFS_SERVER_TYPE_NETATALK )
1488 -#define is_airport(x) ( (x)->machine_type == AFPFS_SERVER_TYPE_AIRPORT )
1489 -#define is_macintosh(x) ( (x)->machine_type == AFPFS_SERVER_TYPE_MACINTOSH )
1493 -struct afp_versions {
1494 - char *av_name;
1495 - int av_number;
1497 -extern struct afp_versions afp_versions[];
1499 -struct afp_server {
1501 - /* Our buffer sizes */
1502 - unsigned int tx_quantum;
1503 - unsigned int rx_quantum;
1505 - unsigned int tx_delay;
1507 - /* Connection information */
1508 - struct sockaddr_in address;
1509 - int fd;
1511 - /* Some stats, for information only */
1512 - struct {
1513 - uint64_t runt_packets;
1514 - uint64_t incoming_dsi;
1515 - uint64_t rx_bytes;
1516 - uint64_t tx_bytes;
1517 - uint64_t requests_pending;
1518 - } stats;
1520 - /* General information */
1521 - char server_name[AFP_SERVER_NAME_LEN];
1522 - char server_name_utf8[AFP_SERVER_NAME_UTF8_LEN];
1523 - char server_name_printable[AFP_SERVER_NAME_UTF8_LEN];
1525 - char machine_type[17];
1526 - char icon[256];
1527 - char signature[16];
1528 - unsigned short flags;
1529 - int connect_state;
1530 - enum server_type server_type;
1532 - /* This is the time we connected */
1533 - time_t connect_time;
1535 - /* UAMs */
1536 - unsigned int supported_uams;
1537 - unsigned int using_uam;
1539 - /* Authentication */
1540 - char username[AFP_MAX_USERNAME_LEN];
1541 - char password[AFP_MAX_PASSWORD_LEN];
1543 - /* Session */
1544 - struct afp_token token;
1545 - char need_resume;
1547 - /* Versions */
1548 - unsigned char requested_version;
1549 - unsigned char versions[SERVER_MAX_VERSIONS];
1550 - struct afp_versions *using_version;
1552 - /* Volumes */
1553 - unsigned char num_volumes;
1554 - struct afp_volume * volumes;
1556 - void * dsi;
1557 - unsigned int exit_flag;
1559 - /* Our DSI request queue */
1560 - pthread_mutex_t requestid_mutex;
1561 - pthread_mutex_t request_queue_mutex;
1562 - unsigned short lastrequestid;
1563 - unsigned short expectedrequestid;
1564 - struct dsi_request * command_requests;
1567 - char loginmesg[200];
1568 - char servermesg[200];
1569 - char path_encoding;
1571 - /* This is the data for the incoming buffer */
1572 - char * incoming_buffer;
1573 - int data_read;
1574 - int bufsize;
1576 - /* And this is for the outgoing queue */
1577 - pthread_mutex_t send_mutex;
1579 - /* This is for user mapping */
1580 - struct passwd passwd;
1581 - unsigned int server_uid, server_gid;
1582 - int server_gid_valid;
1584 - struct afp_server *next;
1586 - /* These are for DSI attention packets */
1587 - unsigned int attention_quantum;
1588 - unsigned int attention_len;
1589 - char * attention_buffer;
1593 -struct afp_extattr_info {
1594 - unsigned int maxsize;
1595 - unsigned int size;
1596 - char data[1024];
1598 -struct afp_comment {
1599 - unsigned int maxsize;
1600 - unsigned int size;
1601 - char *data;
1604 -struct afp_icon {
1605 - unsigned int maxsize;
1606 - unsigned int size;
1607 - char *data;
1610 -#define AFP_DEFAULT_ATTENTION_QUANTUM 1024
1612 -void afp_unixpriv_to_stat(struct afp_file_info *fp,
1613 - struct stat *stat);
1615 -int init_uams(void) ;
1617 -unsigned int find_uam_by_name(const char * name);
1618 -char * uam_bitmap_to_string(unsigned int bitmap);
1621 -char * get_uam_names_list(void);
1623 -unsigned int default_uams_mask(void);
1625 -struct afp_volume * find_volume_by_name(struct afp_server * server,
1626 - const char * volname);
1628 -struct afp_connection_request {
1629 - unsigned int uam_mask;
1630 - struct afp_url url;
1633 -void afp_default_url(struct afp_url *url);
1634 -int afp_parse_url(struct afp_url * url, const char * toparse, int verbose);
1635 -void afp_print_url(struct afp_url * url);
1636 -int afp_url_validate(char * url_string, struct afp_url * valid_url);
1638 -int afp_list_volnames(struct afp_server * server, char * names, int max);
1640 -/* User mapping */
1641 -int afp_detect_mapping(struct afp_volume * volume);
1643 -/* These are some functions that help with simple status text generation */
1645 -int afp_status_header(char * text, int * len);
1646 -int afp_status_server(struct afp_server * s,char * text, int * len);
1649 -struct afp_server * afp_server_full_connect(void * priv, struct afp_connection_request * req);
1651 -void * just_end_it_now(void *other);
1652 -void add_fd_and_signal(int fd);
1653 -void loop_disconnect(struct afp_server *s);
1654 -void afp_wait_for_started_loop(void);
1657 -struct afp_versions * pick_version(unsigned char *versions,
1658 - unsigned char requested) ;
1659 -int pick_uam(unsigned int u1, unsigned int u2);
1661 -int afp_server_login(struct afp_server *server,
1662 - char * mesg, unsigned int *l, unsigned int max);
1665 -int afp_dologin(struct afp_server *server,
1666 - unsigned int uam, char * username, char * passwd);
1668 -void afp_free_server(struct afp_server **server);
1670 -struct afp_server * afp_server_init(struct sockaddr_in * address);
1671 -int afp_get_address(void * priv, const char * hostname, unsigned int port,
1672 - struct sockaddr_in * address);
1675 -int afp_main_loop(int command_fd);
1676 -int afp_main_quick_startup(pthread_t * thread);
1678 -int afp_server_destroy(struct afp_server *s) ;
1679 -int afp_server_reconnect(struct afp_server * s, char * mesg,
1680 - unsigned int *l, unsigned int max);
1681 -int afp_server_connect(struct afp_server *s, int full);
1683 -struct afp_server * afp_server_complete_connection(
1684 - void * priv,
1685 - struct afp_server * server,
1686 - struct sockaddr_in * address, unsigned char * versions,
1687 - unsigned int uams, char * username, char * password,
1688 - unsigned int requested_version, unsigned int uam_mask);
1690 -int afp_connect_volume(struct afp_volume * volume, struct afp_server * server,
1691 - char * mesg, unsigned int * l, unsigned int max);
1692 -int something_is_mounted(struct afp_server * server);
1694 -int add_cache_entry(struct afp_file_info * file) ;
1695 -struct afp_file_info * get_cache_by_name(char * name);
1696 -struct afp_server * find_server_by_address(struct sockaddr_in * address);
1697 -struct afp_server * find_server_by_signature(char * signature);
1698 -struct afp_server * find_server_by_name(char * name);
1699 -int server_still_valid(struct afp_server * server);
1702 -struct afp_server * get_server_base(void);
1703 -int afp_server_remove(struct afp_server * server);
1705 -int afp_unmount_volume(struct afp_volume * volume);
1706 -int afp_unmount_all_volumes(struct afp_server * server);
1708 -#define volume_is_readonly(x) (((x)->attributes&kReadOnly) || \
1709 - ((x)->extra_flags & VOLUME_EXTRA_FLAGS_READONLY))
1711 -int afp_opendt(struct afp_volume *volume, unsigned short * refnum);
1713 -int afp_closedt(struct afp_server * server, unsigned short * refnum);
1715 -int afp_getcomment(struct afp_volume *volume, unsigned int did,
1716 - const char * pathname, struct afp_comment * comment);
1718 -int afp_addcomment(struct afp_volume *volume, unsigned int did,
1719 - const char * pathname, char * comment,uint64_t *size);
1721 -int afp_geticon(struct afp_volume * volume, unsigned int filecreator,
1722 - unsigned int filetype, unsigned char icontype,
1723 - unsigned short length, struct afp_icon * icon);
1725 -/* Things you want to do to a server */
1727 -int afp_getsrvrmsg(struct afp_server *server, unsigned short messagetype,unsigned char utf8, unsigned char block, char * mesg);
1729 -int afp_login(struct afp_server *server, char * uaname,
1730 - char * userauthinfo, unsigned int userauthinfo_len,
1731 - struct afp_rx_buffer *rx);
1733 -int afp_changepassword(struct afp_server *server, char * uaname,
1734 - char * userauthinfo, unsigned int userauthinfo_len,
1735 - struct afp_rx_buffer *rx);
1737 -int afp_logincont(struct afp_server *server, unsigned short id,
1738 - char * userauthinfo, unsigned int userauthinfo_len,
1739 - struct afp_rx_buffer *rx);
1741 -int afp_getsessiontoken(struct afp_server * server, int type,
1742 - unsigned int timestamp, struct afp_token *outgoing_token,
1743 - struct afp_token * incoming_token);
1745 -int afp_getsrvrparms(struct afp_server *server);
1747 -int afp_logout(struct afp_server *server,unsigned char wait);
1749 -int afp_mapname(struct afp_server * server, unsigned char subfunction,
1750 - char * name, unsigned int * id);
1752 -int afp_mapid(struct afp_server * server, unsigned char subfunction,
1753 - unsigned int id, char *name);
1755 -int afp_getuserinfo(struct afp_server * server, int thisuser,
1756 - unsigned int userid, unsigned short bitmap,
1757 - unsigned int *newuid, unsigned int *newgid);
1759 -int afp_zzzzz(struct afp_server *server);
1761 -int afp_volopen(struct afp_volume * volume,
1762 - unsigned short bitmap, char * password);
1764 -int afp_flush(struct afp_volume * volume);
1766 -int afp_getfiledirparms(struct afp_volume *volume, unsigned int did,
1767 - unsigned int filebitmap, unsigned int dirbitmap, const char * pathname,
1768 - struct afp_file_info *fp);
1770 -int afp_enumerate(struct afp_volume * volume,
1771 - unsigned int dirid,
1772 - unsigned int filebitmap, unsigned int dirbitmap,
1773 - unsigned short reqcount,
1774 - unsigned short startindex,
1775 - char * path,
1776 - struct afp_file_info ** file_p);
1778 -int afp_enumerateext2(struct afp_volume * volume,
1779 - unsigned int dirid,
1780 - unsigned int filebitmap, unsigned int dirbitmap,
1781 - unsigned short reqcount,
1782 - unsigned long startindex,
1783 - char * path,
1784 - struct afp_file_info ** file_p);
1786 -int afp_openfork(struct afp_volume * volume,
1787 - unsigned char forktype,
1788 - unsigned int dirid,
1789 - unsigned short accessmode,
1790 - char * filename,
1791 - struct afp_file_info *fp);
1793 -int afp_read(struct afp_volume * volume, unsigned short forkid,
1794 - uint32_t offset,
1795 - uint32_t count, struct afp_rx_buffer * rx);
1797 -int afp_readext(struct afp_volume * volume, unsigned short forkid,
1798 - uint64_t offset,
1799 - uint64_t count, struct afp_rx_buffer * rx);
1801 -int afp_getvolparms(struct afp_volume * volume, unsigned short bitmap);
1804 -int afp_createdir(struct afp_volume * volume, unsigned int dirid, const char * pathname, unsigned int *did_p);
1806 -int afp_delete(struct afp_volume * volume,
1807 - unsigned int dirid, char * pathname);
1810 -int afp_createfile(struct afp_volume * volume, unsigned char flag,
1811 - unsigned int did, char * pathname);
1813 -int afp_write(struct afp_volume * volume, unsigned short forkid,
1814 - uint32_t offset, uint32_t reqcount,
1815 - char * data, uint32_t * written);
1817 -int afp_writeext(struct afp_volume * volume, unsigned short forkid,
1818 - uint64_t offset, uint64_t reqcount,
1819 - char * data, uint64_t * written);
1821 -int afp_flushfork(struct afp_volume * volume, unsigned short forkid);
1823 -int afp_closefork(struct afp_volume * volume, unsigned short forkid);
1824 -int afp_setfileparms(struct afp_volume * volume,
1825 - unsigned int dirid, const char * pathname, unsigned short bitmap,
1826 - struct afp_file_info *fp);
1827 -int afp_setfiledirparms(struct afp_volume * volume,
1828 - unsigned int dirid, const char * pathname, unsigned short bitmap,
1829 - struct afp_file_info *fp);
1831 -int afp_setdirparms(struct afp_volume * volume,
1832 - unsigned int dirid, const char * pathname, unsigned short bitmap,
1833 - struct afp_file_info *fp);
1835 -int afp_volclose(struct afp_volume * volume);
1838 -int afp_setforkparms(struct afp_volume *volume,
1839 - unsigned short forkid, unsigned short bitmap, unsigned long len);
1841 -int afp_byterangelock(struct afp_volume * volume,
1842 - unsigned char flag,
1843 - unsigned short forkid,
1844 - uint32_t offset,
1845 - uint32_t len, uint32_t *generated_offset);
1847 -int afp_byterangelockext(struct afp_volume * volume,
1848 - unsigned char flag,
1849 - unsigned short forkid,
1850 - uint64_t offset,
1851 - uint64_t len, uint64_t *generated_offset);
1853 -int afp_moveandrename(struct afp_volume *volume,
1854 - unsigned int src_did,
1855 - unsigned int dst_did,
1856 - char * src_path, char * dst_path, char *new_name);
1858 -int afp_rename(struct afp_volume * volume,
1859 - unsigned int dirid,
1860 - char * path_from, char * path_to);
1862 -int afp_listextattr(struct afp_volume * volume,
1863 - unsigned int dirid, unsigned short bitmap,
1864 - char * pathname, struct afp_extattr_info * info);
1866 -/* This is a currently undocumented command */
1867 -int afp_newcommand76(struct afp_volume * volume, unsigned int dlen, char * data);
1869 -/* For debugging */
1870 -char * afp_get_command_name(char code);
1873 -#endif
1874 diff -Naur afpfs-ng-0.8.1/include/afp_protocol.h afpfs-ng-0.8.1.patch/include/afp_protocol.h
1875 --- afpfs-ng-0.8.1/include/afp_protocol.h 2008-02-18 04:33:43.000000000 +0100
1876 +++ afpfs-ng-0.8.1.patch/include/afp_protocol.h 1970-01-01 01:00:00.000000000 +0100
1877 @@ -1,361 +0,0 @@
1879 -#ifndef _AFP_PROTOCOL_H_
1880 -#define _AFP_PROTOCOL_H_
1882 -#include <sys/types.h>
1883 -#include <stddef.h>
1884 -#include <unistd.h>
1885 -#include <stdint.h>
1887 -/* This file defines constants for the Apple File Protocol.
1888 - All page references are from "Apple Filing Protocol Programming" version 3.2.
1889 - except where noted.
1892 -#define AFP_SERVER_NAME_LEN 33
1893 -#define AFP_SERVER_NAME_UTF8_LEN 255
1894 -#define AFP_VOLUME_NAME_LEN 33
1895 -#define AFP_VOLUME_NAME_UTF8_LEN 33
1896 -#define AFP_SIGNATURE_LEN 16
1897 -#define AFP_MACHINETYPE_LEN 33
1898 -#define AFP_LOGINMESG_LEN 200
1899 -#define AFP_VOLPASS_LEN 8
1900 -#define AFP_HOSTNAME_LEN 255
1901 -/* This is actually just a guess, and only used for appletalk */
1902 -#define AFP_ZONE_LEN 255
1904 -#define AFP_SERVER_ICON_LEN 256
1907 -#define AFP_MAX_USERNAME_LEN 127
1908 -#define AFP_MAX_PASSWORD_LEN 127
1911 -/* This is the maximum length of any UAM string */
1912 -#define AFP_UAM_LENGTH 24
1914 -/* This is the maximum length of any path description */
1915 -#define AFP_MAX_PATH 768
1917 -#define AFP_VOL_FLAT 1
1918 -#define AFP_VOL_FIXED 2
1919 -#define AFP_VOL_VARIABLE 3
1921 -/* The root directory ID, p.26 */
1923 -#define AFP_ROOT_DID 2
1925 -/* Path type constants, p.249 */
1927 -enum {
1928 -kFPShortName = 1,
1929 -kFPLongName = 2,
1930 -kFPUTF8Name = 3
1933 -/* fork types */
1935 -#define AFP_FORKTYPE_DATA 0x0
1936 -#define AFP_FORKTYPE_RESOURCE 0x80
1938 -/* openfork access modes, from p.196 */
1940 -#define AFP_OPENFORK_ALLOWREAD 1
1941 -#define AFP_OPENFORK_ALLOWWRITE 2
1942 -#define AFP_OPENFORK_DENYREAD 0x10
1943 -#define AFP_OPENFORK_DENYWRITE 0x20
1945 -/* Message type for getsrvmesg, p. 169*/
1947 -typedef enum {
1948 - AFPMESG_LOGIN = 0,
1949 - AFPMESG_SERVER = 1
1950 -} afpmessage_t;
1952 -/* Message bitmap for getsrvrmsg */
1954 -#define AFP_GETSRVRMSG_UTF8 0x2
1955 -#define AFP_GETSRVRMSG_GETMSG 0x1
1958 -/* Maximum Version length, p.17 */
1959 -#define AFP_MAX_VERSION_LENGTH 16
1961 -/* Maximum length of a token, this is undocumented */
1962 -#define AFP_TOKEN_MAX_LEN 256
1964 -/* The maximum size of a file for AFP 2 */
1965 -#define AFP_MAX_AFP2_FILESIZE (4294967296)
1967 -/* Unix privs, p.240 */
1969 -struct afp_unixprivs {
1970 - uint32_t uid __attribute__((__packed__));
1971 - uint32_t gid __attribute__((__packed__));
1972 - uint32_t permissions __attribute__((__packed__));
1973 - uint32_t ua_permissions __attribute__((__packed__));
1978 -/* AFP Volume attributes bitmap, p.241 */
1980 -enum {
1981 - kReadOnly = 0x01,
1982 - kHasVolumePassword = 0x02,
1983 - kSupportsFileIDs = 0x04,
1984 - kSupportsCatSearch = 0x08,
1985 - kSupportsBlankAccessPrivs = 0x10,
1986 - kSupportsUnixPrivs = 0x20,
1987 - kSupportsUTF8Names = 0x40,
1988 - kNoNetworkUserIDs = 0x80,
1989 - kDefaultPrivsFromParent = 0x100,
1990 - kNoExchangeFiles = 0x200,
1991 - kSupportsExtAttrs = 0x400,
1992 - kSupportsACLs=0x800
1995 -/* AFP file creation constantes, p.250 */
1996 -enum {
1997 -kFPSoftCreate = 0,
1998 -kFPHardCreate = 0x80
2001 -/* AFP Directory attributes, taken from the protocol guide p.236 */
2003 -enum {
2004 - kFPAttributeBit = 0x1,
2005 - kFPParentDirIDBit = 0x2,
2006 - kFPCreateDateBit = 0x4,
2007 - kFPModDateBit = 0x8,
2008 - kFPBackupDateBit = 0x10,
2009 - kFPFinderInfoBit = 0x20,
2010 - kFPLongNameBit = 0x40,
2011 - kFPShortNameBit = 0x80,
2012 - kFPNodeIDBit = 0x100,
2013 - kFPOffspringCountBit = 0x0200,
2014 - kFPOwnerIDBit = 0x0400,
2015 - kFPGroupIDBit = 0x0800,
2016 - kFPAccessRightsBit = 0x1000,
2017 - kFPProDOSInfoBit = 0x2000, // AFP version 2.2 and earlier
2018 - kFPUTF8NameBit = 0x2000, // AFP version 3.0 and later
2019 - kFPUnixPrivsBit = 0x8000 // AFP version 3.0 and later
2022 -/* AFP File bitmap, p.238. These are the ones not in the AFP Directory
2023 - attributes map. */
2025 -enum {
2026 - kFPDataForkLenBit = 0x0200,
2027 - kFPRsrcForkLenBit = 0x0400,
2028 - kFPExtDataForkLenBit = 0x0800, // AFP version 3.0 and later
2029 - kFPLaunchLimitBit = 0x1000,
2030 - kFPExtRsrcForkLenBit = 0x4000, // AFP version 3.0 and later
2033 -/* AFP Extended Attributes Bitmap, p.238 */
2035 -enum {
2036 - kXAttrNoFollow = 0x1,
2037 - kXAttrCreate = 0x2,
2038 - kXAttrREplace=0x4
2042 -/* AFP function codes */
2043 -enum AFPFunction
2045 - afpByteRangeLock = 1, afpCloseVol, afpCloseDir, afpCloseFork,
2046 - afpCopyFile, afpCreateDir, afpCreateFile,
2047 - afpDelete, afpEnumerate, afpFlush, afpFlushFork,
2048 - afpGetForkParms = 14, afpGetSrvrInfo, afpGetSrvrParms,
2049 - afpGetVolParms, afpLogin, afpLoginCont, afpLogout, afpMapID,
2050 - afpMapName, afpMoveAndRename, afpOpenVol, afpOpenDir, afpOpenFork,
2051 - afpRead, afpRename, afpSetDirParms, afpSetFileParms,
2052 - afpSetForkParms, afpSetVolParms, afpWrite, afpGetFileDirParms,
2053 - afpSetFileDirParms, afpChangePassword,
2054 - afpGetUserInfo=37,afpGetSrvrMsg = 38,
2055 - afpOpenDT=48,
2056 - afpCloseDT=49,
2057 - afpGetIcon=51, afpGetIconInfo=52,
2058 - afpAddComment=56, afpRemoveComment=57, afpGetComment=58,
2059 - afpByteRangeLockExt=59, afpReadExt, afpWriteExt,
2060 - afpGetAuthMethods=62,
2061 - afp_LoginExt=63,
2062 - afpGetSessionToken=64,
2063 - afpDisconnectOldSession=65,
2064 - afpEnumerateExt=66,
2065 - afpCatSearchExt = 67,
2066 - afpEnumerateExt2 = 68, afpGetExtAttr, afpSetExtAttr,
2067 - afpRemoveExtAttr , afpListExtAttrs,
2068 - afpZzzzz = 122,
2069 - afpAddIcon=192,
2072 -/* AFP Volume bitmap. Take from 242 of the protocol guide. */
2073 -enum {
2074 - kFPBadVolPre222Bitmap = 0xFe00,
2075 - kFPBadVolBitmap = 0xF000,
2076 - kFPVolAttributeBit = 0x1,
2077 - kFPVolSignatureBit = 0x2,
2078 - kFPVolCreateDateBit = 0x4,
2079 - kFPVolModDateBit = 0x8,
2080 - kFPVolBackupDateBit = 0x10,
2081 - kFPVolIDBit = 0x20,
2082 - kFPVolBytesFreeBit = 0x40,
2083 - kFPVolBytesTotalBit = 0x80,
2084 - kFPVolNameBit = 0x100,
2085 - kFPVolExtBytesFreeBit = 0x200,
2086 - kFPVolExtBytesTotalBit = 0x400,
2087 - kFPVolBlockSizeBit = 0x800
2090 -/* AFP Attention Codes -- 4 bits */
2091 -#define AFPATTN_SHUTDOWN (1 << 15) /* shutdown/disconnect */
2092 -#define AFPATTN_CRASH (1 << 14) /* server crashed */
2093 -#define AFPATTN_MESG (1 << 13) /* server has message */
2094 -#define AFPATTN_NORECONNECT (1 << 12) /* don't reconnect */
2095 -/* server notification */
2096 -#define AFPATTN_NOTIFY (AFPATTN_MESG | AFPATTN_NORECONNECT)
2098 -/* extended bitmap -- 12 bits. volchanged is only useful w/ a server
2099 - * notification, and time is only useful for shutdown. */
2100 -#define AFPATTN_VOLCHANGED (1 << 0) /* volume has changed */
2101 -#define AFPATTN_TIME(x) ((x) & 0xfff) /* time in minutes */
2103 -#define kFPNoErr 0
2105 -/* AFP result codes, p252 */
2106 -#define kASPSessClosed -1072
2107 -#define kFPAccessDenied -5000
2108 -#define kFPAuthContinue -5001
2109 -#define kFPBadUAM -5002
2110 -#define kFPBadVersNum -5003
2111 -#define kFPBitmapErr -5004
2112 -#define kFPCantMove -5005
2113 -#define kFPDenyConflict -5006
2114 -#define kFPDirNotEmpty -5007
2115 -#define kFPDiskFull -5008
2116 -#define kFPEOFErr -5009
2117 -#define kFPFileBusy -5010
2118 -#define kFPFlatVol -5011
2119 -#define kFPItemNotFound -5012
2120 -#define kFPLockErr -5013
2121 -#define kFPMiscErr -5014
2122 -#define kFPNoMoreLocks -5015
2123 -#define kFPNoServer -5016
2124 -#define kFPObjectExists -5017
2125 -#define kFPObjectNotFound -5018
2126 -#define kFPParamErr -5019
2127 -#define kFPRangeNotLocked -5020
2128 -#define kFPRangeOverlap -5021
2129 -#define kFPSessClosed -5022
2130 -#define kFPUserNotAuth -5023
2131 -#define kFPCallNotSupported -5024
2132 -#define kFPObjectTypeErr -5025
2133 -#define kFPTooManyFilesOpen -5026
2134 -#define kFPServerGoingDown -5027
2135 -#define kFPCantRename -5028
2136 -#define kFPDirNotFound -5029
2137 -#define kFPIconTypeError -5030
2138 -#define kFPVolLocked -5031
2139 -#define kFPObjectLocked -5032
2140 -#define kFPContainsSharedErr -5033
2141 -#define kFPIDNotFound -5034
2142 -#define kFPIDExists -5035
2143 -#define kFPDiffVolErr -5036
2144 -#define kFPCatalogChanged -5037
2145 -#define kFPSameObjectErr -5038
2146 -#define kFPBadIDErr -5039
2147 -#define kFPPwdSameErr -5040
2148 -#define kFPPwdTooShortErr -5041
2149 -#define kFPPwdExpiredErr -5042
2150 -#define kFPInsideSharedErr -5043
2151 -#define kFPInsideTrashErr -5044
2152 -#define kFPPwdNeedsChangeErr -5045
2153 -#define kFPPwdPolicyErr -5046
2154 -#define kFPDiskQuotaExceeded –5047
2158 -/* These flags determine to lock or unlock in ByteRangeLock(Ext) */
2160 -enum {
2161 -ByteRangeLock_Lock = 0,
2162 -ByteRangeLock_Unlock = 1
2165 -/* These flags are used in volopen and getsrvrparm replies, p.171 */
2167 -#define HasConfigInfo 0x1
2168 -#define HasPassword 0x80
2170 -/* These are the subfunction for kFPMapID, as per p.248 */
2172 -enum {
2173 -kUserIDToName = 1,
2174 -kGroupIDToName = 2,
2175 -kUserIDToUTF8Name = 3,
2176 -kGroupIDToUTF8Name = 4,
2177 -kUserUUIDToUTF8Name = 5,
2178 -kGroupUUIDToUTF8Name = 6
2182 -/* These are the subfunction flags described in the FPMapName command, p.286.
2183 - Note that this is different than what's described on p. 186. */
2185 -enum {
2186 -kNameToUserID = 1,
2187 -kNameToGroupID = 2,
2188 -kUTF8NameToUserID = 3,
2189 -kUTF8NameToGroupID = 4,
2190 -kUTF8NameToUserUUID = 5,
2191 -kUTF8NameToGroupUUID = 6
2194 -/* These are bits for FPGetUserInfo, p.173. */
2195 -#define kFPGetUserInfo_USER_ID 1
2196 -#define kFPGetUserInfo_PRI_GROUPID 2
2198 -/* Flags for the replies of GetSrvrInfo and DSI GetStatus, p.240 */
2200 -enum {
2201 - kSupportsCopyfile = 0x01,
2202 - kSupportsChgPwd = 0x02,
2203 - kDontAllowSavePwd = 0x04,
2204 - kSupportsSrvrMsg = 0x08,
2205 - kSrvrSig = 0x10,
2206 - kSupportsTCP = 0x20,
2207 - kSupportsSrvrNotify = 0x40,
2208 - kSupportsReconnect = 0x80,
2209 - kSupportsDirServices = 0x100,
2210 - kSupportsUTF8SrvrName = 0x200,
2211 - kSupportsUUIDs = 0x400,
2212 - kSupportsSuperClient = 0x8000
2216 -/* p.247 */
2218 -enum {
2219 - kLoginWithoutID = 0,
2220 - kLoginWithID = 1,
2221 - kReconnWithID = 2,
2222 - kLoginWithTimeAndID = 3,
2223 - kReconnWithTimeAndID = 4,
2224 - kRecon1Login = 5,
2225 - kRecon1ReconnectLogin = 6,
2226 - kRecon1Refresh = 7, kGetKerberosSessionKey = 8
2230 -#define AFP_CHMOD_ALLOWED_BITS_22 \
2231 - (S_IRUSR |S_IWUSR | S_IRGRP | S_IWGRP |S_IROTH | S_IWOTH | S_IFREG )
2234 -#endif
2239 diff -Naur afpfs-ng-0.8.1/include/codepage.h afpfs-ng-0.8.1.patch/include/codepage.h
2240 --- afpfs-ng-0.8.1/include/codepage.h 2007-09-23 16:21:30.000000000 +0200
2241 +++ afpfs-ng-0.8.1.patch/include/codepage.h 1970-01-01 01:00:00.000000000 +0100
2242 @@ -1,11 +0,0 @@
2243 -#ifndef __CODE_PAGE_H_
2244 -#define __CODE_PAGE_H_
2245 -int convert_utf8dec_to_utf8pre(const char *src, int src_len,
2246 - char * dest, int dest_len);
2247 -int convert_utf8pre_to_utf8dec(const char * src, int src_len,
2248 - char * dest, int dest_len);
2249 -int convert_path_to_unix(char encoding, char * dest,
2250 - char * src, int dest_len);
2251 -int convert_path_to_afp(char encoding, char * dest,
2252 - char * src, int dest_len);
2253 -#endif
2254 diff -Naur afpfs-ng-0.8.1/include/dsi.h afpfs-ng-0.8.1.patch/include/dsi.h
2255 --- afpfs-ng-0.8.1/include/dsi.h 2008-02-18 04:33:24.000000000 +0100
2256 +++ afpfs-ng-0.8.1.patch/include/dsi.h 1970-01-01 01:00:00.000000000 +0100
2257 @@ -1,33 +0,0 @@
2259 -#ifndef __DSI_H_
2260 -#define __DSI_H_
2262 -#include "afp.h"
2264 -struct dsi_request
2266 - unsigned short requestid;
2267 - unsigned char subcommand;
2268 - void * other;
2269 - unsigned char wait;
2270 - pthread_cond_t condition_cond;
2271 - struct dsi_request * next;
2272 - int return_code;
2275 -int dsi_receive(struct afp_server * server, void * data, int size);
2276 -int dsi_getstatus(struct afp_server * server);
2278 -int dsi_opensession(struct afp_server *server);
2280 -int dsi_send(struct afp_server *server, char * msg, int size,int wait,unsigned char subcommand, void ** other);
2281 -struct dsi_session * dsi_create(struct afp_server *server);
2282 -int dsi_restart(struct afp_server *server);
2283 -int dsi_recv(struct afp_server * server);
2285 -#define DSI_BLOCK_TIMEOUT -1
2286 -#define DSI_DONT_WAIT 0
2287 -#define DSI_DEFAULT_TIMEOUT 5
2290 -#endif
2291 diff -Naur afpfs-ng-0.8.1/include/libafpclient.h afpfs-ng-0.8.1.patch/include/libafpclient.h
2292 --- afpfs-ng-0.8.1/include/libafpclient.h 2008-01-30 05:37:59.000000000 +0100
2293 +++ afpfs-ng-0.8.1.patch/include/libafpclient.h 1970-01-01 01:00:00.000000000 +0100
2294 @@ -1,50 +0,0 @@
2296 -#ifndef __CLIENT_H_
2297 -#define __CLIENT_H_
2299 -#include <unistd.h>
2300 -#include <syslog.h>
2302 -#define MAX_CLIENT_RESPONSE 2048
2305 -enum loglevels {
2306 - AFPFSD,
2309 -struct afp_server;
2310 -struct afp_volume;
2312 -struct libafpclient {
2313 - int (*unmount_volume) (struct afp_volume * volume);
2314 - void (*log_for_client)(void * priv,
2315 - enum loglevels loglevel, int logtype, const char *message);
2316 - void (*forced_ending_hook)(void);
2317 - int (*scan_extra_fds)(int command_fd,fd_set *set, int * max_fd);
2318 - void (*loop_started)(void);
2319 -} ;
2321 -extern struct libafpclient * libafpclient;
2323 -void libafpclient_register(struct libafpclient * tmpclient);
2326 -void signal_main_thread(void);
2328 -/* These are logging functions */
2330 -#define MAXLOGSIZE 2048
2332 -#define LOG_METHOD_SYSLOG 1
2333 -#define LOG_METHOD_STDOUT 2
2335 -void set_log_method(int m);
2338 -void log_for_client(void * priv,
2339 - enum loglevels loglevel, int logtype, char * message,...);
2341 -void stdout_log_for_client(void * priv,
2342 - enum loglevels loglevel, int logtype, const char *message);
2344 -#endif
2345 diff -Naur afpfs-ng-0.8.1/include/Makefile.am afpfs-ng-0.8.1.patch/include/Makefile.am
2346 --- afpfs-ng-0.8.1/include/Makefile.am 1970-01-01 01:00:00.000000000 +0100
2347 +++ afpfs-ng-0.8.1.patch/include/Makefile.am 2011-09-10 12:13:50.126124692 +0200
2348 @@ -0,0 +1,3 @@
2349 +## Process this file with automake to produce Makefile.in
2351 +SUBDIRS = afpfs-ng
2352 diff -Naur afpfs-ng-0.8.1/include/map_def.h afpfs-ng-0.8.1.patch/include/map_def.h
2353 --- afpfs-ng-0.8.1/include/map_def.h 2008-01-17 05:55:46.000000000 +0100
2354 +++ afpfs-ng-0.8.1.patch/include/map_def.h 1970-01-01 01:00:00.000000000 +0100
2355 @@ -1,15 +0,0 @@
2356 -#ifndef __MAP_H_
2357 -#define __MAP_H_
2359 -#include "afp.h"
2361 -#define AFP_MAPPING_UNKNOWN 0
2362 -#define AFP_MAPPING_COMMON 1
2363 -#define AFP_MAPPING_LOGINIDS 2
2364 -#define AFP_MAPPING_NAME 3
2366 -unsigned int map_string_to_num(char * name);
2367 -char * get_mapping_name(struct afp_volume * volume);
2370 -#endif
2371 diff -Naur afpfs-ng-0.8.1/include/midlevel.h afpfs-ng-0.8.1.patch/include/midlevel.h
2372 --- afpfs-ng-0.8.1/include/midlevel.h 2007-12-24 20:39:25.000000000 +0100
2373 +++ afpfs-ng-0.8.1.patch/include/midlevel.h 1970-01-01 01:00:00.000000000 +0100
2374 @@ -1,64 +0,0 @@
2375 -#ifndef __MIDLEVEL_H_
2376 -#define __MIDLEVEL_H_
2378 -#include <utime.h>
2379 -#include "afp.h"
2381 -int ml_open(struct afp_volume * volume, const char *path, int flags,
2382 - struct afp_file_info **newfp);
2384 -int ml_creat(struct afp_volume * volume, const char *path,mode_t mode);
2386 -int ml_readdir(struct afp_volume * volume,
2387 - const char *path,
2388 - struct afp_file_info **base);
2390 -int ml_read(struct afp_volume * volume, const char *path,
2391 - char *buf, size_t size, off_t offset,
2392 - struct afp_file_info *fp, int * eof);
2394 -int ml_chmod(struct afp_volume * vol, const char * path, mode_t mode);
2396 -int ml_unlink(struct afp_volume * vol, const char *path);
2398 -int ml_mkdir(struct afp_volume * vol, const char * path, mode_t mode);
2400 -int ml_close(struct afp_volume * volume, const char * path,
2401 - struct afp_file_info * fp);
2403 -int ml_getattr(struct afp_volume * volume, const char *path,
2404 - struct stat *stbuf);
2406 -int ml_write(struct afp_volume * volume, const char * path,
2407 - const char *data, size_t size, off_t offset,
2408 - struct afp_file_info * fp, uid_t uid,
2409 - gid_t gid);
2411 -int ml_readlink(struct afp_volume * vol, const char * path,
2412 - char *buf, size_t size);
2414 -int ml_rmdir(struct afp_volume * vol, const char *path);
2416 -int ml_chown(struct afp_volume * vol, const char * path,
2417 - uid_t uid, gid_t gid);
2419 -int ml_truncate(struct afp_volume * vol, const char * path, off_t offset);
2421 -int ml_utime(struct afp_volume * vol, const char * path,
2422 - struct utimbuf * timebuf);
2424 -int ml_symlink(struct afp_volume *vol, const char * path1, const char * path2);
2426 -int ml_rename(struct afp_volume * vol,
2427 - const char * path_from, const char * path_to);
2429 -int ml_statfs(struct afp_volume * vol, const char *path, struct statvfs *stat);
2431 -void afp_ml_filebase_free(struct afp_file_info **filebase);
2433 -int ml_passwd(struct afp_server *server,
2434 - char * username, char * oldpasswd, char * newpasswd);
2438 -#endif
2439 diff -Naur afpfs-ng-0.8.1/include/uams_def.h afpfs-ng-0.8.1.patch/include/uams_def.h
2440 --- afpfs-ng-0.8.1/include/uams_def.h 2007-09-07 15:10:51.000000000 +0200
2441 +++ afpfs-ng-0.8.1.patch/include/uams_def.h 1970-01-01 01:00:00.000000000 +0100
2442 @@ -1,16 +0,0 @@
2443 -#ifndef __UAM_DEFS_H_
2444 -#define __UAM_DEFS_H_
2446 -#define UAM_NOUSERAUTHENT 0x1
2447 -#define UAM_CLEARTXTPASSWRD 0x2
2448 -#define UAM_RANDNUMEXCHANGE 0x4
2449 -#define UAM_2WAYRANDNUM 0x8
2450 -#define UAM_DHCAST128 0x10
2451 -#define UAM_CLIENTKRB 0x20
2452 -#define UAM_DHX2 0x40
2453 -#define UAM_RECON1 0x80
2455 -int uam_string_to_bitmap(char * name);
2456 -char * uam_bitmap_to_string(unsigned int bitmap);
2458 -#endif
2459 diff -Naur afpfs-ng-0.8.1/include/utils.h afpfs-ng-0.8.1.patch/include/utils.h
2460 --- afpfs-ng-0.8.1/include/utils.h 2008-02-18 04:33:58.000000000 +0100
2461 +++ afpfs-ng-0.8.1.patch/include/utils.h 1970-01-01 01:00:00.000000000 +0100
2462 @@ -1,43 +0,0 @@
2463 -#ifndef __UTILS_H_
2464 -#define __UTILS_H_
2465 -#include <stdio.h>
2467 -#include "afp.h"
2469 -#if BYTE_ORDER == BIG_ENDIAN
2470 -#define hton64(x) (x)
2471 -#define ntoh64(x) (x)
2472 -#else /* BYTE_ORDER == BIG_ENDIAN */
2473 -#define hton64(x) ((u_int64_t) (htonl(((x) >> 32) & 0xffffffffLL)) | \
2474 - (u_int64_t) ((htonl(x) & 0xffffffffLL) << 32))
2475 -#define ntoh64(x) (hton64(x))
2476 -#endif /* BYTE_ORDER == BIG_ENDIAN */
2478 -#define min(a,b) (((a)<(b)) ? (a) : (b))
2479 -#define max(a,b) (((a)>(b)) ? (a) : (b))
2483 -unsigned char unixpath_to_afppath(
2484 - struct afp_server * server,
2485 - char * buf);
2487 -unsigned char sizeof_path_header(struct afp_server * server);
2491 -unsigned char copy_from_pascal(char *dest, char *pascal,unsigned int max_len) ;
2492 -unsigned short copy_from_pascal_two(char *dest, char *pascal,unsigned int max_len);
2494 -unsigned char copy_to_pascal(char *dest, const char *src);
2495 -unsigned short copy_to_pascal_two(char *dest, const char *src);
2497 -void copy_path(struct afp_server * server, char * dest, const char * pathname, unsigned char len);
2500 -char * create_path(struct afp_server * server, char * pathname, unsigned short * len);
2503 -int invalid_filename(struct afp_server * server, const char * filename);
2505 -#endif
2506 diff -Naur afpfs-ng-0.8.1/lib/afp.c afpfs-ng-0.8.1.patch/lib/afp.c
2507 --- afpfs-ng-0.8.1/lib/afp.c 2008-03-08 03:44:16.000000000 +0100
2508 +++ afpfs-ng-0.8.1.patch/lib/afp.c 2011-09-10 12:13:50.131124759 +0200
2509 @@ -9,7 +9,7 @@
2513 -#include "afp.h"
2514 +#include "afpfs-ng/afp.h"
2515 #include <config.h>
2517 #include <stdio.h>
2518 @@ -21,17 +21,17 @@
2519 #include <sys/socket.h>
2520 #include <errno.h>
2522 -#include "afp_protocol.h"
2523 -#include "libafpclient.h"
2524 +#include "afpfs-ng/afp_protocol.h"
2525 +#include "afpfs-ng/libafpclient.h"
2526 #include "server.h"
2527 -#include "dsi.h"
2528 +#include "afpfs-ng/dsi.h"
2529 #include "dsi_protocol.h"
2530 -#include "utils.h"
2531 +#include "afpfs-ng/utils.h"
2532 #include "afp_replies.h"
2533 #include "afp_internal.h"
2534 #include "did.h"
2535 #include "forklist.h"
2536 -#include "codepage.h"
2537 +#include "afpfs-ng/codepage.h"
2539 struct afp_versions afp_versions[] = {
2540 { "AFPVersion 1.1", 11 },
2541 diff -Naur afpfs-ng-0.8.1/lib/afp_internal.h afpfs-ng-0.8.1.patch/lib/afp_internal.h
2542 --- afpfs-ng-0.8.1/lib/afp_internal.h 2007-11-09 05:27:20.000000000 +0100
2543 +++ afpfs-ng-0.8.1.patch/lib/afp_internal.h 2011-09-10 12:13:50.132124772 +0200
2544 @@ -1,7 +1,7 @@
2545 #ifndef _AFP_INTERNAL_H_
2546 #define _AFP_INTERNAL_H_
2548 -#include "afp.h"
2549 +#include "afpfs-ng/afp.h"
2551 extern struct afp_versions afp_versions[];
2553 diff -Naur afpfs-ng-0.8.1/lib/afp_url.c afpfs-ng-0.8.1.patch/lib/afp_url.c
2554 --- afpfs-ng-0.8.1/lib/afp_url.c 2008-03-04 21:16:49.000000000 +0100
2555 +++ afpfs-ng-0.8.1.patch/lib/afp_url.c 2011-09-10 12:13:50.132124772 +0200
2556 @@ -3,7 +3,7 @@
2557 #include <stdio.h>
2558 #include <stdlib.h>
2559 #include <errno.h>
2560 -#include "afp.h"
2561 +#include "afpfs-ng/afp.h"
2563 void afp_default_url(struct afp_url *url)
2565 diff -Naur afpfs-ng-0.8.1/lib/client.c afpfs-ng-0.8.1.patch/lib/client.c
2566 --- afpfs-ng-0.8.1/lib/client.c 2008-02-18 04:36:30.000000000 +0100
2567 +++ afpfs-ng-0.8.1.patch/lib/client.c 2011-09-10 12:13:50.132124772 +0200
2568 @@ -1,5 +1,5 @@
2569 -#include <afp.h>
2570 -#include <libafpclient.h>
2571 +#include <afpfs-ng/afp.h>
2572 +#include <afpfs-ng/libafpclient.h>
2575 struct libafpclient * libafpclient = NULL;
2576 diff -Naur afpfs-ng-0.8.1/lib/codepage.c afpfs-ng-0.8.1.patch/lib/codepage.c
2577 --- afpfs-ng-0.8.1/lib/codepage.c 2008-02-18 04:36:54.000000000 +0100
2578 +++ afpfs-ng-0.8.1.patch/lib/codepage.c 2011-09-10 12:13:50.133124786 +0200
2579 @@ -14,8 +14,8 @@
2581 #include <string.h>
2582 #include <stdlib.h>
2583 -#include "afp_protocol.h"
2584 -#include "utils.h"
2585 +#include "afpfs-ng/afp_protocol.h"
2586 +#include "afpfs-ng/utils.h"
2587 #include "unicode.h"
2589 int convert_utf8dec_to_utf8pre(const char *src, int src_len,
2590 diff -Naur afpfs-ng-0.8.1/lib/connect.c afpfs-ng-0.8.1.patch/lib/connect.c
2591 --- afpfs-ng-0.8.1/lib/connect.c 2008-02-18 04:38:59.000000000 +0100
2592 +++ afpfs-ng-0.8.1.patch/lib/connect.c 2011-09-10 12:13:50.133124786 +0200
2593 @@ -10,13 +10,13 @@
2594 #include <string.h>
2595 #include <sys/socket.h>
2597 -#include "afp.h"
2598 -#include "dsi.h"
2599 -#include "utils.h"
2600 -#include "uams_def.h"
2601 -#include "codepage.h"
2602 +#include "afpfs-ng/afp.h"
2603 +#include "afpfs-ng/dsi.h"
2604 +#include "afpfs-ng/utils.h"
2605 +#include "afpfs-ng/uams_def.h"
2606 +#include "afpfs-ng/codepage.h"
2607 #include "users.h"
2608 -#include "libafpclient.h"
2609 +#include "afpfs-ng/libafpclient.h"
2610 #include "server.h"
2613 diff -Naur afpfs-ng-0.8.1/lib/did.c afpfs-ng-0.8.1.patch/lib/did.c
2614 --- afpfs-ng-0.8.1/lib/did.c 2008-02-18 04:39:17.000000000 +0100
2615 +++ afpfs-ng-0.8.1.patch/lib/did.c 2011-09-10 12:13:50.133124786 +0200
2616 @@ -9,8 +9,8 @@
2617 #include <string.h>
2618 #include <stdio.h>
2620 -#include "afp.h"
2621 -#include "afp_protocol.h"
2622 +#include "afpfs-ng/afp.h"
2623 +#include "afpfs-ng/afp_protocol.h"
2625 #undef DID_CACHE_DISABLE
2627 diff -Naur afpfs-ng-0.8.1/lib/dsi.c afpfs-ng-0.8.1.patch/lib/dsi.c
2628 --- afpfs-ng-0.8.1/lib/dsi.c 2008-02-18 04:53:03.000000000 +0100
2629 +++ afpfs-ng-0.8.1.patch/lib/dsi.c 2011-09-10 12:13:50.134124800 +0200
2630 @@ -19,12 +19,12 @@
2631 #include <signal.h>
2632 #include <iconv.h>
2634 -#include "utils.h"
2635 -#include "dsi.h"
2636 -#include "afp.h"
2637 -#include "uams_def.h"
2638 +#include "afpfs-ng/utils.h"
2639 +#include "afpfs-ng/dsi.h"
2640 +#include "afpfs-ng/afp.h"
2641 +#include "afpfs-ng/uams_def.h"
2642 #include "dsi_protocol.h"
2643 -#include "libafpclient.h"
2644 +#include "afpfs-ng/libafpclient.h"
2645 #include "afp_internal.h"
2646 #include "afp_replies.h"
2648 diff -Naur afpfs-ng-0.8.1/lib/forklist.c afpfs-ng-0.8.1.patch/lib/forklist.c
2649 --- afpfs-ng-0.8.1/lib/forklist.c 2008-01-17 05:49:16.000000000 +0100
2650 +++ afpfs-ng-0.8.1.patch/lib/forklist.c 2011-09-10 12:13:50.135124814 +0200
2651 @@ -10,7 +10,7 @@
2655 -#include "afp.h"
2656 +#include "afpfs-ng/afp.h"
2658 #include <stdlib.h>
2659 #include <pthread.h>
2660 diff -Naur afpfs-ng-0.8.1/lib/log.c afpfs-ng-0.8.1.patch/lib/log.c
2661 --- afpfs-ng-0.8.1/lib/log.c 2008-01-30 05:37:58.000000000 +0100
2662 +++ afpfs-ng-0.8.1.patch/lib/log.c 2011-09-10 12:13:50.135124814 +0200
2663 @@ -3,7 +3,7 @@
2664 #include <stdarg.h>
2665 #include <string.h>
2666 #include <stdlib.h>
2667 -#include "libafpclient.h"
2668 +#include "afpfs-ng/libafpclient.h"
2670 void log_for_client(void * priv,
2671 enum loglevels loglevel, int logtype, char *format, ...) {
2672 diff -Naur afpfs-ng-0.8.1/lib/loop.c afpfs-ng-0.8.1.patch/lib/loop.c
2673 --- afpfs-ng-0.8.1/lib/loop.c 2008-02-18 04:40:11.000000000 +0100
2674 +++ afpfs-ng-0.8.1.patch/lib/loop.c 2011-09-10 12:13:50.135124814 +0200
2675 @@ -16,9 +16,9 @@
2676 #include <sys/time.h>
2677 #include <signal.h>
2679 -#include "afp.h"
2680 -#include "dsi.h"
2681 -#include "utils.h"
2682 +#include "afpfs-ng/afp.h"
2683 +#include "afpfs-ng/dsi.h"
2684 +#include "afpfs-ng/utils.h"
2686 #define SIGNAL_TO_USE SIGUSR2
2688 diff -Naur afpfs-ng-0.8.1/lib/lowlevel.c afpfs-ng-0.8.1.patch/lib/lowlevel.c
2689 --- afpfs-ng-0.8.1/lib/lowlevel.c 2008-02-20 02:33:17.000000000 +0100
2690 +++ afpfs-ng-0.8.1.patch/lib/lowlevel.c 2011-09-10 12:13:50.136124828 +0200
2691 @@ -19,10 +19,10 @@
2692 #else
2693 #include <fcntl.h>
2694 #endif
2695 -#include "afp.h"
2696 -#include "afp_protocol.h"
2697 -#include "codepage.h"
2698 -#include "utils.h"
2699 +#include "afpfs-ng/afp.h"
2700 +#include "afpfs-ng/afp_protocol.h"
2701 +#include "afpfs-ng/codepage.h"
2702 +#include "afpfs-ng/utils.h"
2703 #include "did.h"
2704 #include "users.h"
2706 diff -Naur afpfs-ng-0.8.1/lib/map_def.c afpfs-ng-0.8.1.patch/lib/map_def.c
2707 --- afpfs-ng-0.8.1/lib/map_def.c 2007-09-07 15:10:59.000000000 +0200
2708 +++ afpfs-ng-0.8.1.patch/lib/map_def.c 2011-09-10 12:13:50.136124828 +0200
2709 @@ -1,6 +1,6 @@
2710 #include <string.h>
2711 -#include "afp.h"
2712 -#include "map_def.h"
2713 +#include "afpfs-ng/afp.h"
2714 +#include "afpfs-ng/map_def.h"
2716 static char *afp_map_strings[] = {
2717 "Unknown",
2718 diff -Naur afpfs-ng-0.8.1/lib/meta.c afpfs-ng-0.8.1.patch/lib/meta.c
2719 --- afpfs-ng-0.8.1/lib/meta.c 2008-01-04 04:52:44.000000000 +0100
2720 +++ afpfs-ng-0.8.1.patch/lib/meta.c 2011-09-10 12:13:50.137124841 +0200
2721 @@ -17,10 +17,10 @@
2722 #include <unistd.h>
2723 #include <sys/time.h>
2725 -#include "afp.h"
2726 -#include "dsi.h"
2727 -#include "afp_protocol.h"
2728 -#include "utils.h"
2729 +#include "afpfs-ng/afp.h"
2730 +#include "afpfs-ng/dsi.h"
2731 +#include "afpfs-ng/afp_protocol.h"
2732 +#include "afpfs-ng/utils.h"
2735 int afp_meta_getattr(const char *path, struct stat *stbuf)
2736 diff -Naur afpfs-ng-0.8.1/lib/midlevel.c afpfs-ng-0.8.1.patch/lib/midlevel.c
2737 --- afpfs-ng-0.8.1/lib/midlevel.c 2008-03-08 17:08:18.000000000 +0100
2738 +++ afpfs-ng-0.8.1.patch/lib/midlevel.c 2011-09-10 12:13:50.160125150 +0200
2739 @@ -10,7 +10,7 @@
2743 -#include "afp.h"
2744 +#include "afpfs-ng/afp.h"
2746 #include <sys/stat.h>
2747 #include <string.h>
2748 @@ -28,9 +28,9 @@
2749 #include "users.h"
2750 #include "did.h"
2751 #include "resource.h"
2752 -#include "utils.h"
2753 -#include "codepage.h"
2754 -#include "midlevel.h"
2755 +#include "afpfs-ng/utils.h"
2756 +#include "afpfs-ng/codepage.h"
2757 +#include "afpfs-ng/midlevel.h"
2758 #include "afp_internal.h"
2759 #include "forklist.h"
2760 #include "uams.h"
2761 diff -Naur afpfs-ng-0.8.1/lib/proto_attr.c afpfs-ng-0.8.1.patch/lib/proto_attr.c
2762 --- afpfs-ng-0.8.1/lib/proto_attr.c 2008-01-30 05:37:58.000000000 +0100
2763 +++ afpfs-ng-0.8.1.patch/lib/proto_attr.c 2011-09-10 12:13:50.168125257 +0200
2764 @@ -7,10 +7,10 @@
2766 #include <string.h>
2767 #include <stdlib.h>
2768 -#include "dsi.h"
2769 -#include "afp.h"
2770 -#include "utils.h"
2771 -#include "afp_protocol.h"
2772 +#include "afpfs-ng/dsi.h"
2773 +#include "afpfs-ng/afp.h"
2774 +#include "afpfs-ng/utils.h"
2775 +#include "afpfs-ng/afp_protocol.h"
2776 #include "dsi_protocol.h"
2778 /* This is a new command, function 76. There are currently no docs, so this
2779 diff -Naur afpfs-ng-0.8.1/lib/proto_desktop.c afpfs-ng-0.8.1.patch/lib/proto_desktop.c
2780 --- afpfs-ng-0.8.1/lib/proto_desktop.c 2008-02-18 04:44:11.000000000 +0100
2781 +++ afpfs-ng-0.8.1.patch/lib/proto_desktop.c 2011-09-10 12:13:50.168125257 +0200
2782 @@ -9,10 +9,10 @@
2783 #include <string.h>
2784 #include <stdlib.h>
2786 -#include "dsi.h"
2787 -#include "afp.h"
2788 -#include "utils.h"
2789 -#include "afp_protocol.h"
2790 +#include "afpfs-ng/dsi.h"
2791 +#include "afpfs-ng/afp.h"
2792 +#include "afpfs-ng/utils.h"
2793 +#include "afpfs-ng/afp_protocol.h"
2794 #include "dsi_protocol.h"
2796 /* closedt, addicon, geticoninfo, addappl, removeappl */
2797 diff -Naur afpfs-ng-0.8.1/lib/proto_directory.c afpfs-ng-0.8.1.patch/lib/proto_directory.c
2798 --- afpfs-ng-0.8.1/lib/proto_directory.c 2008-02-19 03:39:29.000000000 +0100
2799 +++ afpfs-ng-0.8.1.patch/lib/proto_directory.c 2011-09-10 12:13:50.168125257 +0200
2800 @@ -9,10 +9,10 @@
2801 #include <string.h>
2802 #include <stdlib.h>
2804 -#include "dsi.h"
2805 -#include "afp.h"
2806 -#include "utils.h"
2807 -#include "afp_protocol.h"
2808 +#include "afpfs-ng/dsi.h"
2809 +#include "afpfs-ng/afp.h"
2810 +#include "afpfs-ng/utils.h"
2811 +#include "afpfs-ng/afp_protocol.h"
2812 #include "dsi_protocol.h"
2813 #include "afp_replies.h"
2815 diff -Naur afpfs-ng-0.8.1/lib/proto_files.c afpfs-ng-0.8.1.patch/lib/proto_files.c
2816 --- afpfs-ng-0.8.1/lib/proto_files.c 2008-02-18 04:46:18.000000000 +0100
2817 +++ afpfs-ng-0.8.1.patch/lib/proto_files.c 2011-09-10 12:13:50.169125270 +0200
2818 @@ -8,11 +8,11 @@
2820 #include <stdlib.h>
2821 #include <string.h>
2822 -#include "dsi.h"
2823 -#include "afp.h"
2824 -#include "utils.h"
2825 +#include "afpfs-ng/dsi.h"
2826 +#include "afpfs-ng/afp.h"
2827 +#include "afpfs-ng/utils.h"
2828 #include "dsi_protocol.h"
2829 -#include "afp_protocol.h"
2830 +#include "afpfs-ng/afp_protocol.h"
2831 #include "afp_internal.h"
2833 /* afp_setfileparms, afp_setdirparms and afpsetfiledirparms are all remarkably
2834 diff -Naur afpfs-ng-0.8.1/lib/proto_fork.c afpfs-ng-0.8.1.patch/lib/proto_fork.c
2835 --- afpfs-ng-0.8.1/lib/proto_fork.c 2008-01-30 05:37:58.000000000 +0100
2836 +++ afpfs-ng-0.8.1.patch/lib/proto_fork.c 2011-09-10 12:13:50.169125270 +0200
2837 @@ -9,11 +9,11 @@
2838 #include <stdlib.h>
2839 #include <string.h>
2841 -#include "dsi.h"
2842 -#include "afp.h"
2843 -#include "utils.h"
2844 +#include "afpfs-ng/dsi.h"
2845 +#include "afpfs-ng/afp.h"
2846 +#include "afpfs-ng/utils.h"
2847 #include "dsi_protocol.h"
2848 -#include "afp_protocol.h"
2849 +#include "afpfs-ng/afp_protocol.h"
2851 int afp_setforkparms(struct afp_volume * volume,
2852 unsigned short forkid, unsigned short bitmap, unsigned long len)
2853 diff -Naur afpfs-ng-0.8.1/lib/proto_login.c afpfs-ng-0.8.1.patch/lib/proto_login.c
2854 --- afpfs-ng-0.8.1/lib/proto_login.c 2008-01-30 05:37:59.000000000 +0100
2855 +++ afpfs-ng-0.8.1.patch/lib/proto_login.c 2011-09-10 12:13:50.169125270 +0200
2856 @@ -10,10 +10,10 @@
2858 #include <stdlib.h>
2859 #include <string.h>
2860 -#include "dsi.h"
2861 +#include "afpfs-ng/dsi.h"
2862 #include "dsi_protocol.h"
2863 -#include "afp.h"
2864 -#include "utils.h"
2865 +#include "afpfs-ng/afp.h"
2866 +#include "afpfs-ng/utils.h"
2867 #include "afp_internal.h"
2870 diff -Naur afpfs-ng-0.8.1/lib/proto_map.c afpfs-ng-0.8.1.patch/lib/proto_map.c
2871 --- afpfs-ng-0.8.1/lib/proto_map.c 2008-01-30 05:37:59.000000000 +0100
2872 +++ afpfs-ng-0.8.1.patch/lib/proto_map.c 2011-09-10 12:13:50.170125283 +0200
2873 @@ -9,11 +9,11 @@
2874 #include <stdlib.h>
2875 #include <string.h>
2877 -#include "dsi.h"
2878 -#include "afp.h"
2879 -#include "utils.h"
2880 +#include "afpfs-ng/dsi.h"
2881 +#include "afpfs-ng/afp.h"
2882 +#include "afpfs-ng/utils.h"
2883 #include "dsi_protocol.h"
2884 -#include "afp_protocol.h"
2885 +#include "afpfs-ng/afp_protocol.h"
2887 /* This is used to pass the return values back from afp_getuserinfo_reply() */
2888 struct uidgid {
2889 diff -Naur afpfs-ng-0.8.1/lib/proto_replyblock.c afpfs-ng-0.8.1.patch/lib/proto_replyblock.c
2890 --- afpfs-ng-0.8.1/lib/proto_replyblock.c 2008-02-18 04:46:19.000000000 +0100
2891 +++ afpfs-ng-0.8.1.patch/lib/proto_replyblock.c 2011-09-10 12:13:50.170125283 +0200
2892 @@ -6,9 +6,9 @@
2895 #include <string.h>
2896 -#include "dsi.h"
2897 -#include "afp.h"
2898 -#include "utils.h"
2899 +#include "afpfs-ng/dsi.h"
2900 +#include "afpfs-ng/afp.h"
2901 +#include "afpfs-ng/utils.h"
2902 #include "afp_internal.h"
2905 diff -Naur afpfs-ng-0.8.1/lib/proto_server.c afpfs-ng-0.8.1.patch/lib/proto_server.c
2906 --- afpfs-ng-0.8.1/lib/proto_server.c 2008-02-19 02:56:21.000000000 +0100
2907 +++ afpfs-ng-0.8.1.patch/lib/proto_server.c 2011-09-10 12:13:50.170125283 +0200
2908 @@ -7,12 +7,12 @@
2910 #include <stdlib.h>
2911 #include <string.h>
2912 -#include "dsi.h"
2913 -#include "afp.h"
2914 -#include "utils.h"
2915 +#include "afpfs-ng/dsi.h"
2916 +#include "afpfs-ng/afp.h"
2917 +#include "afpfs-ng/utils.h"
2918 #include "dsi_protocol.h"
2919 -#include "afp_protocol.h"
2920 -#include "codepage.h"
2921 +#include "afpfs-ng/afp_protocol.h"
2922 +#include "afpfs-ng/codepage.h"
2923 #include "afp_internal.h"
2925 int afp_getsrvrparms(struct afp_server *server)
2926 diff -Naur afpfs-ng-0.8.1/lib/proto_session.c afpfs-ng-0.8.1.patch/lib/proto_session.c
2927 --- afpfs-ng-0.8.1/lib/proto_session.c 2008-02-18 04:46:19.000000000 +0100
2928 +++ afpfs-ng-0.8.1.patch/lib/proto_session.c 2011-09-10 12:13:50.170125283 +0200
2929 @@ -8,10 +8,10 @@
2931 #include <stdlib.h>
2932 #include <string.h>
2933 -#include "dsi.h"
2934 +#include "afpfs-ng/dsi.h"
2935 #include "dsi_protocol.h"
2936 -#include "afp.h"
2937 -#include "utils.h"
2938 +#include "afpfs-ng/afp.h"
2939 +#include "afpfs-ng/utils.h"
2941 int afp_getsessiontoken(struct afp_server * server, int type,
2942 unsigned int timestamp, struct afp_token *outgoing_token,
2943 diff -Naur afpfs-ng-0.8.1/lib/proto_volume.c afpfs-ng-0.8.1.patch/lib/proto_volume.c
2944 --- afpfs-ng-0.8.1/lib/proto_volume.c 2008-02-18 04:47:48.000000000 +0100
2945 +++ afpfs-ng-0.8.1.patch/lib/proto_volume.c 2011-09-10 12:13:50.171125296 +0200
2946 @@ -8,13 +8,13 @@
2948 #include <string.h>
2949 #include <stdlib.h>
2950 -#include "dsi.h"
2951 -#include "afp.h"
2952 -#include "utils.h"
2953 +#include "afpfs-ng/dsi.h"
2954 +#include "afpfs-ng/afp.h"
2955 +#include "afpfs-ng/utils.h"
2956 #include "dsi_protocol.h"
2957 -#include "afp_protocol.h"
2958 +#include "afpfs-ng/afp_protocol.h"
2959 #include "afp_internal.h"
2960 -#include "codepage.h"
2961 +#include "afpfs-ng/codepage.h"
2963 static int parse_volbitmap_reply(struct afp_server * server,
2964 struct afp_volume * tmpvol,
2965 diff -Naur afpfs-ng-0.8.1/lib/resource.c afpfs-ng-0.8.1.patch/lib/resource.c
2966 --- afpfs-ng-0.8.1/lib/resource.c 2008-02-18 04:46:56.000000000 +0100
2967 +++ afpfs-ng-0.8.1.patch/lib/resource.c 2011-09-10 12:13:50.171125296 +0200
2968 @@ -3,11 +3,11 @@
2969 #include <string.h>
2970 #include <errno.h>
2971 #include <fcntl.h>
2972 -#include "afp.h"
2973 +#include "afpfs-ng/afp.h"
2974 #include "resource.h"
2975 #include "lowlevel.h"
2976 #include "did.h"
2977 -#include "midlevel.h"
2978 +#include "afpfs-ng/midlevel.h"
2980 #define appledouble ".AppleDouble"
2981 #define finderinfo_string ".finderinfo"
2982 diff -Naur afpfs-ng-0.8.1/lib/server.c afpfs-ng-0.8.1.patch/lib/server.c
2983 --- afpfs-ng-0.8.1/lib/server.c 2008-02-19 02:56:21.000000000 +0100
2984 +++ afpfs-ng-0.8.1.patch/lib/server.c 2011-09-10 12:13:50.172125310 +0200
2985 @@ -8,15 +8,15 @@
2986 #include <string.h>
2987 #include <time.h>
2989 -#include "afp.h"
2990 -#include "dsi.h"
2991 -#include "utils.h"
2992 -#include "uams_def.h"
2993 -#include "codepage.h"
2994 +#include "afpfs-ng/afp.h"
2995 +#include "afpfs-ng/dsi.h"
2996 +#include "afpfs-ng/utils.h"
2997 +#include "afpfs-ng/uams_def.h"
2998 +#include "afpfs-ng/codepage.h"
2999 #include "users.h"
3000 -#include "libafpclient.h"
3001 +#include "afpfs-ng/libafpclient.h"
3002 #include "afp_internal.h"
3003 -#include "dsi.h"
3004 +#include "afpfs-ng/dsi.h"
3007 struct afp_server * afp_server_complete_connection(
3008 diff -Naur afpfs-ng-0.8.1/lib/status.c afpfs-ng-0.8.1.patch/lib/status.c
3009 --- afpfs-ng-0.8.1/lib/status.c 2008-03-08 17:08:38.000000000 +0100
3010 +++ afpfs-ng-0.8.1.patch/lib/status.c 2011-09-10 12:13:50.172125310 +0200
3011 @@ -1,8 +1,8 @@
3012 #include <string.h>
3013 #include <stdio.h>
3014 -#include "map_def.h"
3015 -#include "dsi.h"
3016 -#include "afp.h"
3017 +#include "afpfs-ng/map_def.h"
3018 +#include "afpfs-ng/dsi.h"
3019 +#include "afpfs-ng/afp.h"
3021 int afp_status_header(char * text, int * len)
3023 diff -Naur afpfs-ng-0.8.1/lib/uams.c afpfs-ng-0.8.1.patch/lib/uams.c
3024 --- afpfs-ng-0.8.1/lib/uams.c 2008-01-04 04:52:44.000000000 +0100
3025 +++ afpfs-ng-0.8.1.patch/lib/uams.c 2011-09-10 12:13:50.173125324 +0200
3026 @@ -8,10 +8,10 @@
3028 #include <string.h>
3029 #include <stdlib.h>
3030 -#include "dsi.h"
3031 -#include "afp.h"
3032 -#include "utils.h"
3033 -#include "uams_def.h"
3034 +#include "afpfs-ng/dsi.h"
3035 +#include "afpfs-ng/afp.h"
3036 +#include "afpfs-ng/utils.h"
3037 +#include "afpfs-ng/uams_def.h"
3038 #include "config.h"
3040 #ifdef HAVE_LIBGCRYPT
3041 diff -Naur afpfs-ng-0.8.1/lib/users.c afpfs-ng-0.8.1.patch/lib/users.c
3042 --- afpfs-ng-0.8.1/lib/users.c 2008-02-18 04:48:56.000000000 +0100
3043 +++ afpfs-ng-0.8.1.patch/lib/users.c 2011-09-10 12:13:50.174125338 +0200
3044 @@ -3,8 +3,8 @@
3045 #include <grp.h>
3046 #include <string.h>
3048 -#include "afp.h"
3049 -#include "map_def.h"
3050 +#include "afpfs-ng/afp.h"
3051 +#include "afpfs-ng/map_def.h"
3053 /* How mapping works
3055 diff -Naur afpfs-ng-0.8.1/lib/utils.c afpfs-ng-0.8.1.patch/lib/utils.c
3056 --- afpfs-ng-0.8.1/lib/utils.c 2008-02-18 04:53:37.000000000 +0100
3057 +++ afpfs-ng-0.8.1.patch/lib/utils.c 2011-09-10 12:13:50.174125338 +0200
3058 @@ -8,10 +8,10 @@
3059 #include <stdio.h>
3060 #include <string.h>
3061 #include <stdlib.h>
3062 -#include "afp.h"
3063 -#include "utils.h"
3064 +#include "afpfs-ng/afp.h"
3065 +#include "afpfs-ng/utils.h"
3066 #include "afp_internal.h"
3067 -#include "afp_protocol.h"
3068 +#include "afpfs-ng/afp_protocol.h"
3070 struct afp_path_header_long {
3071 unsigned char type;
3072 diff -Naur afpfs-ng-0.8.1/Makefile.am afpfs-ng-0.8.1.patch/Makefile.am
3073 --- afpfs-ng-0.8.1/Makefile.am 2008-02-18 04:24:14.000000000 +0100
3074 +++ afpfs-ng-0.8.1.patch/Makefile.am 2011-09-10 12:13:50.176125365 +0200
3075 @@ -1,5 +1,5 @@
3076 if HAVE_LIBFUSE
3077 -SUBDIRS = lib fuse cmdline docs
3078 +SUBDIRS = lib fuse cmdline include docs
3079 else
3080 -SUBDIRS = lib cmdline docs
3081 +SUBDIRS = lib cmdline include docs
3082 endif