netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
netatalk_conf.h File Reference
`#include <stdint.h>`
`#include <atalk/globals.h>`
`#include <atalk/volume.h>`

Go to the source code of this file.

## Functions
int | afp_config_parse (AFPObj *obj, char *processname)
void | afp_config_free (AFPObj *obj)
int | load_charset (struct vol *vol)
int | load_volumes (AFPObj *obj, lv_flags_t flags)
| Initialize volumes and load ini configfile.
void | unload_volumes (AFPObj *obj)
struct vol * | getvolumes (void)
struct vol * | getvolbyvid (const uint16_t)
struct vol * | getvolbypath (AFPObj *obj, const char *path)
| Search volume by path, creating user home vols as necessary.
struct vol * | getvolbyname (const char *name)
void | volume_free (struct vol *vol)
| Free all resources allocated in a struct vol in load_volumes().
void | volume_unlink (struct vol *volume)
struct extmap * | getdefextmap (void)
struct extmap * | getextmap (const char *path)

## Function Documentation

## ◆ 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

## ◆ 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_volumes()), but user volumes are as load_volumes() 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.

1. Search "normal" volume list
2. Check if theres a [Homes] section, load_volumes() remembers this for us
3. If there is, match "path" with "basedir regex" to get the user home parent dir
4. Built user home path by appending the basedir matched in (3) and appending the username
5. 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
6. Append [Homes]->path subdirectory if defined
7. 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_charset()

int load_charset | ( | struct vol * | vol | ) |
| extern

Load charsets for a volume

## ◆ load_volumes()

int load_volumes | ( | AFPObj * | obj,
|  | lv_flags_t | flags )
| extern

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

## ◆ unload_volumes()

void unload_volumes | ( | AFPObj * | obj | ) |
| extern

## ◆ volume_free()

void volume_free | ( | struct vol * | vol | ) |
| extern

Free all resources allocated in a struct vol in load_volumes().

Actually opening a volume (afp_openvol()) will allocate additional resources which are freed in closevol()

## ◆ volume_unlink()

void volume_unlink | ( | struct vol * | volume | ) |
| extern

Remove a volume from the linked list of volumes