netatalk
netatalk copied to clipboard
Restore AppleTalk support in afpd
afpd in Netatalk 2.x supports both ATP and DSI transport layers, whereas in 3.x it was refactored to only speak DSI.
Additionally, support for AFP revisions 1.1, 2.0 and 2.1 should be brought back.
Some notes from my codebase comparisons:
afp_avahi.c
Add logic to disable entries if server is ATP only.
auth.h
Re-add old AFP revisions Fixed in #1339
auth.c
Re-add DSI and ATP logic in status_versions()
Maybe re-add ASP logic in login()? This looks like part of a feature that was removed in later revisions unrelated to AppleTalk.
Figure out if print_groups() and set_groups() is needed. Maybe removed due to lack of use?
desktop.c
New code was added to 3.x, verify it won't conflict with older AFP revisions.
Re-add DSI and ATP logic in afp_addicon().
file.c
Re-add GS/OS date fix to setfilparams(). Fixed in #1339
fork.c
Check if support for nlmask and nlchar needs to be added back into read_fork(). This function saw significant refactoring in 3.x.
Re-add DSI and ATP logic in read_fork() and write_fork()
ofork.c
Re-add of_pforkdesc().
messages.c
Re-add logic for maxmsgsize depending on DSI or ATP in readmessage().
unix.c
See why setdirmode() and code using it in directory.c was removed.
volume.c
Re-add logic for limiting volume freespace for prodos and limitsize options in getvolspace().
Quite a bit of code was reshuffled and refactored in here (volume creation was moved to libatalk under netatalk_conf.c), so there will be other changes yet to be discovered.
netatalk_conf.c
Re-add DSI and ATP specific logic in volxlate().
Re-add DSI specific check in hostaccessvol().
status.c
Re-add DDP addresses in status_netaddress().
@NJRoadfan One question I don't think we have discussed yet, is controlling which transport layer to activate.
In 2.x afpd.conf has its -ddp -tcp -transall options that allows you to enable and disable either or both transport layers at runtime.
We either ought to bring this back as a dynamic afp.conf option, or always enable the transport layers that were compiled into afpd. I.e. always enable DSI, and enable DDP when netatalk was compiled with -Dwith-appletalk=true.
What do you think?
I'm leaning towards the latter to keep the logic simple.
The default should be to always enable DSI when nothing is specified in afp.conf. Add a new option called transport with ddp, tcp, and all. The none, notcp, and noddp setting should not come back. Since we only have one master server configuration in 3.x, it isn't needed.
Moving this here....
Some notes regarding afpd and dsi/atp support
afp_config.c
Re-add DSI and ATP specific logic in configfree()
Re-add DSI and ATP specific logic in configinit(). Code here needs to be moved back to dsi_start(), which is now in main.c (maybe move it back).
The functions DSIConfigInit() and ASPConfigInit() need to be restored and refactored to support the new INI configuration system since AFPConfigInit() is obsolete in 3.x.
Maybe re-add SLP support and dsi_cleanup()?
Re-add asp_start() and asp_cleanup().
main.c
Child spawning code in main() needs to be converted back to being protocol agnostic. AFPPROTO_DSI and AFPPROTO_ATP variables need to return in volume objects to specific which protocol a volume is set to listen on.
Note, one item of concern is any possible regressions, particularly in the area of file transfer performance. Read/write benchmarks between this PR and stock Netatalk 3 are going to be needed. Benchmark with both AppleTalk support compiled in, and without (which should be nearly identical code path to 3.x).