ProFTPD Developer's Guide: API Functions

ProFTPD Version 1.2

__walk_pools

Declaration:
  static long __walk_pools(pool *p, int level)
Comments: Walk all the pools, start with the top-level permanent pool, displaying a tree.

Source File:
src/pool.c

_add_allow_deny

Declaration:
  MODRET _add_allow_deny(cmd_rec *cmd, char *name)
Source File:
modules/mod_core.c

_add_allow_deny_group

Declaration:
  MODRET _add_allow_deny_group(cmd_rec *cmd, char *name)
Source File:
modules/mod_core.c

_add_allow_deny_user

Declaration:
  MODRET _add_allow_deny_user(cmd_rec *cmd, char *name)
Source File:
modules/mod_core.c

_auth_anonymous_group

Declaration:
  static config_rec *_auth_anonymous_group(pool *p, char *user)
Comments: Check to see if the given user is a member of an AnonymousGroup group, and returns the config_rec in which the matching AnonymousGroup directive was found, or else NULL.

Source File:
modules/mod_auth.c

_auth_group

Declaration:
  static config_rec *_auth_group(pool *p, char *user, char **group, char **ournamep,
    char **anonnamep, char *pass)
Comments: This function handles groups-based authentication (rarely used), and is only checked if user-based password authentication fails.

Source File:
modules/mod_auth.c

_auth_lookup_id

Declaration:
  static idmap_t *_auth_lookup_id(xaset_t **id_table, idauth_t id)

Source File:
modules/mod_auth_unix.c

_auth_resolve_user

Declaration:
  static config_rec *_auth_resolve_user(pool *p, char **user, char **ournamep,
    char **anonnamep)
Source File:
modules/mod_auth.c

_calc_fs

Declaration:
  unsigned long _calc_fs(unsigned long blocks, unsigned long bsize)
Source File:
src/support.c

_chdir

Declaration:
  MODRET _chdir(cmd_rec *cmd, char *ndir)
Source File:
modules/mod_core.c

_check_group_access

Declaration:
  static int _check_group_access(xaset_t *conf, char *name)
Source File:
src/dirtree.c

_check_ip_access

Declaration:
  static int _check_ip_access(xaset_t *conf, char *name)
Source File:
src/dirtree.c

_check_ip_negative

Declaration:
  static int _check_ip_negative(const config_rec *c)
Source File:
src/dirtree.c

_check_ip_positive

Declaration:
  static int _check_ip_positive(const config_rec *c)
Source File:
src/dirtree.c

_check_limit

Declaration:
  static int _check_limit(config_rec *c)
Comments: Checks <Limit> ACLs. Returns 1 if the operation is explicitly allowed, 0 if implicitly allowed, -1 if implicitly denied, and -2 if explicitly denied.

Source File:
src/dirtree.c

_check_limits

Declaration:
  static int _check_limits(xaset_t *set, char *cmd, int hidden)
Source File:
src/dirtree.c

_check_limit_allow

Declaration:
  static int _check_limit_allow(config_rec *c)
Source File:
src/dirtree.c

_check_limit_deny

Declaration:
  static int _check_limit_deny(config_rec *c)
Source File:
src/dirtree.c

_check_user_access

Declaration:
  static int _check_user_access(xaset_t *conf, char *name)
Source File:
src/dirtree.c

_compare_file_mtime

Declaration:
  int _compare_file_mtime(const struct sort_filename *f1, const struct sort_filename *f2)
Source File:
modules/mod_ls.c

_compare_file_mtime_reversed

Declaration:
  int _compare_file_mtime_reversed(const struct sort_filename *f1, const struct sort_filename *f2)
Source File:
modules/mod_ls.c

_compare_gid

Declaration:
  inline static int _compare_gid(idmap_t *m1, idmap_t *m2)
Source File:
modules/mod_auth_unix.c

_compare_id

Declaration:
  inline static int _compare_id(xaset_t **table, idauth_t id, idauth_t idcomp)
Source File:
modules/mod_auth_unix.c

_compare_sym

Declaration:
  static int _compare_sym(struct symbol_hash *s1, struct symbol_hash *s2)
Source File:
src/modules.c

_compare_uid

Declaration:
  inline static int _compare_uid(idmap_t *m1, idmap_t *m2)
Source File:
modules/mod_auth_unix.c

_copy_global_to_all

Declaration:
  void _copy_global_to_all(xaset_t *set)
Source File:
src/dirtree.c

_copy_recur

Declaration:
  void _copy_recur(xaset_t **set, pool *p, config_rec *c, config_rec *new_parent)
Source File:
src/dirtree.c

_create_inet_pool

Declaration:
  static void _create_inet_pool(void)
Source File:
src/inet.c

_dir_check_op

Declaration:
  static int _dir_check_op(pool *p, xaset_t *c, int op, int uid, int gid, int mode)
Source File:
src/dirtree.c

_dispatch

Declaration:
 static int _dispatch(cmd_rec *cmd, int cmd_type, int validate, char *match)
Source File:
src/main.c

_dispatch_auth

Declaration:
  static modret_t *_dispatch_auth(cmd_rec *cmd, char *match)
Source File:
src/auth.c

_do_auth

Declaration:
  static int _do_auth(pool *p, xaset_t *conf, char *u, char *pw)
Source File:
modules/mod_auth.c

_dup_low_fd

Declaration:
  static int _dup_low_fd(int fd)
Source File:
src/main.c

_exists

Declaration:
  static int _exists(char *path, int dirp)
Comments: This function simply checks for the existence of the given path, as modified by the dirp argument.

If dirp == 1, returns FALSE unless path is an existing directory. If dirp == 0, returns FALSE unless path is an existing non-directory. If dirp == -1, returns FALSE unless path exists; the caller in this case does not care whether path is a file or a directory.

Source File:
src/support.c

_find_best_dir

Declaration:
  static config_rec *_find_best_dir(xaset_t *set, char *path, int *matchlen)
Comments: Recursively find the most appropriate place to which to move a
CONF_DIR directive.

Source File: src/dirtree.c

_find_ls_limit

Declaration:
  static config_rec *_find_ls_limit(char *ftp_cmd)
Source File:
modules/mod_ls.c

_get_default_chdir

Declaration:
  static char *_get_default_chdir(pool *p, xaset_t *conf)
Source File:
modules/mod_auth.c

_get_default_root

Declaration:
  static char *_get_default_root(pool *p)
Source File:
modules/mod_auth.c

_get_full_cmd

Declaration:
  static char *_get_full_cmd(cmd_rec *cmd)
Source File:
modules/mod_site.c

_get_gmtoff

Declaration:
  struct tm *_get_gmtoff(int *tz)
Source File:
modules/mod_log.c

_get_ppw_info

Declaration:
  static char *_get_ppw_info(pool *p, const char *u)
Source File:
modules/mod_auth_unix.c

_get_pw_info

Declaration:
  static char *_get_pw_info(pool *p, const char *u, time_t *lstchg, time_t *min, time_t *max,
    time_t *warn, time_t *inact, time_t *expire)
Source File:
modules/mod_auth_unix.c

_internal_abort

Declaration:
  static void _internal_abort(void)
Source File:
src/main.c

_log_transfer

Declaration:
  static void _log_transfer(char direction, char abort_flag)
Source File:
modules/mod_xfer.c

_make_cmd

Declaration:
  static cmd_rec *_make_cmd(pool *cp, int argc, ...)
Source File:
src/auth.c

_mergedown

Declaration:
 static void _mergedown(xaset_t *set, int dynamic)
Source File:
src/dirtree.c

_parse_classes

Declaration:
  static int _parse_classes(char *s)
Source File:
modules/mod_log.c

_parse_options

Declaration:
  void _parse_options(char **opt, int *glob_flags)
Source File:
modules/mod_ls.c

_prepare_core

Declaration:
  static char *_prepare_core(void)
