#include <stdint.h>
#include <atalk/globals.h>
#include <atalk/volume.h>
Go to the source code of this file.
◆ NETATALK_READBUF_LIMIT
| #define NETATALK_READBUF_LIMIT ((uint64_t)1 << 30) |
ceiling for dsireadbuf x server quantum per session (1 GiB)
◆ afp_config_free()
| void afp_config_free |
( |
AFPObj * |
obj | ) |
|
|
extern |
get rid of any allocated afp_option buffers.
◆ afp_config_parse()
| int afp_config_parse |
( |
AFPObj * |
AFPObj, |
|
|
char * |
processname |
|
) |
| |
|
extern |
Initialize an AFPObj and options from ini config file
◆ conf_cnid_scheme_in_use()
| int conf_cnid_scheme_in_use |
( |
const AFPObj * |
obj, |
|
|
const char * |
scheme |
|
) |
| |
|
extern |
Whether any configured volume resolves to the given CNID scheme.
Scans the loaded volume list, then the [Homes] section: homes volumes are instantiated per-user at login, so outside AFP sessions they never appear in the list. The section's scheme is resolved the same way creatvol() resolves it (section -> preset -> global -> compiled default).
◆ getdefextmap()
| struct extmap * getdefextmap |
( |
void |
| ) |
|
◆ getextmap()
| struct extmap * getextmap |
( |
const char * |
path | ) |
|
◆ getvolbyname()
| struct vol * getvolbyname |
( |
const char * |
name | ) |
|
|
extern |
◆ getvolbypath()
| struct vol * getvolbypath |
( |
AFPObj * |
obj, |
|
|
const char * |
path |
|
) |
| |
|
extern |
Search volume by path, creating user home vols as necessary.
Path may be absolute or relative. Ordinary volume structs are created when the ini config is initially parsed (load_afp_conf_vols()), but user volumes are as load_afp_conf_vols() only can create the user volume of the logged in user in an AFP session in afpd, but not when called from e.g. cnid_metad or dbd. Both cnid_metad and dbd thus need a way to lookup and create struct vols for user home by path. This is what this func does as well.
- Search "normal" volume list
- Check if theres a [Homes] section, load_afp_conf_vols() remembers this for us
- If there is, match "path" with "basedir regex" to get the user home parent dir
- Built user home path by appending the basedir matched in (3) and appending the username
- The next path element then is the username
- getvolbypath() assumes that the user home directory has the same name as the username. If that is not true, getuserbypath() is called and tries to retrieve the username from the directory owner, checking its validity
- Append [Homes]->path subdirectory if defined
- Create volume
- Parameters
-
| [in,out] | obj | handle |
| [in] | path | path, may be relative or absolute |
◆ getvolbyvid()
| struct vol * getvolbyvid |
( |
const uint16_t |
vid | ) |
|
|
extern |
◆ getvolumes()
| struct vol * getvolumes |
( |
void |
| ) |
|
|
extern |
◆ load_afp_conf_vols()
Initialize volumes and load ini configfile.
- Parameters
-
| [in] | obj | handle |
| [in] | flags | flags controlling volume load behaviour:
- LV_DEFAULT: load shares in a user/session context, this honors authorization
- LV_ALL: load shares that are available in the config file
- LV_FORCE: reload file even though the timestamp wasn't changed
|
◆ load_charset()
| int load_charset |
( |
struct vol * |
vol | ) |
|
|
extern |
Load charsets for a volume
◆ netatalk_readbuf_clamp()
| int netatalk_readbuf_clamp |
( |
int |
readbuf, |
|
|
uint32_t |
quantum, |
|
|
uint64_t |
limit |
|
) |
| |
|
extern |
Bound dsireadbuf so dsireadbuf * quantum never exceeds limit. The limit always wins: on a constrained platform the result may drop below the usual dsireadbuf floor of 6, but never below 1. The quantum is never reduced here: frame acceptance must not change as a side effect of read-ahead sizing. A zero quantum cannot occur in the config path and is treated as "no limit".
◆ unload_volumes()
| void unload_volumes |
( |
AFPObj * |
obj | ) |
|
|
extern |
◆ volume_free()
| void volume_free |
( |
struct vol * |
vol | ) |
|
|
extern |
◆ volume_unlink()
| void volume_unlink |
( |
struct vol * |
volume | ) |
|
|
extern |
Remove a volume from the linked list of volumes