fix_afpfs-ng_includes.patch 89 KB

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