Source File:
src/main.c

_rate_diffusec

Declaration:
  static float _rate_diffusec(struct timeval tlast, struct timeval t)
Comments: This function calculates the difference, in microseconds, between timeval's.

Source File:
modules/mod_xfer.c

_rate_throttle

Declaration:
  static void _rate_throttle(unsigned long rate_pos, long rate_bytes, struct timeval rate_tvlast,
    long rate_freebytes, long rate_bps, int rate_hardbps)
Source File:
modules/mod_xfer.c

_recur_match_path

Declaration:
  static config_rec *_recur_match_path(pool *p, xaset_t *si, char *path)
Source File:
src/dirtree.c

_reorder_dirs

Declaration:
  static void _reorder_dirs(xaset_t *set, int mask)
Comments: Reorder all the
CONF_DIR configuration sections in the given set so that they are in directory tree order.

Source File: src/dirtree.c

_reparent_all

Declaration:
  static void _reparent_all(config_rec *newparent, xaset_t *set)
Comments: Move all the members (i.e. a "branch") of the given configuration set to a different configuration set, newparent.

Source File:
src/dirtree.c

_set_oobinline

Declaration:
  void _set_oobinline(int fd)
Source File:
src/inet.c

_set_owner

Declaration:
  void _set_owner(int fd)
Source File:
src/inet.c

_sethide

Declaration:
  MODRET _sethide(cmd_rec *cmd, const char *param)
Source File:
modules/mod_ls.c

_setup_environment

Declaration:
  static int _setup_environment(pool *p, char *user, char *pass)
Comments: This function really need to be broken up, rearranged!

Source File:
modules/mod_auth.c

_stor_chown

Declaration:
  static void _stor_chown(void)
Source File:
modules/mod_xfer.c

_strmatch

Declaration:
  static int _strmatch(register char *s1, register char *s2)
Comments: Returns the number of characters which match, character for character, in the given strings s1 and s2.

Source File:
src/dirtree.c

_symlink

Declaration:
  static mode_t _symlink(char *path, ino_t last_inode, int rcount)
Comments: Returns the mode_t, including file type, of the file pointed to by the symlink path, or 0 if the pointed to file does not exist (i.e. path is a dangling symlink). This recursing function catches symlink loops via the last_inode and rcount arguments.

Source File:
src/support.c

_transmit_data

Declaration:
  static long _transmit_data(int rate_bps, unsigned long count, off_t offset, char *buf, long bufsize)
Source File:
modules/mod_xfer.c

_transmit_normal

Declaration:
  static int _transmit_normal(char *buf, long bufsize)
Source File:
modules/mod_xfer.c

_transmit_sendfile

Declaration:
  static int _transmit_sendfile(int rate_bps, unsigned long count, off_t offset, pr_sendfile_t *retval)
Source File:
modules/mod_xfer.c

_xlate_ascii_read

Declaration:
  static int _xlate_ascii_read(char *buf, int *bufsize, int *adjlen)
Source File:
src/data.c

_xlate_ascii_write

Declaration:
  static int _xlate_ascii_write(char **buf, int *bufsize, int *adjlen)
Source File:
src/data.c

accept_binding

Declaration:
  conn_t *accept_binding(fd_set *rfd, int *lfd)
Source File:
src/main.c

access_check

Declaration:
  int access_check(char *path, int mode)
Comments: This function performs access checks much like access(2), except that the process's effective user ID and group ID are used (access(2) uses the real user ID and group ID). As with access(2), mode is a mask consisting of one or more of R_OK, W_OK, X_OK and F_OK. R_OK, W_OK, and X_OK request checking whether the path exists and has read, write, and execute permissions, respectively. F_OK requests merely checking for the existence of path. 0 is returned if acccess is granted, -1 if denied, with errno set appropriately.

Source File:
src/support.c

add_allow

Declaration:
  MODRET add_allow(cmd_rec *cmd)
Comments: Configuration directive handler for the Allow directive.

Source File:
modules/mod_core.c

add_allowgroup

Declaration:
  MODRET add_allowgroup(cmd_rec *cmd)
Comments: Configuration directive handler for the AllowGroup directive.

Source File:
modules/mod_core.c

add_allowuser

Declaration:
  MODRET add_allowuser(cmd_rec *cmd)
Comments: Configuration directive handler for the AllowUser directive.

Source File:
modules/mod_core.c

add_anonymous

Declaration:
  MODRET add_anonymous(cmd_rec *cmd)
Comments: Configuration directive handler for the <Anonymous> directive.

Source File:
modules/mod_core.c

add_anonymousgroup

Declaration:
  MODRET add_anonymousgroup(cmd_rec *cmd)
Comments: Configuration directive handler for the AnonymousGroup directive.

Source File:
modules/mod_core.c

add_bind

Declaration:
  MODRET add_bind(cmd_rec *cmd)
Comments: Configuration directive handler for the Bind directive.

Source File:
modules/mod_core.c

add_binding

Declaration:
  int add_binding(server_rec *server, p_in_addr_t *ipaddr, conn_t *listen, char isdefault,
    char islocalhost)
Source File:
src/main.c

add_cdir

Declaration:
 static cdir_t *add_cdir(class_t *class, u_int_32 address, u_int_8 netmask)
Source File:
modules/mod_core.c

add_cdpath

Declaration:
  MODRET add_cdpath(cmd_rec *cmd)
Comments: Configuration directive handler for the CDPath directive.

Source File:
modules/mod_core.c

add_class

Declaration:
  static class_t *add_class(char *name)
Source File:
modules/mod_core.c

add_config

Declaration:
  config_rec *add_config(const char *name)
Comments: Adds a config_rec on the current "level" of the configuration stack. This is used during the parsing of configuration files.

Source File:
src/dirtree.c

add_config_param

Declaration:
  config_rec *add_config_param(const char *name, int num, ...)
Comments: Adds a config_rec to the server's set with name name. The added config_rec will have num arguments, each of which must a void * pointers to data. The given number of pointers num must follow. If planning to set those additional arguments manually, after this call, at least use NULL as a placeholder in the argument list. This function, being a varargs function, will happily copy garbage from the stack into the created config_rec if an insufficient number of pointers follow the num argument.

Source File:
src/dirtree.c

add_config_param_set

Declaration:
  config_rec *add_config_param_set(xaset_t **set, const char *name, int num, ...)
Source File:
src/dirtree.c

add_config_param_str

Declaration:
  config_rec *add_config_param_str(const char *name, int num, ...)
Comments: Similar to
add_config_param(), except that the given pointers are all assumed to be strings. pstrdup() will be called on each pointer, using permanent_pool as the pool.

Source File: src/dirtree.c

add_config_set

Declaration:
  config_rec *add_config_set(xaset_t **set, const char *name)
Comments: Adds a config_rec to the given xaset_t set, giving that config_rec the name name.

Source File:
src/dirtree.c

add_defaultchdir

Declaration:
  MODRET add_defaultchdir(cmd_rec *cmd)
Comments: Configuration directive handler for the DefaultChdir directive.

Source File:
modules/mod_auth.c

add_defaultroot

Declaration:
  MODRET add_defaultroot(cmd_rec *cmd)
Comments: Configuration directive handler for the DefaultRoot directive.

Source File:
modules/mod_auth.c

add_define

Declaration:
  MODRET add_define(cmd_rec *cmd)
Comments: Configuration directive handler for the Define directive.

Source File:
modules/mod_core.c

add_deny

Declaration:
  MODRET add_deny(cmd_rec *cmd)
Comments: Configuration directive handler for the Deny directive.

Source File:
modules/mod_core.c

add_denygroup

Declaration:
  MODRET add_denygroup(cmd_rec *cmd)
Comments: Configuration directive handler for the DenyGroup directive.

Source File:
modules/mod_core.c

add_denyuser

Declaration:
  MODRET add_denyuser(cmd_rec *cmd)
Comments: Configuration directive handler for the DenyUser directive.

Source File:
modules/mod_core.c

add_directory

Declaration:
  MODRET add_directory(cmd_rec *cmd)
Comments: Configuration directive handler for the <Directory> directive.

Source File:
modules/mod_core.c

add_extendedlog

Declaration:
  MODRET add_extendedlog(cmd_rec *cmd)
Comments: Configuration directive handler for the ExtendedLog directive.

Source File:
modules/mod_log.c

add_global

Declaration:
  MODRET add_global(cmd_rec *cmd)
Comments: Configuration directive handler for the <Global> directive.

Source File:
modules/mod_core.c

add_groupowner

Declaration:
  MODRET add_groupowner(cmd_rec *cmd)
Comments: Configuration directive handler for the GroupOwner directive.

Source File:
modules/mod_core.c

add_hidegroup

Declaration:
  MODRET add_hidegroup(cmd_rec *cmd)
Comments: Configuration directive handler for the HideGroup directive.

Source File:
modules/mod_core.c

add_hideuser

Declaration:
  MODRET add_hideuser(cmd_rec *cmd)
Comments: Configuration directive handler for the HideUser directive.

Source File:
modules/mod_core.c

add_hostname

Declaration:
  static hostname_t *add_hostname(class_t *class, char *name)
Source File:
modules/mod_core.c

add_include

Declaration:
  MODRET add_include(cmd_rec *cmd)
Comments: Configuration directive handler for the Include directive.

Source File:
modules/mod_core.c

add_limit

Declaration:
  MODRET add_limit(cmd_rec *cmd)
Comments: Configuration directive handler for the <Limit> directive.

Source File:
modules/mod_core.c

add_logformat

Declaration:
  MODRET add_logformat(cmd_rec *cmd)
Comments: Configuration directive handler for the LogFormat directive.

Source File:
modules/mod_log.c

add_masqueradeaddress

Declaration:
  MODRET add_masqueradeaddress(cmd_rec *cmd)
Comments: Configuration directive handler for the MasqueradeAddress directive.

Source File:
modules/mod_core.c

add_meta

Declaration:
  static void add_meta(unsigned char **s, unsigned char meta, int args, ...)
Source File:
modules/mod_log.c

add_order

Declaration:
  MODRET add_order(cmd_rec *cmd)
Comments: Configuration directive handler for the Order directive.

Source File:
modules/mod_core.c

add_ratebool

Declaration:
  MODRET add_ratebool(cmd_rec *cmd)
Comments: Configuration directive handler for the RateReadHardBPS and RateWriteHardBPS directives.

Source File:
modules/mod_xfer.c

add_ratenum

Declaration:
  MODRET add_ratenum(cmd_rec *cmd)
Comments: Configuration directive handler for the RateReadBPS, RateReadFreeBytes, RateWriteBPS, and RateWriteFreeBytes directives.

Source File:
modules/mod_xfer.c

add_timer

Declaration:
  int add_timer(int seconds, int timerno, module *mod, callback_t cb)
Comments: Create and activate a new timer with an interval seconds, a timer ID number of timerno, and a callback of cb. Note that if a timerno of -1 is given, a "dynamic" timer ID number will be assigned. The timerno of the timer is returned.

Source File:
src/timers.c

add_transferlog

Declaration:
  MODRET add_transferlog(cmd_rec *cmd)
Comments: Configuration directive handler for the TransferLog directive.

Source File:
modules/mod_core.c

add_userdirroot

Declaration:
  MODRET add_userdirroot (cmd_rec *cmd)
Comments: Configuration directive handler for the UserDirRoot directive.

Source File:
modules/mod_auth.c

add_userowner

Declaration:
  MODRET add_userowner(cmd_rec *cmd)
Comments: Configuration directive handler for the UserOwner directive.

Source File:
modules/mod_core.c

add_virtualhost

Declaration:
  MODRET add_virtualhost(cmd_rec *cmd)
Comments: Configuration directive handler for the <VirtualHost> directive.

Source File:
modules/mod_core.c

addfile

Declaration:
  static void addfile(cmd_rec *cmd, const char *name, const char *suffix, time_t mtime)
Source File:
modules/mod_ls.c

addl_bindings

Declaration:
  void addl_bindings(server_rec *s)
Comments: On startup, once the configuration file has been parsed, this function is called. It loops through the given server s's configuration records, and for each Bind directive found, it will create an additional
binding_t for that server's IP address and port.

Source File: src/main.c

allow_dyn_config

Declaration:
  static int allow_dyn_config(void)
Comments:

Source File:
src/dirtree.c

append_arrays

Declaration:
  array_header *append_arrays(pool *p, const array_header *first, const array_header *second)
Comments: Using memory from pool p, copy array_header first, then append array_header second to it, and return a pointer to the concatenated array_headers.

Source File:
src/pool.c

array_cat

Declaration:
  void array_cat(array_header *dst, const array_header *src)
Comments: Concatenate the elements from array_header src to the elements of array_header dst.

Source File:
src/pool.c

auth_acct

Declaration:
  MODRET auth_acct(cmd_rec *cmd)
Comments: Command handler for the ACCT FTP command.

Source File:
modules/mod_auth.c

auth_authenticate

Declaration:
  int auth_authenticate(pool *p, const char *name, const char *pw)
Comments: Dispatcher for the auth() authentication handler.

The purpose of the dispatched-to authentication handler is to provide a higher-level "yes or no" answer of whether a the given user name is successfully authenticated by the given cleartext password pw.

Source File:
src/auth.c

auth_check

Declaration:
  int auth_check(pool *p, const char *cpw, const char *name, const char *pw)
Comments: Dispatcher for the check() authentication handler.

The purpose of the dispatched-to authentication handler is to, given the hashed password cpw, the username name, and the cleartext password pw, and using whatever method the module developer desires, determine whether the hashed password is sufficient and proper for that user, if the the cleartext password belongs to that user.

Source File:
src/auth.c

auth_check_ftpusers

Declaration:
  static unsigned char auth_check_ftpusers(xaset_t *set, const char *user)
Comments: Check the given user against a list of prohibited users, usually contained in /etc/ftpusers, a file used by wu-ftpd servers. This check can be skipped by using the UseFtpUsers configuration directive.

Source File:
modules/mod_auth.c

_auth_check_shell

Declaration:
  static unsigned char auth_check_shell(xaset_t *set, const char *shell)
Comments: Check the given shell of the connecting user against a list of valid system shells, usually contained in /etc/shells. This check can be skipped by using the RequireValidShell configuration directive.

Source File:
modules/mod_auth.c

auth_cmd_chk_cb

Declaration:
  static int auth_cmd_chk_cb(cmd_rec *cmd)
Source File:
modules/mod_auth.c

auth_count_scoreboard

Declaration:
  static void auth_count_scoreboard(cmd_rec *cmd, char *user)
Source File:
modules/mod_auth.c

auth_endgrent

Declaration:
  void auth_endgrent(pool *p)
Comments: Dispatcher for the endgrent() authentication handler.

The purpose of the dispatched-to authentication handler is to provide a custom implementation of the endgrent(3) libc function.

Source File:
src/auth.c

auth_endpwent

Declaration:
  void auth_endpwent(pool *p)
Comments: Dispatcher for the endpwent() authentication handler.

The purpose of the dispatched-to authentication handler is to provide a custom implementation of the endpwent(3) libc function.

Source File:
src/auth.c

auth_getgrent

Declaration:
  struct group *auth_getgrent(pool *p)
Comments: Dispatcher for the getgrent() authentication handler.

The purpose of the dispatched-to authentication handler is to provide a custom implementation of the getgrent(3) libc function.

Source File:
src/auth.c

auth_getgrgid

Declaration:
  struct group *auth_getgrgid(pool *p, gid_t gid)
Comments: Dispatcher for the getgrgid() authentication handler.

The purpose of the dispatched-to authentication handler is to provide a custom implementation of the getgrgid(3) libc function.

Source File:
src/auth.c

auth_getgrnam

Declaration:
  struct group *auth_getgrnam(pool *p, const char *name)
Comments: Dispatcher for the getgrnam() authentication handler.

The purpose of the dispatched-to authentication handler is to provide a custom implementation of the getgrnam(3) libc function.

Source File:
src/auth.c

auth_getpwent

Declaration:
  struct passwd *auth_getpwent(pool *p)
Comments: Dispatcher for the getpwent() authentication handler.

The purpose of the dispatched-to authentication handler is to provide a custom implementation of the getpwent(3) libc function.

Source File:
src/auth.c

auth_getpwnam

Declaration:
  struct passwd *auth_getpwnam(pool *p, const char *name)
Comments: Dispatcher for the getpwnam() authentication handler.

The purpose of the dispatched-to authentication handler is to provide a custom implementation of the getpwnam(3) libc function.

Source File:
src/auth.c

auth_getgroups

Declaration:
  struct passwd *auth_getgroups(pool *p, const char *name, array_header **group_ids,
    array_header **group_names)
Comments: Dispatcher for the getgroups() authentication handler.

The purpose of the dispatched-to authentication handler is to provide a custom implementation of the getgroups(2) system call.

Source File:
src/auth.c

auth_getpwuid

Declaration:
  struct passwd *auth_getpwuid(pool *p, uid_t uid)
Comments: Dispatcher for the getpwuid() authentication handler.

The purpose of the dispatched-to authentication handler is to provide a custom implementation of the getpwuid(3) libc function.

Source File:
src/auth.c

auth_gid_name

Declaration:
  const char *auth_gid_name(pool *p, gid_t gid)
Comments: Dispatcher for the gid_name() authentication handler.

The purpose of the dispatched-to authentication handler is to do a GID-to-name lookup for the given GID gid.

Source File:
src/auth.c

auth_init

Declaration:
  static int auth_init(void)
Source File:
modules/mod_auth.c

auth_login_timeout_cb

Declaration:
  static int auth_login_timeout_cb(CALLBACK_FRAME)
Comments: Timer callback function which disconnects the control connection if the timer has elapsed before the client has successfully authenticated. The timer length is configurable via the TimeoutLogin configuration directive.

Source File:
modules/mod_auth.c

auth_name_gid

Declaration:
  gid_t auth_name_gid(pool *p, const char *name)
Comments: Dispatcher for the name_gid() authentication handler.

The purpose of the dispatched-to authentication handler is to do a name-to-GID lookup for the given group name.

Notes: The caller of this function must take due caution when handling the returned gid_t, and treat a gid_t of -1 properly.

Source File:
src/auth.c

auth_name_uid

Declaration:
  uid_t auth_name_uid(pool *p, const char *name)
Comments: Dispatcher for the name_uid() authentication handler.

The purpose of the dispatched-to authentication handler is to do a name-to-UID lookup for the given user name.

Notes: The caller of this function must take due caution when handling the returned uid_t, and treat a uid_t of -1 properly.

Source File:
src/auth.c

auth_pass

Declaration:
  MODRET auth_pass(cmd_rec *cmd)
Comments: Command handler for the PASS FTP command.

Source File:
modules/mod_auth.c

auth_post_pass

Declaration:
  MODRET auth_post_pass(cmd_rec *cmd)
Source File:
modules/mod_auth.c

auth_pre_pass

Declaration:
  MODRET auth_pre_pass(cmd_rec *cmd)
Source File:
modules/mod_auth.c

auth_pre_user

Declaration:
  MODRET auth_pre_user(cmd_rec *cmd)
Source File:
modules/mod_auth.c

auth_rein

Declaration:
  MODRET auth_rein(cmd_rec *cmd)
Comments: Command handler for the REIN FTP command.

Source File:
modules/mod_auth.c

auth_scan_scoreboard

Declaration:
  static void auth_scan_scoreboard(void)
Source File:
modules/mod_auth.c

auth_sess_init

Declaration:
  static int auth_sess_init(void)
Source File:
modules/mod_auth.c

auth_setgrent

Declaration:
  void auth_setgrent(pool *p)
Comments: Dispatcher for the setgrent() authentication handler.

The purpose of the dispatched-to authentication handler is to provide a custom implementation of the setgrent(3) libc function.

Source File:
src/auth.c

auth_setpwent

Declaration:
  void auth_setpwent(pool *p)
Comments: Dispatcher for the setpwent() authentication handler.

The purpose of the dispatched-to authentication handler is to provide a custom implementation of the setpwent(3) libc function.

Source File:
src/auth.c

auth_uid_name

Declaration:
  const char *auth_uid_name(pool *p, uid_t uid)
Comments: Dispatcher for the uid_name() authentication handler.

The purpose of the dispatched-to authentication handler is to do a UID-to-name lookup for the given UID uid.

Source File:
src/auth.c

auth_user

Declaration:
  MODRET auth_user(cmd_rec *cmd)
Comments: Command handler for the USER FTP command.

Source File:
modules/mod_auth.c

build_dyn_config

Declaration:
  void build_dyn_config(pool *p, char *_path, struct stat *_sbuf, int recurse)
Comments: This function looks through each directory in _path, from the "deepest" up, looking for new or updated .ftpaccess files. All .ftpaccess files are considered to be placed within a <Directory>; within the .ftpaccess file itself, all configuration directives are considered to be in a dynamic context (
CONF_DYNDIR to be specific). .ftpaccess files that have been updated are reparsed; files that once contained directives, but are now empty or deleted are removed from the configuration records.

Source File: src/dirtree.c

bytes_in_block_list

Declaration:
  long bytes_in_block_list(union block_hdr *blok)
Comments: Return the number of bytes in the given union block_header.

Source File:
src/pool.c

call_module

Declaration:
  modret_t *call_module(module *m, modret_t *(*func)(cmd_rec *), cmd_rec *cmd)
Source File:
src/modules.c

call_module_auth

Declaration:
  modret_t *call_module_auth(module *mi, modret_t *(*func)(cmd_rec *), cmd_rec *cmd)
Source File:
src/modules.c

call_module_cmd

Declaration:
  modret_t *call_module_cmd(module *m, modret_t *(*func)(cmd_rec *), cmd_rec *cmd)
Source File:
src/modules.c

check_context

Declaration:
  unsigned char check_context(cmd_rec *cmd, int allowed)
Source File:
src/dirtree.c

check_shutmsg

Declaration:
  int check_shutmsg(time_t *shut, time_t *deny, time_t *disc, char *msg, size_t msg_size)
Comments: Checks for the existence of
SHUTMSG_PATH, the shutdown message file. deny and disc are filled with the times at which to deny new connections and to disconnect existing ones, respectively.

Source File: src/support.c

chk_on_blk_list

Declaration:
  void chk_on_blk_list(union block_hdr *blok, union block_hdr *free_blk)
Comments: A debugging function, it walks the given union block_hdr free_blk, making sure that none of the chained union block_hdrs point to union block_hdr blok.

Source File:
src/pool.c

clear_inet_pool

Declaration:
  void clear_inet_pool(void)
Source File:
src/inet.c

clear_pool

Declaration:
  static void clear_pool(struct pool *p)
Comments: Frees up the resources used by pool p. Does not destroy pool p when finished.

Source File:
src/pool.c

cmd_loop

Declaration:
  void cmd_loop(server_rec *server, conn_t *c)
Source File:
src/main.c

cmp

Declaration:
  static int cmp(const void *a, const void *b)
Source File:
modules/mod_ls.c

conn_cleanup_cb

Declaration:
  static void conn_cleanup_cb(void *cv)
Source File:
src/inet.c

copy_array

Declaration:
  array_header *copy_array(pool *p, const array_header *arr)
Comments: Returns a pointer to an array_header that is a copy of arr, using resources from pool p.

Source File:
src/pool.c

copy_array_hdr

Declaration:
  array_header *copy_array_hdr(pool *p, const array_header *arr)
Comments: Returns a pointer to an array_header which contains duplicate pointers to the original elements of array_header arr, using the resources of pool p.

Source File:
src/pool.c

copy_array_str

Declaration:
  array_header *copy_array_str(pool *p, const array_header *arr)
Comments: Returns a pointer to an array_header which contains duplicate elements (i.e. strings) of the original elements of array_header arr, allocated from the resources of pool p.

Source File:
src/pool.c

core_cdup

Declaration:
  MODRET core_cdup(cmd_rec *cmd)
Comments: Command handler for the CDUP FTP command.

Source File:
modules/mod_core.c

core_chgrp

Declaration:
  int core_chgrp(cmd_rec *cmd, char *dir, uid_t uid, gid_t gid)

Source File:
modules/mod_core.c

core_chmod

Declaration:
  int core_chmod(cmd_rec *cmd, char *dir, mode_t mode)

Source File:
modules/mod_core.c

core_cwd

Declaration:
  MODRET core_cwd(cmd_rec *cmd)
Comments: Command handler for the CWD and XCWD FTP commands.

Source File:
modules/mod_core.c

core_dele

Declaration:
  MODRET core_dele(cmd_rec *cmd)
Comments: Command handler for the DELE FTP command.

Source File:
modules/mod_core.c

core_display_file

Declaration:
  int core_display_file(const char *numeric, const char *fn, const char *fs)
Comments: Displays the file fn, which lives on the filesystem fs, via the given response numeric. The file is displayed in normal RFC959 multiline mode, unless MultilineRFC2228 is set.

This function returns -1 on error, or 0 if the file is displayed without trouble.

Source File:
modules/mod_core.c

core_help

Declaration:
  MODRET core_help(cmd_rec *cmd)
Comments: Command handler for the HELP FTP command.

Source File:
modules/mod_core.c

core_mdtm

Declaration:
  MODRET cmd_mdtm(cmd_rec *cmd)
Comments: Command handler for the MDTM FTP command.

Source File:
modules/mod_core.c

core_mkd

Declaration:
  MODRET core_mkd(cmd_rec *cmd)
Comments: Command handler for the MKD FTP command.

Source File:
modules/mod_core.c

core_netio_abort_cb

Declaration:
  static void core_netio_abort_cb(pr_netio_stream_t *nstrm)

Source File:
src/netio.c

core_netio_close_cb

Declaration:
  static int core_netio_close_cb(pr_netio_stream_t *nstrm)

Source File:
src/netio.c

core_netio_open_cb

Declaration:
  static pr_netio_stream_t *core_netio_open_cb(pr_netio_stream_t *nstrm, int fd, int mode)

Source File:
src/netio.c

core_netio_poll_cb

Declaration:
  static int core_netio_poll_cb(pr_netio_stream_t *nstrm)

Source File:
src/netio.c

core_netio_postopen_cb

Declaration:
  static int core_netio_postopen_cb(pr_netio_stream_t *nstrm)

Source File:
src/netio.c

core_netio_read_cb

Declaration:
  static int core_netio_read_cb(pr_netio_stream_t *nstrm, char *buf, size_t buflen)

Source File:
src/netio.c

core_netio_reopen_cb

Declaration:
  static pr_netio_stream_t *core_netio_reopen_cb(pr_netio_stream_t *nstrm, int fd, int mode)

Source File:
src/netio.c

core_netio_shutdown_cb

Declaration:
  static int core_netio_shutdown_cb(pr_netio_stream_t *nstrm, int how)

Source File:
src/netio.c

core_netio_write_cb

Declaration:
  static int core_netio_write_cb(pr_netio_stream_t *nstrm, char *buf, size_t buflen)

Source File:
src/netio.c

core_noop

Declaration:
  MODRET core_noop(cmd_rec *cmd)
Comments: Command handler for the NOOP FTP command.

Source File:
modules/mod_core.c

core_pasv

Declaration:
  MODRET core_pasv(cmd_rec *cmd)
Comments: Command handler for the PASV FTP command.

Source File:
modules/mod_core.c

core_port

Declaration:
  MODRET core_port(cmd_rec *cmd)
Comments: Command handler for the PORT FTP command.

Source File:
modules/mod_core.c

core_pwd

Declaration:
  MODRET core_pwd(cmd_rec *cmd)
Comments: Command handler for the PWD FTP command.

Source File:
modules/mod_core.c

core_quit

Declaration:
  MODRET core_quit(cmd_rec *cmd)
Comments: Command handler for the QUIT FTP command.

Source File:
modules/mod_core.c

core_rehash_cb

Declaration:
  static void core_rehash_cb(void *d1, void *d2, void *d3, void *d4)
Source File:
src/main.c

core_rmd

Declaration:
  MODRET core_rmd(cmd_rec *cmd)
Comments: Command handler for the RMD FTP command.

Source File:
modules/mod_core.c

core_rnfr

Declaration:
  MODRET core_rnfr(cmd_rec *cmd)
Comments: Command handler for the RNFR FTP command.

Source File:
modules/mod_core.c

core_rnto

Declaration:
  MODRET core_rnto(cmd_rec *cmd)
Comments: Command handler for the RNTO FTP command.

Source File:
modules/mod_core.c

core_size

Declaration:
  MODRET core_size(cmd_rec *cmd)
Comments: Command handler for the SIZE FTP command.

Source File:
modules/mod_core.c

core_syst

Declaration:
  MODRET core_syst(cmd_rec *cmd)
Comments: Command handler for the SYST FTP command.

Source File:
modules/mod_core.c

create_home

Declaration:
  int create_home(pool *p, const char *home, const char *user, uid_t uid, gid_t gid)
Source File:
src/mkhome.c

daemon_loop

Declaration:
  void daemon_loop(void)
Source File:
src/main.c

daemonize

Declaration:
  static void daemonize(void)
Source File:
src/main.c

data_abort

Declaration:
  void data_abort(int err, int quiet)
Source File:
src/data.c

data_active_open

Declaration:
  static int data_active_open(char *reason, unsigned long size)
Source File:
src/data.c

data_cleanup

Declaration:
  void data_cleanup(void)
Source File:
src/data.c

data_close

Declaration:
  void data_close(int quiet)
Source File:
src/data.c

data_init

Declaration:
  void data_init(char *filename, int direction)
Source File:
src/data.c

data_new_xfer

Declaration:
  static void data_new_xfer(char *filename, int direction)
Source File:
src/data.c

data_open

Declaration:
  int data_open(char *filename, char *reason, int direction, unsigned long size)
Source File:
src/data.c

data_pasv_open

Declaration:
  static int data_pasv_open(char *reason, unsigned long size)
Source File:
src/data.c

data_reset

Declaration:
  void data_reset(void)
Source File:
src/data.c

data_sendfile

Declaration:
  pr_sendfile_t data_sendfile(int retr_fd, off_t *offset, size_t count)
Source File:
src/data.c

data_urgent

Declaration:
  RETSIGTYPE data_urgent(int sig)
Comments: Signal handler for the SIGURG signal, to be raised if OOB data is received on the control connection while a data transfer is in progress. This handler sets the SF_ABORT session flag and aborts the current transfer.

Source File:
src/data.c

data_xfer

Declaration:
  int data_xfer(char *cl_buf, int cl_size)
Comments: This function actually performs the work of transferring data on the data connection. ASCII translation is performed if necessary. The direction of the transfer, set when the data connection was opened, determines whether the client buffer cl_buf is read from or written to.

Returns 0 if successful, or if reading and the data connection closes; -1 on error.

Source File:
src/data.c

debug_dump_config

Declaration:
  void debug_dump_config(xaset_t *s, char *indent)
Source File:
src/dirtree.c

debug_pool_info

Declaration:
  void debug_pool_info(void)
Comments: Debugging function, for debugging pool resource management.

Source File:
src/pool.c

debug_walk_pools

Declaration:
  void debug_walk_pools(void)
Comments: Self-explanatory function, it does just what its name says.

Source File:
src/pool.c

destroy_pool

Declaration:
  void destroy_pool(pool *p)
Comments: Completely frees the resources used by pool p and its subpools. Destroys the pool p when finished.

Source File:
src/pool.c

dir_abs_path

Declaration:
  char *dir_abs_path(pool *p, const char *path, int interpolate)
Comments: Takes a directory path and returns its corresponding absolute path, which is based on the root directory, not on a chrooted directory (i.e. chroot() does not affect the absolute path). If interpolate is TRUE, ~username references will be interpolated appropriately.

Source File:
src/support.c

dir_best_path

Declaration:
  char *dir_best_path(pool *p, const char *path)
Comments: This function creates the most fully canonicalized path possible, i.e. if path components at the end of path do not exist, they are ignored.

Source File:
src/support.c

dir_canonical_path

Declaration:
  char *dir_canonical_path(pool *p, const char *path)
Comments: Takes a directory path and returns its corresponding canonical path, which is based on the current working directory (i.e. chroot() does affect the canonical path). ~username references are interpolated.

Source File:
src/support.c

dir_check

Declaration:
  int dir_check(pool *pp, char *cmd, char *group, char *path, int *hidden)
Comments: This function checks the current directory configuration against the given path. If the current directory partially matches the path, a search is done only in the contained sub-configurations, otherwise the check is handed off to
dir_check_full().

Source File: src/dirtree.c

dir_check_canon

Declaration:
  int dir_check_canon(pool *pp, char *cmd, char *group, char *path, int *hidden)
Source File:
src/dirtree.c

dir_check_full

Declaration:
  int dir_check_full(pool *pp, char *cmd, char *group, char *path, int *hidden)
Comments: This function fully walks the given path.

It returns TRUE if an operation is allowed on the current path, else it returns FALSE.

Source File:
src/dirtree.c

dir_check_limits

Declaration:
  int dir_check_limits(config_rec *c, char *cmd, int hidden)
Source File:
src/dirtree.c

dir_check_op_mode

Declaration:
  int dir_check_op_mode(pool *p, char *path, int op, int uid, int gid, int mode)
Source File:
src/dirtree.c

dir_exists

Declaration:
  int dir_exists(char *path)
Comments: Returns TRUE if path exists and is a directory, FALSE otherwise.

Source File:
src/support.c

dir_hide_file

Declaration:
  unsigned char dir_hide_file(const char *path)
Source File:
src/dirtree.c

dir_interpolate

Declaration:
  char *dir_interpolate(pool *p, const char *path)
Comments: This function interpolates the given path, expanding the ~ notation if necessary.

Source File:
src/support.c

dir_match_path

Declaration:
  config_rec *dir_match_path(pool *p, char *path)
Comments: If the given path ends in "*", strip it off. Then, if path ends in "/", strip it off, too.

Notes: For this function to work correctly, the path given must be an absolute path. This is particularly important when working with paths during anonymous sessions, for in such sessions the paths are modified by the chroot()ing of anonymous sessions. As in other places in the core code, it is wise to have logic such as this before calling dir_match_path():
    config_rec *dir_config = NULL;
    char *fullpath = path;

    if (session.anon_config)
      fullpath = pdircat(p, session.anon_root, path, NULL);

    dir_config = dir_match_path(p, fullpath);
Source File:
src/dirtree.c

dir_realpath

Declaration:
  char *dir_realpath(pool *p, const char *path)
Comments: This function is needed to properly dereference symlinks, for
pr_fs_getcwd() may not work if permissions cause problems somewhere up the tree.

Source File: src/support.c

dir_virtual_chdir

Declaration:
  char *dir_virtual_chdir(pool *p, const char *path)
Source File:
src/support.c

disc_children

Declaration:
  void disc_children(void)
Comments: This function causes SIGUSR1 to be sent to all children processed, terminating them, thus "disconnecting": those clients.

Source File:
src/main.c

discard_output

Declaration:
  void discard_output(void)
Source File:
modules/mod_ls.c

dispatch_cmd

Declaration:
  static void dispatch_cmd(cmd_rec *cmd)
Source File:
src/main.c

do_log

Declaration:
  void do_log(cmd_rec *cmd, logfile_t *lf)
Source File:
modules/mod_log.c

dolist

Declaration:
  int dolist(cmd_rec *cmd, const char *opt, int clearflags)
Source File:
modules/mod_ls.c

end_anonymous

Declaration:
  MODRET end_anonymous(cmd_rec *cmd)
Comments: Configuration directive handler for the </Anonymous> directive.

Source File:
modules/mod_core.c

end_directory

Declaration:
  MODRET end_directory(cmd_rec *cmd)
Comments: Configuration directive handler for the </Directory> directive.

Source File:
modules/mod_core.c

end_ifdefine

Declaration:
  MODRET end_ifdefine(cmd_rec *cmd)
Comments: Configuration directive handler for the </IfDefine> directive.

Source File:
modules/mod_core.c

end_ifmodule

Declaration:
  MODRET end_ifmodule(cmd_rec *cmd)
Comments: Configuration directive handler for the </IfModule> directive.

Source File:
modules/mod_core.c

end_global

Declaration:
  MODRET end_global(cmd_rec *cmd)
Comments: Configuration directive handler for the </Global> directive.

Source File:
modules/mod_core.c

end_limit

Declaration:
  MODRET end_limit(cmd_rec *cmd)
Comments: Configuration directive handler for the </Limit> directive.

Source File:
modules/mod_core.c

end_login

Declaration:
  void end_login(int exitcode)
Comments: Function used for terminating a session. The child process servicing the current session exits with the given exitcode.
end_login_noexit() is invoked before _exit() is used to terminate the process.

Source File: src/main.c

end_login_noexit

Declaration:
  void end_login_noexit(void)
Comments: As part of a session termination, this function is called. All registered exit handlers are run, and all necessary log files are closed.

Source File:
src/main.c

end_new_server

Declaration:
  server_rec *end_new_server(void)
Source File:
src/dirtree.c

end_sub_config

Declaration:
  config_rec *end_sub_config(void)
Source File:
src/dirtree.c

end_virtualhost

Declaration:
  MODRET end_virtualhost(cmd_rec *cmd)
Source File:
modules/mod_core.c

ensure_open_passwd

Declaration:
  static void ensure_open_passwd(pool *p)
Source File:
modules/mod_auth.c

exists

Declaration:
  int exists(char *path)
Source File:
src/support.c

fd_cleanup_cb

Declaration:
  static void fd_cleanup_cb(void *fdv)
Comments: close()s the file descriptor fdv.

Source File:
src/pool.c

fgetbufline

Declaration:
  static char *fgetbufline(char **buf, int *size, FILE *fp)
Source File:
lib/pwgrent.c

fgetgrent

Declaration:
  struct group *fgetgrent(FILE *fp)
Source File:
lib/pwgrent.c

fgetpwent

Declaration:
  struct passwd *fgetpwent(FILE *fp)
Source File:
lib/pwgrent.c

file_child_cleanup_cb

Declaration:
  static void file_child_cleanup_cb(void *fpv)
Comments: close()s the file pointed to by FILE pointer fpv.

Source File:
src/pool.c

file_cleanup_cb

Declaration:
  static void file_cleanup_cb(void *fpv)
Comments: fclose()s the file pointed to by FILE pointer fpv.

Source File:
src/pool.c

file_exists

Declaration:
  int file_exists(char *path)
Comments: Returns TRUE if path exists, FALSE otherwise.

Source File:
src/support.c

file_mode

Declaration:
  mode_t file_mode(char *path)
Source File:
src/support.c

find_binding

Declaration:
  server_rec *find_binding(p_in_addr_t *ipaddr, int port)
Source File:
src/main.c

find_cdir

Declaration:
  static cdir_t *find_cdir(u_int_32 address)
Source File:
modules/mod_core.c

find_class

Declaration:
  class_t *find_class(p_in_addr_t *addr, char *remote_name)
Source File:
modules/mod_core.c

find_config

Declaration:
  config_rec *find_config(xaset_t *set, int type, const char *name, int recurse)
Comments: The recurse parameter should almost always be FALSE. Exceptions to this rule are very rare.

Source File:
src/dirtree.c

find_config_next

Declaration:
  config_rec *find_config_next(config_rec *prev, config_rec *c, int type, const char *name,
    int recurse)
Comments: The recurse parameter should almost always be FALSE. Exceptions to this rule are very rare.

Source File:
src/dirtree.c

find_config_set_top

Declaration:
  void find_config_set_top(config_rec *c)
Source File:
src/dirtree.c

find_hostname

Declaration:
  static hostname_t *find_hostname(char *name)
Source File:
modules/mod_core.c

find_opendir

Declaration:
  static fsdir_t *find_opendir(void *d, int closing)
Source File:
src/fs.c

fixup_dirs

Declaration:
  void fixup_dirs(server_rec *s, int mask)
Source File:
src/dirtree.c

fixup_globals

Declaration:
  void fixup_globals(void)
Source File:
src/dirtree.c

fixup_servers

Declaration:
  void fixup_servers(void)
Comments: Go through each server configuration and complain if important information is missing, after the configuration file(s) have been read. Otherwise, fill in default values where applicable.

Source File:
src/dirtree.c

fmt_time

Declaration:
  char *fmt_time(time_t t)
Source File:
src/log.c

fork_server

Declaration:
  static void fork_server(int fd, conn_t *l, int nofork)
Comments: Forks a child process to handle the session for the requesting client, installing signal handlers and preparing the child process' space for processing client commands. If nofork is TRUE, does not actually fork; this is used mostly for debugging purposes.

Source File:
src/main.c

free_blocks

Declaration:
  void free_blocks(union block_hdr *blok)
Comments: Free a chain of union block_hdrs. Alarms must be blocked before calling this function.

Source File:
src/pool.c

free_conf_stacks

Declaration:
  void free_conf_stacks(void)
Source File:
src/dirtree.c

free_dyn_stacks

Declaration:
  void free_dyn_stacks(void)
Source File:
src/dirtree.c

fs_lookup_dir

Declaration:
  static pr_fh_t *fs_lookup_dir(const char *path, int op)
Comments: This function is called whenever any sort of directory operation, to be performed on a directory or file, is needed. A "closest" match algorithm is used. If the lookup fails or is not "close enough" (i.e. the final target does not exactly match an existing fsdir_t), we can look for matchable targets and call file_hit, then rescan the fsdir_t list. The rescan is performed in case any modules registered FS handlers during the hit.

Source File:
src/fsio.c

fs_lookup_file

Declaration:
  static pr_fh_t *fs_lookup_file(const char *path, char **deref, int op)
Comments: This functions performs a similar function to
fs_lookup_dir(), however, as it performs a file lookup, as opposed to a directory lookup, the target is the subdirectory containing the actual target path. A basic optimization - if the path contains no slashes, pr_fs_cwd() - is used.

Source File: src/fsio.c

fs_lookup_file_canon

Declaration:
  static pr_fh_t *fs_lookup_file_canon(const char *path, char **deref, int op)
Source File:
src/fsio.c

genericlist

Declaration:
  MODRET genericlist(cmd_rec *cmd)
Source File:
modules/mod_ls.c

get_boolean

Declaration:
  int get_boolean(cmd_rec *cmd, int av)
Comments: Check the av argument string in the given cmd as a Boolean value, using a case-insensitive comparison. Valid Boolean strings are: on, off, yes, no, true, false, 1, and 0. Returns 1 if the checked string is a Boolean TRUE, 0 if it is a Boolean FALSE, and -1 to signal that the string is not one of the recognized Boolean strings.

Source File:
src/dirtree.c

get_class

Declaration:
  static class_t *get_class(char *name)
Source File:
modules/mod_core.c

get_command_class

Declaration:
  static int get_command_class(const char *name)
Source File:
src/main.c

get_config_cmd

Declaration:
  cmd_rec *get_config_cmd(pool *ppool, FILE *fp, int *line)
Comments: Reads in a single line from the configuration file fp, then parses that line of text into a configuration directive in the form of a
cmd_rec (allocated from the given pool ppool) which is then dispatched to the appropriate configuration directive handler. line is used to track the current line number being parsed from the configuration file.

Source File: src/dirtree.c

get_context_name

Declaration:
  char *get_context_name(cmd_rec *cmd)
Comments: Returns a string describing the context in which cmd appears; utilized mostly by configuration directive handler functions.

Source File:
src/dirtree.c

get_extendedlogs

Declaration:
  static void get_extendedlogs(void)
Source File:
modules/mod_log.c

get_full_cmd

Declaration:
  char *get_full_cmd(cmd_rec *cmd)
Comments: Returns a string containing the full command issued by a client, including command arguments.

Source File:
src/dirtree.c

get_name_max

Declaration:
  get_name_max(char *dirname, int dir_fd)
Comments: Get the maximum size of a file name, specifically of the pathname component. If a directory file descriptor, ie the dir_fd DIR structure element, is not available, then the second argument should be 0.

Notes: A POSIX compliant system typically should not define NAME_MAX, since the value almost certainly varies across different file system types. Refer to POSIX 1003.1a, Section 2.9.5, Table 2-5.

Source File:
src/support.c

get_next_meta

Declaration:
  static char *get_next_meta(pool *p, cmd_rec *cmd, unsigned char **f)
Source File:
modules/mod_log.c

get_num_bytes

Declaration:
  static ssize_t get_num_bytes(char *nbytes_str)
Source File:
modules/mod_core.c

get_param_int

Declaration:
  long get_param_int(xaset_t *set, const char *name, int recurse)
Comments: This function returns the first argument in a
CONF_PARAM configuration record. If more than one, or all, arguments are needed, the caller will need to use find_config() instead, and iterate through the argv arguments itself. The recurse parameter should almost always be FALSE. Exceptions to this rule are very rare.

Returns -1 if the parameter name is not found. Note that parameters are not allowed to contain negative integers.

Source File: src/dirtree.c

get_param_int_next

Declaration:
  long get_param_int_next(const char *name, int recurse)
Comments: Similar to
get_param_int(), this function will retrieve the next matching parameter after a call to get_param_int().

Returns -1 if the parameter name is not found, or if this function was not preceded by a call to get_param_int().

Source File: src/dirtree.c

get_param_ptr

Declaration:
  void *get_param_ptr(xaset_t *set, const char *name, int recurse)
Comments: This function returns the first argument in a
CONF_PARAM configuration record. If more than one, or all, arguments are needed, the caller will need to use find_config() instead, and iterate through the argv arguments itself. The recurse parameter should almost always be FALSE. Exceptions to this rule are very rare.

Returns NULL if the parameter name is not found.

Source File: src/dirtree.c

get_param_ptr_next

Declaration:
  void *get_param_ptr_next(const char *name, int recurse)
Comments: Similar to
get_param_ptr(), this function will retrieve the next matching parameter after a call to get_param_ptr().

Returns NULL if the parameter name is not found, or if this function was not preceded by a call to get_param_ptr().

Source File: src/dirtree.c

get_token

Declaration:
  char *get_token(char **s, char *sep)
Comments: This function tokenizes the string s, incrementing the pointer to s to the next non-separator sep in the string, and returning a token. If the source string s is empty or NULL, the next token returned will be NULL.

Source File:
src/support.c

get_word

Declaration:
  char *get_word(char **cp)
Comments: Retrieve an individual word, space-delimited, from the given string cp, respecting quotes and escapes. The cp pointer is advanced as the word is consumed from the string.

Source File:
src/dirtree.c

handle_alarm

Declaration:
  void handle_alarm(void)
Source File:
src/timers.c

ident_timeout_cb

Declaration:
  static int ident_timeout_cb(CALLBACK_FRAME)
Comments: Timer callback function which aborts an ident (RFC 1413) lookup. The timer length is set to 10 seconds, and is tunable via the PR_TUNABLE_TIMEOUTIDENT macro, defined in
include/options.h.

Source File: src/ident.c

idle_timeout_cb

Declaration:
  static int idle_timeout_cb(CALLBACK_FRAME)
Comments: Timer callback function which disconnects an idle session. The timer length is configurable via the TimeoutIdle configuration directive.

Source File:
src/main.c

inet_accept

Declaration:
  conn_t *inet_accept(pool *pool, conn_t *d, conn_t *c, int rfd, int wfd, int resolve)
Comments: Accepts a new connection, cloning the existing conn_t and returning it, or NULL upon error.

Source File:
src/inet.c

inet_accept_nowait

Declaration:
  int inet_accept_nowait(pool *pool, conn_t *c)
Comments: Accepts a new connection, return immediately with -1 if no connection is available. If a connection is accepted, creating a new conn_t and potential resolving is deferred, and a normal socket fd is returned for the new connection, which can later be used in inet_openrw to fully open and resolve addresses.

Source File:
src/inet.c

inet_ascii

Declaration:
  char *inet_ascii(pool *pool, p_in_addr_t *addr)
Comments: Wrapper function for inet_ntoa, except it stores the result in memory allocated from pool.

Source File:
src/inet.c

inet_associate

Declaration:
  conn_t *inet_associate(pool *pool, conn_t *c, p_in_addr_t *addr, IOFILE *inf,
    IOFILE *outf, int resolve)
Comments: Associate the already open streams with a connection, returning NULL if either stream points to a non-socket descriptor. If addr is non-NULL, remote address discovery is attempted. If resolve is non-zero, the remote address is reverse solved.

Source File:
src/inet.c

inet_close

Declaration:
  void inet_close(pool *pool, conn_t *c)
Comments: With this function, it is not necessary to close file descriptors or schedule IOFILEs for removal because the creator of the connection, either
inet_create_connection() or inet_copy_connection() will have registered a pool cleanup handler (conn_cleanup_cb()) which will do all of this work for us. Simply destroy the connection c's pool, and it will do the rest. The given pool is not used by this function.

Source File: src/inet.c

inet_connect

Declaration:
  int inet_connect(pool *pool, conn_t *c, p_in_addr_t *addr, int port)
Source File:
src/inet.c

inet_connect_nowait

Declaration:
  int inet_connect_nowait(pool *pool, conn_t *c, p_in_addr_t *addr, int port)
Comments: Attempt to connect a connection, returning immediately with 1 if connected, 0 if not connected, or -1 if error. This only needs to be called once, and can then be selected for writing.

Source File:
src/inet.c

inet_copy_connection

Declaration:
  conn_t *inet_copy_connection(pool *p, conn_t *c)
Comments: Copy a connection structure, also creating a subpool for the new connection.

Source File:
src/inet.c

inet_create_connection

Declaration:
  conn_t *inet_create_connection(pool *p, xaset_t *servers, int fd, p_in_addr_t *bind_addr,
    int port, int retry_bind)
Source File:
src/inet.c

inet_create_connection_portrange

Declaration:
  conn_t *inet_create_connection_portrange(pool *p, xaset_t *servers, p_in_addr_t *bind_addr,
    int low_port, int high_port)
Source File:
src/inet.c

inet_fqdn

Declaration:
  char *inet_fqdn(pool *pool, const char *addr)
Comments: Returns the FQDN (Fully Qualified Domain Name) of an address.

Source File:
src/inet.c

inet_get_conn_info

Declaration:
  int inet_get_conn_info(conn_t *c, int fd)
Comments: Using the socket descriptor fd, retrieve the local and remote IP addresses and ports in use, and store them in c's fields.

Source File:
src/inet.c

inet_getaddr

Declaration:
  p_in_addr_t *inet_getaddr(pool *pool, char *name)
Comments: DNS/hosts lookup for a particular name.

Source File:
src/inet.c

inet_gethostname

Declaration:
   char *inet_gethostname(pool *pool)
Comments: Return the hostname (wrapper for gethostname(2), except that it returns the FQDN).

Source File:
src/inet.c

inet_getname

Declaration:
  char *inet_getname(pool *pool, p_in_addr_t *addr)
Comments: Given an IP address, return the FQDN.

Source File:
src/inet.c

inet_getservport

Declaration:
  int inet_getservport(pool *pool, char *serv, char *proto)
Comments: Find a service, and return its port number (in network byte order).

Source File:
src/inet.c

inet_initialize_connection

Declaration:
  static conn_t *inet_initialize_connection(pool *p, xaset_t *servers, int fd, p_in_addr_t *bind_addr,
    int port, int retry_bind, int reporting)
Comments: Initialize a new connection record, also creating a new subpool just for the new connection.

Source File:
src/inet.c

inet_listen

Declaration:
  int inet_listen(pool *pool, conn_t *c, int backlog)
Comments: Puts a connection in listening mode.

Source File:
src/inet.c

inet_openrw

Declaration:
  conn_t *inet_openrw(pool *pool, conn_t *c, p_in_addr_t *addr, int fd, int rfd,
    int wfd, int resolve)
Comments: Open streams for a new socket; if rfd and wfd != -1, two new fds are dup()ed to the respective read/write fds. If the fds specified correspond to the normal stdin and stdout, the streams opened will be assigned to stdin and stdout in an intuitive fashion (so that they may be later used by printf()/fgets() type libc functions). If addr is non-NULL, the address is assigned to the connection (as the source of the connection). If it is NULL, remote address discovery will be attempted. The connection structure's appropriate fields are filled in, including the destination address. Finally, if resolve is non-zero, inet_openrw() will attempt to reverse resolve the remote address. A new connection structure is created from pool.

Source File:
src/inet.c

_inet_pool_cleanup

Declaration:
  static void inet_pool_cleanup_cb(void *ignore)
Source File:
src/inet.c

inet_resetlisten

Declaration:
  int inet_resetlisten(pool *pool, conn_t *c)
Comments: Reset a connection back to listening mode. Enables blocking mode for safety.

Source File:
src/inet.c

inet_resolve_ip

Declaration:
  void inet_resolve_ip(pool *pool, conn_t *c)
Comments: Performs reverse IP resolution via DNS on an existing connection.

Source File:
src/inet.c

inet_reverse_dns

Declaration:
  int inet_reverse_dns(pool *pool, int enable)
Comments: Enable or disable reverse DNS lookups.

Source File:
src/inet.c

inet_set_proto_options

Declaration:
  int inet_set_proto_options(pool *pool, conn_t *c, int nodelay, int lowdelay, int throughput,
    int nopush)
Comments: Sets the following protocol-level options (if supported by the OS) on the given connection c: TCP_NODELAY, IP_TOS (for low delay and throughput options), and TCP_NOPUSH.

Source File:
src/inet.c

inet_setasync

Declaration:
  int inet_setasync(pool *pool, conn_t *c)
Comments: Puts a socket in asynchronous mode, so that SIGURG is raised on OOB data.

Source File:
src/inet.c

inet_setblock

Comments: Puts a socket in blocking mode.

Declaration:
  int inet_setblock(pool *pool, conn_t *c)
Source File:
src/inet.c

inet_setnonblock

Declaration